From 837ff69c8259c44ef672f2884f8c992ff7930087 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 23 May 2021 16:33:20 +0300 Subject: [PATCH 001/199] 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/199] 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/199] 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/199] 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/199] 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/199] 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/199] 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/199] 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/199] 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/199] 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/199] 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/199] fixes --- .../viewModel/authentication_view_model.dart | 31 ++++--- lib/root_page.dart | 5 ++ .../home/dashboard_slider-item-widget.dart | 4 +- lib/screens/home/dashboard_swipe_widget.dart | 80 ++++++++++--------- ...ctivity_button.dart => activity_card.dart} | 4 +- lib/widgets/dashboard/row_count.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 29 ++++++- .../shared/bottom_navigation_item.dart | 2 +- 8 files changed, 100 insertions(+), 57 deletions(-) rename lib/widgets/dashboard/{activity_button.dart => activity_card.dart} (92%) diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 4e8217d3..c90eb1a4 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -415,16 +415,27 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { - DEVICE_TOKEN = ""; - String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - this.isFromLogin = isFromLogin; - app_status = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + + + try { + DEVICE_TOKEN = ""; + String lang = await sharedPref.getString(APP_Language); + String errr = await sharedPref.getString("LogOut Error"); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + sharedPref.setString("LogOut Error", errr); + + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + app_status = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); + } + + catch (e) { + sharedPref.setString("LogOut Error", e); + } Navigator.pushAndRemoveUntil( AppGlobal.CONTEX, FadePage( diff --git a/lib/root_page.dart b/lib/root_page.dart index 35a3fa44..552289a0 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -13,8 +13,13 @@ import 'landing_page.dart'; class RootPage extends StatelessWidget { @override Widget build(BuildContext context) { + + AuthenticationViewModel authenticationViewModel = Provider.of(context); Widget buildRoot() { + sharedPref.getString("LogOut Error").then((error){ + }); + switch (authenticationViewModel.status) { case APP_STATUS.LOADING: return Scaffold( diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 11c46eb3..de647654 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/activity_card.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -24,7 +24,7 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:12), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 7782832c..91544315 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -28,9 +28,10 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { + double height = SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 40 : 30); return Container( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 40 : 30), + height: height, // height: 230, child: Swiper( onIndexChanged: (index) { @@ -42,7 +43,7 @@ class _DashboardSwipeWidgetState extends State { } }, itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(widget.dashboardItemList, index); + return getSwipeWidget(widget.dashboardItemList, index, height); }, itemCount: 3, // itemHeight: 300, @@ -85,7 +86,7 @@ class _DashboardSwipeWidgetState extends State { ); } - Widget getSwipeWidget(List dashboardItemList, int index) { + Widget getSwipeWidget(List dashboardItemList, int index, double height) { if (index == 1) return RoundedContainer( raduis: 16, @@ -124,10 +125,16 @@ class _DashboardSwipeWidgetState extends State { shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + + children: [ Expanded( flex: 1, child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Expanded( flex: 4, @@ -158,44 +165,41 @@ class _DashboardSwipeWidgetState extends State { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, fontWeight: FontWeight.bold, ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightShort?0: 7) + ) ], - )), + ),), Expanded( flex: 1, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), - ), - Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), - ), + RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + Colors.black), + RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Colors.grey), + RowCounts( + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Colors.red), ], ), ) @@ -206,6 +210,8 @@ class _DashboardSwipeWidgetState extends State { flex: 3, child: Stack(children: [ Container( + padding:EdgeInsets.all(0), + child: GaugeChart( _createReferralData(widget.dashboardItemList))), Positioned( @@ -221,7 +227,7 @@ class _DashboardSwipeWidgetState extends State { ) ], ), - top: MediaQuery.of(context).size.height * 0.13, + top: height * .35, left: 0, right: 0) ]), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_card.dart similarity index 92% rename from lib/widgets/dashboard/activity_button.dart rename to lib/widgets/dashboard/activity_card.dart index 25b925b2..5181de42 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -25,14 +25,14 @@ class GetActivityCard extends StatelessWidget { children: [ AppText( value.value.toString(), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 25, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), ), AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 09, color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a23fb8b9..7fb9a96a 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -33,7 +33,7 @@ class RowCounts extends StatelessWidget { ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontWeight: FontWeight.bold, ) ], diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 820c63cb..36df29a8 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -203,10 +203,31 @@ class _AppDrawerState extends State { ), onTap: () async { - Navigator.pop(context); - GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.logout(isFromLogin: false); - // GifLoaderDialogUtils.showMyDialog(context); + try { + + Navigator.pop(context); + GifLoaderDialogUtils.showMyDialog(context); + await authenticationViewModel.logout(isFromLogin: false); + // GifLoaderDialogUtils.hideDialog(context); + + + } + + catch (err) { + + // show the dialog + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + content: Text(err.toString()), + ); + }, + ); + + // code for handling exception + } + }, ), ], diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index c676d344..bd338866 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -35,7 +35,7 @@ class BottomNavigationItem extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8) ) * 10,), + (SizeConfig.isHeightShort ? 12 : 9) ) * 10,), Container( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index From 49afc338d674bcf4628d819392acc13aad189088 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 1 Jun 2021 10:47:58 +0300 Subject: [PATCH 013/199] 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 014/199] 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 015/199] fix homepage screen --- .../viewModel/authentication_view_model.dart | 26 +++++++---------- lib/widgets/auth/method_type_card.dart | 18 ++++-------- lib/widgets/dashboard/activity_card.dart | 5 ++-- lib/widgets/shared/app_drawer_widget.dart | 29 ++----------------- 4 files changed, 22 insertions(+), 56 deletions(-) diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 4a6d105c..87ba86f5 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -22,13 +22,10 @@ import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart'; -import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; @@ -299,8 +296,7 @@ class AuthenticationViewModel extends BaseViewModel { clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, - tokenID: '', - languageID: 2);//TODO change the lan + tokenID: '',); await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error; @@ -419,18 +415,16 @@ class AuthenticationViewModel extends BaseViewModel { logout({bool isFromLogin = false}) async { DEVICE_TOKEN = ""; - String lang = await sharedPref.getString(APP_Language); + String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - - - this.isFromLogin = isFromLogin; - app_status = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + app_status = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); } deleteUser(){ diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index d7c9a2e0..d02d8dc7 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -35,19 +35,13 @@ class MethodTypeCard extends StatelessWidget { child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - assetPath, - width: SizeConfig.widthMultiplier* 12, - height: cardHeight * 0.35, - // height: , - ), - ], + Image.asset( + assetPath, + width: SizeConfig.widthMultiplier* 12, + height: cardHeight * 0.35, + // height: , ), SizedBox( height:height , diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 5181de42..e3c1fe8f 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -10,9 +10,10 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { return Container( + //TODO change it to make it depend on width width: MediaQuery.of(context).size.height * 0.125, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), + padding: EdgeInsets.all(SizeConfig.heightMultiplier * .3), + margin: EdgeInsets.all(SizeConfig.heightMultiplier * .5), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 4bc783ac..3145da2d 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -51,7 +51,7 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightShort? 30: 35), + width: drawerWidth) * (SizeConfig.isHeightShort? 30: 32), ), margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), @@ -63,7 +63,7 @@ class _AppDrawerState extends State { }, child: Icon( DoctorApp.close_1, - size: SizeConfig.heightMultiplier * 3, + size: SizeConfig.heightMultiplier * 2, ), ), margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?2:3), bottom: SizeConfig.heightMultiplier * 0.5), @@ -163,7 +163,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort?5:9), + height: SizeConfig.heightMultiplier *(SizeConfig.isHeightShort?10:16), ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -203,31 +203,8 @@ class _AppDrawerState extends State { ), onTap: () async { - try { - Navigator.pop(context); - //GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.logout(isFromLogin: false); - // GifLoaderDialogUtils.hideDialog(context); - - - } - - catch (err) { - - // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - content: Text(err.toString()), - ); - }, - ); - - // code for handling exception - } - }, ), ], From 4a9748739ec9a6bb754cec772e70797f1b74b6f2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 11:25:31 +0300 Subject: [PATCH 016/199] improve home design --- ios/Podfile.lock | 327 ------------------ .../home/dashboard_slider-item-widget.dart | 4 +- lib/screens/home/home_page_card.dart | 6 +- lib/screens/home/home_patient_card.dart | 14 +- lib/screens/home/home_screen.dart | 2 +- lib/widgets/dashboard/activity_card.dart | 46 +-- 6 files changed, 38 insertions(+), 361 deletions(-) delete mode 100644 ios/Podfile.lock diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index 9301d419..00000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,327 +0,0 @@ -PODS: - - Alamofire (5.4.3) - - barcode_scan_fix (0.0.1): - - Flutter - - MTBBarcodeScanner - - connectivity (0.0.1): - - Flutter - - Reachability - - connectivity_for_web (0.1.0): - - Flutter - - connectivity_macos (0.0.1): - - Flutter - - device_info (0.0.1): - - Flutter - - Firebase/CoreOnly (6.33.0): - - FirebaseCore (= 6.10.3) - - Firebase/Messaging (6.33.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.3): - - Firebase/CoreOnly (~> 6.33.0) - - Flutter - - firebase_core_web (0.1.0): - - Flutter - - firebase_messaging (7.0.3): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Messaging (~> 6.33.0) - - firebase_core - - Flutter - - FirebaseCore (6.10.3): - - FirebaseCoreDiagnostics (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - FirebaseCoreDiagnostics (1.7.0): - - GoogleDataTransport (~> 7.4) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - nanopb (~> 1.30906.0) - - FirebaseInstallations (1.7.0): - - FirebaseCore (~> 6.10) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - PromisesObjC (~> 1.2) - - FirebaseInstanceID (4.8.0): - - FirebaseCore (~> 6.10) - - FirebaseInstallations (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - FirebaseMessaging (4.7.1): - - FirebaseCore (~> 6.10) - - FirebaseInstanceID (~> 4.7) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Reachability (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - Protobuf (>= 3.9.2, ~> 3.9) - - Flutter (1.0.0) - - flutter_flexible_toast (0.0.1): - - Flutter - - flutter_inappwebview (0.0.1): - - Flutter - - flutter_plugin_android_lifecycle (0.0.1): - - Flutter - - GoogleDataTransport (7.5.1): - - nanopb (~> 1.30906.0) - - GoogleUtilities/AppDelegateSwizzler (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (6.7.2): - - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Network (6.7.2): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.7.2)" - - GoogleUtilities/Reachability (6.7.2): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.7.2): - - GoogleUtilities/Logger - - hexcolor (0.0.1): - - Flutter - - imei_plugin (0.0.1): - - Flutter - - local_auth (0.0.1): - - Flutter - - maps_launcher (0.0.1): - - Flutter - - MTBBarcodeScanner (5.0.11) - - nanopb (1.30906.0): - - nanopb/decode (= 1.30906.0) - - nanopb/encode (= 1.30906.0) - - nanopb/decode (1.30906.0) - - nanopb/encode (1.30906.0) - - OpenTok (2.15.3) - - path_provider_linux (0.0.1): - - Flutter - - path_provider_windows (0.0.1): - - Flutter - - "permission_handler (5.1.0+2)": - - Flutter - - PromisesObjC (1.2.12) - - Protobuf (3.17.0) - - Reachability (3.2) - - screen (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - shared_preferences_linux (0.0.1): - - Flutter - - shared_preferences_macos (0.0.1): - - Flutter - - shared_preferences_web (0.0.1): - - Flutter - - shared_preferences_windows (0.0.1): - - Flutter - - speech_to_text (0.0.1): - - Flutter - - Try - - Try (2.1.1) - - url_launcher (0.0.1): - - Flutter - - url_launcher_linux (0.0.1): - - Flutter - - url_launcher_macos (0.0.1): - - Flutter - - url_launcher_web (0.0.1): - - Flutter - - url_launcher_windows (0.0.1): - - Flutter - - video_player (0.0.1): - - Flutter - - video_player_web (0.0.1): - - Flutter - - wakelock (0.0.1): - - Flutter - - webview_flutter (0.0.1): - - Flutter - -DEPENDENCIES: - - Alamofire (~> 5.2) - - barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`) - - connectivity (from `.symlinks/plugins/connectivity/ios`) - - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - - device_info (from `.symlinks/plugins/device_info/ios`) - - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - - Flutter (from `Flutter`) - - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - - hexcolor (from `.symlinks/plugins/hexcolor/ios`) - - imei_plugin (from `.symlinks/plugins/imei_plugin/ios`) - - local_auth (from `.symlinks/plugins/local_auth/ios`) - - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - - OpenTok - - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) - - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) - - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) - - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) - - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) - - video_player (from `.symlinks/plugins/video_player/ios`) - - video_player_web (from `.symlinks/plugins/video_player_web/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) - - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) - -SPEC REPOS: - trunk: - - Alamofire - - Firebase - - FirebaseCore - - FirebaseCoreDiagnostics - - FirebaseInstallations - - FirebaseInstanceID - - FirebaseMessaging - - GoogleDataTransport - - GoogleUtilities - - MTBBarcodeScanner - - nanopb - - OpenTok - - PromisesObjC - - Protobuf - - Reachability - - Try - -EXTERNAL SOURCES: - barcode_scan_fix: - :path: ".symlinks/plugins/barcode_scan_fix/ios" - connectivity: - :path: ".symlinks/plugins/connectivity/ios" - connectivity_for_web: - :path: ".symlinks/plugins/connectivity_for_web/ios" - connectivity_macos: - :path: ".symlinks/plugins/connectivity_macos/ios" - device_info: - :path: ".symlinks/plugins/device_info/ios" - firebase_core: - :path: ".symlinks/plugins/firebase_core/ios" - firebase_core_web: - :path: ".symlinks/plugins/firebase_core_web/ios" - firebase_messaging: - :path: ".symlinks/plugins/firebase_messaging/ios" - Flutter: - :path: Flutter - flutter_flexible_toast: - :path: ".symlinks/plugins/flutter_flexible_toast/ios" - flutter_inappwebview: - :path: ".symlinks/plugins/flutter_inappwebview/ios" - flutter_plugin_android_lifecycle: - :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" - hexcolor: - :path: ".symlinks/plugins/hexcolor/ios" - imei_plugin: - :path: ".symlinks/plugins/imei_plugin/ios" - local_auth: - :path: ".symlinks/plugins/local_auth/ios" - maps_launcher: - :path: ".symlinks/plugins/maps_launcher/ios" - path_provider_linux: - :path: ".symlinks/plugins/path_provider_linux/ios" - path_provider_windows: - :path: ".symlinks/plugins/path_provider_windows/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" - screen: - :path: ".symlinks/plugins/screen/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - shared_preferences_linux: - :path: ".symlinks/plugins/shared_preferences_linux/ios" - shared_preferences_macos: - :path: ".symlinks/plugins/shared_preferences_macos/ios" - shared_preferences_web: - :path: ".symlinks/plugins/shared_preferences_web/ios" - shared_preferences_windows: - :path: ".symlinks/plugins/shared_preferences_windows/ios" - speech_to_text: - :path: ".symlinks/plugins/speech_to_text/ios" - url_launcher: - :path: ".symlinks/plugins/url_launcher/ios" - url_launcher_linux: - :path: ".symlinks/plugins/url_launcher_linux/ios" - url_launcher_macos: - :path: ".symlinks/plugins/url_launcher_macos/ios" - url_launcher_web: - :path: ".symlinks/plugins/url_launcher_web/ios" - url_launcher_windows: - :path: ".symlinks/plugins/url_launcher_windows/ios" - video_player: - :path: ".symlinks/plugins/video_player/ios" - video_player_web: - :path: ".symlinks/plugins/video_player_web/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" - webview_flutter: - :path: ".symlinks/plugins/webview_flutter/ios" - -SPEC CHECKSUMS: - Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9 - barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1 - connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 - connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b - connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 - device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 - firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 - firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 - FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 - FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 - FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 - flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189 - flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 - imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd - local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd - maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc - OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 - path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 - path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 - PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 - Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 - shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d - shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 - shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 - shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 - shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae - speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe - Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef - url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 - url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 - url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c - url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 - video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 - wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 - webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 - -PODFILE CHECKSUM: d0a3789a37635365b4345e456835ed9d30398217 - -COCOAPODS: 1.10.0.rc.1 diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index de647654..f8783c9a 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -18,13 +18,13 @@ class DashboardSliderItemWidget extends StatelessWidget { children: [ AppText( item.kPIName, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, fontWeight: FontWeight.bold, ), ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:11), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 6ad22c3a..903bdafd 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -11,7 +10,7 @@ class HomePageCard extends StatelessWidget { Key key, this.color, this.opacity = 0.4, - this.margin}) + this.margin, this.width}) : super(key: key); final bool hasBorder; final String imageName; @@ -19,13 +18,14 @@ class HomePageCard extends StatelessWidget { final Function onTap; final Color color; final double opacity; + final double width; final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( onTap: onTap, child: Container( - width: SizeConfig.widthMultiplier * 30, + width: width, margin: this.margin, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index a0a24b89..23072d17 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,8 +22,10 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11); return HomePageCard( color: backgroundColor, + width: width, margin: EdgeInsets.all(4), child: Container( padding: EdgeInsets.all(8), @@ -35,13 +37,13 @@ class HomePatientCard extends StatelessWidget { child: Stack( children: [ Positioned( - bottom: 0.01, + bottom: 0.02, right: 0.2, - width: 10.0, - height: 25.0, + width: SizeConfig.getWidthMultiplier(width: width) * 10, + height: SizeConfig.getWidthMultiplier(width: width) * 15, child: Icon( cardIcon, - size: SizeConfig.widthMultiplier* 15, + size: SizeConfig.getWidthMultiplier(width: width) * 40, color: backgroundIconColor, ), ), @@ -52,7 +54,7 @@ class HomePatientCard extends StatelessWidget { children: [ Icon( cardIcon, - size: SizeConfig.widthMultiplier* 8, + size: SizeConfig.getWidthMultiplier(width: width) * 20, color: textColor, ), SizedBox( @@ -70,7 +72,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * 12, ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 35961b4b..9c72def3 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -291,7 +291,7 @@ class _HomeScreenState extends State { height: SizeConfig.heightMultiplier *1, ), Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:15), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index e3c1fe8f..8b191c3b 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -9,9 +9,9 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12); return Container( - //TODO change it to make it depend on width - width: MediaQuery.of(context).size.height * 0.125, + width: width, padding: EdgeInsets.all(SizeConfig.heightMultiplier * .3), margin: EdgeInsets.all(SizeConfig.heightMultiplier * .5), decoration: BoxDecoration( @@ -19,26 +19,28 @@ class GetActivityCard extends StatelessWidget { borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - value.value.toString(), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 25, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: MediaQuery.of(context).size.height * 0.125)* 09, - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - ), - ], + padding: const EdgeInsets.fromLTRB(8,4, 8, 4), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + value.value.toString(), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 08, + color: Color(0xFF2B353E), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + ), + ], + ), ), ), ); From 01abd02d19f2701b6474ecebfaf8f6e86a178d68 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 14:55:32 +0300 Subject: [PATCH 017/199] move referral patient --- .../home/dashboard_referral_patient.dart | 174 ++++++++++++++++++ .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/dashboard_swipe_widget.dart | 160 +--------------- lib/screens/home/home_patient_card.dart | 4 +- lib/screens/home/home_screen.dart | 10 +- lib/widgets/dashboard/activity_card.dart | 6 +- lib/widgets/dashboard/out_patient_stack.dart | 6 +- lib/widgets/dashboard/row_count.dart | 9 +- .../shared/bottom_navigation_item.dart | 8 +- 9 files changed, 204 insertions(+), 175 deletions(-) create mode 100644 lib/screens/home/dashboard_referral_patient.dart diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart new file mode 100644 index 00000000..16ef6595 --- /dev/null +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -0,0 +1,174 @@ + +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; + + +class DashboardReferralPatient extends StatelessWidget { + final List dashboardItemList; + final double height; + final DashboardViewModel model; + + const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + @override + Widget build(BuildContext context) { + return RoundedContainer( + raduis: 16, + showBorder: true, + borderColor: Colors.white, + shadowWidth: 0.2, + shadowSpreadRadius: 3, + shadowDy: 1, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + + children: [ + Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .patients, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontWeight: FontWeight.bold, + fontHeight: 0.5, + ), + AppText( + TranslationBase.of(context) + .referral, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightShort?14: 20) + ) + ], + ),), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + Colors.black, height: height,), + RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Colors.grey, height: height,), + RowCounts( + + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Colors.red, height: height,), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + padding:EdgeInsets.all(0), + + child: GaugeChart( + _createReferralData(dashboardItemList))), + Positioned( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + model + .getPatientCount(dashboardItemList[2]) + .toString(), + fontSize: SizeConfig.textMultiplier * 3.0, + fontWeight: FontWeight.bold, + ) + ], + ), + top: height * .35, + left: 0, + right: 0) + ]), + ), + ], + )), + ])); + } + static List> _createReferralData(List dashboardItemList) { + final data = [ + new GaugeSegment( + dashboardItemList[2].summaryoptions[0].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[0].value), + charts.MaterialPalette.black), + new GaugeSegment( + dashboardItemList[2].summaryoptions[1].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[1].value), + charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment( + dashboardItemList[2].summaryoptions[2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[2].value), + charts.MaterialPalette.red.shadeDefault), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + + static int getValue(value) { + return value == 0 ? 1 : value; + } + +} \ No newline at end of file diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index f8783c9a..a3fbaedb 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -24,7 +24,7 @@ class DashboardSliderItemWidget extends StatelessWidget { ], ), new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:11), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?13:12), child: ListView( scrollDirection: Axis.horizontal, children: diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 91544315..0315caf2 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,17 +1,14 @@ -import 'package:charts_flutter/flutter.dart' as charts; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; -import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; +import 'dashboard_referral_patient.dart'; + class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; final DashboardViewModel model; @@ -29,7 +26,7 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 40 : 30); + (SizeConfig.isHeightShort ? 40 : 37); return Container( height: height, // height: 230, @@ -46,7 +43,6 @@ class _DashboardSwipeWidgetState extends State { return getSwipeWidget(widget.dashboardItemList, index, height); }, itemCount: 3, - // itemHeight: 300, pagination: new SwiperCustomPagination( builder: (BuildContext context, SwiperPluginConfig config) { return new Stack( @@ -116,156 +112,12 @@ class _DashboardSwipeWidgetState extends State { padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) - return RoundedContainer( - raduis: 16, - showBorder: true, - borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - - children: [ - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .patients, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, - fontWeight: FontWeight.bold, - fontHeight: 0.5, - ), - AppText( - TranslationBase.of(context) - .referral, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightShort?0: 7) - ) - ], - ),), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), - RowCounts( - dashboardItemList[2] - .summaryoptions[1] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey), - RowCounts( - dashboardItemList[2] - .summaryoptions[2] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red), - ], - ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - padding:EdgeInsets.all(0), - - child: GaugeChart( - _createReferralData(widget.dashboardItemList))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - widget.model - .getPatientCount(dashboardItemList[2]) - .toString(), - fontSize: SizeConfig.textMultiplier * 3.0, - fontWeight: FontWeight.bold, - ) - ], - ), - top: height * .35, - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); return Container(); } - static List> _createReferralData(List dashboardItemList) { - final data = [ - new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), - charts.MaterialPalette.black), - new GaugeSegment( - dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), - charts.MaterialPalette.gray.shadeDefault), - new GaugeSegment( - dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), - charts.MaterialPalette.red.shadeDefault), - ]; - return [ - new charts.Series( - id: 'Segments', - domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, - data: data, - colorFn: (GaugeSegment segment, _) => segment.color, - ) - ]; - } - static int getValue(value) { - return value == 0 ? 1 : value; - } } + + diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 23072d17..09590ef2 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,7 +22,7 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?16:11); return HomePageCard( color: backgroundColor, width: width, @@ -72,7 +72,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightShort?10:12), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 9c72def3..a45332f0 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -119,7 +119,7 @@ class _HomeScreenState extends State { return Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.end, children: [ Column( mainAxisAlignment: @@ -142,8 +142,8 @@ class _HomeScreenState extends State { ), constraints: BoxConstraints( - minWidth: SizeConfig.widthMultiplier* 6, - minHeight: SizeConfig.widthMultiplier* 6, + minWidth: SizeConfig.widthMultiplier* 5.5, + minHeight: SizeConfig.widthMultiplier* 5, ), child: Center( child: AppText( @@ -157,7 +157,7 @@ class _HomeScreenState extends State { projectsProvider .isArabic ? SizeConfig.widthMultiplier* 3.5 - : SizeConfig.widthMultiplier* 4, + : SizeConfig.widthMultiplier* 3, textAlign: TextAlign .center, @@ -291,7 +291,7 @@ class _HomeScreenState extends State { height: SizeConfig.heightMultiplier *1, ), Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?18:11), + height: SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?16:11), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 8b191c3b..d64ef370 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -9,7 +9,7 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?15:12); + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightShort?13:12); return Container( width: width, padding: EdgeInsets.all(SizeConfig.heightMultiplier * .3), @@ -19,7 +19,7 @@ class GetActivityCard extends StatelessWidget { borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8,4, 8, 4), + padding: const EdgeInsets.fromLTRB(8,8, 8, 4), child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -34,7 +34,7 @@ class GetActivityCard extends StatelessWidget { AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 08, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightShort?6: 8), color: Color(0xFF2B353E), textAlign: TextAlign.start, fontWeight: FontWeight.w700, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 41fe28e2..430f5698 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -33,6 +33,8 @@ class GetOutPatientStack extends StatelessWidget { } getStack(Summaryoptions value, max,context) { + double barHeight = SizeConfig.heightMultiplier * + (SizeConfig.isHeightShort ? 30 : 25); return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), @@ -55,7 +57,7 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, + height: max != 0 ? ((barHeight )* value.value) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), @@ -63,7 +65,7 @@ class GetOutPatientStack extends StatelessWidget { ), ), Container( - height: MediaQuery.of(context).size.height * 0.20, + height: barHeight, margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index 7fb9a96a..dcadb8be 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -5,12 +5,13 @@ import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; final int count; + final double height; final Color c; - RowCounts(this.name, this.count, this.c); + RowCounts(this.name, this.count, this.c, {this.height}); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(top: 5, bottom: 5), + padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -46,8 +47,8 @@ class RowCounts extends StatelessWidget { Widget dot(Color c) { return Container( - padding: EdgeInsets.all(5.0), - margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 2), + margin: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 1), decoration: BoxDecoration(color: c, shape: BoxShape.circle)); } } diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index bd338866..f85636ff 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -23,7 +23,7 @@ class BottomNavigationItem extends StatelessWidget { return Expanded( child: SizedBox( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8), + (SizeConfig.isHeightShort ? 10 : 6), child: Material( type: MaterialType.transparency, child: InkWell( @@ -42,16 +42,16 @@ class BottomNavigationItem extends StatelessWidget { ? Color(0xFF333C45) : Theme.of(context).dividerColor, size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8) ) * 40,), + (SizeConfig.isHeightShort ? 10 : 6) ) * 40,), ), SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightShort ? 10 : 8) ) * 0.5,), + (SizeConfig.isHeightShort ? 10 : 6) ) * 0.5,), Expanded( child: Text( name, style: TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: currentIndex == index ? Theme.of(context).primaryColor : Theme.of(context).dividerColor, From 08e104ca56219bebabce05d105528f5f0b65eb18 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 2 Jun 2021 16:05:37 +0300 Subject: [PATCH 018/199] 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 019/199] 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 020/199] 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 021/199] fix sms popup --- lib/config/size_config.dart | 10 +- lib/screens/home/Label.dart | 2 +- lib/widgets/auth/sms-popup.dart | 343 ++++++++++++++++---------------- 3 files changed, 180 insertions(+), 175 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 9179d99a..943bce75 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -19,6 +19,7 @@ class SizeConfig { static bool isMobile = false; static bool isHeightShort = false; static bool isHeightVeryShort = false; + static bool isWidthLarge = false; void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; @@ -32,20 +33,21 @@ class SizeConfig { } else if (constraints.maxHeight < 800) { isHeightShort = true; } + + if(constraints.maxWidth > 600) { + isWidthLarge = true; + } + if (orientation == Orientation.portrait) { isPortrait = true; if (realScreenWidth < 450) { isMobilePortrait = true; } - // textMultiplier = _blockHeight; - // imageSizeMultiplier = _blockWidth; screenHeight = realScreenHeight; screenWidth = realScreenWidth; } else { isPortrait = false; isMobilePortrait = false; - // textMultiplier = _blockWidth; - // imageSizeMultiplier = _blockHeight; screenHeight = realScreenWidth; screenWidth = realScreenHeight; } diff --git a/lib/screens/home/Label.dart b/lib/screens/home/Label.dart index 5d2338a5..73539b15 100644 --- a/lib/screens/home/Label.dart +++ b/lib/screens/home/Label.dart @@ -24,7 +24,7 @@ class Label extends StatelessWidget { children: [ AppText( firstLine, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3 , + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , // fontWeight: FontWeight.bold, color: color, fontHeight: .5, diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index e93489ef..42e4d263 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -47,6 +47,7 @@ class SMSOTP { bool isClosed = false; displayDialog(BuildContext context) async { double dialogWidth = MediaQuery.of(context).size.width * 0.90; + double dialogInputWidth = (dialogWidth / 4) - (SizeConfig.isWidthLarge?SizeConfig.getWidthMultiplier(width:dialogWidth )* 4.5: 20); double dialogHeight = SizeConfig.isHeightVeryShort ?MediaQuery.of(context).size.height * 0.50:MediaQuery.of(context).size.height * 0.40; return showDialog( context: context, @@ -56,222 +57,224 @@ class SMSOTP { width: dialogWidth, child: Material( child: SingleChildScrollView( - child: Container( - color: Colors.white, - child: StatefulBuilder(builder: (context, setState) { - if (displayTime == '') { - startTimer(setState); - } + child: Center( + child: Container( + color: Colors.white, + child: StatefulBuilder(builder: (context, setState) { + if (displayTime == '') { + startTimer(setState); + } - return Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2,), + return Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2,), - Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - children: [ - Icon( - type == AuthMethodTypes.SMS - ? DoctorApp.verify_sms_1 - : DoctorApp.verify_whtsapp, - size: dialogWidth * 0.13, - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.close), - iconSize: dialogWidth * 0.13, - onPressed: () { - this.isClosed = true; - Navigator.pop(context); - this.onFailure(); - }, - ) - ], - ) - ]), - SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 10,), - Padding( - padding: EdgeInsets.only(top: 5, right: 5), - child: AppText( - TranslationBase.of(context).verificationMessage + - ' XXXXXX' + - mobileNo - .toString() - .substring(mobileNo.toString().length - 3), - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, //14, - maxLines: 2, - )), - Form( - key: verifyAccountForm, - child: Padding( - padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2), - child: Directionality( - textDirection: TextDirection.ltr, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, + Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + children: [ + Icon( + type == AuthMethodTypes.SMS + ? DoctorApp.verify_sms_1 + : DoctorApp.verify_whtsapp, + size: SizeConfig.getHeightMultiplier(height:dialogHeight) * 9, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - width: (dialogWidth / 4) - 20, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - child: TextFormField( - textInputAction: TextInputAction - .next, - style: buildTextStyle(), - autofocus: true, - maxLength: 1, - controller: digit1, - textAlign: TextAlign.center, - keyboardType: TextInputType.number, - decoration: buildInputDecoration( - context), - onSaved: (val) {}, - validator: validateCodeDigit, - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD2); - }, - onChanged: (val) { - if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); - checkValue(); - } - }, - ), - ), - Container( - width: dialogWidth / 4 - 20, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - child: TextFormField( - focusNode: focusD2, + IconButton( + icon: Icon(Icons.close), + iconSize: SizeConfig.getHeightMultiplier(height:dialogHeight) * 15, + onPressed: () { + this.isClosed = true; + Navigator.pop(context); + this.onFailure(); + }, + ) + ], + ) + ]), + SizedBox(height: SizeConfig.getHeightMultiplier(height:dialogHeight) * (SizeConfig.isHeightVeryShort?10:5),), + Padding( + padding: EdgeInsets.only(top: 5, right: 5), + child: AppText( + TranslationBase.of(context).verificationMessage + + ' XXXXXX' + + mobileNo + .toString() + .substring(mobileNo.toString().length - 3), + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, //14, + maxLines: 2, + )), + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier(height:dialogHeight) * 2), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: dialogInputWidth, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + child: TextFormField( textInputAction: TextInputAction .next, + style: buildTextStyle(), + autofocus: true, maxLength: 1, - controller: digit2, + controller: digit1, textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType - .number, + keyboardType: TextInputType.number, decoration: buildInputDecoration( context), onSaved: (val) {}, + validator: validateCodeDigit, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD3); + .requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit), - ), - Container( - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - width: dialogWidth / 4 - 20, + ), + ), + Container( + width: dialogInputWidth, height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), child: TextFormField( - focusNode: focusD3, + focusNode: focusD2, textInputAction: TextInputAction .next, maxLength: 1, - controller: digit3, + controller: digit2, textAlign: TextAlign.center, style: buildTextStyle(), keyboardType: TextInputType .number, - decoration: - buildInputDecoration(context), + decoration: buildInputDecoration( + context), onSaved: (val) {}, onFieldSubmitted: (_) { FocusScope.of(context) - .requestFocus(focusD4); + .requestFocus(focusD3); }, onChanged: (val) { if (val.length == 1) { FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = val.trim(); checkValue(); } }, - validator: validateCodeDigit)), - Container( - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - width: dialogWidth / 4 - 20, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + validator: validateCodeDigit), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + width: dialogInputWidth, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction + .next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + Container( + margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), + width: dialogInputWidth, + height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - child: TextFormField( - focusNode: focusD4, - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - controller: digit4, - keyboardType: TextInputType - .number, - decoration: - buildInputDecoration(context), - onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); - }, - onChanged: (val) { - if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); - checkValue(); - } - }, - validator: validateCodeDigit)), - ], - )), + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: TextInputType + .number, + decoration: + buildInputDecoration(context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue['digit4'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + ], + )), + ), ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).validationMessage + - ' ', - fontWeight: FontWeight.w600, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, - ), - AppText( - displayTime, - color: Colors.red, - textAlign: TextAlign.start, - fontWeight: FontWeight.bold, - fontSize: 14, - ) - ]) - ], + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).validationMessage + + ' ', + fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, + ), + AppText( + displayTime, + color: Colors.red, + textAlign: TextAlign.start, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5, + ) + ]) + ], + ), ), - ), - ); + ); - }) + }) + ), ), ), ), From 259ea53319c8fb3125a1036d7b417eac72f55c5c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 3 Jun 2021 22:19:28 +0300 Subject: [PATCH 022/199] home design --- .../home/dashboard_referral_patient.dart | 37 ++++++++++++++++--- .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/home_screen.dart | 8 +++- lib/screens/home/home_screen_header.dart | 18 +++++---- lib/screens/home/{Label.dart => label.dart} | 7 ++-- lib/widgets/dashboard/out_patient_stack.dart | 31 ++++++++++------ lib/widgets/shared/app_scaffold_widget.dart | 4 +- 7 files changed, 78 insertions(+), 29 deletions(-) rename lib/screens/home/{Label.dart => label.dart} (74%) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 7be28985..f7bb9ad5 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -10,8 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; -import 'Label.dart'; - +import 'label.dart'; class DashboardReferralPatient extends StatelessWidget { final List dashboardItemList; @@ -58,12 +57,40 @@ class DashboardReferralPatient extends StatelessWidget { CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?2: 2) + height: SizeConfig + .getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 3 + : SizeConfig.isHeightShort + ? 2 + : 2) ), - Label(firstLine:TranslationBase.of(context).patients ,secondLine:TranslationBase.of(context).referral,color: Color(0xFF2B353E), ), + Label(firstLine: TranslationBase + .of(context) + .patients, + secondLine: TranslationBase + .of(context) + .referral, + color: Color(0xFF2B353E), + fontSize: SizeConfig + .getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 7 + : 12),), SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?5:SizeConfig.isHeightShort?10: 12) + height: SizeConfig + .getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 10 + : 12) ) ], ),), diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 3ffb5ae5..8877aa29 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_card.dart'; import 'package:flutter/material.dart'; -import 'Label.dart'; +import 'label.dart'; class DashboardSliderItemWidget extends StatelessWidget { final DashboardModel item; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 603c20cd..684cf95a 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -23,8 +23,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'Label.dart'; import 'home_screen_header.dart'; +import 'label.dart'; class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -46,6 +46,8 @@ class _HomeScreenState extends State { String clinicId; AuthenticationViewModel authenticationViewModel; int colorIndex = 0; + final GlobalKey scaffoldKey = new GlobalKey(); + @override Widget build(BuildContext context) { @@ -58,6 +60,7 @@ class _HomeScreenState extends State { } return BaseView( + onModelReady: (model) async { await model.setFirebaseNotification( projectsProvider, authenticationViewModel); @@ -70,6 +73,9 @@ class _HomeScreenState extends State { isShowAppBar: true, appBar: HomeScreenHeader( model: model, + onOpenDrawer: (){ + Scaffold.of(context).openDrawer(); + }, ), body: ListView(children: [ Column(children: [ diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index fe8cce38..7d38e898 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -17,11 +17,12 @@ import 'package:provider/provider.dart'; class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { final DashboardViewModel model; + final Function onOpenDrawer; double height = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6); - HomeScreenHeader({Key key, this.model}) : super(key: key); + HomeScreenHeader({Key key, this.model, this.onOpenDrawer}) : super(key: key); @override _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); @@ -33,7 +34,8 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { class _HomeScreenHeaderState extends State { ProjectViewModel projectsProvider; - var clinicId; + int clinicId; + AuthenticationViewModel authenticationViewModel; @@ -53,7 +55,9 @@ class _HomeScreenHeaderState extends State { ), iconSize: SizeConfig.heightMultiplier * 2, color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), + onPressed: (){ + widget.onOpenDrawer(); + }, ), Column( children: [ @@ -113,9 +117,9 @@ class _HomeScreenHeaderState extends State { constraints: BoxConstraints( minWidth: SizeConfig - .widthMultiplier * 5.5, + .getHeightMultiplier(height: widget.height) * 50, minHeight: SizeConfig - .widthMultiplier * 5, + .getHeightMultiplier(height: widget.height) * 50, ), child: Center( child: AppText( @@ -129,9 +133,9 @@ class _HomeScreenHeaderState extends State { projectsProvider .isArabic ? SizeConfig - .widthMultiplier * 3.5 + .getHeightMultiplier(height: widget.height) : SizeConfig - .widthMultiplier * 3, + .getHeightMultiplier(height: widget.height) * 30, textAlign: TextAlign .center, diff --git a/lib/screens/home/Label.dart b/lib/screens/home/label.dart similarity index 74% rename from lib/screens/home/Label.dart rename to lib/screens/home/label.dart index 73539b15..bf80dca8 100644 --- a/lib/screens/home/Label.dart +++ b/lib/screens/home/label.dart @@ -7,11 +7,12 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color, + Key key, this.firstLine, this.secondLine, this.color, this.fontSize, }) : super(key: key); final String firstLine; final String secondLine; Color color; + final double fontSize; @override Widget build(BuildContext context) { @@ -24,7 +25,7 @@ class Label extends StatelessWidget { children: [ AppText( firstLine, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , // fontWeight: FontWeight.bold, color: color, fontHeight: .5, @@ -32,7 +33,7 @@ class Label extends StatelessWidget { AppText( secondLine, color: color, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?6:6.40), fontWeight: FontWeight.bold, ), ], diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index cfa7ce68..a609986e 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,8 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/screens/home/Label.dart'; +import 'package:doctor_app_flutter/screens/home/label.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -13,30 +12,40 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { + double barHeight = + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 23 : 19); value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); var list = new List(); - value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value,context))}); + value.summaryoptions.forEach((result) => { + list.add(getStack( + result, value.summaryoptions.first.value, context, barHeight)) + }); return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Container( - padding: EdgeInsets.symmetric(horizontal: 5,vertical: 5), - child: Label(firstLine:Helpers.getLabelFromKPI(value.kPIName) ,secondLine:Helpers.getNameFromKPI(value.kPIName),color: Color(0xFF2B353E), ), + padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), + child: Label( + firstLine: Helpers.getLabelFromKPI(value.kPIName), + secondLine: Helpers.getNameFromKPI(value.kPIName), + color: Color(0xFF2B353E), + fontSize: SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 9 + : 12), + ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) ], ); } - - - getStack(Summaryoptions value, max,context) { - double barHeight = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 23 : 19); + getStack(Summaryoptions value, max, context, barHeight) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e957b5d4..d3533801 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -21,6 +21,7 @@ class AppScaffold extends StatelessWidget { final Widget appBar; final String subtitle; final bool isHomeIcon; + final Key key; AppScaffold( {this.appBarTitle = '', this.body, @@ -30,7 +31,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle}); + this.appBar, this.subtitle, this.key}); @override Widget build(BuildContext context) { @@ -42,6 +43,7 @@ class AppScaffold extends StatelessWidget { }, child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, + key: key, appBar: isShowAppBar ? appBar ?? AppBar( From d0173bd061fe37d82d31ba8d902a26bf5ced25c2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 11:32:41 +0300 Subject: [PATCH 023/199] home design fixes --- .../home/dashboard_referral_patient.dart | 4 +- lib/screens/home/home_screen.dart | 10 ++--- lib/screens/home/home_screen_header.dart | 43 +++++++++++-------- lib/screens/home/label.dart | 10 +++-- lib/widgets/dashboard/out_patient_stack.dart | 18 +++++--- .../shared/bottom_navigation_item.dart | 10 ++--- 6 files changed, 57 insertions(+), 38 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index f7bb9ad5..1a9c09a2 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -73,7 +73,7 @@ class DashboardReferralPatient extends StatelessWidget { .of(context) .referral, color: Color(0xFF2B353E), - fontSize: SizeConfig + secondLineFontSize: SizeConfig .getHeightMultiplier( height: height) * (SizeConfig.isHeightVeryShort @@ -90,7 +90,7 @@ class DashboardReferralPatient extends StatelessWidget { ? 5 : SizeConfig.isHeightShort ? 10 - : 12) + : 5) ) ], ),), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 684cf95a..a0ef6310 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -71,7 +71,7 @@ class _HomeScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: HomeScreenHeader( + appBar: HomeScreenHeader( model: model, onOpenDrawer: (){ Scaffold.of(context).openDrawer(); @@ -98,7 +98,7 @@ class _HomeScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * 5, + height: SizeConfig.heightMultiplier * 3, ), sliderActiveIndex == 1 ? DashboardSliderItemWidget( @@ -128,7 +128,7 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * 2, + height: SizeConfig.heightMultiplier * 1, ), Container( child: Label( @@ -136,7 +136,7 @@ class _HomeScreenState extends State { secondLine: TranslationBase.of(context).services, )), SizedBox( - height: SizeConfig.heightMultiplier * 1, + height: SizeConfig.heightMultiplier * .6, ), Container( height: SizeConfig.heightMultiplier * @@ -152,7 +152,7 @@ class _HomeScreenState extends State { ], ), ), - SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?6:SizeConfig.isHeightShort?4:3)) + SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?6:SizeConfig.isHeightShort?4:2)) ], ), diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 7d38e898..1e0536e1 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -45,18 +45,20 @@ class _HomeScreenHeaderState extends State { ProjectViewModel projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); - return Container( - color: Colors.grey[100], - child: Stack(children: [ - IconButton( - icon: Image.asset( - 'assets/images/menu.png', - width: SizeConfig.widthMultiplier * 7, - ), - iconSize: SizeConfig.heightMultiplier * 2, - color: Colors.black, - onPressed: (){ - widget.onOpenDrawer(); + return widget.model.state == ViewState.Busy + ? Container(color: Colors.grey.withOpacity(0.6)) + : Container( + color: Colors.grey[100], + child: Stack(children: [ + IconButton( + icon: Image.asset( + 'assets/images/menu.png', + width: SizeConfig.widthMultiplier * 7, + ), + iconSize: SizeConfig.heightMultiplier * 2, + color: Colors.black, + onPressed: () { + widget.onOpenDrawer(); }, ), Column( @@ -117,9 +119,13 @@ class _HomeScreenHeaderState extends State { constraints: BoxConstraints( minWidth: SizeConfig - .getHeightMultiplier(height: widget.height) * 50, + .getHeightMultiplier( + height: widget.height) * + 35, minHeight: SizeConfig - .getHeightMultiplier(height: widget.height) * 50, + .getHeightMultiplier( + height: widget.height) * + 30, ), child: Center( child: AppText( @@ -133,9 +139,12 @@ class _HomeScreenHeaderState extends State { projectsProvider .isArabic ? SizeConfig - .getHeightMultiplier(height: widget.height) + .getHeightMultiplier( + height: widget.height) : SizeConfig - .getHeightMultiplier(height: widget.height) * 30, + .getHeightMultiplier( + height: widget + .height) * 20, textAlign: TextAlign .center, @@ -150,7 +159,7 @@ class _HomeScreenHeaderState extends State { .of(context) .size .width * .6) * 5, - color: Colors.black, + color: Color(0xFF2B353E), textOverflow: TextOverflow .ellipsis, fontWeight: diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index bf80dca8..d732d1c9 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -7,12 +7,13 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color, this.fontSize, + Key key, this.firstLine, this.secondLine, this.color, this.secondLineFontSize, this.firstLineFontSize, }) : super(key: key); final String firstLine; final String secondLine; Color color; - final double fontSize; + final double secondLineFontSize; + final double firstLineFontSize; @override Widget build(BuildContext context) { @@ -25,15 +26,16 @@ class Label extends StatelessWidget { children: [ AppText( firstLine, - fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , // fontWeight: FontWeight.bold, color: color, fontHeight: .5, + fontWeight: FontWeight.w600, ), AppText( secondLine, color: color, - fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?6:6.40), + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), fontWeight: FontWeight.bold, ), ], diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index a609986e..387c2625 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -13,7 +13,7 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { double barHeight = - SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 23 : 19); + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 17); value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); @@ -32,12 +32,20 @@ class GetOutPatientStack extends StatelessWidget { firstLine: Helpers.getLabelFromKPI(value.kPIName), secondLine: Helpers.getNameFromKPI(value.kPIName), color: Color(0xFF2B353E), - fontSize: SizeConfig.getHeightMultiplier(height: barHeight) * + firstLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * (SizeConfig.isHeightVeryShort - ? 5 + ? 10 : SizeConfig.isHeightShort - ? 9 - : 12), + ? 10 + : 8.5), + secondLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 15 + : SizeConfig.isHeightShort + ? 15 + : 14.5), ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index baf5713a..eb87f50f 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -23,7 +23,7 @@ class BottomNavigationItem extends StatelessWidget { return Expanded( child: SizedBox( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 :SizeConfig.isHeightShort ? 6: 7), + (SizeConfig.isHeightVeryShort ? 10 :SizeConfig.isHeightShort ? 8: 8), child: Material( type: MaterialType.transparency, child: InkWell( @@ -35,14 +35,14 @@ class BottomNavigationItem extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 9) ) * 10,), + (SizeConfig.isHeightVeryShort ? 12:SizeConfig.isHeightShort ?10 : 9) ) * 10,), Container( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? Color(0xFF333C45) - : Theme.of(context).dividerColor, + : Color(0xFF989898), size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 40,), + (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40,), ), SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 0.5,), @@ -53,7 +53,7 @@ class BottomNavigationItem extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: currentIndex == index ? Color(0xFF333C45) - : Theme.of(context).dividerColor, + : Color(0xFF989898)//#989898, ), ), ), From c671b60097a3f2aae5c848460928314030b9b257 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 12:14:18 +0300 Subject: [PATCH 024/199] 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 0747dfb1e00e5e659ff0ae10bd8be9cda2bf2594 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Jun 2021 15:31:23 +0300 Subject: [PATCH 025/199] Migrate to flutter 2 --- lib/client/base_app_client.dart | 4 +- .../viewModel/authentication_view_model.dart | 4 +- lib/core/viewModel/dashboard_view_model.dart | 11 +- lib/root_page.dart | 11 +- .../AddVerifyMedicalReport.dart | 12 +- .../profile/vital_sign/LineChartCurved.dart | 8 +- .../shared/app_expandable_notifier_new.dart | 2 +- .../shared/text_fields/html_rich_editor.dart | 94 ++-- pubspec.lock | 450 +++++++++++------- pubspec.yaml | 60 +-- speech_to_text/example/pubspec.lock | 42 +- speech_to_text/pubspec.lock | 174 ++++--- speech_to_text/pubspec.yaml | 10 +- 13 files changed, 478 insertions(+), 404 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 10181bf4..7713eb3a 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -93,7 +93,7 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(url, + final response = await http.post(Uri.parse(url), body: json.encode(body), headers: { 'Content-Type': 'application/json', @@ -219,7 +219,7 @@ class BaseAppClient { print("Body : ${json.encode(body)}"); if (await Helpers.checkConnection()) { - final response = await http.post(url.trim(), + final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 58df9331..a5028266 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -65,7 +65,7 @@ class AuthenticationViewModel extends BaseViewModel { UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); List _availableBiometrics; - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; bool unverified = false; @@ -357,7 +357,7 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions(); + await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); } try { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index bbbef0b6..6f34f034 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -12,7 +12,7 @@ import 'authentication_view_model.dart'; import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); List get dashboardItemsList => @@ -28,13 +28,8 @@ class DashboardViewModel extends BaseViewModel { await projectsProvider.getDoctorClinicsList(); // _firebaseMessaging.setAutoInitEnabled(true); - _firebaseMessaging.requestNotificationPermissions( - const IosNotificationSettings( - sound: true, badge: true, alert: true, provisional: true)); - _firebaseMessaging.onIosSettingsRegistered - .listen((IosNotificationSettings settings) { - print("Settings registered: $settings"); - }); + _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); + _firebaseMessaging.getToken().then((String token) async { if (token != '') { diff --git a/lib/root_page.dart b/lib/root_page.dart index 35a3fa44..6b5eb09d 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -1,8 +1,6 @@ -import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -22,7 +20,9 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNVERIFIED: - return VerificationMethodsScreen(password: null,); + return VerificationMethodsScreen( + password: null, + ); break; case APP_STATUS.UNAUTHENTICATED: return LoginScreen(); @@ -30,6 +30,11 @@ class RootPage extends StatelessWidget { case APP_STATUS.AUTHENTICATED: return LandingPage(); break; + default: + return Scaffold( + body: AppLoaderWidget(), + ); + break; } } diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index a3fa91e9..3eb3660d 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -21,6 +21,7 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { + HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -55,12 +56,9 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: model - .medicalReportTemplate[0] - .templateTextHtml, - height: - MediaQuery.of(context).size.height * - 0.75, + initialText: model.medicalReportTemplate[0].templateTextHtml, + height: MediaQuery.of(context).size.height * 0.75, + controller: _controller, ), ], ), @@ -87,7 +85,7 @@ class _AddVerifyMedicalReportState extends State { fontWeight: FontWeight.w700, onPressed: () async { String txtOfMedicalReport = - await HtmlEditor.getText(); + await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 564c8c2c..7c766158 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -1,9 +1,9 @@ -import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; class LineChartCurved extends StatelessWidget { final String title; @@ -12,8 +12,8 @@ class LineChartCurved extends StatelessWidget { LineChartCurved({this.title, this.timeSeries, this.indexes}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; // DateFormat format = DateFormat("yyyy-MM-dd"); DateFormat yearFormat = DateFormat("yyyy/MMM"); @@ -233,7 +233,7 @@ class LineChartCurved extends StatelessWidget { } List getData(context) { - List spots = List(); + List spots = []; isDatesSameYear = true; int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart index 848f5265..1e825b6c 100644 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -58,7 +58,7 @@ class _AppExpandableNotifier extends State { scrollOnExpand: true, scrollOnCollapse: false, child: ExpandablePanel( - hasIcon: false, + // hasIcon: false, theme: const ExpandableThemeData( headerAlignment: ExpandablePanelHeaderAlignment.center, tapBodyToCollapse: true, diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 71359604..41cd0573 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -12,7 +12,16 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { - HtmlRichEditor({ + final String hint; + final String initialText; + final double height; + final BoxDecoration decoration; + final bool darkMode; + final bool showBottomToolbar; + final List toolbar; + final HtmlEditorController controller; + + HtmlRichEditor({ key, this.hint = "Your text here...", this.initialText, @@ -21,15 +30,8 @@ class HtmlRichEditor extends StatefulWidget { this.darkMode = false, this.showBottomToolbar = false, this.toolbar, + @required this.controller, }) : super(key: key); - final String hint; - final String initialText; - final double height; - final BoxDecoration decoration; - final bool darkMode; - final bool showBottomToolbar; - final List toolbar; - @override _HtmlRichEditorState createState() => _HtmlRichEditorState(); @@ -40,7 +42,6 @@ class _HtmlRichEditorState extends State { stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); - @override void initState() { @@ -55,8 +56,6 @@ class _HtmlRichEditorState extends State { super.initState(); } - - @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -64,40 +63,35 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - hint: widget.hint, - height: widget.height, - initialText: widget.initialText, - showBottomToolbar: widget.showBottomToolbar, - darkMode: widget.darkMode, - decoration: widget.decoration ?? - BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.all( - Radius.circular(30.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - toolbar: widget.toolbar ?? - const [ - // Style(), - Font(buttons: [ - FontButtons.bold, - FontButtons.italic, - FontButtons.underline, - ]), - // ColorBar(buttons: [ColorButtons.color]), - Paragraph(buttons: [ - ParagraphButtons.ul, - ParagraphButtons.ol, - ParagraphButtons.paragraph - ]), - // Insert(buttons: [InsertButtons.link, InsertButtons.picture, InsertButtons.video, InsertButtons.table]), - // Misc(buttons: [MiscButtons.fullscreen, MiscButtons.codeview, MiscButtons.help]) - ], - ), + controller: widget.controller, + htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ + StyleButtons(), + FontSettingButtons(), + FontButtons(), + // ColorButtons(), + ListButtons(), + ParagraphButtons(), + // InsertButtons(), + // OtherButtons(), + ]), + htmlEditorOptions: HtmlEditorOptions( + hint: widget.hint, + initialText: widget.initialText, + darkMode: widget.darkMode, + ), + otherOptions: OtherOptions( + height: widget.height, + decoration: widget.decoration ?? + BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.all( + Radius.circular(30.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + )), Positioned( - top: - 50, //MediaQuery.of(context).size.height * 0, + top: 50, //MediaQuery.of(context).size.height * 0, right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, @@ -107,8 +101,7 @@ class _HtmlRichEditorState extends State { icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -117,7 +110,6 @@ class _HtmlRichEditorState extends State { ); } - onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; @@ -150,15 +142,15 @@ class _HtmlRichEditorState extends State { ].request(); } - void resultListener(result)async { + void resultListener(result) async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await HtmlEditor.getText(); + String txt = await widget.controller.getText(); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - HtmlEditor.setText(txt+recognizedWord); + widget.controller.setText(txt + recognizedWord); }); } else { print(result.finalResult); diff --git a/pubspec.lock b/pubspec.lock index 77df9848..2ff9dca7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,35 +7,35 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "12.0.0" + version: "22.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "1.7.1" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "3.1.2" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "2.1.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" autocomplete_textfield: dependency: "direct main" description: @@ -56,355 +56,376 @@ packages: name: bazel_worker url: "https://pub.dartlang.org" source: hosted - version: "0.1.25" + version: "1.0.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "2.0.2" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "0.4.5" + version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.7" + version: "3.0.0" build_modules: dependency: transitive description: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" + version: "4.0.0" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "1.5.3" + version: "2.0.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.11.1" + version: "2.0.4" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "6.1.7" + version: "7.0.0" build_web_compilers: dependency: "direct dev" description: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "2.12.2" + version: "3.0.0" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "5.0.0" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.0.6" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" charts_common: dependency: transitive description: name: charts_common url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" charts_flutter: dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" chewie: dependency: transitive description: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "0.9.10" + version: "1.2.0" chewie_audio: dependency: transitive description: name: chewie_audio url: "https://pub.dartlang.org" source: hosted - version: "1.0.0+1" + version: "1.2.0" cli_util: dependency: transitive description: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.3.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.7.0" + version: "4.0.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" connectivity: dependency: "direct main" description: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+5" + version: "3.0.6" connectivity_for_web: dependency: transitive description: name: connectivity_for_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.1+4" + version: "0.4.0" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+7" + version: "0.2.0" connectivity_platform_interface: dependency: transitive description: name: connectivity_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.1" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "3.0.0" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" - css_colors: - dependency: transitive - description: - name: css_colors - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" + version: "3.0.1" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.16.2" + version: "0.17.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.0.3" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "1.3.10" + version: "2.0.1" date_time_picker: dependency: "direct main" description: name: date_time_picker url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "2.0.0" device_info: dependency: "direct main" description: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.2+10" + version: "2.0.2" device_info_platform_interface: dependency: transitive description: name: device_info_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.1" dropdown_search: dependency: "direct main" description: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.6.1" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.2.6" + version: "2.0.2" eva_icons_flutter: dependency: "direct main" description: name: eva_icons_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.0" expandable: dependency: "direct main" description: name: expandable url: "https://pub.dartlang.org" source: hosted - version: "4.1.4" + version: "5.0.1" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "5.2.1" + version: "6.1.1" + file_picker: + dependency: transitive + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2+2" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.5.3" + version: "1.2.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "4.0.1" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.1+1" + version: "1.1.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "7.0.3" + version: "10.0.1" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "1.0.0" fl_chart: dependency: "direct main" description: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.12.3" + version: "0.36.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_colorpicker: + dependency: transitive + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" flutter_device_type: dependency: "direct main" description: name: flutter_device_type url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.0" flutter_flexible_toast: dependency: "direct main" description: @@ -425,19 +446,54 @@ packages: name: flutter_html url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.1.0" flutter_inappwebview: dependency: transitive description: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "4.0.0+4" + version: "5.3.2" + flutter_keyboard_visibility: + dependency: transitive + description: + name: flutter_keyboard_visibility + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.2" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_layout_grid: + dependency: transitive + description: + name: flutter_layout_grid + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3" flutter_page_indicator: dependency: transitive description: @@ -451,21 +507,21 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "1.0.11" + version: "2.0.2" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.4.0" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.18.1" + version: "0.22.0" flutter_swiper: dependency: "direct main" description: @@ -489,77 +545,84 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "8.12.0" + version: "9.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" get_it: dependency: "direct main" description: name: get_it url: "https://pub.dartlang.org" source: hosted - version: "4.0.4" + version: "7.1.3" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.0.1" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "2.0.0" hexcolor: dependency: "direct main" description: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.4" html: dependency: "direct main" description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+4" + version: "0.15.0" html_editor_enhanced: dependency: "direct main" description: name: html_editor_enhanced url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "2.1.1" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.13.3" http_interceptor: dependency: "direct main" description: name: http_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.1" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "3.0.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" imei_plugin: dependency: "direct main" description: @@ -567,216 +630,223 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + infinite_listview: + dependency: transitive + description: + name: infinite_listview + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.16.1" + version: "0.17.0" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.5" + version: "1.0.0" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "4.0.1" local_auth: dependency: "direct main" description: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "0.6.3+4" + version: "1.1.6" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.4" + version: "1.0.1" maps_launcher: dependency: "direct main" description: name: maps_launcher url: "https://pub.dartlang.org" source: hosted - version: "1.2.2+2" + version: "2.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.7" + version: "1.0.0" nested: dependency: transitive description: name: nested url: "https://pub.dartlang.org" source: hosted - version: "0.0.4" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - node_io: + version: "1.0.0" + numberpicker: dependency: transitive description: - name: node_io + name: numberpicker url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - open_iconic_flutter: + version: "2.1.1" + numerus: dependency: transitive description: - name: open_iconic_flutter + name: numerus url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "1.1.1" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "2.0.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.4.1+1" + version: "0.5.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.1" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+2" + version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "2.0.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.11.0" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "2.1.9+1" + version: "3.0.1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "5.1.0+2" + version: "8.0.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.5.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.1.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "2.0.0" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0+1" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.5.0" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted - version: "3.0.13" + version: "4.2.1" progress_hud_v2: dependency: "direct main" description: @@ -790,105 +860,98 @@ packages: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "2.0.0" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.3" + version: "5.0.0" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.4" + version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.8" + version: "1.0.0" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.1" scratch_space: dependency: transitive description: name: scratch_space url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" - screen: - dependency: transitive - description: - name: screen - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" + version: "1.0.0" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.12+4" + version: "2.0.6" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+4" + version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+11" + version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.2+7" + version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+3" + version: "2.0.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.9" + version: "1.1.4" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.4+1" + version: "1.0.1" sky_engine: dependency: transitive description: flutter @@ -900,14 +963,14 @@ packages: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.9" + version: "0.10.10" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" speech_to_text: dependency: "direct main" description: @@ -921,56 +984,56 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" sticky_headers: dependency: "direct main" description: name: sticky_headers url: "https://pub.dartlang.org" source: hosted - version: "0.1.8+1" + version: "0.2.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+3" + version: "1.0.0" transformer_page_view: dependency: transitive description: @@ -978,146 +1041,181 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.6" + tuple: + dependency: transitive + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.7.10" + version: "6.0.6" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+4" + version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+9" + version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.0.3" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.5+3" + version: "2.0.1" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+3" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.2" + version: "2.0.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" video_player: dependency: transitive description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "0.10.12+5" + version: "2.1.5" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "4.1.0" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+1" + version: "2.0.1" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" wakelock: dependency: transitive description: name: wakelock url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+2" + version: "0.5.2" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+1" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+15" + version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.1.0" webview_flutter: dependency: transitive description: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.3.24" + version: "2.0.8" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.4+1" + version: "2.1.3" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "4.5.1" + version: "5.1.2" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.1.0" sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.22.0 <2.0.0" + dart: ">=2.13.0 <3.0.0" + flutter: ">=2.2.0" diff --git a/pubspec.yaml b/pubspec.yaml index 973e8800..ac0e78c3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,67 +24,67 @@ environment: dependencies: flutter: sdk: flutter - hexcolor: ^1.0.1 + hexcolor: ^2.0.4 flutter_localizations: sdk: flutter - flutter_device_type: ^0.2.0 - intl: ^0.16.0 - http: ^0.12.0+4 - provider: ^4.0.5+1 - shared_preferences: ^0.5.6+3 - imei_plugin: ^1.1.6 + flutter_device_type: ^0.4.0 + intl: ^0.17.0 + http: ^0.13.0 + provider: ^5.0.0 + shared_preferences: ^2.0.6 + imei_plugin: ^1.2.0 flutter_flexible_toast: ^0.1.4 - local_auth: ^0.6.1+3 - http_interceptor: ^0.2.0 + local_auth: ^1.1.6 + http_interceptor: ^0.4.1 progress_hud_v2: ^2.0.0 - connectivity: ^0.4.8+2 - maps_launcher: ^1.2.0 - url_launcher: ^5.4.5 - charts_flutter: ^0.9.0 + connectivity: ^3.0.6 + maps_launcher: ^2.0.0 + url_launcher: ^6.0.6 + charts_flutter: ^0.10.0 flutter_swiper: ^1.1.6 #Icons - eva_icons_flutter: ^2.0.0 - font_awesome_flutter: ^8.11.0 - dropdown_search: ^0.4.8 - flutter_staggered_grid_view: ^0.3.2 + eva_icons_flutter: ^3.0.0 + font_awesome_flutter: ^9.0.0 + dropdown_search: ^0.6.1 + flutter_staggered_grid_view: ^0.4.0 - expandable: ^4.1.4 + expandable: ^5.0.1 # Qr code Scanner barcode_scan_fix: ^1.0.2 # permissions - permission_handler: ^5.0.0+hotfix.3 - device_info: ^0.4.2+4 + permission_handler: ^8.0.1 + device_info: ^2.0.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.3 # SVG #flutter_svg: ^0.17.4 - percent_indicator: ^2.1.1 + percent_indicator: ^3.0.1 #Dependency Injection - get_it: ^4.0.2 + get_it: ^7.1.3 #chart - fl_chart: ^0.12.1 + fl_chart: ^0.36.1 # Firebase - firebase_messaging: ^7.0.3 + firebase_messaging: ^10.0.1 #GIF image flutter_gifimage: ^1.0.1 #Autocomplete TextField autocomplete_textfield: ^1.7.3 - date_time_picker: ^1.1.1 + date_time_picker: ^2.0.0 # Html - html: ^0.14.0+4 + html: ^0.15.0 # Flutter Html View - flutter_html: 1.0.2 - sticky_headers: "^0.1.8" + flutter_html: ^2.1.0 + sticky_headers: ^0.2.0 #speech to text speech_to_text: @@ -93,7 +93,7 @@ dependencies: # Html Editor Enhanced - html_editor_enhanced: ^1.3.0 + html_editor_enhanced: ^2.1.1 dev_dependencies: flutter_test: diff --git a/speech_to_text/example/pubspec.lock b/speech_to_text/example/pubspec.lock index 6809f75f..1538589c 100644 --- a/speech_to_text/example/pubspec.lock +++ b/speech_to_text/example/pubspec.lock @@ -7,42 +7,42 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -73,21 +73,21 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "4.0.1" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" nested: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" permission_handler: dependency: "direct main" description: @@ -141,7 +141,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" speech_to_text: dependency: "direct dev" description: @@ -155,49 +155,49 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" sdks: - dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.16.0 <2.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.16.0" diff --git a/speech_to_text/pubspec.lock b/speech_to_text/pubspec.lock index efc63cc7..95b0d050 100644 --- a/speech_to_text/pubspec.lock +++ b/speech_to_text/pubspec.lock @@ -7,175 +7,182 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "22.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.39.13" + version: "1.7.1" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "2.1.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "2.0.2" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "3.0.0" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "1.3.10" + version: "2.0.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "2.0.4" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "5.2.0" + version: "7.0.0" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "5.0.0" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.0.6" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" clock: dependency: "direct main" description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.4.0" + version: "4.0.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "3.0.0" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" + version: "3.0.1" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "1.3.6" + version: "2.0.1" fake_async: dependency: "direct dev" description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.1" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "1.0.0" flutter: dependency: "direct main" description: flutter @@ -186,174 +193,153 @@ packages: description: flutter source: sdk version: "0.0.0" - glob: + frontend_server_client: dependency: transitive description: - name: glob + name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - graphs: + version: "2.1.0" + glob: dependency: transitive description: - name: graphs + name: glob url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" - html: + version: "2.0.1" + graphs: dependency: transitive description: - name: html + name: graphs url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+3" + version: "2.0.0" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "3.0.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "1.0.0" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "4.0.1" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "3.3.0" + version: "4.1.3" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "0.11.4" + version: "1.0.1" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.6+3" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" + version: "1.0.0" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "2.0.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.11.0" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.5.0" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.4" + version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" + version: "1.0.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.7" + version: "1.1.4" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "1.0.1" sky_engine: dependency: transitive description: flutter @@ -365,98 +351,98 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "0.9.6" + version: "1.0.1" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+2" + version: "1.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+15" + version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "2.1.0" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.1.0" sdks: - dart: ">=2.10.0-110 <2.11.0" + dart: ">=2.12.0 <3.0.0" flutter: ">=1.10.0" diff --git a/speech_to_text/pubspec.yaml b/speech_to_text/pubspec.yaml index 34b3da29..a40fe1ec 100644 --- a/speech_to_text/pubspec.yaml +++ b/speech_to_text/pubspec.yaml @@ -10,15 +10,15 @@ environment: dependencies: flutter: sdk: flutter - json_annotation: ^3.0.0 - clock: ^1.0.1 + json_annotation: ^4.0.1 + clock: ^1.1.0 dev_dependencies: flutter_test: sdk: flutter - build_runner: ^1.0.0 - json_serializable: ^3.0.0 - fake_async: ^1.0.1 + build_runner: ^2.0.4 + json_serializable: ^4.1.3 + fake_async: ^1.2.0 flutter: plugin: From 60b5d474c1d8efe2f87a3ecb3d8f07c1420b714e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 16:13:12 +0300 Subject: [PATCH 026/199] home design fixes for small and large screen --- lib/screens/home/dashboard_referral_patient.dart | 2 +- lib/screens/home/dashboard_swipe_widget.dart | 4 ++-- lib/screens/home/home_patient_card.dart | 7 ++++--- lib/screens/home/home_screen.dart | 15 ++++++++++++--- lib/screens/home/home_screen_header.dart | 14 ++++++-------- lib/widgets/dashboard/activity_card.dart | 2 +- .../dashboard/swiper_rounded_pagination.dart | 10 +++++----- .../patients/profile/profile-welcome-widget.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 10 +++++----- lib/widgets/shared/app_scaffold_widget.dart | 4 +--- lib/widgets/shared/drawer_item_widget.dart | 8 ++++---- 11 files changed, 42 insertions(+), 36 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 1a9c09a2..0b9e6765 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -22,7 +22,7 @@ class DashboardReferralPatient extends StatelessWidget { Widget build(BuildContext context) { return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.2, shadowSpreadRadius: 3, diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 1b5ce330..68e1263b 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -86,7 +86,7 @@ class _DashboardSwipeWidgetState extends State { if (index == 1) return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.2, shadowSpreadRadius: 3, @@ -102,7 +102,7 @@ class _DashboardSwipeWidgetState extends State { if (index == 0) return RoundedContainer( raduis: 16, - showBorder: true, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.2, shadowSpreadRadius: 3, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 0a24b4db..3a7ded81 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -22,11 +22,12 @@ class HomePatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightVeryShort?14:13); + double width = SizeConfig.heightMultiplier* + (SizeConfig.isHeightVeryShort ? 16 : 13); return HomePageCard( color: backgroundColor, width: width, - margin: EdgeInsets.all(4), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.6), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -72,7 +73,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort?10:12), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort?11:12), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2bc42f5e..75e02aa4 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -79,6 +79,9 @@ class _HomeScreenState extends State { ), body: ListView(children: [ Column(children: [ + // SizedBox( + // height: SizeConfig.heightMultiplier * 1.4, + // ), model.dashboardItemsList.length > 0 ? DashboardSwipeWidget( model.dashboardItemsList, @@ -90,6 +93,10 @@ class _HomeScreenState extends State { }, ) : SizedBox(), + + // SizedBox( + // height: SizeConfig.heightMultiplier * 1.4, + // ), model.dashboardItemsList.length > 0 ? FractionallySizedBox( widthFactor: 0.90, @@ -113,14 +120,16 @@ class _HomeScreenState extends State { ), ) : SizedBox(), - + SizedBox( + height: SizeConfig.heightMultiplier * 1.4, + ), FractionallySizedBox( // widthFactor: 0.90, child: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( - topRight: Radius.circular(50), + topRight: Radius.circular(70), )), padding: EdgeInsets.only(left: 20, top: 10, right: 20), margin: EdgeInsets.only(top: 10), @@ -153,7 +162,7 @@ class _HomeScreenState extends State { ], ), ), - SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?6:SizeConfig.isHeightShort?4:2)) + SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?4:2)) ], ), diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 8e30504c..263d332f 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -28,7 +29,6 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); @override - // TODO: implement preferredSize Size get preferredSize => Size(double.maxFinite,height); } @@ -51,11 +51,8 @@ class _HomeScreenHeaderState extends State { color: Colors.grey[100], child: Stack(children: [ IconButton( - icon: Image.asset( - 'assets/images/menu.png', - width: SizeConfig.widthMultiplier * 7, - ), - iconSize: SizeConfig.heightMultiplier * 2, + icon: Icon(FontAwesomeIcons.ellipsisH), + iconSize: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?4: 3), color: Colors.black, onPressed: () { widget.onOpenDrawer(); @@ -65,7 +62,7 @@ class _HomeScreenHeaderState extends State { children: [ ProfileWelcomeWidget( Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, children: [ Container( width: MediaQuery @@ -101,6 +98,7 @@ class _HomeScreenHeaderState extends State { mainAxisAlignment: MainAxisAlignment .center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( padding: @@ -158,7 +156,7 @@ class _HomeScreenHeaderState extends State { width: MediaQuery .of(context) .size - .width * .6) * 5, + .width * .6) * (SizeConfig.isWidthLarge?4:5), color: Color(0xFF2B353E), textOverflow: TextOverflow .ellipsis, diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart index 44f0c50c..71fcad7f 100644 --- a/lib/widgets/dashboard/activity_card.dart +++ b/lib/widgets/dashboard/activity_card.dart @@ -13,7 +13,7 @@ class GetActivityCard extends StatelessWidget { return Container( width: width, padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), - margin: EdgeInsets.all(SizeConfig.heightMultiplier * .5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15), diff --git a/lib/widgets/dashboard/swiper_rounded_pagination.dart b/lib/widgets/dashboard/swiper_rounded_pagination.dart index 7e5c2c70..c0360d96 100644 --- a/lib/widgets/dashboard/swiper_rounded_pagination.dart +++ b/lib/widgets/dashboard/swiper_rounded_pagination.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; class SwiperRoundedPagination extends StatelessWidget { @@ -7,15 +8,14 @@ class SwiperRoundedPagination extends StatelessWidget { Widget build(BuildContext context) { return active == true ? Container( - height: 5, - width: 30, - // margin: EdgeInsets.only(10), + height: SizeConfig.heightMultiplier * .6, + width: SizeConfig.widthMultiplier * 6, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), color: Colors.black), ) : Container( - height: 5, - width: 8, + height: SizeConfig.heightMultiplier * .6, + width: SizeConfig.widthMultiplier * 2, margin: EdgeInsets.all(2), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.grey)); diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index a7621115..17b88630 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -22,7 +22,7 @@ class ProfileWelcomeWidget extends StatelessWidget { widthFactor: 0.9, child: Row( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ this.isClinic == true ? clinicWidget : SizedBox(), SizedBox( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index ee74590f..800bbc19 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -50,7 +50,7 @@ class _AppDrawerState extends State { child: Image.asset( 'assets/images/dr_app_logo.png', width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightVeryShort? 25:SizeConfig.isHeightVeryShort?30: 32), + width: drawerWidth) * (SizeConfig.isHeightVeryShort? 25:SizeConfig.isHeightShort?32: 32), ), margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), @@ -97,7 +97,7 @@ class _AppDrawerState extends State { fontFamily: 'Poppins', fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 8, + width: drawerWidth) * (SizeConfig.isWidthLarge?5: 8), ), ), Padding( @@ -109,7 +109,7 @@ class _AppDrawerState extends State { color: Color(0xFF2E303A), fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 6, + width: drawerWidth) * (SizeConfig.isWidthLarge?3: 6), fontFamily: 'Poppins', )) ], @@ -232,7 +232,7 @@ class _AppDrawerState extends State { fontWeight: FontWeight.bold, fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 6, + width: drawerWidth) * (SizeConfig.isWidthLarge?4: 6), fontFamily: 'Poppins', ), children: [ @@ -242,7 +242,7 @@ class _AppDrawerState extends State { color: Color(0xFF2E303A), fontSize: SizeConfig .getTextMultiplierBasedOnWidth( - width: drawerWidth) * 7, + width: drawerWidth) * (SizeConfig.isWidthLarge?5: 7), fontFamily: 'Poppins', ), ) diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index d3533801..e957b5d4 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -21,7 +21,6 @@ class AppScaffold extends StatelessWidget { final Widget appBar; final String subtitle; final bool isHomeIcon; - final Key key; AppScaffold( {this.appBarTitle = '', this.body, @@ -31,7 +30,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle, this.key}); + this.appBar, this.subtitle}); @override Widget build(BuildContext context) { @@ -43,7 +42,6 @@ class AppScaffold extends StatelessWidget { }, child: Scaffold( backgroundColor: backgroundColor ?? Colors.white, - key: key, appBar: isShowAppBar ? appBar ?? AppBar( diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 71021f5d..6d381cad 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -29,15 +29,15 @@ class _DrawerItemState extends State { children: [ if(widget.assetLink!=null) Container( - height: 20, - width: 20, + height: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), + width: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), child: Image.asset(widget.assetLink), ), if(widget.assetLink==null) Icon( widget.icon, color: widget.color ?? Colors.black87, - size: SizeConfig.imageSizeMultiplier * 5, + size: SizeConfig.imageSizeMultiplier * (SizeConfig.isWidthLarge?3: 5), ), Expanded( child: Column( @@ -51,7 +51,7 @@ class _DrawerItemState extends State { marginLeft: 5, marginRight: 5, color:widget.color ??Color(0xFF2E303A), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * (SizeConfig.isHeightVeryShort?5:6), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * (SizeConfig.isHeightVeryShort?5:(SizeConfig.isWidthLarge?4: 6)), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), From 1f8a90e47b85f03bbedc91ca7eac3f22880cf641 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 6 Jun 2021 17:15:52 +0300 Subject: [PATCH 027/199] 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 d784310c8247d32721973dfcf6f573b08fb9bde5 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Jun 2021 18:02:23 +0300 Subject: [PATCH 028/199] Migrate models to flutter 2 --- lib/client/base_app_client.dart | 40 ++- lib/config/size_config.dart | 22 +- .../admissionRequest/admission-request.dart | 94 +++---- .../model/admissionRequest/clinic-model.dart | 21 +- .../model/admissionRequest/ward-model.dart | 8 +- .../model/auth/activation_Code_req_model.dart | 21 +- ...on_code_for_verification_screen_model.dart | 27 +- ...on_code_for_doctor_app_response_model.dart | 110 ++++---- .../check_activation_code_request_model.dart | 29 +- lib/core/model/auth/imei_details.dart | 59 ++-- lib/core/model/auth/insert_imei_model.dart | 66 ++--- .../new_login_information_response_model.dart | 46 ++-- ...on_code_for_doctor_app_response_model.dart | 8 +- .../get_hospitals_request_model.dart | 18 +- .../get_hospitals_response_model.dart | 6 +- .../model/insurance/insurance_approval.dart | 66 ++--- .../insurance_approval_in_patient_model.dart | 118 ++++---- lib/core/model/labs/LabOrderResult.dart | 30 +- lib/core/model/labs/lab_result.dart | 71 +++-- lib/core/model/labs/patient_lab_orders.dart | 72 ++--- .../labs/patient_lab_special_result.dart | 10 +- .../labs/request_patient_lab_orders.dart | 26 +- .../request_patient_lab_special_result.dart | 36 +-- .../labs/request_send_lab_report_email.dart | 98 +++---- ...dingPatientERForDoctorAppRequestModel.dart | 6 +- .../medical_report/medical_file_model.dart | 258 +++++++++--------- .../medical_file_request_model.dart | 6 +- .../patient-admission-request-service.dart | 1 + lib/models/doctor/doctor_profile_model.dart | 2 +- pubspec.yaml | 2 +- 30 files changed, 690 insertions(+), 687 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 7713eb3a..f083258d 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -18,9 +18,9 @@ Helpers helpers = new Helpers(); class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, + {required Map body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, bool isAllowAny = false,bool isLiveCare = false}) async { String url; if(isLiveCare) @@ -30,22 +30,20 @@ class BaseAppClient { bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - if (profile != null) { - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) - body['DoctorID'] = doctorProfile?.doctorID; - if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) - body['EditedBy'] = doctorProfile?.doctorID; - if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; - } - - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + if (body['DoctorID'] == null) + body['DoctorID'] = doctorProfile?.doctorID; + if (body['DoctorID'] == "") body['DoctorID'] = null; + if (body['EditedBy'] == null) + body['EditedBy'] = doctorProfile?.doctorID; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; } + + if (body['ClinicID'] == null) + body['ClinicID'] = doctorProfile?.clinicID; if (body['DoctorID'] == '') { body['DoctorID'] = null; } @@ -140,10 +138,10 @@ class BaseAppClient { } postPatient(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - @required PatiantInformtion patient, + {required Map body, + required Function(dynamic response, int statusCode) onSuccess, + required Function(String error, int statusCode) onFailure, + required PatiantInformtion patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6b996b3f..06dc3cda 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,14 +5,14 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - static double realScreenWidth; - static double realScreenHeight; - static double screenWidth; - static double screenHeight; - static double textMultiplier; - static double imageSizeMultiplier; - static double heightMultiplier; - static double widthMultiplier; + static double ? realScreenWidth; + static double ? realScreenHeight; + static double ? screenWidth; + static double ? screenHeight; + static double ? textMultiplier; + static double ? imageSizeMultiplier; + static double ? heightMultiplier; + static double ? widthMultiplier; static bool isPortrait = true; static bool isMobilePortrait = false; @@ -28,7 +28,7 @@ class SizeConfig { } if (orientation == Orientation.portrait) { isPortrait = true; - if (realScreenWidth < 450) { + if (realScreenWidth! < 450) { isMobilePortrait = true; } // textMultiplier = _blockHeight; @@ -43,8 +43,8 @@ class SizeConfig { screenHeight = realScreenWidth; screenWidth = realScreenHeight; } - _blockWidth = screenWidth / 100; - _blockHeight = screenHeight / 100; + _blockWidth = (screenWidth! / 100); + _blockHeight = (screenHeight! / 100)!; textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 1ab5a990..5cf56e8e 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,48 +1,48 @@ class AdmissionRequest { - int patientMRN; - int admitToClinic; - bool isPregnant; - int pregnancyWeeks; - int pregnancyType; - int noOfBabies; - int mrpDoctorID; - String admissionDate; - int expectedDays; - int admissionType; - int admissionLocationID; - int roomCategoryID; - int wardID; - bool isSickLeaveRequired; - String sickLeaveComments; - bool isTransport; - String transportComments; - bool isPhysioAppointmentNeeded; - String physioAppointmentComments; - bool isOPDFollowupAppointmentNeeded; - String opdFollowUpComments; - bool isDietType; - int dietType; - String dietRemarks; - bool isPhysicalActivityModification; - String physicalActivityModificationComments; - int orStatus; - String mainLineOfTreatment; - int estimatedCost; - String elementsForImprovement; - bool isPackagePatient; - String complications; - String otherDepartmentInterventions; - String otherProcedures; - String pastMedicalHistory; - String pastSurgicalHistory; - List admissionRequestDiagnoses; - List admissionRequestProcedures; - int appointmentNo; - int episodeID; - int admissionRequestNo; + late int patientMRN; + late int? admitToClinic; + late bool? isPregnant; + late int pregnancyWeeks; + late int pregnancyType; + late int noOfBabies; + late int? mrpDoctorID; + late String? admissionDate; + late int? expectedDays; + late int? admissionType; + late int admissionLocationID; + late int roomCategoryID; + late int? wardID; + late bool? isSickLeaveRequired; + late String sickLeaveComments; + late bool isTransport; + late String transportComments; + late bool isPhysioAppointmentNeeded; + late String physioAppointmentComments; + late bool isOPDFollowupAppointmentNeeded; + late String opdFollowUpComments; + late bool? isDietType; + late int? dietType; + late String? dietRemarks; + late bool isPhysicalActivityModification; + late String physicalActivityModificationComments; + late int orStatus; + late String? mainLineOfTreatment; + late int? estimatedCost; + late String? elementsForImprovement; + late bool isPackagePatient; + late String complications; + late String otherDepartmentInterventions; + late String otherProcedures; + late String pastMedicalHistory; + late String pastSurgicalHistory; + late List? admissionRequestDiagnoses; + late List? admissionRequestProcedures; + late int? appointmentNo; + late int? episodeID; + late int? admissionRequestNo; AdmissionRequest( - {this.patientMRN, + {required this.patientMRN, this.admitToClinic, this.isPregnant, this.pregnancyWeeks = 0, @@ -123,17 +123,17 @@ class AdmissionRequest { pastMedicalHistory = json['pastMedicalHistory']; pastSurgicalHistory = json['pastSurgicalHistory']; if (json['admissionRequestDiagnoses'] != null) { - admissionRequestDiagnoses = new List(); + admissionRequestDiagnoses = []; json['admissionRequestDiagnoses'].forEach((v) { - admissionRequestDiagnoses.add(v); + admissionRequestDiagnoses!.add(v); // admissionRequestDiagnoses // .add(new AdmissionRequestDiagnoses.fromJson(v)); }); } if (json['admissionRequestProcedures'] != null) { - admissionRequestProcedures = new List(); + admissionRequestProcedures = []; json['admissionRequestProcedures'].forEach((v) { - admissionRequestProcedures.add(v); + admissionRequestProcedures!.add(v); // admissionRequestProcedures // .add(new AdmissionRequestProcedures.fromJson(v)); }); @@ -190,7 +190,7 @@ class AdmissionRequest { } if (this.admissionRequestProcedures != null) { data['admissionRequestProcedures'] = - this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/core/model/admissionRequest/clinic-model.dart b/lib/core/model/admissionRequest/clinic-model.dart index 05d34645..e5a03264 100644 --- a/lib/core/model/admissionRequest/clinic-model.dart +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -1,16 +1,16 @@ class Clinic { - int clinicGroupID; - String clinicGroupName; - int clinicID; - String clinicNameArabic; - String clinicNameEnglish; + late int? clinicGroupID; + late String? clinicGroupName; + late int? clinicID; + late String? clinicNameArabic; + late String? clinicNameEnglish; Clinic( {this.clinicGroupID, - this.clinicGroupName, - this.clinicID, - this.clinicNameArabic, - this.clinicNameEnglish}); + this.clinicGroupName, + this.clinicID, + this.clinicNameArabic, + this.clinicNameEnglish}); Clinic.fromJson(Map json) { clinicGroupID = json['clinicGroupID']; @@ -29,5 +29,4 @@ class Clinic { data['clinicNameEnglish'] = this.clinicNameEnglish; return data; } - -} \ No newline at end of file +} diff --git a/lib/core/model/admissionRequest/ward-model.dart b/lib/core/model/admissionRequest/ward-model.dart index 606758d3..8f7b9fe5 100644 --- a/lib/core/model/admissionRequest/ward-model.dart +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -1,9 +1,9 @@ class WardModel{ - String description; - String descriptionN; - int floorID; - bool isActive; + late String ? description; + late String ? descriptionN; + late int ? floorID; + late bool ? isActive; WardModel( {this.description, this.descriptionN, this.floorID, this.isActive}); diff --git a/lib/core/model/auth/activation_Code_req_model.dart b/lib/core/model/auth/activation_Code_req_model.dart index 1a9510e8..1ef02c02 100644 --- a/lib/core/model/auth/activation_Code_req_model.dart +++ b/lib/core/model/auth/activation_Code_req_model.dart @@ -1,14 +1,15 @@ class ActivationCodeModel { - String mobileNumber; - String zipCode; - int channel; - int languageID; - double versionID; - int memberID; - String password; - int facilityId; - String generalid; - String otpSendType; + late String? mobileNumber; + late String? zipCode; + late int? channel; + late int? languageID; + late double? versionID; + late int? memberID; + late String? password; + late int? facilityId; + late String? generalid; + late String? otpSendType; + ActivationCodeModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/activation_code_for_verification_screen_model.dart b/lib/core/model/auth/activation_code_for_verification_screen_model.dart index 28cc58db..f7aba9f0 100644 --- a/lib/core/model/auth/activation_code_for_verification_screen_model.dart +++ b/lib/core/model/auth/activation_code_for_verification_screen_model.dart @@ -1,17 +1,18 @@ class ActivationCodeForVerificationScreenModel { - int oTPSendType; - String mobileNumber; - String zipCode; - int channel; - int languageID; - double versionID; - int memberID; - int facilityId; - String generalid; - int isMobileFingerPrint; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String iMEI; + late int? oTPSendType; + late String? mobileNumber; + late String? zipCode; + late int? channel; + late int? languageID; + late double? versionID; + late int? memberID; + late int? facilityId; + late String? generalid; + late int? isMobileFingerPrint; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late String? iMEI; + ActivationCodeForVerificationScreenModel( {this.oTPSendType, this.mobileNumber, diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index c5ff29e6..0d9e5149 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { - String authenticationTokenID; - List listDoctorsClinic; - List listDoctorProfile; - MemberInformation memberInformation; + late String? authenticationTokenID; + late List? listDoctorsClinic; + late List? listDoctorProfile; + late MemberInformation? memberInformation; CheckActivationCodeForDoctorAppResponseModel( {this.authenticationTokenID, @@ -15,16 +15,16 @@ class CheckActivationCodeForDoctorAppResponseModel { Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { - listDoctorsClinic = new List(); + listDoctorsClinic = []; json['List_DoctorsClinic'].forEach((v) { - listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); + listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); }); } if (json['List_DoctorProfile'] != null) { - listDoctorProfile = new List(); + listDoctorProfile = []; json['List_DoctorProfile'].forEach((v) { - listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); + listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); }); } @@ -38,34 +38,35 @@ class CheckActivationCodeForDoctorAppResponseModel { data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { data['List_DoctorsClinic'] = - this.listDoctorsClinic.map((v) => v.toJson()).toList(); + this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { data['List_DoctorProfile'] = - this.listDoctorProfile.map((v) => v.toJson()).toList(); + this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { - data['memberInformation'] = this.memberInformation.toJson(); + data['memberInformation'] = this.memberInformation!.toJson(); } return data; } } class ListDoctorsClinic { - Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; - - ListDoctorsClinic({this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + late dynamic setupID; + late int? projectID; + late int? doctorID; + late int? clinicID; + late bool? isActive; + late String? clinicName; + + ListDoctorsClinic( + {this.setupID, + this.projectID, + this.doctorID, + this.clinicID, + this.isActive, + this.clinicName}); ListDoctorsClinic.fromJson(Map json) { setupID = json['SetupID']; @@ -89,31 +90,32 @@ class ListDoctorsClinic { } class MemberInformation { - List clinics; - int doctorId; - String email; - int employeeId; - int memberId; - Null memberName; - Null memberNameArabic; - String preferredLanguage; - List roles; - - MemberInformation({this.clinics, - this.doctorId, - this.email, - this.employeeId, - this.memberId, - this.memberName, - this.memberNameArabic, - this.preferredLanguage, - this.roles}); + late List? clinics; + late int? doctorId; + late String? email; + late int? employeeId; + late int? memberId; + late dynamic memberName; + late dynamic memberNameArabic; + late String? preferredLanguage; + late List? roles; + + MemberInformation( + {this.clinics, + this.doctorId, + this.email, + this.employeeId, + this.memberId, + this.memberName, + this.memberNameArabic, + this.preferredLanguage, + this.roles}); MemberInformation.fromJson(Map json) { if (json['clinics'] != null) { - clinics = new List(); + clinics = []; json['clinics'].forEach((v) { - clinics.add(new Clinics.fromJson(v)); + clinics!.add(new Clinics.fromJson(v)); }); } doctorId = json['doctorId']; @@ -124,9 +126,9 @@ class MemberInformation { memberNameArabic = json['memberNameArabic']; preferredLanguage = json['preferredLanguage']; if (json['roles'] != null) { - roles = new List(); + roles = []; json['roles'].forEach((v) { - roles.add(new Roles.fromJson(v)); + roles!.add(new Roles.fromJson(v)); }); } } @@ -134,7 +136,7 @@ class MemberInformation { Map toJson() { final Map data = new Map(); if (this.clinics != null) { - data['clinics'] = this.clinics.map((v) => v.toJson()).toList(); + data['clinics'] = this.clinics!.map((v) => v.toJson()).toList(); } data['doctorId'] = this.doctorId; data['email'] = this.email; @@ -144,16 +146,16 @@ class MemberInformation { data['memberNameArabic'] = this.memberNameArabic; data['preferredLanguage'] = this.preferredLanguage; if (this.roles != null) { - data['roles'] = this.roles.map((v) => v.toJson()).toList(); + data['roles'] = this.roles!.map((v) => v.toJson()).toList(); } return data; } } class Clinics { - bool defaultClinic; - int id; - String name; + late bool? defaultClinic; + late int? id; + late String? name; Clinics({this.defaultClinic, this.id, this.name}); @@ -173,8 +175,8 @@ class Clinics { } class Roles { - String name; - int roleId; + late String? name; + late int? roleId; Roles({this.name, this.roleId}); diff --git a/lib/core/model/auth/check_activation_code_request_model.dart b/lib/core/model/auth/check_activation_code_request_model.dart index 9bb3d4f6..187c989c 100644 --- a/lib/core/model/auth/check_activation_code_request_model.dart +++ b/lib/core/model/auth/check_activation_code_request_model.dart @@ -1,18 +1,19 @@ class CheckActivationCodeRequestModel { - String mobileNumber; - String zipCode; - int doctorID; - String iPAdress; - int channel; - int languageID; - int projectID; - double versionID; - String generalid; - String logInTokenID; - String activationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int oTPSendType; + late String? mobileNumber; + late String? zipCode; + late int? doctorID; + late String? iPAdress; + late int? channel; + late int? languageID; + late int? projectID; + late double? versionID; + late String? generalid; + late String? logInTokenID; + late String? activationCode; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late int? oTPSendType; + CheckActivationCodeRequestModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/imei_details.dart b/lib/core/model/auth/imei_details.dart index eb37e736..95ff1e74 100644 --- a/lib/core/model/auth/imei_details.dart +++ b/lib/core/model/auth/imei_details.dart @@ -1,33 +1,34 @@ class GetIMEIDetailsModel { - int iD; - String iMEI; - int logInTypeID; - bool outSA; - String mobile; - dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; - dynamic clinicDescriptionN; - int projectID; - String projectName; - String genderDescription; - dynamic genderDescriptionN; - String titleDescription; - dynamic titleDescriptionN; - dynamic zipCode; - String createdOn; - dynamic createdBy; - String editedOn; - dynamic editedBy; - bool biometricEnabled; - dynamic preferredLanguage; - bool isActive; - String vidaAuthTokenID; - String vidaRefreshTokenID; - String password; + late int? iD; + late String? iMEI; + late int? logInTypeID; + late bool? outSA; + late String? mobile; + late dynamic identificationNo; + late int? doctorID; + late String? doctorName; + late String? doctorNameN; + late int? clinicID; + late String? clinicDescription; + late dynamic clinicDescriptionN; + late int? projectID; + late String? projectName; + late String? genderDescription; + late dynamic genderDescriptionN; + late String? titleDescription; + late dynamic titleDescriptionN; + late dynamic zipCode; + late String? createdOn; + late dynamic createdBy; + late String? editedOn; + late dynamic editedBy; + late bool? biometricEnabled; + late dynamic preferredLanguage; + late bool? isActive; + late String? vidaAuthTokenID; + late String? vidaRefreshTokenID; + late String? password; + GetIMEIDetailsModel( {this.iD, this.iMEI, diff --git a/lib/core/model/auth/insert_imei_model.dart b/lib/core/model/auth/insert_imei_model.dart index 25e22b7a..5e54b127 100644 --- a/lib/core/model/auth/insert_imei_model.dart +++ b/lib/core/model/auth/insert_imei_model.dart @@ -1,37 +1,37 @@ class InsertIMEIDetailsModel { - String iMEI; - int logInTypeID; - dynamic outSA; - String mobile; - dynamic identificationNo; - int doctorID; - String doctorName; - String doctorNameN; - int clinicID; - String clinicDescription; - Null clinicDescriptionN; - String projectName; - String genderDescription; - Null genderDescriptionN; - String titleDescription; - Null titleDescriptionN; - bool bioMetricEnabled; - Null preferredLanguage; - bool isActive; - int editedBy; - int projectID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - int patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - dynamic password; + late String? iMEI; + late int ?logInTypeID; + late dynamic outSA; + late String? mobile; + late dynamic identificationNo; + late int ?doctorID; + late String? doctorName; + late String ?doctorNameN; + late int ?clinicID; + late String ?clinicDescription; + late dynamic clinicDescriptionN; + late String ?projectName; + late String ?genderDescription; + late dynamic genderDescriptionN; + late String ?titleDescription; + late dynamic titleDescriptionN; + late bool ?bioMetricEnabled; + late dynamic preferredLanguage; + late bool ?isActive; + late int ?editedBy; + late int ?projectID; + late String ?tokenID; + late int ?languageID; + late String ?stamp; + late String ?iPAdress; + late double ?versionID; + late int ?channel; + late String ?sessionID; + late bool ?isLoginForDoctorApp; + late int ?patientOutSA; + late String ?vidaAuthTokenID; + late String ?vidaRefreshTokenID; + late dynamic password; InsertIMEIDetailsModel( {this.iMEI, this.logInTypeID, diff --git a/lib/core/model/auth/new_login_information_response_model.dart b/lib/core/model/auth/new_login_information_response_model.dart index 117060e4..c834580b 100644 --- a/lib/core/model/auth/new_login_information_response_model.dart +++ b/lib/core/model/auth/new_login_information_response_model.dart @@ -1,13 +1,13 @@ class NewLoginInformationModel { - int doctorID; - List listMemberInformation; - String logInTokenID; - String mobileNumber; - Null sELECTDeviceIMEIbyIMEIList; - int userID; - String zipCode; - bool isActiveCode; - bool isSMSSent; + late int? doctorID; + late List? listMemberInformation; + late String ?logInTokenID; + late String ?mobileNumber; + late dynamic sELECTDeviceIMEIbyIMEIList; + late int ?userID; + late String ?zipCode; + late bool ?isActiveCode; + late bool ?isSMSSent; NewLoginInformationModel( {this.doctorID, @@ -23,9 +23,9 @@ class NewLoginInformationModel { NewLoginInformationModel.fromJson(Map json) { doctorID = json['DoctorID']; if (json['List_MemberInformation'] != null) { - listMemberInformation = new List(); + listMemberInformation = []; json['List_MemberInformation'].forEach((v) { - listMemberInformation.add(new ListMemberInformation.fromJson(v)); + listMemberInformation!.add(new ListMemberInformation.fromJson(v)); }); } logInTokenID = json['LogInTokenID']; @@ -42,7 +42,7 @@ class NewLoginInformationModel { data['DoctorID'] = this.doctorID; if (this.listMemberInformation != null) { data['List_MemberInformation'] = - this.listMemberInformation.map((v) => v.toJson()).toList(); + this.listMemberInformation!.map((v) => v.toJson()).toList(); } data['LogInTokenID'] = this.logInTokenID; data['MobileNumber'] = this.mobileNumber; @@ -56,17 +56,17 @@ class NewLoginInformationModel { } class ListMemberInformation { - Null setupID; - int memberID; - String memberName; - Null memberNameN; - String preferredLang; - String pIN; - String saltHash; - int referenceID; - int employeeID; - int roleID; - int projectid; + late dynamic setupID; + late int ? memberID; + late String ? memberName; + late dynamic memberNameN; + late String ? preferredLang; + late String ? pIN; + late String ? saltHash; + late int ? referenceID; + late int ? employeeID; + late int ? roleID; + late int ? projectid; ListMemberInformation( {this.setupID, diff --git a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart index ceaf4c65..db971954 100644 --- a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart @@ -1,8 +1,8 @@ class SendActivationCodeForDoctorAppResponseModel { - String logInTokenID; - String verificationCode; - String vidaAuthTokenID; - String vidaRefreshTokenID; + String? logInTokenID; + String? verificationCode; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; SendActivationCodeForDoctorAppResponseModel( {this.logInTokenID, diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 8a5f1bc1..550f8ca8 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -1,13 +1,13 @@ class GetHospitalsRequestModel { - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - String memberID; + int ?languageID; + String? stamp; + String? iPAdress; + double? versionID; + int ?channel; + String? tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + String ?memberID; GetHospitalsRequestModel( {this.languageID, diff --git a/lib/core/model/hospitals/get_hospitals_response_model.dart b/lib/core/model/hospitals/get_hospitals_response_model.dart index edbc3fe5..1109b58b 100644 --- a/lib/core/model/hospitals/get_hospitals_response_model.dart +++ b/lib/core/model/hospitals/get_hospitals_response_model.dart @@ -1,7 +1,7 @@ class GetHospitalsResponseModel { - String facilityGroupId; - int facilityId; - String facilityName; + String? facilityGroupId; + int ?facilityId; + String ?facilityName; GetHospitalsResponseModel( {this.facilityGroupId, this.facilityId, this.facilityName}); diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index a3717c42..69e88a2e 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -1,11 +1,11 @@ class ApporvalDetails { - int approvalNo; + int? approvalNo; - String procedureName; + String? procedureName; //String procedureNameN; - String status; + String ?status; - String isInvoicedDesc; + String ?isInvoicedDesc; ApporvalDetails( {this.approvalNo, this.procedureName, this.status, this.isInvoicedDesc}); @@ -35,35 +35,35 @@ class ApporvalDetails { } class InsuranceApprovalModel { - List apporvalDetails; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int eXuldAPPNO; - int projectID; - String doctorName; - String clinicName; - String patientDescription; - int approvalNo; - String approvalStatusDescption; - int unUsedCount; - String doctorImage; - String projectName; + List ?apporvalDetails; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool ? isDentalAllowedBackend; + int ? deviceTypeID; + int ? patientID; + String ? tokenID; + int ? patientTypeID; + int ? patientType; + int ? eXuldAPPNO; + int ? projectID; + String ? doctorName; + String ? clinicName; + String ? patientDescription; + int ? approvalNo; + String ?approvalStatusDescption; + int ? unUsedCount; + String ? doctorImage; + String ? projectName; //String companyName; - String expiryDate; - String rceiptOn; - int appointmentNo; + String ? expiryDate; + String ? rceiptOn; + int ?appointmentNo; InsuranceApprovalModel( {this.versionID, @@ -126,9 +126,9 @@ class InsuranceApprovalModel { doctorImage = json['DoctorImageURL']; clinicName = json['ClinicName']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails =[]; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } appointmentNo = json['AppointmentNo']; diff --git a/lib/core/model/insurance/insurance_approval_in_patient_model.dart b/lib/core/model/insurance/insurance_approval_in_patient_model.dart index f185a8bf..722d34c7 100644 --- a/lib/core/model/insurance/insurance_approval_in_patient_model.dart +++ b/lib/core/model/insurance/insurance_approval_in_patient_model.dart @@ -1,36 +1,36 @@ class InsuranceApprovalInPatientModel { - String setupID; - int projectID; - int approvalNo; - int status; - String approvalDate; - int patientType; - int patientID; - int companyID; - bool subCategoryID; - int doctorID; - int clinicID; - int approvalType; - int inpatientApprovalSubType; + String? setupID; + int? projectID; + int? approvalNo; + int? status; + String? approvalDate; + int? patientType; + int? patientID; + int? companyID; + bool? subCategoryID; + int? doctorID; + int? clinicID; + int? approvalType; + int? inpatientApprovalSubType; dynamic isApprovalOnGross; - String companyApprovalNo; + String? companyApprovalNo; dynamic progNoteOrderNo; - String submitOn; - String receiptOn; - String expiryDate; - int admissionNo; - int admissionRequestNo; - String approvalStatusDescption; + String? submitOn; + String? receiptOn; + String? expiryDate; + int? admissionNo; + int? admissionRequestNo; + String? approvalStatusDescption; dynamic approvalStatusDescptionN; dynamic remarks; - List apporvalDetails; - String clinicName; + List? apporvalDetails; + String? clinicName; dynamic companyName; - String doctorName; - String projectName; - int totaUnUsedCount; - int unUsedCount; - String doctorImage; + String? doctorName; + String? projectName; + int? totaUnUsedCount; + int? unUsedCount; + String? doctorImage; InsuranceApprovalInPatientModel( {this.setupID, @@ -93,9 +93,9 @@ class InsuranceApprovalInPatientModel { approvalStatusDescptionN = json['ApprovalStatusDescptionN']; remarks = json['Remarks']; if (json['ApporvalDetails'] != null) { - apporvalDetails = new List(); + apporvalDetails = []; json['ApporvalDetails'].forEach((v) { - apporvalDetails.add(new ApporvalDetails.fromJson(v)); + apporvalDetails!.add(new ApporvalDetails.fromJson(v)); }); } clinicName = json['ClinicName']; @@ -135,7 +135,7 @@ class InsuranceApprovalInPatientModel { data['Remarks'] = this.remarks; if (this.apporvalDetails != null) { data['ApporvalDetails'] = - this.apporvalDetails.map((v) => v.toJson()).toList(); + this.apporvalDetails!.map((v) => v.toJson()).toList(); } data['ClinicName'] = this.clinicName; data['CompanyName'] = this.companyName; @@ -148,35 +148,35 @@ class InsuranceApprovalInPatientModel { } class ApporvalDetails { - Null setupID; - Null projectID; - int approvalNo; - Null lineItemNo; - Null orderType; - Null procedureID; - Null toothNo; - Null price; - Null approvedAmount; - Null unapprovedPatientShare; - Null waivedAmount; - Null discountType; - Null discountValue; - Null shareType; - Null patientShareTypeValue; - Null companyShareTypeValue; - Null patientShare; - Null companyShare; - Null deductableAmount; - String disapprovedRemarks; - Null progNoteOrderNo; - Null progNoteLineItemNo; - Null invoiceTransactionType; - Null invoiceNo; - String procedureName; - String procedureNameN; - String status; - Null isInvoiced; - String isInvoicedDesc; + dynamic setupID; + dynamic projectID; + int? approvalNo; + dynamic lineItemNo; + dynamic orderType; + dynamic procedureID; + dynamic toothNo; + dynamic price; + dynamic approvedAmount; + dynamic unapprovedPatientShare; + dynamic waivedAmount; + dynamic discountType; + dynamic discountValue; + dynamic shareType; + dynamic patientShareTypeValue; + dynamic companyShareTypeValue; + dynamic patientShare; + dynamic companyShare; + dynamic deductableAmount; + String? disapprovedRemarks; + dynamic progNoteOrderNo; + dynamic progNoteLineItemNo; + dynamic invoiceTransactionType; + dynamic invoiceNo; + String? procedureName; + String? procedureNameN; + String? status; + dynamic isInvoiced; + String? isInvoicedDesc; ApporvalDetails( {this.setupID, diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart index ecb4ae65..7fc4432f 100644 --- a/lib/core/model/labs/LabOrderResult.dart +++ b/lib/core/model/labs/LabOrderResult.dart @@ -1,23 +1,23 @@ class LabOrderResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int ?gender; + int? lineItemNo; dynamic maleInterpretativeData; dynamic notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String ?packageID; + int ?patientID; + String ? projectID; + String ? referanceRange; + String ? resultValue; + String ? sampleCollectedOn; + String ? sampleReceivedOn; + String ? setupID; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; - String verifiedOnDateTime; + String? testCode; + String? uOM; + String? verifiedOn; + String? verifiedOnDateTime; LabOrderResult( {this.description, diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 1c09696b..9a8cfe82 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,44 +1,44 @@ class LabResult { - String description; + String? description; dynamic femaleInterpretativeData; - int gender; - int lineItemNo; + int? gender; + int? lineItemNo; dynamic maleInterpretativeData; - String notes; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; + String? notes; + String? packageID; + int? patientID; + String? projectID; + String? referanceRange; + String? resultValue; + String? sampleCollectedOn; + String? sampleReceivedOn; + String? setupID; dynamic superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; + String? testCode; + String? uOM; + String? verifiedOn; dynamic verifiedOnDateTime; LabResult( {this.description, - this.femaleInterpretativeData, - this.gender, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResult.fromJson(Map json) { description = json['Description']; @@ -87,12 +87,11 @@ class LabResult { } } - class LabResultList { String filterName = ""; - List patientLabResultList = List(); + List patientLabResultList = []; - LabResultList({this.filterName, LabResult lab}) { + LabResultList({required this.filterName, required LabResult lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index af60f86f..08f81f16 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientLabOrders { - int actualDoctorRate; - String clinicDescription; - String clinicDescriptionEnglish; - Null clinicDescriptionN; - int clinicID; - int doctorID; - String doctorImageURL; - String doctorName; - String doctorNameEnglish; - Null doctorNameN; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - String invoiceNo; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isRead; - String nationalityFlagURL; - int noOfPatientsRate; - DateTime orderDate; - String orderNo; - String patientID; - String projectID; - String projectName; - Null projectNameN; - String qR; - String setupID; - List speciality; - bool isLiveCareAppointment; + int ?actualDoctorRate; + String ?clinicDescription; + String ?clinicDescriptionEnglish; + dynamic clinicDescriptionN; + int ?clinicID; + int ?doctorID; + String? doctorImageURL; + String ?doctorName; + String ?doctorNameEnglish; + dynamic doctorNameN; + int ?doctorRate; + String ?doctorTitle; + int ?gender; + String ?genderDescription; + String ?invoiceNo; + bool ?isActiveDoctorProfile; + bool ?isDoctorAllowVedioCall; + bool ?isExecludeDoctor; + bool ?isInOutPatient; + String ?isInOutPatientDescription; + String ?isInOutPatientDescriptionN; + bool ?isRead; + String ?nationalityFlagURL; + int ?noOfPatientsRate; + DateTime? orderDate; + String ?orderNo; + String ?patientID; + String ?projectID; + String ?projectName; + dynamic projectNameN; + String ?qR; + String ?setupID; + List ?speciality; + bool ?isLiveCareAppointment; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -149,10 +149,10 @@ class PatientLabOrders { class PatientLabOrdersList { String filterName = ""; - List patientLabOrdersList = List(); + List patientLabOrdersList = []; PatientLabOrdersList( - {this.filterName, PatientLabOrders patientDoctorAppointment}) { + {required this.filterName, required PatientLabOrders patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart index 2fbcb832..f86dd56f 100644 --- a/lib/core/model/labs/patient_lab_special_result.dart +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -1,9 +1,9 @@ class PatientLabSpecialResult { - String invoiceNo; - String moduleID; - String resultData; - String resultDataHTML; - Null resultDataTxt; + String ?invoiceNo; + String ?moduleID; + String ? resultData; + String ? resultDataHTML; + dynamic resultDataTxt; PatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart index ce9263ef..4f746277 100644 --- a/lib/core/model/labs/request_patient_lab_orders.dart +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -1,17 +1,17 @@ class RequestPatientLabOrders { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + double? versionID; + int ?channel; + int ?languageID; + String? iPAdress; + String ?generalid; + int? patientOutSA; + String? sessionID; + bool ?isDentalAllowedBackend; + int ?deviceTypeID; + int ?patientID; + String ?tokenID; + int ?patientTypeID; + int ?patientType; RequestPatientLabOrders( {this.versionID, diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index b48cf0e1..100f92b5 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,22 +1,22 @@ class RequestPatientLabSpecialResult { - String invoiceNo; - String orderNo; - String setupID; - String projectID; - int clinicID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + String? invoiceNo; + String? orderNo; + String? setupID; + String? projectID; + int ?clinicID; + double? versionID; + int ?channel; + int ?languageID; + String? iPAdress; + String ?generalid; + int ?patientOutSA; + String ?sessionID; + bool ?isDentalAllowedBackend; + int ?deviceTypeID; + int ?patientID; + String? tokenID; + int ?patientTypeID; + int ?patientType; RequestPatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 118da906..66f5e2a0 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -1,56 +1,56 @@ class RequestSendLabReportEmail { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - String to; - String dateofBirth; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - String setupID; - String projectName; - String clinicName; - String doctorName; - String projectID; - String invoiceNo; - String orderDate; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + String? to; + String? dateofBirth; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + String? setupID; + String? projectName; + String? clinicName; + String? doctorName; + String? projectID; + String? invoiceNo; + String? orderDate; RequestSendLabReportEmail( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.to, - this.dateofBirth, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.setupID, - this.projectName, - this.clinicName, - this.doctorName, - this.projectID, - this.invoiceNo, - this.orderDate}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart index dc1f25b3..a99c9649 100644 --- a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart +++ b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart @@ -1,7 +1,7 @@ class PendingPatientERForDoctorAppRequestModel { - bool outSA; - int doctorID; - String sErServiceID; + bool ? outSA; + int ? doctorID; + String ? sErServiceID; PendingPatientERForDoctorAppRequestModel( {this.outSA, this.doctorID, this.sErServiceID}); diff --git a/lib/core/model/medical_report/medical_file_model.dart b/lib/core/model/medical_report/medical_file_model.dart index deebb2af..53737499 100644 --- a/lib/core/model/medical_report/medical_file_model.dart +++ b/lib/core/model/medical_report/medical_file_model.dart @@ -1,14 +1,14 @@ class MedicalFileModel { - List entityList; + List? entityList; dynamic statusMessage; MedicalFileModel({this.entityList, this.statusMessage}); MedicalFileModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } statusMessage = json['statusMessage']; @@ -17,7 +17,7 @@ class MedicalFileModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['statusMessage'] = this.statusMessage; return data; @@ -25,15 +25,15 @@ class MedicalFileModel { } class EntityList { - List timelines; + List? timelines; EntityList({this.timelines}); EntityList.fromJson(Map json) { if (json['Timelines'] != null) { - timelines = new List(); + timelines = []; json['Timelines'].forEach((v) { - timelines.add(new Timelines.fromJson(v)); + timelines!.add(new Timelines.fromJson(v)); }); } } @@ -41,25 +41,25 @@ class EntityList { Map toJson() { final Map data = new Map(); if (this.timelines != null) { - data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); + data['Timelines'] = this.timelines!.map((v) => v.toJson()).toList(); } return data; } } class Timelines { - int clinicId; - String clinicName; - String date; - int doctorId; - String doctorImage; - String doctorName; - int encounterNumber; - String encounterType; - int projectID; - String projectName; - String setupID; - List timeLineEvents; + int? clinicId; + String? clinicName; + String? date; + int? doctorId; + String? doctorImage; + String? doctorName; + int? encounterNumber; + String? encounterType; + int? projectID; + String? projectName; + String? setupID; + List? timeLineEvents; Timelines( {this.clinicId, @@ -88,9 +88,9 @@ class Timelines { projectName = json['ProjectName']; setupID = json['SetupID']; if (json['TimeLineEvents'] != null) { - timeLineEvents = new List(); + timeLineEvents = []; json['TimeLineEvents'].forEach((v) { - timeLineEvents.add(new TimeLineEvents.fromJson(v)); + timeLineEvents!.add(new TimeLineEvents.fromJson(v)); }); } } @@ -110,25 +110,25 @@ class Timelines { data['SetupID'] = this.setupID; if (this.timeLineEvents != null) { data['TimeLineEvents'] = - this.timeLineEvents.map((v) => v.toJson()).toList(); + this.timeLineEvents!.map((v) => v.toJson()).toList(); } return data; } } class TimeLineEvents { - List admissions; - String colorClass; - List consulations; + List? admissions; + String? colorClass; + List? consulations; TimeLineEvents({this.admissions, this.colorClass, this.consulations}); TimeLineEvents.fromJson(Map json) { colorClass = json['ColorClass']; if (json['Consulations'] != null) { - consulations = new List(); + consulations = []; json['Consulations'].forEach((v) { - consulations.add(new Consulations.fromJson(v)); + consulations!.add(new Consulations.fromJson(v)); }); } } @@ -138,38 +138,38 @@ class TimeLineEvents { data['ColorClass'] = this.colorClass; if (this.consulations != null) { - data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); + data['Consulations'] = this.consulations!.map((v) => v.toJson()).toList(); } return data; } } class Consulations { - int admissionNo; - String appointmentDate; - int appointmentNo; - String appointmentType; - String clinicID; - String clinicName; - int doctorID; - String doctorName; - String endTime; - String episodeDate; - int episodeID; - int patientID; - int projectID; - String projectName; - String remarks; - String setupID; - String startTime; - String visitFor; - String visitType; - String dispalyName; - List lstAssessments; - List lstPhysicalExam; - List lstProcedure; - List lstMedicalHistory; - List lstCheifComplaint; + int? admissionNo; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? clinicID; + String? clinicName; + int? doctorID; + String? doctorName; + String? endTime; + String? episodeDate; + int? episodeID; + int? patientID; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? startTime; + String? visitFor; + String? visitType; + String? dispalyName; + List? lstAssessments; + List? lstPhysicalExam; + List? lstProcedure; + List? lstMedicalHistory; + List? lstCheifComplaint; Consulations( {this.admissionNo, @@ -220,33 +220,33 @@ class Consulations { visitType = json['VisitType']; dispalyName = json['dispalyName']; if (json['lstAssessments'] != null) { - lstAssessments = new List(); + lstAssessments = []; json['lstAssessments'].forEach((v) { - lstAssessments.add(new LstAssessments.fromJson(v)); + lstAssessments!.add(new LstAssessments.fromJson(v)); }); } if (json['lstCheifComplaint'] != null) { - lstCheifComplaint = new List(); + lstCheifComplaint = []; json['lstCheifComplaint'].forEach((v) { - lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); + lstCheifComplaint!.add(new LstCheifComplaint.fromJson(v)); }); } if (json['lstPhysicalExam'] != null) { - lstPhysicalExam = new List(); + lstPhysicalExam = []; json['lstPhysicalExam'].forEach((v) { - lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); + lstPhysicalExam!.add(new LstPhysicalExam.fromJson(v)); }); } if (json['lstProcedure'] != null) { - lstProcedure = new List(); + lstProcedure = []; json['lstProcedure'].forEach((v) { - lstProcedure.add(new LstProcedure.fromJson(v)); + lstProcedure!.add(new LstProcedure.fromJson(v)); }); } if (json['lstMedicalHistory'] != null) { - lstMedicalHistory = new List(); + lstMedicalHistory = []; json['lstMedicalHistory'].forEach((v) { - lstMedicalHistory.add(new LstMedicalHistory.fromJson(v)); + lstMedicalHistory!.add(new LstMedicalHistory.fromJson(v)); }); } } @@ -275,40 +275,40 @@ class Consulations { data['dispalyName'] = this.dispalyName; if (this.lstAssessments != null) { data['lstAssessments'] = - this.lstAssessments.map((v) => v.toJson()).toList(); + this.lstAssessments!.map((v) => v.toJson()).toList(); } if (this.lstCheifComplaint != null) { data['lstCheifComplaint'] = - this.lstCheifComplaint.map((v) => v.toJson()).toList(); + this.lstCheifComplaint!.map((v) => v.toJson()).toList(); } if (this.lstPhysicalExam != null) { data['lstPhysicalExam'] = - this.lstPhysicalExam.map((v) => v.toJson()).toList(); + this.lstPhysicalExam!.map((v) => v.toJson()).toList(); } if (this.lstProcedure != null) { - data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); + data['lstProcedure'] = this.lstProcedure!.map((v) => v.toJson()).toList(); } if (this.lstMedicalHistory != null) { data['lstMedicalHistory'] = - this.lstMedicalHistory.map((v) => v.toJson()).toList(); + this.lstMedicalHistory!.map((v) => v.toJson()).toList(); } return data; } } class LstCheifComplaint { - int appointmentNo; - String cCDate; - String chiefComplaint; - String currentMedication; - int episodeID; - String hOPI; - int patientID; - String patientType; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + String? cCDate; + String? chiefComplaint; + String? currentMedication; + int? episodeID; + String? hOPI; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstCheifComplaint( {this.appointmentNo, @@ -358,19 +358,19 @@ class LstCheifComplaint { } class LstAssessments { - int appointmentNo; - String condition; - String description; - int episodeID; - String iCD10; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String type; - String dispalyName; + int? appointmentNo; + String? condition; + String? description; + int? episodeID; + String? iCD10; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? type; + String? dispalyName; LstAssessments( {this.appointmentNo, @@ -423,19 +423,19 @@ class LstAssessments { } class LstPhysicalExam { - String abnormal; - int appointmentNo; - int episodeID; - String examDesc; - String examID; - String examType; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + String? abnormal; + int? appointmentNo; + int? episodeID; + String? examDesc; + String? examID; + String? examType; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstPhysicalExam( {this.abnormal, @@ -488,17 +488,17 @@ class LstPhysicalExam { } class LstProcedure { - int appointmentNo; - int episodeID; - String orderDate; - int patientID; - String patientType; - String procName; - String procedureId; - int projectID; - String projectName; - String setupID; - String dispalyName; + int? appointmentNo; + int? episodeID; + String? orderDate; + int? patientID; + String? patientType; + String? procName; + String? procedureId; + int? projectID; + String? projectName; + String? setupID; + String? dispalyName; LstProcedure( {this.appointmentNo, @@ -545,17 +545,17 @@ class LstProcedure { } class LstMedicalHistory { - int appointmentNo; - String checked; - int episodeID; - String history; - int patientID; - String patientType; - int projectID; - String projectName; - String remarks; - String setupID; - String dispalyName; + int? appointmentNo; + String? checked; + int? episodeID; + String? history; + int? patientID; + String? patientType; + int? projectID; + String? projectName; + String? remarks; + String? setupID; + String? dispalyName; LstMedicalHistory( {this.appointmentNo, diff --git a/lib/core/model/medical_report/medical_file_request_model.dart b/lib/core/model/medical_report/medical_file_request_model.dart index 8703141a..01a2abf2 100644 --- a/lib/core/model/medical_report/medical_file_request_model.dart +++ b/lib/core/model/medical_report/medical_file_request_model.dart @@ -1,7 +1,7 @@ class MedicalFileRequestModel { - int patientMRN; - String vidaAuthTokenID; - String iPAdress; + int ?patientMRN; + String ?vidaAuthTokenID; + String ?iPAdress; MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID,this.iPAdress}); diff --git a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart index c97f8426..bc952162 100644 --- a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart +++ b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart @@ -222,6 +222,7 @@ class AdmissionRequestService extends LookupService { POST_ADMISSION_REQUEST, onSuccess: (dynamic response, int statusCode) { print(response["admissionResponse"]["success"]); + AdmissionRequest admissionRequest = AdmissionRequest.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index c2f5b0dd..7c7f6e37 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -84,7 +84,7 @@ class DoctorProfileModel { this.qR, this.serviceID}); - DoctorProfileModel.fromJson(Map json) { + DoctorProfileModel.fromJson(Map json) { doctorID = json['DoctorID']; doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; diff --git a/pubspec.yaml b/pubspec.yaml index ac0e78c3..ce9d34be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter project. version: 1.2.2+2 environment: - sdk: ">=2.8.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" #dependency_overrides: From 931e21ed5ea75036d9bad362be82121ca2891392 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Jun 2021 10:08:10 +0300 Subject: [PATCH 029/199] Migrate models to flutter 2 --- .../model/Prescriptions/Prescriptions.dart | 85 ++++++------- .../in_patient_prescription_model.dart | 2 +- .../Prescriptions/perscription_pharmacy.dart | 46 +++---- .../post_prescrition_req_model.dart | 42 +++---- .../prescription_in_patient.dart | 68 +++++------ .../Prescriptions/prescription_model.dart | 8 +- .../Prescriptions/prescription_report.dart | 84 ++++++------- .../prescription_report_enh.dart | 66 +++++------ .../Prescriptions/prescription_req_model.dart | 2 +- .../Prescriptions/prescriptions_order.dart | 92 +++++++------- ...t_get_list_pharmacy_for_prescriptions.dart | 30 ++--- .../request_prescription_report.dart | 44 +++---- .../request_prescription_report_enh.dart | 44 +++---- .../model/calculate_box_request_model.dart | 10 +- lib/core/model/hospitals_model.dart | 32 ++--- lib/core/model/note/CreateNoteModel.dart | 38 +++--- lib/core/model/note/note_model.dart | 40 +++---- lib/core/model/note/update_note_model.dart | 66 +++++------ .../patient_muse/PatientMuseResultsModel.dart | 24 ++-- .../PatientSearchRequestModel.dart | 24 ++-- lib/core/model/procedure/ControlsModel.dart | 4 +- .../Procedure_template_request_model.dart | 60 +++++----- .../model/procedure/categories_procedure.dart | 50 ++++---- .../get_ordered_procedure_model.dart | 72 +++++------ .../get_ordered_procedure_request_model.dart | 4 +- .../model/procedure/get_procedure_model.dart | 44 +++---- .../procedure/get_procedure_req_model.dart | 12 +- .../procedure/post_procedure_req_model.dart | 28 ++--- .../procedure_category_list_model.dart | 14 +-- .../procedure/procedure_templateModel.dart | 18 +-- .../procedure_template_details_model.dart | 58 ++++----- ...cedure_template_details_request_model.dart | 62 +++++----- .../procedure/procedure_valadate_model.dart | 14 +-- .../procedure_valadate_request_model.dart | 10 +- .../update_procedure_request_model.dart | 28 ++--- lib/core/model/radiology/final_radiology.dart | 24 ++-- .../request_patient_rad_orders_details.dart | 46 +++---- .../request_send_rad_report_email.dart | 58 ++++----- .../referral/DischargeReferralPatient.dart | 90 +++++++------- .../referral/MyReferralPatientModel.dart | 112 +++++++++--------- lib/core/model/referral/ReferralRequest.dart | 54 ++++----- .../get_medication_response_model.dart | 18 +-- .../search_drug/item_by_medicine_model.dart | 42 +++---- .../item_by_medicine_request_model.dart | 4 +- .../model/search_drug/search_drug_model.dart | 10 +- .../search_drug_request_model.dart | 2 +- .../sick_leave/sick_leave_patient_model.dart | 76 ++++++------ .../sick_leave_patient_request_model.dart | 30 ++--- lib/core/service/base/base_service.dart | 28 ++--- lib/core/service/home/dasboard_service.dart | 2 +- 50 files changed, 959 insertions(+), 962 deletions(-) diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index c47a813a..881f318a 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class Prescriptions { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - DateTime dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - bool isLiveCareAppointment; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + DateTime? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + bool? isLiveCareAppointment; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; Prescriptions( {this.setupID, @@ -69,9 +69,10 @@ class Prescriptions { this.nationalityFlagURL, this.noOfPatientsRate, this.qR, - this.speciality,this.isLiveCareAppointment}); + this.speciality, + this.isLiveCareAppointment}); - Prescriptions.fromJson(Map json) { + Prescriptions.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -105,11 +106,11 @@ class Prescriptions { noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; @@ -149,10 +150,10 @@ class Prescriptions { } class PrescriptionsList { - String filterName = ""; - List prescriptionsList = List(); + String? filterName = ""; + List prescriptionsList =[]; - PrescriptionsList({this.filterName, Prescriptions prescriptions}) { + PrescriptionsList({this.filterName, required Prescriptions prescriptions}) { prescriptionsList.add(prescriptions); } } diff --git a/lib/core/model/Prescriptions/in_patient_prescription_model.dart b/lib/core/model/Prescriptions/in_patient_prescription_model.dart index f6e88bf7..3f67e659 100644 --- a/lib/core/model/Prescriptions/in_patient_prescription_model.dart +++ b/lib/core/model/Prescriptions/in_patient_prescription_model.dart @@ -1,5 +1,5 @@ class InPatientPrescriptionRequestModel { - String vidaAuthTokenID; + String? vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart index 3adaef7e..c6b013d3 100644 --- a/lib/core/model/Prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -1,28 +1,28 @@ class PharmacyPrescriptions { - String expiryDate; + String? expiryDate; dynamic sellingPrice; - int quantity; - int itemID; - int locationID; - int projectID; - String setupID; - String locationDescription; - Null locationDescriptionN; - String itemDescription; - Null itemDescriptionN; - String alias; - int locationTypeID; - int barcode; - Null companybarcode; - int cityID; - String cityName; - int distanceInKilometers; - String latitude; - int locationType; - String longitude; - String phoneNumber; - String projectImageURL; - Null sortOrder; + int?quantity; + int?itemID; + int?locationID; + int?projectID; + String ?setupID; + String ?locationDescription; + dynamic locationDescriptionN; + String ? itemDescription; + dynamic itemDescriptionN; + String ? alias; + int ? locationTypeID; + int ? barcode; + dynamic companybarcode; + int ? cityID; + String? cityName; + int ? distanceInKilometers; + String? latitude; + int ?locationType; + String? longitude; + String ?phoneNumber; + String ? projectImageURL; + dynamic sortOrder; PharmacyPrescriptions( {this.expiryDate, diff --git a/lib/core/model/Prescriptions/post_prescrition_req_model.dart b/lib/core/model/Prescriptions/post_prescrition_req_model.dart index 06a524ed..9609a0df 100644 --- a/lib/core/model/Prescriptions/post_prescrition_req_model.dart +++ b/lib/core/model/Prescriptions/post_prescrition_req_model.dart @@ -1,10 +1,10 @@ class PostPrescriptionReqModel { - String vidaAuthTokenID; - int clinicID; - int episodeID; - int appointmentNo; - int patientMRN; - List prescriptionRequestModel; + String ?vidaAuthTokenID; + int? clinicID; + int? episodeID; + int? appointmentNo; + int? patientMRN; + List ?prescriptionRequestModel; PostPrescriptionReqModel( {this.vidaAuthTokenID, @@ -21,9 +21,9 @@ class PostPrescriptionReqModel { appointmentNo = json['AppointmentNo']; patientMRN = json['PatientMRN']; if (json['prescriptionRequestModel'] != null) { - prescriptionRequestModel = new List(); + prescriptionRequestModel =[]; json['prescriptionRequestModel'].forEach((v) { - prescriptionRequestModel.add(new PrescriptionRequestModel.fromJson(v)); + prescriptionRequestModel!.add(new PrescriptionRequestModel.fromJson(v)); }); } } @@ -37,25 +37,25 @@ class PostPrescriptionReqModel { data['PatientMRN'] = this.patientMRN; if (this.prescriptionRequestModel != null) { data['prescriptionRequestModel'] = - this.prescriptionRequestModel.map((v) => v.toJson()).toList(); + this.prescriptionRequestModel!.map((v) => v.toJson()).toList(); } return data; } } class PrescriptionRequestModel { - int itemId; - String doseStartDate; - int duration; - double dose; - int doseUnitId; - int route; - int frequency; - int doseTime; - bool covered; - bool approvalRequired; - String remarks; - String icdcode10Id; + int ? itemId; + String? doseStartDate; + int ?duration; + double? dose; + int ?doseUnitId; + int ?route; + int ?frequency; + int ?doseTime; + bool ?covered; + bool ?approvalRequired; + String ?remarks; + String ?icdcode10Id; PrescriptionRequestModel({ this.itemId, diff --git a/lib/core/model/Prescriptions/prescription_in_patient.dart b/lib/core/model/Prescriptions/prescription_in_patient.dart index c66bc8a4..f32556bc 100644 --- a/lib/core/model/Prescriptions/prescription_in_patient.dart +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -1,50 +1,50 @@ class PrescriotionInPatient { - int admissionNo; - int authorizedBy; + int ?admissionNo; + int ?authorizedBy; dynamic bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int ?createdBy; + String ?createdByName; dynamic createdByNameN; - String createdOn; - String direction; - int directionID; + String ?createdOn; + String ?direction; + int ?directionID; dynamic directionN; - String dose; - int editedBy; + String ?dose; + int ?editedBy; dynamic iVDiluentLine; - int iVDiluentType; + int ?iVDiluentType; dynamic iVDiluentVolume; dynamic iVRate; dynamic iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - String prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String ?pharmacyRemarks; + String ?prescriptionDatetime; + int ?prescriptionNo; + String? processedBy; + int ?projectID; + int ?refillID; + String ?refillType; dynamic refillTypeN; - int reviewedPharmacist; + int ?reviewedPharmacist; dynamic roomId; - String route; - int routeId; + String ?route; + int ?routeId; dynamic routeN; dynamic setupID; - String startDatetime; - int status; - String statusDescription; + String ?startDatetime; + int ?status; + String ?statusDescription; dynamic statusDescriptionN; - String stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + String ?stopDatetime; + int ?unitofMeasurement; + String? unitofMeasurementDescription; dynamic unitofMeasurementDescriptionN; PrescriotionInPatient( diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 92574c66..89959394 100644 --- a/lib/core/model/Prescriptions/prescription_model.dart +++ b/lib/core/model/Prescriptions/prescription_model.dart @@ -1,5 +1,5 @@ class PrescriptionModel { - List entityList; + List? entityList; dynamic rowcount; dynamic statusMessage; @@ -7,9 +7,9 @@ class PrescriptionModel { PrescriptionModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class PrescriptionModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index d2427004..e3a6eec8 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -1,48 +1,48 @@ class PrescriptionReport { - String address; - int appointmentNo; - String clinic; - String companyName; - int days; - String doctorName; + String ? address; + int ? appointmentNo; + String? clinic; + String ?companyName; + int ?days; + String ?doctorName; var doseDailyQuantity; - String frequency; - int frequencyNumber; - String image; - String imageExtension; - String imageSRCUrl; - String imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; - String prescriptionQR; - int prescriptionTimes; - String productImage; - String productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? frequency; + int ?frequencyNumber; + String? image; + String? imageExtension; + String? imageSRCUrl; + String? imageString; + String? imageThumbUrl; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int ?patientID; + String ?patientName; + String ?phoneOffice1; + String ?prescriptionQR; + int ?prescriptionTimes; + String? productImage; + String? productImageBase64; + String? productImageString; + int? projectID; + String?projectName; + String?remarks; + String?route; + String?sKU; + int ?scaleOffset; + String? startDate; - String patientAge; - String patientGender; - String phoneOffice; - int doseTimingID; - int frequencyID; - int routeID; - String name; - String itemDescriptionN; - String routeN; - String frequencyN; + String ? patientAge; + String ? patientGender; + String ? phoneOffice; + int ?doseTimingID; + int ?frequencyID; + int ?routeID; + String ? name; + String ? itemDescriptionN; + String ? routeN; + String ? frequencyN; PrescriptionReport({ this.address, diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index 203eaaff..a51cdc7b 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,37 +1,37 @@ class PrescriptionReportEnh { - String address; - int appointmentNo; - String clinic; - Null companyName; - int days; - String doctorName; - int doseDailyQuantity; - String frequency; - int frequencyNumber; - Null image; - Null imageExtension; - String imageSRCUrl; - Null imageString; - String imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; - Null prescriptionQR; - int prescriptionTimes; - Null productImage; - Null productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String ? address; + int ? appointmentNo; + String ? clinic; + dynamic companyName; + int ? days; + String ? doctorName; + int ? doseDailyQuantity; + String ? frequency; + int ? frequencyNumber; + dynamic image; + dynamic imageExtension; + String ? imageSRCUrl; + dynamic imageString ; + String ? imageThumbUrl; + String ? isCovered; + String ? itemDescription; + int ? itemID; + String ? orderDate; + int ? patientID; + String ? patientName; + String ? phoneOffice1; + dynamic prescriptionQR; + int ? prescriptionTimes; + dynamic productImage; + dynamic productImageBase64; + String ? productImageString; + int ? projectID; + String ? projectName; + String ? remarks; + String ? route; + String ? sKU; + int ? scaleOffset; + String ? startDate; PrescriptionReportEnh( {this.address, diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index a45878d8..1177431d 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,5 +1,5 @@ class PrescriptionReqModel { - String vidaAuthTokenID; + String ?vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index f51420ec..afe38aa1 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -1,32 +1,32 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionsOrder { - int iD; + int? iD; dynamic patientID; - bool patientOutSA; - bool isOutPatient; - int projectID; - int nearestProjectID; - double longitude; - double latitude; + bool? patientOutSA; + bool? isOutPatient; + int? projectID; + int? nearestProjectID; + double? longitude; + double? latitude; dynamic appointmentNo; dynamic dischargeID; - int lineItemNo; - int status; + int? lineItemNo; + int? status; dynamic description; dynamic descriptionN; - DateTime createdOn; - int serviceID; - int createdBy; - DateTime editedOn; - int editedBy; - int channel; + DateTime? createdOn; + int? serviceID; + int? createdBy; + DateTime? editedOn; + int? editedBy; + int? channel; dynamic clientRequestID; - bool returnedToQueue; + bool? returnedToQueue; dynamic pickupDateTime; dynamic pickupLocationName; dynamic dropoffLocationName; - int realRRTHaveTransactions; + int? realRRTHaveTransactions; dynamic nearestProjectDescription; dynamic nearestProjectDescriptionN; dynamic projectDescription; @@ -34,35 +34,35 @@ class PrescriptionsOrder { PrescriptionsOrder( {this.iD, - this.patientID, - this.patientOutSA, - this.isOutPatient, - this.projectID, - this.nearestProjectID, - this.longitude, - this.latitude, - this.appointmentNo, - this.dischargeID, - this.lineItemNo, - this.status, - this.description, - this.descriptionN, - this.createdOn, - this.serviceID, - this.createdBy, - this.editedOn, - this.editedBy, - this.channel, - this.clientRequestID, - this.returnedToQueue, - this.pickupDateTime, - this.pickupLocationName, - this.dropoffLocationName, - this.realRRTHaveTransactions, - this.nearestProjectDescription, - this.nearestProjectDescriptionN, - this.projectDescription, - this.projectDescriptionN}); + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); PrescriptionsOrder.fromJson(Map json) { iD = json['ID']; diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index 739bb838..af8a3da8 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,16 +1,16 @@ class RequestGetListPharmacyForPrescriptions { - int latitude; - int longitude; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int itemID; + int ? latitude; + int ? longitude; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool ?isDentalAllowedBackend; + int ? deviceTypeID; + int ? itemID; RequestGetListPharmacyForPrescriptions( {this.latitude, @@ -26,7 +26,7 @@ class RequestGetListPharmacyForPrescriptions { this.deviceTypeID, this.itemID}); - RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { latitude = json['Latitude']; longitude = json['Longitude']; versionID = json['VersionID']; @@ -41,8 +41,8 @@ class RequestGetListPharmacyForPrescriptions { itemID = json['ItemID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Latitude'] = this.latitude; data['Longitude'] = this.longitude; data['VersionID'] = this.versionID; diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index c8323740..8eeefb7a 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReport { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int episodeID; - int clinicID; - int projectID; - int dischargeNo; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool ?isDentalAllowedBackend; + int ? deviceTypeID; + int ? patientID; + String ? tokenID; + int ? patientTypeID; + int ? patientType; + int ? appointmentNo; + String ? setupID; + int ? episodeID; + int ? clinicID; + int ? projectID; + int ? dischargeNo; RequestPrescriptionReport( {this.versionID, @@ -40,7 +40,7 @@ class RequestPrescriptionReport { this.projectID, this.dischargeNo}); - RequestPrescriptionReport.fromJson(Map json) { + RequestPrescriptionReport.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -62,8 +62,8 @@ class RequestPrescriptionReport { dischargeNo = json['DischargeNo']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index 4905fc2a..9ed39b47 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,23 +1,23 @@ class RequestPrescriptionReportEnh { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int appointmentNo; - String setupID; - int dischargeNo; - int episodeID; - int clinicID; - int projectID; + double ?versionID; + int ? channel; + int ? languageID; + String ? iPAdress; + String ? generalid; + int ? patientOutSA; + String ? sessionID; + bool? isDentalAllowedBackend; + int ? deviceTypeID; + int ? patientID; + String ? tokenID; + int ? patientTypeID; + int ? patientType; + int ? appointmentNo; + String ? setupID; + int ? dischargeNo; + int ? episodeID; + int ? clinicID; + int ? projectID; RequestPrescriptionReportEnh( {this.versionID, @@ -39,7 +39,7 @@ class RequestPrescriptionReportEnh { this.clinicID, this.projectID,this.dischargeNo}); - RequestPrescriptionReportEnh.fromJson(Map json) { + RequestPrescriptionReportEnh.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -60,8 +60,8 @@ class RequestPrescriptionReportEnh { projectID = json['ProjectID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/calculate_box_request_model.dart b/lib/core/model/calculate_box_request_model.dart index 80281854..24e75bb7 100644 --- a/lib/core/model/calculate_box_request_model.dart +++ b/lib/core/model/calculate_box_request_model.dart @@ -1,9 +1,9 @@ class CalculateBoxQuantityRequestModel { - int itemCode; - double strength; - int frequency; - int duration; - String vidaAuthTokenID; + int? itemCode; + double? strength; + int? frequency; + int? duration; + String? vidaAuthTokenID; CalculateBoxQuantityRequestModel( {this.itemCode, diff --git a/lib/core/model/hospitals_model.dart b/lib/core/model/hospitals_model.dart index b09807d6..f2c89cfb 100644 --- a/lib/core/model/hospitals_model.dart +++ b/lib/core/model/hospitals_model.dart @@ -1,20 +1,20 @@ class HospitalsModel { - String desciption; + String? desciption; dynamic desciptionN; - int iD; - String legalName; - String legalNameN; - String name; + int? iD; + String? legalName; + String? legalNameN; + String? name; dynamic nameN; - String phoneNumber; - String setupID; - int distanceInKilometers; - bool isActive; - String latitude; - String longitude; - int mainProjectID; + String? phoneNumber; + String? setupID; + int? distanceInKilometers; + bool ?isActive; + String? latitude; + String? longitude; + int? mainProjectID; dynamic projectOutSA; - bool usingInDoctorApp; + bool ?usingInDoctorApp; HospitalsModel({this.desciption, this.desciptionN, @@ -33,7 +33,7 @@ class HospitalsModel { this.projectOutSA, this.usingInDoctorApp}); - HospitalsModel.fromJson(Map json) { + HospitalsModel.fromJson(Map json) { desciption = json['Desciption']; desciptionN = json['DesciptionN']; iD = json['ID']; @@ -52,8 +52,8 @@ class HospitalsModel { usingInDoctorApp = json['UsingInDoctorApp']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Desciption'] = this.desciption; data['DesciptionN'] = this.desciptionN; data['ID'] = this.iD; diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index ce076705..5d1709ca 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -1,23 +1,23 @@ class CreateNoteModel { - int visitType; - int admissionNo; - int projectID; - int patientTypeID; - int patientID; - int clinicID; - String notes; - int createdBy; - int editedBy; - String nursingRemarks; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? visitType; + int? admissionNo; + int? projectID; + int? patientTypeID; + int? patientID; + int? clinicID; + String? notes; + int ?createdBy; + int ?editedBy; + String ?nursingRemarks; + int ?languageID; + String? stamp; + String ?iPAdress; + double ?versionID; + int ?channel; + String ?tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + bool ?patientOutSA; CreateNoteModel( {this.visitType, diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 797f9b6d..713de924 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -1,24 +1,24 @@ class NoteModel { - String setupID; - int projectID; - int patientID; - int patientType; - String admissionNo; - int lineItemNo; - int visitType; - String notes; - String assessmentDate; - String visitTime; - int status; - String nursingRemarks; - String createdOn; - String editedOn; - int createdBy; - int admissionClinicID; - String admissionClinicName; - Null doctorClinicName; - String doctorName; - String visitTypeDesc; + String? setupID; + int ?projectID; + int ?patientID; + int ?patientType; + String ?admissionNo; + int ?lineItemNo; + int ?visitType; + String ?notes; + String ?assessmentDate; + String ?visitTime; + int ?status; + String ?nursingRemarks; + String ?createdOn; + String ?editedOn; + int ?createdBy; + int ?admissionClinicID; + String ?admissionClinicName; + dynamic doctorClinicName; + String ?doctorName; + String ?visitTypeDesc; NoteModel( {this.setupID, diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index 20fd4b86..a3189e39 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -1,40 +1,40 @@ class UpdateNoteReqModel { - int projectID; - int createdBy; - int admissionNo; - int lineItemNo; - String notes; - bool verifiedNote; - bool cancelledNote; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? createdBy; + int? admissionNo; + int? lineItemNo; + String? notes; + bool? verifiedNote; + bool? cancelledNote; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; UpdateNoteReqModel( {this.projectID, - this.createdBy, - this.admissionNo, - this.lineItemNo, - this.notes, - this.verifiedNote, - this.cancelledNote, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.createdBy, + this.admissionNo, + this.lineItemNo, + this.notes, + this.verifiedNote, + this.cancelledNote, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); UpdateNoteReqModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 401fd1a7..970d48cb 100644 --- a/lib/core/model/patient_muse/PatientMuseResultsModel.dart +++ b/lib/core/model/patient_muse/PatientMuseResultsModel.dart @@ -1,19 +1,19 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientMuseResultsModel { - int rowID; - String setupID; - int projectID; - String orderNo; - int lineItemNo; - int patientType; - int patientID; - String procedureID; + int ?rowID; + String? setupID; + int ?projectID; + String? orderNo; + int? lineItemNo; + int? patientType; + int? patientID; + String ?procedureID; dynamic reportData; - String imageURL; - String createdBy; - String createdOn; - DateTime createdOnDateTime; + String? imageURL; + String? createdBy; + String? createdOn; + DateTime? createdOnDateTime; PatientMuseResultsModel( {this.rowID, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 437c5885..3a722c96 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -1,16 +1,16 @@ class PatientSearchRequestModel { - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; + int ?doctorID; + String?firstName; + String?middleName; + String?lastName; + String?patientMobileNumber; + String?patientIdentificationID; + int ?patientID; + String? from; + String ?to; + int ?searchType; + String? mobileNo; + String? identificationNo; PatientSearchRequestModel( {this.doctorID =0, diff --git a/lib/core/model/procedure/ControlsModel.dart b/lib/core/model/procedure/ControlsModel.dart index b3e8ae9c..e14c7768 100644 --- a/lib/core/model/procedure/ControlsModel.dart +++ b/lib/core/model/procedure/ControlsModel.dart @@ -1,6 +1,6 @@ class Controls { - String code; - String controlValue; + String ?code; + String ?controlValue; Controls({this.code, this.controlValue}); diff --git a/lib/core/model/procedure/Procedure_template_request_model.dart b/lib/core/model/procedure/Procedure_template_request_model.dart index 698178e3..a734382b 100644 --- a/lib/core/model/procedure/Procedure_template_request_model.dart +++ b/lib/core/model/procedure/Procedure_template_request_model.dart @@ -1,31 +1,31 @@ class ProcedureTempleteRequestModel { - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; - int editedBy; - int projectID; - int clinicID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int deviceTypeID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + String? mobileNo; + String? identificationNo; + int? editedBy; + int? projectID; + int? clinicID; + String? tokenID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + int? deviceTypeID; ProcedureTempleteRequestModel( {this.doctorID, @@ -56,7 +56,7 @@ class ProcedureTempleteRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteRequestModel.fromJson(Map json) { + ProcedureTempleteRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; middleName = json['MiddleName']; @@ -86,8 +86,8 @@ class ProcedureTempleteRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 9e6f847f..e4df9963 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -1,26 +1,26 @@ class CategoriseProcedureModel { - List entityList; - int rowcount; + List ?entityList; + int ?rowcount; dynamic statusMessage; CategoriseProcedureModel( - {this.entityList, this.rowcount, this.statusMessage}); + {this.entityList, this.rowcount, this.statusMessage}); - CategoriseProcedureModel.fromJson(Map json) { + CategoriseProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,20 +29,20 @@ class CategoriseProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool ?allowedClinic; + String ? category; + String ? categoryID; + String ? genderValidation; + String ? group; + String ? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; - String remarks; - String type; + String ? procedureId; + String ? procedureName; + String ? specialPermission; + String ? subGroup; + String ? template; + String ? remarks; + String ? type; EntityList( {this.allowedClinic, @@ -60,7 +60,7 @@ class EntityList { this.remarks, this.type}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -75,8 +75,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_ordered_procedure_model.dart b/lib/core/model/procedure/get_ordered_procedure_model.dart index c3c7718f..5b0d4695 100644 --- a/lib/core/model/procedure/get_ordered_procedure_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_model.dart @@ -1,26 +1,26 @@ class GetOrderedProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetOrderedProcedureModel( {this.entityList, this.rowcount, this.statusMessage}); - GetOrderedProcedureModel.fromJson(Map json) { + GetOrderedProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,31 +29,31 @@ class GetOrderedProcedureModel { } class EntityList { - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; - int doctorID; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; + int? doctorID; EntityList( {this.achiCode, @@ -82,7 +82,7 @@ class EntityList { this.template, this.doctorID}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { achiCode = json['achiCode']; doctorID = json['doctorID']; appointmentDate = json['appointmentDate']; @@ -110,8 +110,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['achiCode'] = this.achiCode; data['doctorID'] = this.doctorID; data['appointmentDate'] = this.appointmentDate; diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index dfbd444c..64f1cb2b 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,6 +1,6 @@ class GetOrderedProcedureRequestModel { - String vidaAuthTokenID; - int patientMRN; + String? vidaAuthTokenID; + int? patientMRN; GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN}); diff --git a/lib/core/model/procedure/get_procedure_model.dart b/lib/core/model/procedure/get_procedure_model.dart index 5c83b49b..516c8e42 100644 --- a/lib/core/model/procedure/get_procedure_model.dart +++ b/lib/core/model/procedure/get_procedure_model.dart @@ -1,25 +1,25 @@ class GetProcedureModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; GetProcedureModel({this.entityList, this.rowcount, this.statusMessage}); - GetProcedureModel.fromJson(Map json) { + GetProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -28,18 +28,18 @@ class GetProcedureModel { } class EntityList { - bool allowedClinic; - String category; - String categoryID; - String genderValidation; - String group; - String orderedValidation; + bool? allowedClinic; + String? category; + String? categoryID; + String? genderValidation; + String? group; + String? orderedValidation; dynamic price; - String procedureId; - String procedureName; - String specialPermission; - String subGroup; - String template; + String? procedureId; + String? procedureName; + String? specialPermission; + String? subGroup; + String? template; EntityList( {this.allowedClinic, @@ -55,7 +55,7 @@ class EntityList { this.subGroup, this.template}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -70,8 +70,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_procedure_req_model.dart b/lib/core/model/procedure/get_procedure_req_model.dart index 6202a520..832fbadb 100644 --- a/lib/core/model/procedure/get_procedure_req_model.dart +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -1,11 +1,11 @@ class GetProcedureReqModel { - int clinicId; - int patientMRN; - int pageSize; - int pageIndex; - List search; + int? clinicId; + int? patientMRN; + int? pageSize; + int? pageIndex; + List ?search; dynamic category; - String vidaAuthTokenID; + String ?vidaAuthTokenID; GetProcedureReqModel( {this.clinicId, diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart index b12563f8..44ef9775 100644 --- a/lib/core/model/procedure/post_procedure_req_model.dart +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -1,11 +1,11 @@ import 'ControlsModel.dart'; class PostProcedureReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - List procedures; - String vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List ?procedures; + String ?vidaAuthTokenID; PostProcedureReqModel( {this.patientMRN, @@ -19,9 +19,9 @@ class PostProcedureReqModel { appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; if (json['Procedures'] != null) { - procedures = new List(); + procedures = []; json['Procedures'].forEach((v) { - procedures.add(new Procedures.fromJson(v)); + procedures!.add(new Procedures.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; @@ -33,7 +33,7 @@ class PostProcedureReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeID; if (this.procedures != null) { - data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); + data['Procedures'] = this.procedures!.map((v) => v.toJson()).toList(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -41,9 +41,9 @@ class PostProcedureReqModel { } class Procedures { - String procedure; - String category; - List controls; + String ?procedure; + String ?category; + List ?controls; Procedures({this.procedure, this.category, this.controls}); @@ -51,9 +51,9 @@ class Procedures { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -63,7 +63,7 @@ class Procedures { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/procedure/procedure_category_list_model.dart b/lib/core/model/procedure/procedure_category_list_model.dart index 849e84e5..50048080 100644 --- a/lib/core/model/procedure/procedure_category_list_model.dart +++ b/lib/core/model/procedure/procedure_category_list_model.dart @@ -1,6 +1,6 @@ class ProcedureCategoryListModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; ProcedureCategoryListModel( @@ -8,9 +8,9 @@ class ProcedureCategoryListModel { ProcedureCategoryListModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -20,7 +20,7 @@ class ProcedureCategoryListModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,8 +29,8 @@ class ProcedureCategoryListModel { } class EntityList { - int categoryId; - String categoryName; + int? categoryId; + String? categoryName; EntityList({this.categoryId, this.categoryName}); diff --git a/lib/core/model/procedure/procedure_templateModel.dart b/lib/core/model/procedure/procedure_templateModel.dart index 3b12d646..38a05693 100644 --- a/lib/core/model/procedure/procedure_templateModel.dart +++ b/lib/core/model/procedure/procedure_templateModel.dart @@ -1,13 +1,13 @@ class ProcedureTempleteModel { - String setupID; - int projectID; - int clinicID; - int doctorID; - int templateID; - String templateName; - bool isActive; - int createdBy; - String createdOn; + String? setupID; + int? projectID; + int? clinicID; + int? doctorID; + int? templateID; + String? templateName; + bool? isActive; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; diff --git a/lib/core/model/procedure/procedure_template_details_model.dart b/lib/core/model/procedure/procedure_template_details_model.dart index 1fc797ae..13316fa8 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -1,29 +1,29 @@ class ProcedureTempleteDetailsModel { - String setupID; - int projectID; - int clinicID; - int doctorID; - int templateID; - String templateName; - String procedureID; - bool isActive; - int createdBy; - String createdOn; + String? setupID; + int? projectID; + int? clinicID; + int? doctorID; + int? templateID; + String? templateName; + String? procedureID; + bool ?isActive; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; - String procedureName; - String procedureNameN; - String alias; - String aliasN; - String categoryID; - String subGroupID; - String categoryDescription; - String categoryDescriptionN; - String categoryAlias; + String? procedureName; + String? procedureNameN; + String? alias; + String? aliasN; + String? categoryID; + String? subGroupID; + String? categoryDescription; + String? categoryDescriptionN; + String? categoryAlias; dynamic riskCategoryID; - String type = "1"; - String remarks; - int selectedType = 0; + String? type = "1"; + String? remarks; + int? selectedType = 0; ProcedureTempleteDetailsModel( {this.setupID, @@ -52,7 +52,7 @@ class ProcedureTempleteDetailsModel { this.type = "1", this.selectedType = 0}); - ProcedureTempleteDetailsModel.fromJson(Map json) { + ProcedureTempleteDetailsModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; clinicID = json['ClinicID']; @@ -77,8 +77,8 @@ class ProcedureTempleteDetailsModel { categoryAlias = json['CategoryAlias']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['ClinicID'] = this.clinicID; @@ -105,12 +105,12 @@ class ProcedureTempleteDetailsModel { } } class ProcedureTempleteDetailsModelList { - List procedureTemplate = List(); - String templateName; - int templateId; + List procedureTemplate =[]; + String? templateName; + int? templateId; ProcedureTempleteDetailsModelList( - {this.templateName, this.templateId, ProcedureTempleteDetailsModel template}) { + {this.templateName, this.templateId, required ProcedureTempleteDetailsModel template}) { procedureTemplate.add(template); } } diff --git a/lib/core/model/procedure/procedure_template_details_request_model.dart b/lib/core/model/procedure/procedure_template_details_request_model.dart index 6df6fc73..7d48e1c8 100644 --- a/lib/core/model/procedure/procedure_template_details_request_model.dart +++ b/lib/core/model/procedure/procedure_template_details_request_model.dart @@ -1,32 +1,32 @@ class ProcedureTempleteDetailsRequestModel { - int doctorID; - String firstName; - int templateID; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int searchType; - String mobileNo; - String identificationNo; - int editedBy; - int projectID; - int clinicID; - String tokenID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String vidaAuthTokenID; - String vidaRefreshTokenID; - int deviceTypeID; + int? doctorID; + String? firstName; + int? templateID; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? searchType; + String? mobileNo; + String? identificationNo; + int? editedBy; + int? projectID; + int? clinicID; + String? tokenID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + int? deviceTypeID; ProcedureTempleteDetailsRequestModel( {this.doctorID, @@ -58,7 +58,7 @@ class ProcedureTempleteDetailsRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteDetailsRequestModel.fromJson(Map json) { + ProcedureTempleteDetailsRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; templateID = json['TemplateID']; @@ -89,8 +89,8 @@ class ProcedureTempleteDetailsRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['TemplateID'] = this.templateID; diff --git a/lib/core/model/procedure/procedure_valadate_model.dart b/lib/core/model/procedure/procedure_valadate_model.dart index 3a3e23cf..431d369a 100644 --- a/lib/core/model/procedure/procedure_valadate_model.dart +++ b/lib/core/model/procedure/procedure_valadate_model.dart @@ -1,6 +1,6 @@ class ProcedureValadteModel { - List entityList; - int rowcount; + List? entityList; + int? rowcount; dynamic statusMessage; dynamic success; @@ -9,9 +9,9 @@ class ProcedureValadteModel { ProcedureValadteModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -22,7 +22,7 @@ class ProcedureValadteModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -32,8 +32,8 @@ class ProcedureValadteModel { } class EntityList { - String procedureId; - List warringMessages; + String? procedureId; + List? warringMessages; EntityList({this.procedureId, this.warringMessages}); diff --git a/lib/core/model/procedure/procedure_valadate_request_model.dart b/lib/core/model/procedure/procedure_valadate_request_model.dart index 0b872b93..581ff41f 100644 --- a/lib/core/model/procedure/procedure_valadate_request_model.dart +++ b/lib/core/model/procedure/procedure_valadate_request_model.dart @@ -1,9 +1,9 @@ class ProcedureValadteRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeID; - List procedure; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeID; + List? procedure; ProcedureValadteRequestModel( {this.vidaAuthTokenID, diff --git a/lib/core/model/procedure/update_procedure_request_model.dart b/lib/core/model/procedure/update_procedure_request_model.dart index aee39879..a6b92d16 100644 --- a/lib/core/model/procedure/update_procedure_request_model.dart +++ b/lib/core/model/procedure/update_procedure_request_model.dart @@ -1,13 +1,13 @@ import 'ControlsModel.dart'; class UpdateProcedureRequestModel { - int orderNo; - int patientMRN; - int appointmentNo; - int episodeID; - int lineItemNo; - ProcedureDetail procedureDetail; - String vidaAuthTokenID; + int? orderNo; + int? patientMRN; + int? appointmentNo; + int? episodeID; + int? lineItemNo; + ProcedureDetail? procedureDetail; + String? vidaAuthTokenID; UpdateProcedureRequestModel( {this.orderNo, @@ -38,7 +38,7 @@ class UpdateProcedureRequestModel { data['EpisodeID'] = this.episodeID; data['LineItemNo'] = this.lineItemNo; if (this.procedureDetail != null) { - data['procedureDetail'] = this.procedureDetail.toJson(); + data['procedureDetail'] = this.procedureDetail!.toJson(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -46,9 +46,9 @@ class UpdateProcedureRequestModel { } class ProcedureDetail { - String procedure; - String category; - List controls; + String? procedure; + String? category; + List? controls; ProcedureDetail({this.procedure, this.category, this.controls}); @@ -56,9 +56,9 @@ class ProcedureDetail { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = new List(); + controls = []; json['Controls'].forEach((v) { - controls.add(new Controls.fromJson(v)); + controls!.add(new Controls.fromJson(v)); }); } } @@ -68,7 +68,7 @@ class ProcedureDetail { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index e09f269a..4c16151c 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -8,17 +8,17 @@ class FinalRadiology { dynamic invoiceNo; dynamic doctorID; dynamic clinicID; - DateTime orderDate; - DateTime reportDate; + DateTime? orderDate; + DateTime ?reportDate; dynamic reportData; dynamic imageURL; dynamic procedureID; dynamic appodynamicmentNo; dynamic dIAPacsURL; - bool isRead; + bool? isRead; dynamic readOn; var admissionNo; - bool isInOutPatient; + bool ?isInOutPatient; dynamic actualDoctorRate; dynamic clinicDescription; dynamic dIAPACSURL; @@ -28,8 +28,8 @@ class FinalRadiology { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool isActiveDoctorProfile; - bool isExecludeDoctor; + bool? isActiveDoctorProfile; + bool ?isExecludeDoctor; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; dynamic nationalityFlagURL; @@ -39,10 +39,10 @@ class FinalRadiology { dynamic qR; dynamic reportDataHTML; dynamic reportDataTextdynamic; - List speciality; - bool isCVI; - bool isRadMedicalReport; - bool isLiveCareAppodynamicment; + List? speciality; + bool ?isCVI; + bool ?isRadMedicalReport; + bool ?isLiveCareAppodynamicment; FinalRadiology( {this.setupID, @@ -186,9 +186,9 @@ class FinalRadiology { class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = List(); + List finalRadiologyList = []; - FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) { finalRadiologyList.add(finalRadiology); } } diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart index 9e3458d5..b42bc723 100644 --- a/lib/core/model/radiology/request_patient_rad_orders_details.dart +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -1,24 +1,24 @@ class RequestPatientRadOrdersDetails { - int projectID; - int orderNo; - int invoiceNo; - String setupID; - String procedureID; - bool isMedicalReport; - bool isCVI; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; + int? projectID; + int? orderNo; + int? invoiceNo; + String? setupID; + String? procedureID; + bool? isMedicalReport; + bool? isCVI; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; RequestPatientRadOrdersDetails( {this.projectID, @@ -42,7 +42,7 @@ class RequestPatientRadOrdersDetails { this.patientTypeID, this.patientType}); - RequestPatientRadOrdersDetails.fromJson(Map json) { + RequestPatientRadOrdersDetails.fromJson(Map json) { projectID = json['ProjectID']; orderNo = json['OrderNo']; invoiceNo = json['InvoiceNo']; @@ -65,8 +65,8 @@ class RequestPatientRadOrdersDetails { patientType = json['PatientType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; data['InvoiceNo'] = this.invoiceNo; diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 6d68653d..3b9e961a 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -1,30 +1,30 @@ class RequestSendRadReportEmail { - int channel; - String clinicName; - String dateofBirth; - int deviceTypeID; - String doctorName; - String generalid; - int invoiceNo; - String iPAdress; - bool isDentalAllowedBackend; - int languageID; - String orderDate; - int patientID; - String patientIditificationNum; - String patientMobileNumber; - String patientName; - int patientOutSA; - int patientType; - int patientTypeID; - int projectID; - String projectName; - String radResult; - String sessionID; - String setupID; - String to; - String tokenID; - double versionID; + int? channel; + String? clinicName; + String? dateofBirth; + int? deviceTypeID; + String? doctorName; + String? generalid; + int? invoiceNo; + String? iPAdress; + bool ?isDentalAllowedBackend; + int? languageID; + String? orderDate; + int? patientID; + String? patientIditificationNum; + String? patientMobileNumber; + String? patientName; + int? patientOutSA; + int? patientType; + int? patientTypeID; + int? projectID; + String? projectName; + String? radResult; + String? sessionID; + String? setupID; + String? to; + String? tokenID; + double? versionID; RequestSendRadReportEmail( {this.channel, @@ -54,7 +54,7 @@ class RequestSendRadReportEmail { this.tokenID, this.versionID}); - RequestSendRadReportEmail.fromJson(Map json) { + RequestSendRadReportEmail.fromJson(Map json) { channel = json['Channel']; clinicName = json['ClinicName']; dateofBirth = json['DateofBirth']; @@ -83,8 +83,8 @@ class RequestSendRadReportEmail { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Channel'] = this.channel; data['ClinicName'] = this.clinicName; data['DateofBirth'] = this.dateofBirth; diff --git a/lib/core/model/referral/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart index dff63bfc..d104ccae 100644 --- a/lib/core/model/referral/DischargeReferralPatient.dart +++ b/lib/core/model/referral/DischargeReferralPatient.dart @@ -2,56 +2,56 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class DischargeReferralPatient { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - String dischargeDate; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime ?referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + String? dischargeDate; dynamic clinicID; - String age; - String clinicDescription; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + String? age; + String? clinicDescription; + String? frequencyDescription; + String? genderDescription; + bool?isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; DischargeReferralPatient( {this.rowID, @@ -106,7 +106,7 @@ class DischargeReferralPatient { this.referringClinicDescription, this.referringDoctorName}); - DischargeReferralPatient.fromJson(Map json) { + DischargeReferralPatient.fromJson(Map json) { rowID = json['RowID']; projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; @@ -160,8 +160,8 @@ class DischargeReferralPatient { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 797109dd..87757148 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -2,65 +2,65 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { dynamic rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; dynamic doctorNameN; - String firstName; - String middleName; - String lastName; + String? firstName; + String? middleName; + String? lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; dynamic nursingStationID; dynamic description; - String nationalityName; + String? nationalityName; dynamic nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - DateTime referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + DateTime ?referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; MyReferralPatientModel( {this.rowID, @@ -124,7 +124,7 @@ class MyReferralPatientModel { this.referringClinicDescription, this.referringDoctorName}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; @@ -187,8 +187,8 @@ class MyReferralPatientModel { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; @@ -253,6 +253,6 @@ class MyReferralPatientModel { } get patientName { - return this.firstName+" "+this.lastName; + return this.firstName!+" "+this.lastName!; } } diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index b3ad1f03..5b7ffc05 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -1,28 +1,28 @@ class ReferralRequest { - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - int projectID; - int admissionNo; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + int? projectID; + int? admissionNo; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double ?versionID; + int? channel; + String? tokenID; + String? sessionID; + bool ?isLoginForDoctorApp; + bool ?patientOutSA; ReferralRequest( {this.roomID, @@ -50,7 +50,7 @@ class ReferralRequest { this.isLoginForDoctorApp, this.patientOutSA}); - ReferralRequest.fromJson(Map json) { + ReferralRequest.fromJson(Map json) { roomID = json['RoomID']; referralClinic = json['ReferralClinic']; referralDoctor = json['ReferralDoctor']; @@ -77,8 +77,8 @@ class ReferralRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RoomID'] = this.roomID; data['ReferralClinic'] = this.referralClinic; data['ReferralDoctor'] = this.referralDoctor; diff --git a/lib/core/model/search_drug/get_medication_response_model.dart b/lib/core/model/search_drug/get_medication_response_model.dart index a42a8b47..24079b5e 100644 --- a/lib/core/model/search_drug/get_medication_response_model.dart +++ b/lib/core/model/search_drug/get_medication_response_model.dart @@ -1,13 +1,13 @@ class GetMedicationResponseModel { - String description; - String genericName; - int itemId; - String keywords; + String? description; + String? genericName; + int ?itemId; + String? keywords; dynamic price; dynamic quantity; dynamic mediSpanGPICode; - bool isNarcotic; - String uom; + bool ?isNarcotic; + String? uom; GetMedicationResponseModel( {this.description, this.genericName, @@ -19,7 +19,7 @@ class GetMedicationResponseModel { this.uom, this.mediSpanGPICode}); - GetMedicationResponseModel.fromJson(Map json) { + GetMedicationResponseModel.fromJson(Map json) { description = json['Description']; genericName = json['GenericName']; itemId = json['ItemId']; @@ -31,8 +31,8 @@ class GetMedicationResponseModel { uom = json['uom']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Description'] = this.description; data['GenericName'] = this.genericName; data['ItemId'] = this.itemId; diff --git a/lib/core/model/search_drug/item_by_medicine_model.dart b/lib/core/model/search_drug/item_by_medicine_model.dart index 0a93a4f1..a95988db 100644 --- a/lib/core/model/search_drug/item_by_medicine_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_model.dart @@ -1,27 +1,27 @@ class ItemByMedicineModel { - List frequencies; - List routes; - List strengths; + List? frequencies; + List ?routes; + List? strengths; ItemByMedicineModel({this.frequencies, this.routes, this.strengths}); ItemByMedicineModel.fromJson(Map json) { if (json['frequencies'] != null) { - frequencies = new List(); + frequencies = []; json['frequencies'].forEach((v) { - frequencies.add(new Frequencies.fromJson(v)); + frequencies!.add(new Frequencies.fromJson(v)); }); } if (json['routes'] != null) { - routes = new List(); + routes = []; json['routes'].forEach((v) { - routes.add(new Routes.fromJson(v)); + routes!.add(new Routes.fromJson(v)); }); } if (json['strengths'] != null) { - strengths = new List(); + strengths = []; json['strengths'].forEach((v) { - strengths.add(new Strengths.fromJson(v)); + strengths!.add(new Strengths.fromJson(v)); }); } } @@ -29,22 +29,22 @@ class ItemByMedicineModel { Map toJson() { final Map data = new Map(); if (this.frequencies != null) { - data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList(); + data['frequencies'] = this.frequencies!.map((v) => v.toJson()).toList(); } if (this.routes != null) { - data['routes'] = this.routes.map((v) => v.toJson()).toList(); + data['routes'] = this.routes!.map((v) => v.toJson()).toList(); } if (this.strengths != null) { - data['strengths'] = this.strengths.map((v) => v.toJson()).toList(); + data['strengths'] = this.strengths!.map((v) => v.toJson()).toList(); } return data; } } class Frequencies { - String description; - bool isDefault; - int parameterCode; + String? description; + bool? isDefault; + int ?parameterCode; Frequencies({this.description, this.isDefault, this.parameterCode}); @@ -64,9 +64,9 @@ class Frequencies { } class Strengths { - String description; - bool isDefault; - int parameterCode; + String? description; + bool ?isDefault; + int ?parameterCode; Strengths({this.description, this.isDefault, this.parameterCode}); @@ -86,9 +86,9 @@ class Strengths { } class Routes { - String description; - bool isDefault; - int parameterCode; + String ?description; + bool ?isDefault; + int ?parameterCode; Routes({this.description, this.isDefault, this.parameterCode}); diff --git a/lib/core/model/search_drug/item_by_medicine_request_model.dart b/lib/core/model/search_drug/item_by_medicine_request_model.dart index 7460044b..7ec3e21e 100644 --- a/lib/core/model/search_drug/item_by_medicine_request_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_request_model.dart @@ -1,6 +1,6 @@ class ItemByMedicineRequestModel { - String vidaAuthTokenID; - int medicineCode; + String ?vidaAuthTokenID; + int ?medicineCode; ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode}); diff --git a/lib/core/model/search_drug/search_drug_model.dart b/lib/core/model/search_drug/search_drug_model.dart index 396526c1..aa7739a2 100644 --- a/lib/core/model/search_drug/search_drug_model.dart +++ b/lib/core/model/search_drug/search_drug_model.dart @@ -1,15 +1,15 @@ class SearchDrugModel { - List entityList; - int rowcount; + List? entityList; + int ?rowcount; dynamic statusMessage; SearchDrugModel({this.entityList, this.rowcount, this.statusMessage}); SearchDrugModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = []; json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList!.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class SearchDrugModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/search_drug/search_drug_request_model.dart b/lib/core/model/search_drug/search_drug_request_model.dart index b64e7d18..8c725c86 100644 --- a/lib/core/model/search_drug/search_drug_request_model.dart +++ b/lib/core/model/search_drug/search_drug_request_model.dart @@ -1,5 +1,5 @@ class SearchDrugRequestModel { - List search; + List ?search; // String vidaAuthTokenID; SearchDrugRequestModel({this.search}); diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 3c78f1ff..db701206 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -1,41 +1,41 @@ import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; class SickLeavePatientModel { - String setupID; - int projectID; - int patientID; - int patientType; - int clinicID; - int doctorID; - int requestNo; - String requestDate; - int sickLeaveDays; - int appointmentNo; - int admissionNo; - int actualDoctorRate; - String appointmentDate; - String clinicName; - String doctorImageURL; - String doctorName; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isLiveCareAppointment; - int noOfPatientsRate; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + int? clinicID; + int? doctorID; + int? requestNo; + String? requestDate; + int? sickLeaveDays; + int? appointmentNo; + int? admissionNo; + int? actualDoctorRate; + String? appointmentDate; + String? clinicName; + String? doctorImageURL; + String? doctorName; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isLiveCareAppointment; + int? noOfPatientsRate; dynamic patientName; - String projectName; - String qR; - // List speciality; - String strRequestDate; - String startDate; - String endDate; + String? projectName; + String? qR; + // List speciality; + String? strRequestDate; + String? startDate; + String? endDate; SickLeavePatientModel( {this.setupID, @@ -74,7 +74,7 @@ class SickLeavePatientModel { this.startDate, this.endDate}); - SickLeavePatientModel.fromJson(Map json) { + SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; @@ -107,14 +107,14 @@ class SickLeavePatientModel { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); strRequestDate = json['StrRequestDate']; startDate = json['StartDate']; endDate = json['EndDate']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index ec588316..ff5079b1 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -1,16 +1,16 @@ class SickLeavePatientRequestModel { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - int deviceTypeID; - int patientType; - int patientTypeID; - String tokenID; - int patientID; - String sessionID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + int? deviceTypeID; + int? patientType; + int? patientTypeID; + String? tokenID; + int? patientID; + String? sessionID; SickLeavePatientRequestModel( {this.versionID, @@ -26,7 +26,7 @@ class SickLeavePatientRequestModel { this.patientID, this.sessionID}); - SickLeavePatientRequestModel.fromJson(Map json) { + SickLeavePatientRequestModel.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -41,8 +41,8 @@ class SickLeavePatientRequestModel { sessionID = json['SessionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 09ee7c49..ac069304 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -6,33 +6,29 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { - String error; + String ?error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel ?doctorProfile; List patientArrivalList = []; //TODO add the user login model when we need it - Future getDoctorProfile({bool isGetProfile = false}) async { + Future ? getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile!; } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile!; } return null; } else { @@ -40,7 +36,7 @@ class BaseService { } } - Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ + Future getPatientArrivalList(String date,{String? fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ hasError = false; Map body = Map(); body['From'] = fromDate == null ? date : fromDate; diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index b35d24f2..401ec76e 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -7,7 +7,7 @@ class DashboardService extends BaseService { List get dashboardItemsList => _dashboardItemsList; bool hasVirtualClinic = false; - String sServiceID; + String ?sServiceID; Future getDashboard() async { hasError = false; From 5a477848db66e7cc68e51ec466dfd2d855f9966f Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Jun 2021 11:04:59 +0300 Subject: [PATCH 030/199] Migrate view model to flutter 2 --- .../viewModel/DischargedPatientViewModel.dart | 4 +- lib/core/viewModel/InsuranceViewModel.dart | 8 +- .../viewModel/LiveCarePatientViewModel.dart | 26 ++-- .../PatientMedicalReportViewModel.dart | 8 +- .../viewModel/authentication_view_model.dart | 78 ++++++----- lib/core/viewModel/base_view_model.dart | 24 ++-- lib/core/viewModel/dashboard_view_model.dart | 14 +- .../viewModel/doctor_replay_view_model.dart | 4 +- lib/core/viewModel/hospitals_view_model.dart | 12 +- lib/core/viewModel/labs_view_model.dart | 54 ++++---- .../viewModel/leave_rechdule_response.dart | 28 ++-- lib/core/viewModel/livecare_view_model.dart | 2 +- .../viewModel/medical_file_view_model.dart | 4 +- lib/core/viewModel/medicine_view_model.dart | 40 +++--- .../patient-admission-request-viewmodel.dart | 22 ++-- .../viewModel/patient-referral-viewmodel.dart | 122 +++++++++--------- .../viewModel/patient-ucaf-viewmodel.dart | 31 +++-- .../patient-vital-sign-viewmodel.dart | 5 +- lib/core/viewModel/patient_view_model.dart | 54 ++++---- 19 files changed, 265 insertions(+), 275 deletions(-) diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 9df347e2..f8e30851 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -42,7 +42,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.getDischargedPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else { filterData = myDischargedPatient; @@ -54,7 +54,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index 46f48d35..edc57abd 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -16,12 +16,12 @@ class InsuranceViewModel extends BaseViewModel { _insuranceCardService.insuranceApprovalInPatient; Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + {int ? appointmentNo, int? projectId}) async { error = ""; setState(ViewState.Busy); if (appointmentNo != null) await _insuranceCardService.getInsuranceApproval(patient, - appointmentNo: appointmentNo, projectId: projectId); + appointmentNo: appointmentNo, projectId: projectId!); else await _insuranceCardService.getInsuranceApproval(patient); if (_insuranceCardService.hasError) { @@ -31,13 +31,13 @@ class InsuranceViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getInsuranceInPatient({int mrn}) async { + Future getInsuranceInPatient({required int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _insuranceCardService.getInsuranceApprovalInPatient(mrn: mrn); if (_insuranceCardService.hasError) { - error = _insuranceCardService.error; + error = _insuranceCardService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 844ebf55..1899028a 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -35,7 +35,7 @@ class LiveCarePatientViewModel extends BaseViewModel { await _liveCarePatientServices.getPendingPatientERForDoctorApp( pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { @@ -47,7 +47,7 @@ class LiveCarePatientViewModel extends BaseViewModel { Future endCall(int vCID, bool isPatient) async { await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile.doctorID; + endCallReq.doctorId = doctorProfile!.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; @@ -55,7 +55,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -67,24 +67,24 @@ class LiveCarePatientViewModel extends BaseViewModel { return token; } - Future startCall({int vCID, bool isReCall}) async { + Future startCall({required int vCID, required bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); await getDoctorProfile(); - startCallReq.clinicId = super.doctorProfile.clinicID; + startCallReq.clinicId = super.doctorProfile!.clinicID; startCallReq.vCID = vCID; //["VC_ID"]; startCallReq.isrecall = isReCall; - startCallReq.doctorId = doctorProfile.doctorID; + startCallReq.doctorId = doctorProfile!.doctorID; startCallReq.isOutKsa = false; //["IsOutKSA"]; - startCallReq.projectName = doctorProfile.projectName; - startCallReq.docotrName = doctorProfile.doctorName; - startCallReq.clincName = doctorProfile.clinicDescription; - startCallReq.docSpec = doctorProfile.doctorTitleForProfile; + startCallReq.projectName = doctorProfile!.projectName; + startCallReq.docotrName = doctorProfile!.doctorName; + startCallReq.clincName = doctorProfile!.clinicDescription; + startCallReq.docSpec = doctorProfile!.doctorTitleForProfile; startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); await _liveCarePatientServices.startCall(startCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -95,7 +95,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.endCallWithCharge(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -107,7 +107,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.transferToAdmin(vcID, notes); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 999a0530..4a9045be 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -19,7 +19,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportList(patient); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); // ViewState.Error } else setState(ViewState.Idle); @@ -29,7 +29,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportTemplate(); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -39,7 +39,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.insertMedicalReport(patient, htmlText); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -50,7 +50,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.verifyMedicalReport(patient, medicalReport); if (_service.hasError) { - error = _service.error; + error = _service.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index a5028266..c547b150 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -59,12 +59,12 @@ class AuthenticationViewModel extends BaseViewModel { get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; - NewLoginInformationModel loggedUser; - GetIMEIDetailsModel user; + late NewLoginInformationModel loggedUser; + late GetIMEIDetailsModel ? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - List _availableBiometrics; + late List _availableBiometrics; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; @@ -72,7 +72,7 @@ class AuthenticationViewModel extends BaseViewModel { bool isFromLogin = false; APP_STATUS app_status = APP_STATUS.LOADING; - AuthenticationViewModel({bool checkDeviceInfo = false}) { + AuthenticationViewModel() { getDeviceInfoFromFirebase(); getDoctorProfile(); } @@ -82,7 +82,7 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Busy); await _authService.selectDeviceImei(imei); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -121,7 +121,7 @@ class AuthenticationViewModel extends BaseViewModel { await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -133,14 +133,14 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _authService.login(userInfo); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { sharedPref.setInt(PROJECT_ID, userInfo.projectID); loggedUser = loginInfo; saveObjToString(LOGGED_IN_USER, loginInfo); sharedPref.remove(LAST_LOGIN_USER); - sharedPref.setString(TOKEN, loginInfo.logInTokenID); + sharedPref.setString(TOKEN, loginInfo.logInTokenID!); setState(ViewState.Idle); } } @@ -150,37 +150,37 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, + iMEI: user!.iMEI, + facilityId: user!.projectID, + memberID: user!.doctorID, + zipCode: user!.outSA == true ? '971' : '966', + mobileNumber: user!.mobile, oTPSendType: authMethodType.getTypeIdService(), isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); + vidaAuthTokenID: user!.vidaAuthTokenID, + vidaRefreshTokenID: user!.vidaRefreshTokenID); await _authService.sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password }) async { + Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password }) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation[0].memberID, + memberID: loggedUser.listMemberInformation![0].memberID, zipCode: loggedUser.zipCode, mobileNumber: loggedUser.mobileNumber, otpSendType: authMethodType.getTypeIdService().toString(), password: password); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -188,24 +188,24 @@ class AuthenticationViewModel extends BaseViewModel { /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({String activationCode}) async { + Future checkActivationCodeForDoctorApp({required String activationCode}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( zipCode: - loggedUser != null ? loggedUser.zipCode :user.zipCode, + loggedUser != null ? loggedUser.zipCode :user!.zipCode, mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user.mobile, + loggedUser != null ? loggedUser.mobileNumber : user!.mobile, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) - : user.projectID, + : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), activationCode: activationCode ?? '0000', oTPSendType: await sharedPref.getInt(OTP_TYPE), generalid: "Cs2020@2016\$2958"); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -218,7 +218,7 @@ class AuthenticationViewModel extends BaseViewModel { getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error; + error = _hospitalsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -255,13 +255,13 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + - sendActivationCodeForDoctorAppResponseModel.verificationCode); + sendActivationCodeForDoctorAppResponseModel.verificationCode!); sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); sharedPref.setString(LOGIN_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.logInTokenID); + sendActivationCodeForDoctorAppResponseModel.logInTokenID!); } saveObjToString(String key, value) async { @@ -303,7 +303,7 @@ class AuthenticationViewModel extends BaseViewModel { languageID: 2);//TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { localSetDoctorProfile(doctorProfilesList.first); @@ -315,18 +315,18 @@ class AuthenticationViewModel extends BaseViewModel { onCheckActivationCodeSuccess() async { sharedPref.setString( TOKEN, - checkActivationCodeForDoctorAppRes.authenticationTokenID); + checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile + checkActivationCodeForDoctorAppRes.listDoctorProfile! .isNotEmpty) { localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { sharedPref.setObj( CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic[0] + checkActivationCodeForDoctorAppRes.listDoctorsClinic![0] .toJson()); await getDoctorProfileBasedOnClinic(clinic); } @@ -336,10 +336,8 @@ class AuthenticationViewModel extends BaseViewModel { Future checkIfBiometricAvailable(BiometricType biometricType) async { bool isAvailable = false; await _getAvailableBiometrics(); - if (_availableBiometrics != null) { - for (var i = 0; i < _availableBiometrics.length; i++) { - if (biometricType == _availableBiometrics[i]) isAvailable = true; - } + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; } return isAvailable; } @@ -367,11 +365,11 @@ class AuthenticationViewModel extends BaseViewModel { } var token = await _firebaseMessaging.getToken(); if (DEVICE_TOKEN == "") { - DEVICE_TOKEN = token; + DEVICE_TOKEN = token!; await _authService.selectDeviceImei(DEVICE_TOKEN); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index 9d7032aa..cdc0f3d9 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; class BaseViewModel extends ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel doctorProfile; + DoctorProfileModel ? doctorProfile; ViewState _state = ViewState.Idle; bool isInternetConnection = true; @@ -22,24 +22,20 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future getDoctorProfile({bool isGetProfile = false}) async { + Future ?getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; - } + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; } return null; } else { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 6f34f034..706b828e 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -20,7 +20,7 @@ class DashboardViewModel extends BaseViewModel { bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; - String get sServiceID => _dashboardService.sServiceID; + String? get sServiceID => _dashboardService.sServiceID; Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { @@ -31,9 +31,9 @@ class DashboardViewModel extends BaseViewModel { _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - _firebaseMessaging.getToken().then((String token) async { + _firebaseMessaging.getToken().then((String ?token) async { if (token != '') { - DEVICE_TOKEN = token; + DEVICE_TOKEN = token!; authProvider.insertDeviceImei(); } }); @@ -43,7 +43,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _dashboardService.getDashboard(); if (_dashboardService.hasError) { - error = _dashboardService.error; + error = _dashboardService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -53,7 +53,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _dashboardService.checkDoctorHasLiveCare(); if (_dashboardService.hasError) { - error = _dashboardService.error; + error = _dashboardService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -64,9 +64,9 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID, clinicID: clinicId, - projectID: doctorProfile.projectID, + projectID: doctorProfile!.projectID, ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 18f1a9f5..37a61afe 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -15,7 +15,7 @@ class DoctorReplayViewModel extends BaseViewModel { setState(ViewState.Busy); await _doctorReplyService.getDoctorReply(); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -26,7 +26,7 @@ class DoctorReplayViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _doctorReplyService.replay(referredDoctorRemarks, model); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/hospitals_view_model.dart b/lib/core/viewModel/hospitals_view_model.dart index c0ce1bc4..f2b2abe9 100644 --- a/lib/core/viewModel/hospitals_view_model.dart +++ b/lib/core/viewModel/hospitals_view_model.dart @@ -1,25 +1,21 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; -import 'package:flutter/cupertino.dart'; import '../../locator.dart'; import 'base_view_model.dart'; - class HospitalViewModel extends BaseViewModel { HospitalsService _hospitalsService = locator(); - // List get imeiDetails => _authService.dashboardItemsList; - // get loginInfo => _authService.loginInfo; + Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = + GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; setState(ViewState.Busy); await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error; + error = _hospitalsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 5b4b7e4c..674dddd5 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -18,8 +18,8 @@ class LabsViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; List get patientLabOrdersList => filterType == FilterType.Clinic @@ -30,7 +30,7 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, true); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { @@ -47,7 +47,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription, + filterName: element.clinicDescription!, patientDoctorAppointment: element)); } @@ -67,7 +67,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName, + filterName: element.projectName!, patientDoctorAppointment: element)); } }); @@ -86,19 +86,19 @@ class LabsViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; } getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, - bool isInpatient}) async { + {required String projectID, + required int clinicID, + required String invoiceNo, + required String orderNo, + required PatiantInformtion patient, + required bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, @@ -108,7 +108,7 @@ class LabsViewModel extends BaseViewModel { patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -116,16 +116,16 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResult( - {PatientLabOrders patientLabOrder, - PatiantInformtion patient, - bool isInpatient}) async { + {required PatientLabOrders patientLabOrder, + required PatiantInformtion patient, + required bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult( patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -145,30 +145,30 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { labResultLists - .add(LabResultList(filterName: element.testCode, lab: element)); + .add(LabResultList(filterName: element.testCode!, lab: element)); } }); } getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, + required String procedure, + required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || - element.resultValue.contains('*') || - element.resultValue.isEmpty) isShouldClear = true; + if (element.resultValue!.contains('/') || + element.resultValue!.contains('*') || + element.resultValue!.isEmpty) isShouldClear = true; }); } if (isShouldClear) _labsService.labOrdersResultsList.clear(); @@ -176,10 +176,10 @@ class LabsViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; } else DrAppToastMsg.showSuccesToast(mes); } diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index 555e19cf..cb734073 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -1,16 +1,16 @@ class GetRescheduleLeavesResponse { - int clinicId; + int? clinicId; var coveringDoctorId; - String date; - String dateTimeFrom; - String dateTimeTo; - int doctorId; - int reasonId; - int requisitionNo; - int requisitionType; - int status; - String createdOn; - String statusDescription; + String? date; + String? dateTimeFrom; + String? dateTimeTo; + int? doctorId; + int? reasonId; + int? requisitionNo; + int? requisitionType; + int? status; + String? createdOn; + String? statusDescription; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, @@ -25,7 +25,7 @@ class GetRescheduleLeavesResponse { this.createdOn, this.statusDescription}); - GetRescheduleLeavesResponse.fromJson(Map json) { + GetRescheduleLeavesResponse.fromJson(Map json) { clinicId = json['clinicId']; coveringDoctorId = json['coveringDoctorId']; date = json['date']; @@ -40,8 +40,8 @@ class GetRescheduleLeavesResponse { statusDescription = json['statusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['clinicId'] = this.clinicId; data['coveringDoctorId'] = this.coveringDoctorId; data['date'] = this.date; diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index de586e1e..eb96e687 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -16,7 +16,7 @@ class LiveCareViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); List liveCarePendingList = []; - StartCallRes inCallResponse; + late StartCallRes inCallResponse; var transferToAdmin = {}; var endCallResponse = {}; bool isFinished = true; diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 08e8ce90..406a4617 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -11,13 +11,13 @@ class MedicalFileViewModel extends BaseViewModel { List get medicalFileList => _medicalFileService.medicalFileList; - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({required int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _medicalFileService.getMedicalFile(mrn: mrn); if (_medicalFileService.hasError) { - error = _medicalFileService.error; + error = _medicalFileService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 8ccf1a70..8fa484ea 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -18,7 +18,7 @@ class MedicineViewModel extends BaseViewModel { ProcedureService _procedureService = locator(); PrescriptionService _prescriptionService = locator(); List get procedureTemplate => _procedureService.templateList; - List templateList = List(); + List templateList = []; get pharmacyItemsList => _medicineService.pharmacyItemsList; get searchText => _medicineService.searchText; get pharmaciesList => _medicineService.pharmaciesList; @@ -42,13 +42,13 @@ class MedicineViewModel extends BaseViewModel { List get itemMedicineListRoute => _prescriptionService.itemMedicineListRoute; List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; - Future getItem({int itemID}) async { + Future getItem({required int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -70,12 +70,12 @@ class MedicineViewModel extends BaseViewModel { print(templateList.length.toString()); } - Future getProcedureTemplate({String categoryID}) async { + Future getProcedureTemplate({required String categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -83,13 +83,13 @@ class MedicineViewModel extends BaseViewModel { } } - Future getPrescription({int mrn}) async { + Future getPrescription({required int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -99,17 +99,17 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); if (_medicineService.hasError) { - error = _medicineService.error; + error = _medicineService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMedicationList({String drug}) async { + Future getMedicationList({required String drug}) async { setState(ViewState.Busy); await _prescriptionService.getMedicationList(drug: drug); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -119,7 +119,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getPatientAssessment(getAssessmentReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -129,7 +129,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationStrength); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -139,7 +139,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationRoute); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -149,7 +149,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationIndications); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -159,7 +159,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDoseTime); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -169,7 +169,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationFrequency); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -179,18 +179,18 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDuration); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getBoxQuantity({int itemCode, int duration, double strength, int freq}) async { + Future getBoxQuantity({required int itemCode, required int duration, required double strength, required int freq}) async { setState(ViewState.Busy); await _prescriptionService.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -200,7 +200,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getPharmaciesList(itemId); if (_medicineService.hasError) { - error = _medicineService.error; + error = _medicineService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 0868b601..8e1cbca0 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -39,7 +39,7 @@ class AdmissionRequestViewModel extends BaseViewModel { List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes; - AdmissionRequest admissionRequestData; + late AdmissionRequest admissionRequestData; Future getSpecialityList() async { await getMasterLookup(MasterKeysService.Speciality); @@ -53,7 +53,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getClinics(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -63,7 +63,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDoctorsList(clinicId); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -73,7 +73,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getFloors(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -83,7 +83,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getWardList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -93,7 +93,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getRoomCategories(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -103,7 +103,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDiagnosisTypesList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -120,7 +120,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDietTypesList(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -130,7 +130,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getICDCodes(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -140,7 +140,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.Busy); await _admissionRequestService.makeAdmissionRequest(admissionRequestData); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -150,7 +150,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getMasterLookup(keysService); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; + error = _admissionRequestService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index a414c200..f93b057e 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -62,7 +62,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPatientReferral(patient); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { if (patientReferral.length == 0) { @@ -77,7 +77,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getMasterLookup(masterKeys); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else await getBranches(); @@ -87,7 +87,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getReferralFacilities(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -99,7 +99,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getClinicsList(projectId); await _referralPatientService.getProjectInfo(projectId); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -110,7 +110,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else { doctorsList.clear(); @@ -122,7 +122,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getDoctorBranch() async { - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { dynamic _selectedBranch = { "facilityId": doctorProfile.projectID, @@ -137,7 +137,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getMyReferredPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -151,7 +151,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPendingReferralList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -161,7 +161,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -172,7 +172,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); @@ -183,7 +183,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.responseReferral(pendingReferral, isAccepted); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -195,7 +195,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.makeReferral( patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -203,15 +203,15 @@ class PatientReferralViewModel extends BaseViewModel { } Future makeInPatientReferral( - {PatiantInformtion patient, - int projectID, - int clinicID, - int doctorID, - int frequencyCode, - int priority, - String referralDate, - String remarks, - String ext}) async { + {required PatiantInformtion patient, + required int projectID, + required int clinicID, + required int doctorID, + required int frequencyCode, + required int priority, + required String referralDate, + required String remarks, + required String ext}) async { setState(ViewState.Busy); await _referralService.referralPatient( patientID: patient.patientId, @@ -226,7 +226,7 @@ class PatientReferralViewModel extends BaseViewModel { extension: ext, ); if (_referralService.hasError) { - error = _referralService.error; + error = _referralService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -240,7 +240,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -251,7 +251,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getReferralFrequencyList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -262,7 +262,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else { getMyReferredPatient(); @@ -274,7 +274,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error; + error = _dischargedPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -326,53 +326,53 @@ class PatientReferralViewModel extends BaseViewModel { PatiantInformtion getPatientFromReferralO( MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID; - patient.doctorName = referredPatient.doctorName; + patient.doctorId = referredPatient.doctorID!; + patient.doctorName = referredPatient.doctorName!; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName; - patient.middleName = referredPatient.middleName; - patient.lastName = referredPatient.lastName; - patient.gender = referredPatient.gender; - patient.dateofBirth = referredPatient.dateofBirth; - patient.mobileNumber = referredPatient.mobileNumber; - patient.emailAddress = referredPatient.emailAddress; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo; - patient.patientType = referredPatient.patientType; - patient.admissionNo = referredPatient.admissionNo; - patient.admissionDate = referredPatient.admissionDate; - patient.roomId = referredPatient.roomID; - patient.bedId = referredPatient.bedID; - patient.nationalityName = referredPatient.nationalityName; - patient.nationalityFlagURL = referredPatient.nationalityFlagURL; + patient.firstName = referredPatient.firstName!; + patient.middleName = referredPatient.middleName!; + patient.lastName = referredPatient.lastName!; + patient.gender = referredPatient.gender!; + patient.dateofBirth = referredPatient.dateofBirth!; + patient.mobileNumber = referredPatient.mobileNumber!; + patient.emailAddress = referredPatient.emailAddress!; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; + patient.patientType = referredPatient.patientType!; + patient.admissionNo = referredPatient.admissionNo!; + patient.admissionDate = referredPatient.admissionDate!; + patient.roomId = referredPatient.roomID!; + patient.bedId = referredPatient.bedID!; + patient.nationalityName = referredPatient.nationalityName!; + patient.nationalityFlagURL = referredPatient.nationalityFlagURL!; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription; + patient.clinicDescription = referredPatient.clinicDescription!; return patient; } PatiantInformtion getPatientFromDischargeReferralPatient( DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID; - patient.doctorName = referredPatient.doctorName; + patient.doctorId = referredPatient.doctorID!; + patient.doctorName = referredPatient.doctorName!; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName; - patient.middleName = referredPatient.middleName; - patient.lastName = referredPatient.lastName; - patient.gender = referredPatient.gender; - patient.dateofBirth = referredPatient.dateofBirth; - patient.mobileNumber = referredPatient.mobileNumber; - patient.emailAddress = referredPatient.emailAddress; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo; - patient.patientType = referredPatient.patientType; - patient.admissionNo = referredPatient.admissionNo; - patient.admissionDate = referredPatient.admissionDate; - patient.roomId = referredPatient.roomID; - patient.bedId = referredPatient.bedID; - patient.nationalityName = referredPatient.nationalityName; + patient.firstName = referredPatient.firstName!; + patient.middleName = referredPatient.middleName!; + patient.lastName = referredPatient.lastName!; + patient.gender = referredPatient.gender!; + patient.dateofBirth = referredPatient.dateofBirth!; + patient.mobileNumber = referredPatient.mobileNumber!; + patient.emailAddress = referredPatient.emailAddress!; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; + patient.patientType = referredPatient.patientType!; + patient.admissionNo = referredPatient.admissionNo!; + patient.admissionDate = referredPatient.admissionDate!; + patient.roomId = referredPatient.roomID!; + patient.bedId = referredPatient.bedID!; + patient.nationalityName = referredPatient.nationalityName!; patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription; + patient.clinicDescription = referredPatient.clinicDescription!; return patient; } } diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index b6887061..b665a385 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -36,7 +36,7 @@ class UcafViewModel extends BaseViewModel { List get orderProcedures => _ucafService.orderProcedureList; - String selectedLanguage; + late String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -60,33 +60,32 @@ class UcafViewModel extends BaseViewModel { String from; String to; - if (from == null || from == "0") { + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } - if (to == null || to == "0") { + + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } + // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { - if (heightCm == "0" || heightCm == null || heightCm == 'null') { + if (heightCm == "0" || heightCm == 'null') { heightCm = element.heightCm.toString(); } - if (weightKg == "0" || weightKg == null || weightKg == 'null') { + if (weightKg == "0" || weightKg == 'null') { weightKg = element.weightKg.toString(); } - if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { + if (bodyMax == "0" || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } if (temperatureCelcius == "0" || - temperatureCelcius == null || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } @@ -115,7 +114,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.getPatientAssessment(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { if (patientAssessmentList.isNotEmpty) { @@ -127,7 +126,7 @@ class UcafViewModel extends BaseViewModel { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); } if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -142,7 +141,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.getOrderProcedures(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -155,7 +154,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.getPrescription(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -163,8 +162,8 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel findMasterDataById( - {@required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel ? findMasterDataById( + {required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index bab2ff9f..4f22d9e3 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -35,7 +35,7 @@ class VitalSignsViewModel extends BaseViewModel { setState(ViewState.Busy); await _vitalSignService.getPatientVitalSign(patient); if (_vitalSignService.hasError) { - error = _vitalSignService.error; + error = _vitalSignService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -59,7 +59,7 @@ class VitalSignsViewModel extends BaseViewModel { } if (_vitalSignService.hasError) { - error = _vitalSignService.error; + error = _vitalSignService.error!; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { @@ -163,5 +163,6 @@ class VitalSignsViewModel extends BaseViewModel { } else if (temperatureCelciusMethod == 5) { return "Temporal"; } + return ""; } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index de40afde..547dbdec 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -64,7 +64,7 @@ class PatientViewModel extends BaseViewModel { isView: isView); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -76,7 +76,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResultOrders(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -86,7 +86,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getOutPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -96,7 +96,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getInPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -106,7 +106,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPrescriptionReport(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -116,7 +116,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientRadiology(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -126,7 +126,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResult(labOrdersResModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -136,7 +136,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientInsuranceApprovals(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -151,7 +151,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getPatientProgressNote(patient); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -165,7 +165,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.updatePatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -175,7 +175,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.createPatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -185,7 +185,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getClinicsList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else { { @@ -199,7 +199,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.getDoctorsList(clinicId); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { { @@ -227,7 +227,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getReferralFrequancyList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -241,17 +241,17 @@ class PatientViewModel extends BaseViewModel { } Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {required String selectedDoctorID, + required String selectedClinicID, + required int admissionNo, + required String extension, + required String priority, + required String frequency, + required String referringDoctorRemarks, + required int patientID, + required int patientTypeID, + required String roomID, + required int projectID}) async { setState(ViewState.BusyLocal); await _patientService.referToDoctor( selectedClinicID: selectedClinicID, @@ -266,7 +266,7 @@ class PatientViewModel extends BaseViewModel { roomID: roomID, projectID: projectID); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -276,7 +276,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getArrivedList(); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); From 39887f3eadfe76e2ffa895b7d6825a76d6a6bcea Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 12:25:24 +0300 Subject: [PATCH 031/199] 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 6e6a7deba554dfb298f56d8413d623f46f2e0f67 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 7 Jun 2021 15:37:20 +0300 Subject: [PATCH 032/199] migration Services to flutter 2 --- lib/client/base_app_client.dart | 106 +++---- .../insurance_approval_request_model.dart | 26 +- ...t_get_list_pharmacy_for_prescriptions.dart | 52 ++-- .../request_prescription_report.dart | 80 +++--- .../request_prescription_report_enh.dart | 77 +++--- .../Procedure_template_request_model.dart | 4 +- ...cedure_template_details_request_model.dart | 4 +- lib/core/model/referral/ReferralRequest.dart | 56 ++-- .../sick_leave_patient_request_model.dart | 4 +- lib/core/service/authentication_service.dart | 120 ++++---- .../service/hospitals/hospitals_service.dart | 3 +- .../patient/DischargedPatientService.dart | 14 +- .../patient/LiveCarePatientServices.dart | 73 +++-- .../patient/MyReferralPatientService.dart | 26 +- .../service/patient/PatientMuseService.dart | 7 +- lib/core/service/patient/ReferralService.dart | 28 +- .../patient-doctor-referral-service.dart | 49 ++-- .../patient/patientInPatientService.dart | 11 +- lib/core/service/patient/patient_service.dart | 77 +++--- .../insurance/InsuranceCardService.dart | 36 +-- .../lab_order/labs_service.dart | 58 ++-- .../PatientMedicalReportService.dart | 56 ++-- .../medical_report/medical_file_service.dart | 10 +- .../prescription/prescription_service.dart | 86 ++---- .../prescription/prescriptions_service.dart | 100 +++---- .../procedure/procedure_service.dart | 88 +++--- .../radiology/radiology_service.dart | 16 +- .../sick_leave/sickleave_service.dart | 17 +- .../soap/SOAP_service.dart | 104 +++---- .../ucaf/patient-ucaf-service.dart | 30 +- .../patient-vital-signs-service.dart | 48 ++-- lib/icons_app/doctor_app_icons.dart | 7 +- lib/models/SOAP/Allergy_model.dart | 52 ++-- .../GetChiefComplaintReqModel.dart | 14 +- .../GetChiefComplaintResModel.dart | 52 ++-- lib/models/SOAP/GeneralGetReqForSOAP.dart | 6 +- lib/models/SOAP/GetAllergiesResModel.dart | 49 ++-- lib/models/SOAP/GetAssessmentReqModel.dart | 26 +- lib/models/SOAP/GetAssessmentResModel.dart | 58 ++-- .../SOAP/GetGetProgressNoteReqModel.dart | 27 +- .../SOAP/GetGetProgressNoteResModel.dart | 44 +-- lib/models/SOAP/GetHistoryReqModel.dart | 15 +- lib/models/SOAP/GetHistoryResModel.dart | 26 +- .../SOAP/GetPhysicalExamListResModel.dart | 74 ++--- lib/models/SOAP/GetPhysicalExamReqModel.dart | 10 +- lib/models/SOAP/PatchAssessmentReqModel.dart | 34 +-- lib/models/SOAP/PostEpisodeReqModel.dart | 14 +- .../SOAP/get_Allergies_request_model.dart | 17 +- lib/models/SOAP/master_key_model.dart | 46 ++-- lib/models/SOAP/my_selected_allergy.dart | 27 +- lib/models/SOAP/my_selected_assement.dart | 47 ++-- lib/models/SOAP/my_selected_examination.dart | 21 +- lib/models/SOAP/my_selected_history.dart | 16 +- lib/models/SOAP/order-procedure.dart | 98 ++++--- .../SOAP/post_allergy_request_model.dart | 65 ++--- .../SOAP/post_assessment_request_model.dart | 38 +-- .../post_chief_complaint_request_model.dart | 19 +- .../SOAP/post_histories_request_model.dart | 35 ++- .../post_physical_exam_request_model.dart | 178 ++++++------ .../post_progress_note_request_model.dart | 15 +- lib/models/dashboard/dashboard_model.dart | 27 +- lib/models/doctor/clinic_model.dart | 20 +- lib/models/doctor/doctor_profile_model.dart | 96 +++---- ...list_doctor_working_hours_table_model.dart | 13 +- .../list_gt_my_patients_question_model.dart | 119 ++++---- lib/models/doctor/profile_req_Model.dart | 36 +-- .../request_add_referred_doctor_remarks.dart | 63 +++-- lib/models/doctor/request_doctor_reply.dart | 44 +-- lib/models/doctor/request_schedule.dart | 30 +- .../statstics_for_certain_doctor_request.dart | 19 +- lib/models/doctor/user_model.dart | 26 +- .../verify_referral_doctor_remarks.dart | 107 ++++--- lib/models/livecare/end_call_req.dart | 13 +- lib/models/livecare/get_panding_req_list.dart | 25 +- lib/models/livecare/get_pending_res_list.dart | 66 ++--- lib/models/livecare/session_status_model.dart | 14 +- lib/models/livecare/start_call_req.dart | 22 +- lib/models/livecare/start_call_res.dart | 12 +- lib/models/livecare/transfer_to_admin.dart | 20 +- .../MedicalReport/MedicalReportTemplate.dart | 52 ++-- .../MedicalReport/MeidcalReportModel.dart | 106 +++---- lib/models/patient/PatientArrivalEntity.dart | 78 +++--- .../get_clinic_by_project_id_request.dart | 27 +- .../get_doctor_by_clinic_id_request.dart | 57 ++-- ...t_list_stp_referral_frequency_request.dart | 25 +- .../patient/get_pending_patient_er_model.dart | 226 +++++++-------- .../patient/insurance_aprovals_request.dart | 37 ++- .../lab_orders/lab_orders_req_model.dart | 45 ++- .../lab_orders/lab_orders_res_model.dart | 50 ++-- lib/models/patient/lab_result/lab_result.dart | 122 ++++---- .../lab_result/lab_result_req_model.dart | 56 ++-- .../patient/my_referral/PendingReferral.dart | 82 +++--- .../patient/my_referral/clinic-doctor.dart | 173 ++++++------ .../my_referral_patient_model.dart | 200 +++++++------- .../my_referred_patient_model.dart | 260 +++++++++--------- lib/models/patient/orders_request.dart | 39 ++- lib/models/patient/patiant_info_model.dart | 184 ++++++------- ...et_patient_arrival_list_request_model.dart | 17 +- lib/models/patient/patient_model.dart | 134 +++++---- .../prescription/prescription_report.dart | 114 ++++---- .../prescription_report_for_in_patient.dart | 168 +++++------ .../prescription/prescription_req_model.dart | 71 ----- .../prescription/prescription_res_model.dart | 72 ++--- .../request_prescription_report.dart | 54 ++-- lib/models/patient/progress_note_request.dart | 39 ++- .../radiology/radiology_req_model.dart | 30 +- .../radiology/radiology_res_model.dart | 36 +-- ...st_prescription_report_for_in_patient.dart | 56 ++-- .../patient/refer_to_doctor_request.dart | 68 +++-- .../request_my_referral_patient_model.dart | 60 ++-- .../patient/topten_users_res_model.dart | 15 +- .../vital_sign/patient-vital-sign-data.dart | 113 ++++---- .../patient-vital-sign-history.dart | 7 +- .../vital_sign/vital_sign_req_model.dart | 50 ++-- .../vital_sign/vital_sign_res_model.dart | 20 +- .../pharmacies_List_request_model.dart | 25 +- .../pharmacies_items_request_model.dart | 24 +- .../sickleave/add_sickleave_request.dart | 17 +- .../sickleave/extend_sick_leave_request.dart | 11 +- .../sickleave/get_all_sickleave_response.dart | 18 +- 120 files changed, 2978 insertions(+), 3428 deletions(-) delete mode 100644 lib/models/patient/prescription/prescription_req_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index f083258d..e2de1f86 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -21,36 +21,34 @@ class BaseAppClient { {required Map body, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure, - bool isAllowAny = false,bool isLiveCare = false}) async { + bool isAllowAny = false, + bool isLiveCare = false}) async { String url; - if(isLiveCare) + if (isLiveCare) url = BASE_URL_LIVE_CARE + endPoint; else url = BASE_URL + endPoint; bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) - body['DoctorID'] = doctorProfile?.doctorID; + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) - body['EditedBy'] = doctorProfile?.doctorID; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; } - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; if (body['DoctorID'] == '') { body['DoctorID'] = null; } if (body['EditedBy'] == '') { body.remove("EditedBy"); } - if(body['TokenID'] == null){ + if (body['TokenID'] == null) { body['TokenID'] = token ?? ''; } // body['TokenID'] = "@dm!n" ?? ''; @@ -69,18 +67,16 @@ class BaseAppClient { body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { - body['VidaAuthTokenID'] = - await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); } if (body['VidaRefreshTokenID'] == null) { - body['VidaRefreshTokenID'] = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) - body['PatientOutSA'] = true; - else if(body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3) + body['PatientOutSA'] = true; + else if (body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) body['PatientOutSA'] = true; else body['PatientOutSA'] = false; @@ -92,28 +88,21 @@ class BaseAppClient { var asd2; if (await Helpers.checkConnection()) { final response = await http.post(Uri.parse(url), - body: json.encode(body), - headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }); + body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (!parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await Provider.of(AppGlobal.CONTEX, - listen: false) - .logout(); + await Provider.of(AppGlobal.CONTEX, listen: false).logout(); Helpers.showErrorToast('Your session expired Please login again'); } if (isAllowAny) { @@ -141,19 +130,15 @@ class BaseAppClient { {required Map body, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure, - required PatiantInformtion patient, + PatiantInformtion? patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; try { - Map headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }; + Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; String token = await sharedPref.getString(TOKEN); - var languageID = - await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] @@ -173,12 +158,11 @@ class BaseAppClient { : PATIENT_OUT_SA_PATIENT_REQ; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = - body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -186,7 +170,7 @@ class BaseAppClient { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE : PATIENT_TYPE; @@ -194,15 +178,13 @@ class BaseAppClient { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] - : patient.patientType != null + : patient!.patientType != null ? patient.patientType : PATIENT_TYPE_ID : PATIENT_TYPE_ID; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token; - body['PatientID'] = body['PatientID'] != null - ? body['PatientID'] - : patient.patientId ?? patient.patientMRN; + body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -217,8 +199,7 @@ class BaseAppClient { print("Body : ${json.encode(body)}"); if (await Helpers.checkConnection()) { - final response = await http.post(Uri.parse(url.trim()), - body: json.encode(body), headers: headers); + final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -230,8 +211,7 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -247,28 +227,20 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } } - } else if (parsed['MessageStatus'] == 1 || - parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && - parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && - parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", - statusCode); + onFailure("Server Error found with no available message", statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure( - parsed['message'] ?? - parsed['ErrorEndUserMessage'] ?? - parsed['ErrorMessage'], - statusCode); + onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } else { @@ -278,9 +250,7 @@ class BaseAppClient { if (parsed['message'] != null) { onFailure(parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } @@ -303,12 +273,8 @@ class BaseAppClient { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { - error = error + - parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + - "\n"; + for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { + error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; } } } diff --git a/lib/core/insurance_approval_request_model.dart b/lib/core/insurance_approval_request_model.dart index 02f71ecb..11f7804e 100644 --- a/lib/core/insurance_approval_request_model.dart +++ b/lib/core/insurance_approval_request_model.dart @@ -1,17 +1,17 @@ class InsuranceApprovalInPatientRequestModel { - int patientID; - int patientTypeID; - int eXuldAPPNO; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? eXuldAPPNO; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; InsuranceApprovalInPatientRequestModel( {this.patientID, diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index af8a3da8..7b453b9b 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,32 +1,32 @@ class RequestGetListPharmacyForPrescriptions { - int ? latitude; - int ? longitude; - double ?versionID; - int ? channel; - int ? languageID; - String ? iPAdress; - String ? generalid; - int ? patientOutSA; - String ? sessionID; - bool ?isDentalAllowedBackend; - int ? deviceTypeID; - int ? itemID; + int? latitude; + int? longitude; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? itemID; RequestGetListPharmacyForPrescriptions( {this.latitude, - this.longitude, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.itemID}); + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); - RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { latitude = json['Latitude']; longitude = json['Longitude']; versionID = json['VersionID']; @@ -41,8 +41,8 @@ class RequestGetListPharmacyForPrescriptions { itemID = json['ItemID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Latitude'] = this.latitude; data['Longitude'] = this.longitude; data['VersionID'] = this.versionID; diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index 8eeefb7a..b7ade7d4 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,46 +1,46 @@ class RequestPrescriptionReport { - double ?versionID; - int ? channel; - int ? languageID; - String ? iPAdress; - String ? generalid; - int ? patientOutSA; - String ? sessionID; - bool ?isDentalAllowedBackend; - int ? deviceTypeID; - int ? patientID; - String ? tokenID; - int ? patientTypeID; - int ? patientType; - int ? appointmentNo; - String ? setupID; - int ? episodeID; - int ? clinicID; - int ? projectID; - int ? dischargeNo; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? episodeID; + int? clinicID; + int? projectID; + int? dischargeNo; RequestPrescriptionReport( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID, - this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); - RequestPrescriptionReport.fromJson(Map json) { + RequestPrescriptionReport.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -62,8 +62,8 @@ class RequestPrescriptionReport { dischargeNo = json['DischargeNo']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index 9ed39b47..fc048a95 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,45 +1,46 @@ class RequestPrescriptionReportEnh { - double ?versionID; - int ? channel; - int ? languageID; - String ? iPAdress; - String ? generalid; - int ? patientOutSA; - String ? sessionID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; bool? isDentalAllowedBackend; - int ? deviceTypeID; - int ? patientID; - String ? tokenID; - int ? patientTypeID; - int ? patientType; - int ? appointmentNo; - String ? setupID; - int ? dischargeNo; - int ? episodeID; - int ? clinicID; - int ? projectID; + int? deviceTypeID; + int? patientID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? appointmentNo; + String? setupID; + int? dischargeNo; + int? episodeID; + int? clinicID; + int? projectID; RequestPrescriptionReportEnh( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID,this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); - RequestPrescriptionReportEnh.fromJson(Map json) { + RequestPrescriptionReportEnh.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; @@ -60,8 +61,8 @@ class RequestPrescriptionReportEnh { projectID = json['ProjectID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/procedure/Procedure_template_request_model.dart b/lib/core/model/procedure/Procedure_template_request_model.dart index a734382b..abd6a2b3 100644 --- a/lib/core/model/procedure/Procedure_template_request_model.dart +++ b/lib/core/model/procedure/Procedure_template_request_model.dart @@ -86,8 +86,8 @@ class ProcedureTempleteRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; diff --git a/lib/core/model/procedure/procedure_template_details_request_model.dart b/lib/core/model/procedure/procedure_template_details_request_model.dart index 7d48e1c8..c5504cdd 100644 --- a/lib/core/model/procedure/procedure_template_details_request_model.dart +++ b/lib/core/model/procedure/procedure_template_details_request_model.dart @@ -89,8 +89,8 @@ class ProcedureTempleteDetailsRequestModel { deviceTypeID = json['DeviceTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['TemplateID'] = this.templateID; diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index 5b7ffc05..0e0bc161 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -17,38 +17,38 @@ class ReferralRequest { int? languageID; String? stamp; String? iPAdress; - double ?versionID; + double? versionID; int? channel; String? tokenID; String? sessionID; - bool ?isLoginForDoctorApp; - bool ?patientOutSA; + bool? isLoginForDoctorApp; + bool? patientOutSA; ReferralRequest( {this.roomID, - this.referralClinic, - this.referralDoctor, - this.createdBy, - this.editedBy, - this.patientID, - this.patientTypeID, - this.referringClinic, - this.referringDoctor, - this.projectID, - this.admissionNo, - this.referringDoctorRemarks, - this.priority, - this.frequency, - this.extension, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.referralClinic, + this.referralDoctor, + this.createdBy, + this.editedBy, + this.patientID, + this.patientTypeID, + this.referringClinic, + this.referringDoctor, + this.projectID, + this.admissionNo, + this.referringDoctorRemarks, + this.priority, + this.frequency, + this.extension, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); ReferralRequest.fromJson(Map json) { roomID = json['RoomID']; @@ -77,8 +77,8 @@ class ReferralRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RoomID'] = this.roomID; data['ReferralClinic'] = this.referralClinic; data['ReferralDoctor'] = this.referralDoctor; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index ff5079b1..535836d8 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -41,8 +41,8 @@ class SickLeavePatientRequestModel { sessionID = json['SessionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index 49e89881..7771bea6 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -17,28 +17,29 @@ class AuthenticationService extends BaseService { List get dashboardItemsList => _imeiDetails; NewLoginInformationModel _loginInfo = NewLoginInformationModel(); NewLoginInformationModel get loginInfo => _loginInfo; - SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = + SendActivationCodeForDoctorAppResponseModel(); - SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => + _activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = + SendActivationCodeForDoctorAppResponseModel(); SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); + CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = + CheckActivationCodeForDoctorAppResponseModel(); - CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => + _checkActivationCodeForDoctorAppRes; Map _insertDeviceImeiRes = {}; List _doctorProfilesList = []; List get doctorProfilesList => _doctorProfilesList; - - - Future selectDeviceImei(imei) async { try { - await baseAppClient.post(SELECT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { _imeiDetails = []; response['List_DoctorDeviceDetails'].forEach((v) { _imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); @@ -49,7 +50,7 @@ class AuthenticationService extends BaseService { }, body: {"IMEI": imei, "TokenID": "@dm!n"}); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } @@ -57,8 +58,7 @@ class AuthenticationService extends BaseService { hasError = false; _loginInfo = NewLoginInformationModel(); try { - await baseAppClient.post(LOGIN_URL, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) { _loginInfo = NewLoginInformationModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -66,9 +66,8 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } - } Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async { @@ -77,88 +76,81 @@ class AuthenticationService extends BaseService { try { await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) { - _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } - } - Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel)async { + Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { hasError = false; _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, - onSuccess: (dynamic response, int statusCode) { - _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { + _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } - Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel)async { + Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { hasError = false; _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, - onSuccess: (dynamic response, int statusCode) { - _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: checkActivationCodeRequestModel.toJson()); + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { + _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } - } - - Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel)async { + Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async { hasError = false; - // insertIMEIDetailsModel.tokenID = "@dm!n"; + // insertIMEIDetailsModel.tokenID = "@dm!n"; _insertDeviceImeiRes = {}; try { - await baseAppClient.post(INSERT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { - _insertDeviceImeiRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: insertIMEIDetailsModel.toJson()); + await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { + _insertDeviceImeiRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } - Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel)async { + Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async { hasError = false; try { - await baseAppClient.post(GET_DOC_PROFILES, - onSuccess: (dynamic response, int statusCode) { - _doctorProfilesList.clear(); - response['DoctorProfileList'].forEach((v) { - _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: profileReqModel.toJson()); + await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { + _doctorProfilesList.clear(); + response['DoctorProfileList'].forEach((v) { + _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: profileReqModel.toJson()); } catch (error) { hasError = true; - super.error = error; + super.error = error as String?; } } } diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index f8a7579d..efa24209 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -4,8 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { - -List hospitals =List(); + List hospitals = []; Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 2b353016..6566a57d 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { - List myDischargedPatients = List(); + List myDischargedPatients = []; - List myDischargeReferralPatients = List(); + List myDischargeReferralPatients = []; Future getDischargedPatient() async { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -28,8 +28,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargedPatients.clear(); - await baseAppClient.post(GET_DISCHARGE_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargePatient'] != null) { response['List_MyDischargePatient'].forEach((v) { myDischargedPatients.add(PatiantInformtion.fromJson(v)); @@ -45,7 +44,7 @@ class DischargedPatientService extends BaseService { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -61,8 +60,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargeReferralPatients.clear(); - await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargeReferralPatient'] != null) { response['List_MyDischargeReferralPatient'].forEach((v) { myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 4fc25094..5b528a33 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -15,18 +15,18 @@ class LiveCarePatientServices extends BaseService { bool get isFinished => _isFinished; - setFinished(bool isFinished){ + setFinished(bool isFinished) { _isFinished = isFinished; } - var endCallResponse = {}; var transferToAdminResponse = {}; - StartCallRes _startCallRes; + late 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 +47,47 @@ 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); } -} \ No newline at end of file +} diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 536e68a7..d1ef47fa 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -4,13 +4,13 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; class MyReferralInPatientService extends BaseService { - List myReferralPatients = List(); + List myReferralPatients = []; Future getMyReferralPatientService() async { hasError = false; Map body = Map(); await getDoctorProfile(); - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -42,21 +42,17 @@ 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.projectID = referral.projectID; - _requestAddReferredDoctorRemarks.admissionNo = - referral.admissionNo.toString(); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = - referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; - _requestAddReferredDoctorRemarks.patientID = referral.patientID; - _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + _requestAddReferredDoctorRemarks.projectID = referral.projectID!; + _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; + _requestAddReferredDoctorRemarks.patientID = referral.patientID!; + _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor!; await baseAppClient.post( ADD_REFERRED_DOCTOR_REMARKS, body: _requestAddReferredDoctorRemarks.toJson(), diff --git a/lib/core/service/patient/PatientMuseService.dart b/lib/core/service/patient/PatientMuseService.dart index c34de9e0..893b6260 100644 --- a/lib/core/service/patient/PatientMuseService.dart +++ b/lib/core/service/patient/PatientMuseService.dart @@ -3,16 +3,15 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsMod import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientMuseService extends BaseService { - List patientMuseResultsModelList = List(); + List patientMuseResultsModelList = []; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { Map body = Map(); body['PatientType'] = patientType == 7 ? 1 : patientType; body['PatientOutSA'] = patientOutSA; body['PatientID'] = patientID; hasError = false; - await baseAppClient.post(GET_ECG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ECG, onSuccess: (dynamic response, int statusCode) { patientMuseResultsModelList.clear(); response['HIS_GetPatientMuseResultsList'].forEach((v) { patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 69e2a810..25469dc2 100644 --- a/lib/core/service/patient/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -4,16 +4,16 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { Future referralPatient( - {int admissionNo, - String roomID, - int referralClinic, - int referralDoctor, - int patientID, - int patientTypeID, - int priority, - int frequency, - String referringDoctorRemarks, - String extension}) async { + {int? admissionNo, + String? roomID, + int? referralClinic, + int? referralDoctor, + int? patientID, + int? patientTypeID, + int? priority, + int? frequency, + String? referringDoctorRemarks, + String? extension}) async { await getDoctorProfile(); ReferralRequest referralRequest = ReferralRequest(); referralRequest.admissionNo = admissionNo; @@ -25,11 +25,11 @@ class ReferralService extends BaseService { referralRequest.priority = priority.toString(); referralRequest.frequency = frequency.toString(); referralRequest.referringDoctorRemarks = referringDoctorRemarks; - referralRequest.referringClinic = doctorProfile.clinicID; - referralRequest.referringDoctor = doctorProfile.doctorID; + referralRequest.referringClinic = doctorProfile!.clinicID; + referralRequest.referringDoctor = doctorProfile!.doctorID; referralRequest.extension = extension; - referralRequest.editedBy = doctorProfile.doctorID; - referralRequest.createdBy = doctorProfile.doctorID; + referralRequest.editedBy = doctorProfile!.doctorID; + referralRequest.createdBy = doctorProfile!.doctorID; referralRequest.patientOutSA = false; await baseAppClient.post( diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index c83c74c9..abf3fab3 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -14,7 +14,7 @@ import '../base/lookup-service.dart'; class PatientReferralService extends LookupService { List projectsList = []; List clinicsList = []; - List doctorsList = List(); + List doctorsList = []; List listMyReferredPatientModel = []; List pendingReferralList = []; List patientReferralList = []; @@ -56,8 +56,7 @@ class PatientReferralService extends LookupService { Map body = Map(); body['isSameBranch'] = false; - await baseAppClient.post(GET_REFERRAL_FACILITIES, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async { projectsList = response['ProjectInfo']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -84,8 +83,7 @@ class PatientReferralService extends LookupService { Future getClinicsList(int projectId) async { hasError = false; - ClinicByProjectIdRequest _clinicByProjectIdRequest = - ClinicByProjectIdRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); _clinicByProjectIdRequest.projectID = projectId; await baseAppClient.post( @@ -103,11 +101,9 @@ class PatientReferralService extends LookupService { ); } - Future getDoctorsList( - PatiantInformtion patient, int clinicId, int branchId) async { + Future getDoctorsList(PatiantInformtion patient, int clinicId, int branchId) async { hasError = false; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = - DoctorsByClinicIdRequest(); + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); _doctorsByClinicIdRequest.projectID = branchId; _doctorsByClinicIdRequest.clinicID = clinicId; @@ -128,9 +124,8 @@ class PatientReferralService extends LookupService { Future getMyReferredPatient() async { hasError = false; - RequestMyReferralPatientModel _requestMyReferralPatient = - RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_PATIENT, @@ -140,8 +135,7 @@ class PatientReferralService extends LookupService { response['List_MyReferredPatient'].forEach((v) { MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); if (doctorProfile != null) { - item.isReferralDoctorSameBranch = - doctorProfile.projectID == item.projectID; + item.isReferralDoctorSameBranch = doctorProfile.projectID == item.projectID; } else { item.isReferralDoctorSameBranch = false; } @@ -159,10 +153,10 @@ class PatientReferralService extends LookupService { Future getPendingReferralList() async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); Map body = Map(); // body['ClinicID'] = 0; - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile!.doctorID; await baseAppClient.post( GET_PENDING_REFERRAL_PATIENT, @@ -171,8 +165,7 @@ class PatientReferralService extends LookupService { response['PendingReferralList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = - item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; pendingReferralList.add(item); }); }, @@ -197,8 +190,7 @@ class PatientReferralService extends LookupService { response['ReferralList']['entityList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = - item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; patientReferralList.add(item); }); }, @@ -211,10 +203,9 @@ class PatientReferralService extends LookupService { ); } - Future responseReferral( - PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { hasError = false; - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); Map body = Map(); body['PatientMRN'] = pendingReferral.patientID; @@ -224,7 +215,7 @@ class PatientReferralService extends LookupService { body['IsAccepted'] = isAccepted; body['PatientName'] = pendingReferral.patientName; body['ReferralResponse'] = pendingReferral.remarksFromSource; - body['DoctorName'] = doctorProfile.doctorName; + body['DoctorName'] = doctorProfile!.doctorName; await baseAppClient.post( RESPONSE_PENDING_REFERRAL_PATIENT, @@ -239,15 +230,14 @@ class PatientReferralService extends LookupService { ); } - 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 { hasError = false; Map body = Map(); List physiotheraphyGoalsList = []; listOfPhysiotherapyGoals.forEach((element) { - physiotheraphyGoalsList - .add({"goalId": element.id, "remarks": element.remarks}); + physiotheraphyGoalsList.add({"goalId": element.id, "remarks": element.remarks}); }); body['PatientMRN'] = patient.patientMRN ?? patient.patientId; @@ -296,8 +286,7 @@ class PatientReferralService extends LookupService { ); } - Future verifyReferralDoctorRemarks( - MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { hasError = false; Map body = Map(); diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index e0bc94a3..8648a0cc 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -4,16 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { - List inPatientList = List(); - List myInPatientList = List(); + List inPatientList = []; + List myInPatientList = []; - Future getInPatientList( - PatientSearchRequestModel requestModel, bool isMyInpatient) async { + Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID; } else { requestModel.doctorID = 0; } @@ -27,7 +26,7 @@ class PatientInPatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if(patient.doctorId == doctorProfile.doctorID){ + if (patient.doctorId == doctorProfile!.doctorID) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index e15cc8d1..8eedb7de 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -27,15 +27,12 @@ class PatientService extends BaseService { 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,13 +76,10 @@ class PatientService extends BaseService { get referalFrequancyList => _referalFrequancyList; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = - DoctorsByClinicIdRequest(); - STPReferralFrequencyRequest _referralFrequencyRequest = - STPReferralFrequencyRequest(); - ClinicByProjectIdRequest _clinicByProjectIdRequest = - ClinicByProjectIdRequest(); - ReferToDoctorRequest _referToDoctorRequest; + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); + STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); + ReferToDoctorRequest? _referToDoctorRequest; Future getPatientList(patient, patientType, {isView}) async { hasError = false; @@ -181,8 +175,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) { @@ -375,39 +368,39 @@ class PatientService extends BaseService { // TODO send the total model insted of each parameter Future referToDoctor( - {String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + {String? selectedDoctorID, + String? selectedClinicID, + int? admissionNo, + String? extension, + String? priority, + String? frequency, + String? referringDoctorRemarks, + int? patientID, + int? patientTypeID, + String? roomID, + int? projectID}) async { hasError = false; // TODO Change it to use it when we implement authentication user Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - int doctorID = doctorProfile.doctorID; - int clinicId = doctorProfile.clinicID; + DoctorProfileModel? doctorProfile = new DoctorProfileModel.fromJson(profile); + int? doctorID = doctorProfile.doctorID; + int? clinicId = doctorProfile.clinicID; _referToDoctorRequest = ReferToDoctorRequest( - projectID: projectID, - admissionNo: admissionNo, - roomID: roomID, + projectID: projectID!, + admissionNo: admissionNo!, + roomID: roomID!, referralClinic: selectedClinicID.toString(), referralDoctor: selectedDoctorID.toString(), - createdBy: doctorID, - editedBy: doctorID, - patientID: patientID, - patientTypeID: patientTypeID, - referringClinic: clinicId, + createdBy: doctorID!, + editedBy: doctorID!, + patientID: patientID!, + patientTypeID: patientTypeID!, + referringClinic: clinicId!, referringDoctor: doctorID, - referringDoctorRemarks: referringDoctorRemarks, - priority: priority, - frequency: frequency, - extension: extension, + referringDoctorRemarks: referringDoctorRemarks!, + priority: priority!, + frequency: frequency!, + extension: extension!, ); await baseAppClient.post( PATIENT_PROGRESS_NOTE_URL, @@ -416,7 +409,7 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body: _referToDoctorRequest.toJson(), + body: _referToDoctorRequest!.toJson(), ); } diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 2bb9dac7..2a1574f4 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -7,37 +7,28 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class InsuranceCardService extends BaseService { InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( - isDentalAllowedBackend: false, - patientTypeID: 1, - patientType: 1, - eXuldAPPNO: 0, - projectID: 0); - InsuranceApprovalInPatientRequestModel - _insuranceApprovalInPatientRequestModel = + isDentalAllowedBackend: false, patientTypeID: 1, patientType: 1, eXuldAPPNO: 0, projectID: 0); + InsuranceApprovalInPatientRequestModel _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel(); - List _insuranceApproval = List(); + List _insuranceApproval = []; List get insuranceApproval => _insuranceApproval; - List _insuranceApprovalInPatient = List(); - List get insuranceApprovalInPatient => - _insuranceApprovalInPatient; + List _insuranceApprovalInPatient = []; + List get insuranceApprovalInPatient => _insuranceApprovalInPatient; - Future getInsuranceApprovalInPatient({int mrn}) async { - _insuranceApprovalInPatientRequestModel = - InsuranceApprovalInPatientRequestModel( - patientID: mrn, + Future getInsuranceApprovalInPatient({int? mrn}) async { + _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel( + patientID: mrn!, patientTypeID: 1, ); hasError = false; insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_INSURANCE_IN_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_INSURANCE_IN_PATIENT, onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['List_ApprovalMain_InPatient'].forEach((prescriptions) { - insuranceApprovalInPatient - .add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); + insuranceApprovalInPatient.add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -45,8 +36,7 @@ class InsuranceCardService extends BaseService { }, body: _insuranceApprovalInPatientRequestModel.toJson()); } - Future getInsuranceApproval(PatiantInformtion patient, - {int appointmentNo, int projectId}) async { + Future getInsuranceApproval(PatiantInformtion patient, {int? appointmentNo, int? projectId}) async { hasError = false; // _cardList.clear(); // if (appointmentNo != null) { @@ -59,8 +49,8 @@ class InsuranceCardService extends BaseService { _insuranceApprovalModel.projectID = 0; // } - await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, patient: patient, + onSuccess: (dynamic response, int statusCode) { print(response['HIS_Approval_List'].length); _insuranceApproval.clear(); _insuranceApproval.length = 0; diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index c7bb9a78..4b7a2459 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -10,16 +10,15 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { - List patientLabOrdersList = List(); + List patientLabOrdersList = []; - Future getPatientLabOrdersList( - PatiantInformtion patient, bool isInpatient) async { + Future getPatientLabOrdersList(PatiantInformtion patient, bool isInpatient) async { hasError = false; Map body = Map(); String url = ""; if (isInpatient) { await getDoctorProfile(); - body['ProjectID'] = doctorProfile.projectID; + body['ProjectID'] = doctorProfile!.projectID; url = GET_PATIENT_LAB_OREDERS; } else { body['isDentalAllowedBackend'] = false; @@ -27,8 +26,7 @@ class LabsService extends BaseService { } patientLabOrdersList = []; patientLabOrdersList.clear(); - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList = []; if (!isInpatient) { response['ListPLO'].forEach((hospital) { @@ -46,19 +44,18 @@ class LabsService extends BaseService { }, body: body); } - RequestPatientLabSpecialResult _requestPatientLabSpecialResult = - RequestPatientLabSpecialResult(); + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - List patientLabSpecialResult = List(); - List labResultList = List(); - List labOrdersResultsList = List(); + List patientLabSpecialResult = []; + List labResultList = []; + List labOrdersResultsList = []; Future getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient, + {String? projectID, + int? clinicID, + String? invoiceNo, + String? orderNo, + PatiantInformtion? patient, bool isInpatient = false}) async { hasError = false; @@ -69,8 +66,8 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient!, + onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { @@ -82,29 +79,25 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabResult( - {PatientLabOrders patientLabOrder, - PatiantInformtion patient, - bool isInpatient}) async { + Future getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async { hasError = false; String url = ""; - if (isInpatient) { + if (isInpatient!) { url = GET_PATIENT_LAB_RESULTS; } else { url = GET_Patient_LAB_RESULT; } Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['InvoiceNo'] = patientLabOrder!.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient!, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; labResultList = []; @@ -127,9 +120,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + {PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -141,8 +132,8 @@ class LabsService extends BaseService { } body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; - await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient!, + onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); @@ -153,10 +144,9 @@ class LabsService extends BaseService { }, body: body); } - RequestSendLabReportEmail _requestSendLabReportEmail = - RequestSendLabReportEmail(); + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + Future sendLabReportEmail({PatientLabOrders? patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 94933d7d..14139715 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -13,12 +13,10 @@ class PatientMedicalReportService extends BaseService { Map body = Map(); await getDoctorProfile(); body['AdmissionNo'] = patient.admissionNo; - body['SetupID'] = doctorProfile.setupID; - body['ProjectID'] = doctorProfile.projectID; - - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, - onSuccess: (dynamic response, int statusCode) { + body['SetupID'] = doctorProfile!.setupID; + body['ProjectID'] = doctorProfile!.projectID; + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { medicalReportList.clear(); if (response['DAPP_ListMedicalReportList'] != null) { response['DAPP_ListMedicalReportList'].forEach((v) { @@ -38,19 +36,17 @@ class PatientMedicalReportService extends BaseService { body['SetupID'] = "91877"; body['TemplateID'] = 43; - await baseAppClient.post(PATIENT_MEDICAL_REPORT_GET_TEMPLATE, - onSuccess: (dynamic response, int statusCode) { - - medicalReportTemplate.clear(); - if (response['DAPP_GetTemplateByIDList'] != null) { - response['DAPP_GetTemplateByIDList'].forEach((v) { - medicalReportTemplate.add(MedicalReportTemplate.fromJson(v)); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body); + await baseAppClient.post(PATIENT_MEDICAL_REPORT_GET_TEMPLATE, onSuccess: (dynamic response, int statusCode) { + medicalReportTemplate.clear(); + if (response['DAPP_GetTemplateByIDList'] != null) { + response['DAPP_GetTemplateByIDList'].forEach((v) { + medicalReportTemplate.add(MedicalReportTemplate.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body); } Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { @@ -61,13 +57,11 @@ class PatientMedicalReportService extends BaseService { body['AdmissionNo'] = patient.admissionNo; body['MedicalReportHTML'] = htmlText; - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_INSERT, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body, patient: patient); + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_INSERT, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); } Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport) async { @@ -79,12 +73,10 @@ class PatientMedicalReportService extends BaseService { body['InvoiceNo'] = medicalReport.invoiceNo; body['LineItemNo'] = medicalReport.lineItemNo; - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_VERIFIED, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body, patient: patient); + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_VERIFIED, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); } } diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 42cdafc6..295d38ac 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/medical_report/medical_file_reques import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { - List _medicalFileList = List(); + List _medicalFileList = []; List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( @@ -13,15 +13,13 @@ class MedicalFileService extends BaseService { "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", ); - Future getMedicalFile({int mrn}) async { + Future getMedicalFile({int? mrn}) async { _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); _fileRequestModel.iPAdress = "9.9.9.9"; hasError = false; _medicalFileList.clear(); - await baseAppClient.post(GET_MEDICAL_FILE, - onSuccess: (dynamic response, int statusCode) { - _medicalFileList - .add(MedicalFileModel.fromJson(response['PatientFileList'])); + await baseAppClient.post(GET_MEDICAL_FILE, onSuccess: (dynamic response, int statusCode) { + _medicalFileList.add(MedicalFileModel.fromJson(response['PatientFileList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index ffbcae9b..96399156 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -16,9 +16,9 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionService extends LookupService { - List _prescriptionList = List(); + List _prescriptionList = []; List get prescriptionList => _prescriptionList; - List _drugsList = List(); + List _drugsList = []; List get drugsList => _drugsList; List doctorsList = []; List allMedicationList = []; @@ -31,27 +31,22 @@ class PrescriptionService extends LookupService { dynamic boxQuantity; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); - ItemByMedicineRequestModel _itemByMedicineRequestModel = - ItemByMedicineRequestModel(); + ItemByMedicineRequestModel _itemByMedicineRequestModel = ItemByMedicineRequestModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( //search: ["Acetaminophen"], search: ["Amoxicillin"], ); - CalculateBoxQuantityRequestModel _boxQuantityRequestModel = - CalculateBoxQuantityRequestModel(); + CalculateBoxQuantityRequestModel _boxQuantityRequestModel = CalculateBoxQuantityRequestModel(); - PostPrescriptionReqModel _postPrescriptionReqModel = - PostPrescriptionReqModel(); + PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); - Future getItem({int itemID}) async { - _itemByMedicineRequestModel = - ItemByMedicineRequestModel(medicineCode: itemID); + Future getItem({int? itemID}) async { + _itemByMedicineRequestModel = ItemByMedicineRequestModel(medicineCode: itemID); hasError = false; - await baseAppClient.post(GET_ITEM_BY_MEDICINE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ITEM_BY_MEDICINE, onSuccess: (dynamic response, int statusCode) { itemMedicineList = []; itemMedicineList = response['listItemByMedicineCode']['frequencies']; itemMedicineListRoute = response['listItemByMedicineCode']['routes']; @@ -62,11 +57,9 @@ class PrescriptionService extends LookupService { }, body: _itemByMedicineRequestModel.toJson()); } - Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -78,29 +71,26 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, ); hasError = false; _prescriptionList.clear(); - await baseAppClient.post(GET_PRESCRIPTION_LIST, - onSuccess: (dynamic response, int statusCode) { - _prescriptionList - .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { + _prescriptionList.add(PrescriptionModel.fromJson(response['PrescriptionList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _prescriptionReqModel.toJson()); } - Future getDrugs({String drugName}) async { - _drugRequestModel = SearchDrugRequestModel(search: [drugName]); + Future getDrugs({String? drugName}) async { + _drugRequestModel = SearchDrugRequestModel(search: [drugName!]); hasError = false; - await baseAppClient.post(SEARCH_DRUG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { doctorsList = []; doctorsList = response['MedicationList']['entityList']; }, onFailure: (String error, int statusCode) { @@ -112,8 +102,7 @@ class PrescriptionService extends LookupService { Future getMedicationList({String drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; - await baseAppClient.post(SEARCH_DRUG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { allMedicationList = []; response['MedicationList']['entityList'].forEach((v) { allMedicationList.add(GetMedicationResponseModel.fromJson(v)); @@ -124,8 +113,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future postPrescription( - PostPrescriptionReqModel postProcedureReqModel) async { + Future postPrescription(PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -141,8 +129,7 @@ class PrescriptionService extends LookupService { ); } - Future updatePrescription( - PostPrescriptionReqModel updatePrescriptionReqModel) async { + Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -158,12 +145,8 @@ class PrescriptionService extends LookupService { ); } - Future getDrugToDrug( - VitalSignData vital, - List lstAssessments, - List allergy, - PatiantInformtion patient, - List prescription) async { + Future getDrugToDrug(VitalSignData vital, List lstAssessments, + List allergy, PatiantInformtion patient, List prescription) async { // Map request = { // "Prescription": { // "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, @@ -218,8 +201,7 @@ class PrescriptionService extends LookupService { "Prescription": { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', - "Age": AppDateUtils.convertDateFromServerFormat( - patient.dateofBirth, 'dd/MM/yyyy') + "Age": AppDateUtils.convertDateFromServerFormat(patient.dateofBirth!, 'dd/MM/yyyy') }, "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, "objPrescriptionItems": prescription, @@ -231,29 +213,22 @@ class PrescriptionService extends LookupService { }; hasError = false; - await baseAppClient.post(DRUG_TO_DRUG, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(DRUG_TO_DRUG, onSuccess: (dynamic response, int statusCode) { drugToDrug = []; - drugToDrug = - response['DrugToDrugResponse']['objPrescriptionCheckerResult']; + drugToDrug = response['DrugToDrugResponse']['objPrescriptionCheckerResult']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: request); } - Future calculateBoxQuantity( - {int freq, int duration, int itemCode, double strength}) async { - _boxQuantityRequestModel = CalculateBoxQuantityRequestModel( - frequency: freq, - duration: duration, - itemCode: itemCode, - strength: strength); + Future calculateBoxQuantity({int? freq, int? duration, int? itemCode, double? strength}) async { + _boxQuantityRequestModel = + CalculateBoxQuantityRequestModel(frequency: freq, duration: duration, itemCode: itemCode, strength: strength); hasError = false; - await baseAppClient.post(GET_BOX_QUANTITY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_BOX_QUANTITY, onSuccess: (dynamic response, int statusCode) { boxQuantity = response['BoxQuantity']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -265,10 +240,7 @@ class PrescriptionService extends LookupService { var allergiesObj = []; allergies.forEach((element) { allergiesObj.add({ - "objProperties": { - 'Id': element.allergyDiseaseId, - 'Name': element.allergyDiseaseName - } + "objProperties": {'Id': element.allergyDiseaseId, 'Name': element.allergyDiseaseName} }); }); return allergiesObj; diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index eb860141..83fc9fd3 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -15,14 +15,13 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { - List prescriptionsList = List(); - List prescriptionsOrderList = List(); - List prescriptionInPatientList = List(); + List prescriptionsList = []; + List prescriptionsOrderList = []; + List prescriptionInPatientList = []; - InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = - InPatientPrescriptionRequestModel(); + InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(); - Future getPrescriptionInPatient({int mrn, String adn}) async { + Future getPrescriptionInPatient({int? mrn, String? adn}) async { _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( patientMRN: mrn, admissionNo: adn, @@ -30,12 +29,10 @@ class PrescriptionsService extends BaseService { hasError = false; prescriptionInPatientList.clear(); - await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, onSuccess: (dynamic response, int statusCode) { prescriptionsList.clear(); response['List_PrescriptionReportForInPatient'].forEach((prescriptions) { - prescriptionInPatientList - .add(PrescriotionInPatient.fromJson(prescriptions)); + prescriptionInPatientList.add(PrescriotionInPatient.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -47,8 +44,7 @@ class PrescriptionsService extends BaseService { hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((prescriptions) { prescriptionsList.add(Prescriptions.fromJson(prescriptions)); @@ -60,15 +56,12 @@ class PrescriptionsService extends BaseService { } RequestPrescriptionReport _requestPrescriptionReport = - RequestPrescriptionReport( - appointmentNo: 0, isDentalAllowedBackend: false); - List prescriptionReportList = List(); + RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false); + List prescriptionReportList = []; - Future getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + Future getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { hasError = false; - _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.dischargeNo = prescriptions!.dischargeNo; _requestPrescriptionReport.projectID = prescriptions.projectID; _requestPrescriptionReport.clinicID = prescriptions.clinicID; _requestPrescriptionReport.setupID = prescriptions.setupID; @@ -76,23 +69,18 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; await baseAppClient.postPatient( - prescriptions.isInOutPatient - ? GET_PRESCRIPTION_REPORT_ENH - : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { + prescriptions.isInOutPatient! ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient!, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); prescriptionReportEnhList.clear(); - if (prescriptions.isInOutPatient) { + if (prescriptions.isInOutPatient!) { response['ListPRM'].forEach((prescriptions) { - prescriptionReportList - .add(PrescriptionReport.fromJson(prescriptions)); - prescriptionReportEnhList - .add(PrescriptionReportEnh.fromJson(prescriptions)); + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); }); } else { response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - prescriptionReportList - .add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); }); } }, onFailure: (String error, int statusCode) { @@ -101,25 +89,22 @@ class PrescriptionsService extends BaseService { }, body: _requestPrescriptionReport.toJson()); } - RequestGetListPharmacyForPrescriptions - requestGetListPharmacyForPrescriptions = + RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions( latitude: 0, longitude: 0, isDentalAllowedBackend: false, ); - List pharmacyPrescriptionsList = List(); + List pharmacyPrescriptionsList = []; - Future getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + Future getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, + await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient!, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); response['PharmList'].forEach((prescriptions) { - pharmacyPrescriptionsList - .add(PharmacyPrescriptions.fromJson(prescriptions)); + pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -127,39 +112,36 @@ class PrescriptionsService extends BaseService { }, body: requestGetListPharmacyForPrescriptions.toJson()); } - RequestPrescriptionReportEnh _requestPrescriptionReportEnh = - RequestPrescriptionReportEnh( + RequestPrescriptionReportEnh _requestPrescriptionReportEnh = RequestPrescriptionReportEnh( isDentalAllowedBackend: false, ); - List prescriptionReportEnhList = List(); + List prescriptionReportEnhList = []; Future getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + {PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { ///This logic copy from the old app from class [order-history.component.ts] in line 45 bool isInPatient = false; prescriptionsList.forEach((element) { - if (prescriptionsOrder.appointmentNo == "0") { - if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { + if (prescriptionsOrder!.appointmentNo == "0") { + if (element.dischargeNo == int.parse(prescriptionsOrder!.dischargeID)) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.projectID = element.projectID; _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; + isInPatient = element.isInOutPatient!; } } else { - if (int.parse(prescriptionsOrder.appointmentNo) == - element.appointmentNo) { + if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.projectID = element.projectID; _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; + isInPatient = element.isInOutPatient!; ///call inpGetPrescriptionReport } @@ -168,20 +150,17 @@ class PrescriptionsService extends BaseService { hasError = false; - await baseAppClient.postPatient( - isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient!, onSuccess: (dynamic response, int statusCode) { prescriptionReportEnhList.clear(); if (isInPatient) { response['ListPRM'].forEach((prescriptions) { - prescriptionReportEnhList - .add(PrescriptionReportEnh.fromJson(prescriptions)); + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); }); } else { response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - PrescriptionReportEnh reportEnh = - PrescriptionReportEnh.fromJson(prescriptions); + PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions); reportEnh.itemDescription = prescriptions['ItemDescriptionN']; prescriptionReportEnhList.add(reportEnh); }); @@ -195,13 +174,10 @@ class PrescriptionsService extends BaseService { Future getPrescriptionsOrders() async { Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) { prescriptionsOrderList.clear(); - response['PatientER_GetPatientAllPresOrdersList'] - .forEach((prescriptionsOrder) { - prescriptionsOrderList - .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) { + prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder)); }); }, onFailure: (String error, int statusCode) { hasError = true; 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..6a757986 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -14,30 +14,26 @@ import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ProcedureService extends BaseService { - List _procedureList = List(); + List _procedureList = []; List get procedureList => _procedureList; - List _valadteProcedureList = List(); + List _valadteProcedureList = []; List get valadteProcedureList => _valadteProcedureList; - List _categoriesList = List(); + List _categoriesList = []; List get categoriesList => _categoriesList; - List procedureslist = List(); + List procedureslist = []; List categoryList = []; // List _templateList = List(); // List get templateList => _templateList; - List templateList = List(); + List templateList = []; - List _templateDetailsList = List(); - List get templateDetailsList => - _templateDetailsList; + List _templateDetailsList = []; + List get templateDetailsList => _templateDetailsList; - GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = - GetOrderedProcedureRequestModel(); + GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(); - ProcedureTempleteRequestModel _procedureTempleteRequestModel = - ProcedureTempleteRequestModel(); - ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = - ProcedureTempleteDetailsRequestModel(); + ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel(); + ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(); GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( // clinicId: 17, @@ -63,8 +59,7 @@ class ProcedureService extends BaseService { //search: ["DENTAL"], ); - Future getProcedureTemplate( - {int doctorId, int projectId, int clinicId, String categoryID}) async { + Future getProcedureTemplate({int? doctorId, int? projectId, int? clinicId, String? categoryID}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( tokenID: "@dm!n", patientID: 0, @@ -72,19 +67,18 @@ class ProcedureService extends BaseService { ); hasError = false; - await baseAppClient.post(GET_TEMPLETE_LIST/*GET_PROCEDURE_TEMPLETE*/, + await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/, onSuccess: (dynamic response, int statusCode) { - templateList.clear(); + templateList.clear(); response['DAPP_TemplateGetList'].forEach((template) { ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); - if(categoryID != null){ - if(categoryID == templateElement.categoryID){ + if (categoryID != null) { + if (categoryID == templateElement.categoryID) { templateList.add(templateElement); } } else { templateList.add(templateElement); } - }); // response['HIS_ProcedureTemplateList'].forEach((template) { // _templateList.add(ProcedureTempleteModel.fromJson(template)); @@ -95,21 +89,17 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteRequestModel.toJson()); } - Future getProcedureTemplateDetails( - {int doctorId, int projectId, int clinicId, int templateId}) async { + Future getProcedureTemplateDetails({int? doctorId, int? projectId, int? clinicId, int? templateId}) async { _procedureTempleteDetailsRequestModel = - ProcedureTempleteDetailsRequestModel( - templateID: templateId, searchType: 1, patientID: 0); + ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0); hasError = false; //insuranceApprovalInPatient.clear(); _templateDetailsList.clear(); - await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['HIS_ProcedureTemplateDetailsList'].forEach((template) { - _templateDetailsList - .add(ProcedureTempleteDetailsModel.fromJson(template)); + _templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -117,15 +107,12 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int mrn}) async { - _getOrderedProcedureRequestModel = - GetOrderedProcedureRequestModel(patientMRN: mrn); + Future getProcedure({int? mrn}) async { + _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(patientMRN: mrn); hasError = false; _procedureList.clear(); - await baseAppClient.post(GET_PROCEDURE_LIST, - onSuccess: (dynamic response, int statusCode) { - _procedureList.add( - GetOrderedProcedureModel.fromJson(response['OrderedProcedureList'])); + await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { + _procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -135,8 +122,7 @@ class ProcedureService extends BaseService { Future getCategory() async { hasError = false; - await baseAppClient.post(GET_LIST_CATEGORISE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) { categoryList = []; categoryList = response['listProcedureCategories']['entityList']; }, onFailure: (String error, int statusCode) { @@ -145,7 +131,7 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String categoryName, String categoryID,patientId}) async { + Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( search: ["$categoryName"], patientMRN: patientId, @@ -156,10 +142,8 @@ class ProcedureService extends BaseService { ); hasError = false; _categoriesList.clear(); - await baseAppClient.post(GET_CATEGORISE_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { - _categoriesList - .add(CategoriseProcedureModel.fromJson(response['ProcedureList'])); + await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) { + _categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -169,8 +153,7 @@ class ProcedureService extends BaseService { Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { hasError = false; _procedureList.clear(); - await baseAppClient.post(POST_PROCEDURE_LIST, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -178,12 +161,10 @@ class ProcedureService extends BaseService { }, body: postProcedureReqModel.toJson()); } - Future updateProcedure( - UpdateProcedureRequestModel updateProcedureRequestModel) async { + Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async { hasError = false; _procedureList.clear(); - await baseAppClient.post(UPDATE_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) { print("ACCEPTED"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -191,14 +172,11 @@ class ProcedureService extends BaseService { }, body: updateProcedureRequestModel.toJson()); } - Future valadteProcedure( - ProcedureValadteRequestModel procedureValadteRequestModel) async { + Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async { hasError = false; _valadteProcedureList.clear(); - await baseAppClient.post(GET_PROCEDURE_VALIDATION, - onSuccess: (dynamic response, int statusCode) { - _valadteProcedureList.add( - ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); + await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) { + _valadteProcedureList.add(ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; 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..771ee179 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -6,21 +6,17 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class RadiologyService extends BaseService { - List finalRadiologyList = List(); + List finalRadiologyList = []; String url = ''; - Future getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + Future getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient!, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { @@ -29,8 +25,7 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { String url = GET_PATIENT_ORDERS; final Map body = new Map(); if (isInPatient) { @@ -39,8 +34,7 @@ class RadiologyService extends BaseService { } hasError = false; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { finalRadiologyList = []; String label = "ListRAD"; if (isInPatient) { diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 8113c9a7..63b5d82a 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -16,13 +16,12 @@ class SickLeaveService extends BaseService { List get getReasons => reasonse; List reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = List(); + List _getAllsickLeave = []; List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; - List get getAllRescheduleLeave => - _getReScheduleLeave; + List get getAllRescheduleLeave => _getReScheduleLeave; List _getReScheduleLeave = []; dynamic get postReschedule => _postReschedule; dynamic _postReschedule; @@ -30,10 +29,9 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; - List getAllSickLeavePatient = List(); + List getAllSickLeavePatient = []; - SickLeavePatientRequestModel _sickLeavePatientRequestModel = - SickLeavePatientRequestModel(); + SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); Future getStatistics(appoNo, patientMRN) async { hasError = false; @@ -73,8 +71,7 @@ class SickLeaveService extends BaseService { Future extendSickLeave(GetAllSickLeaveResponse request) async { var extendSickLeaveRequest = ExtendSickLeaveRequest(); - extendSickLeaveRequest.patientMRN = - request.patientMRN.toString(); //'3120746'; + extendSickLeaveRequest.patientMRN = request.patientMRN.toString(); //'3120746'; extendSickLeaveRequest.previousRequestNo = request.requestNo.toString(); extendSickLeaveRequest.noOfDays = request.noOfDays.toString(); extendSickLeaveRequest.remarks = request.remarks; @@ -114,8 +111,8 @@ class SickLeaveService extends BaseService { } Future getSickLeavePatient(patientMRN) async { - _sickLeavePatientRequestModel = SickLeavePatientRequestModel( - patientID: patientMRN, patientTypeID: 2, patientType: 1); + _sickLeavePatientRequestModel = + SickLeavePatientRequestModel(patientID: patientMRN, patientTypeID: 2, patientType: 1); hasError = false; getAllSickLeavePatient = []; getAllSickLeavePatient.clear(); diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index b2e0d603..588dd904 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -32,7 +32,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; - int episodeID; + int? episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -53,8 +53,7 @@ class SOAPService extends LookupService { Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { hasError = false; - await baseAppClient.post(POST_EPISODE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { print("Success"); episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) { @@ -66,8 +65,7 @@ class SOAPService extends LookupService { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; - await baseAppClient.post(POST_ALLERGY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -75,11 +73,9 @@ class SOAPService extends LookupService { }, body: postAllergyRequestModel.toJson()); } - Future postHistories( - PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(POST_HISTORY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -87,11 +83,9 @@ class SOAPService extends LookupService { }, body: postHistoriesRequestModel.toJson()); } - Future postChiefComplaint( - PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; - await baseAppClient.post(POST_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -99,11 +93,9 @@ class SOAPService extends LookupService { }, body: postChiefComplaintRequestModel.toJson()); } - Future postPhysicalExam( - PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { hasError = false; - await baseAppClient.post(POST_PHYSICAL_EXAM, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -111,11 +103,9 @@ class SOAPService extends LookupService { }, body: postPhysicalExamRequestModel.toJson()); } - Future postProgressNote( - PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(POST_PROGRESS_NOTE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -123,11 +113,9 @@ class SOAPService extends LookupService { }, body: postProgressNoteRequestModel.toJson()); } - Future postAssessment( - PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(POST_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -138,8 +126,7 @@ class SOAPService extends LookupService { Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ALLERGY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -147,11 +134,9 @@ class SOAPService extends LookupService { }, body: patchAllergyRequestModel.toJson()); } - Future patchHistories( - PostHistoriesRequestModel patchHistoriesRequestModel) async { + Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_HISTORY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -159,11 +144,9 @@ class SOAPService extends LookupService { }, body: patchHistoriesRequestModel.toJson()); } - Future patchChiefComplaint( - PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -171,11 +154,9 @@ class SOAPService extends LookupService { }, body: patchChiefComplaintRequestModel.toJson()); } - Future patchPhysicalExam( - PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PHYSICAL_EXAM, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -183,11 +164,9 @@ class SOAPService extends LookupService { }, body: patchPhysicalExamRequestModel.toJson()); } - Future patchProgressNote( - PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PROGRESS_NOTE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -195,11 +174,9 @@ class SOAPService extends LookupService { }, body: patchProgressNoteRequestModel.toJson()); } - Future patchAssessment( - PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -210,8 +187,7 @@ class SOAPService extends LookupService { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post(GET_ALLERGY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAllergiesList.clear(); @@ -224,11 +200,9 @@ class SOAPService extends LookupService { }, body: generalGetReqForSOAP.toJson()); } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, - {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { hasError = false; - await baseAppClient.post(GET_HISTORY, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); if (isFirst) patientHistoryList.clear(); response['List_History']['entityList'].forEach((v) { @@ -240,11 +214,9 @@ class SOAPService extends LookupService { }, body: getHistoryReqModel.toJson()); } - Future getPatientChiefComplaint( - GetChiefComplaintReqModel getChiefComplaintReqModel) async { + Future getPatientChiefComplaint(GetChiefComplaintReqModel getChiefComplaintReqModel) async { hasError = false; - await baseAppClient.post(GET_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientChiefComplaintList.clear(); response['List_ChiefComplaint']['entityList'].forEach((v) { @@ -256,11 +228,9 @@ class SOAPService extends LookupService { }, body: getChiefComplaintReqModel.toJson()); } - Future getPatientPhysicalExam( - GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { hasError = false; - await baseAppClient.post(GET_PHYSICAL_EXAM, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { patientPhysicalExamList.clear(); response['PhysicalExamList']['entityList'].forEach((v) { patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); @@ -271,11 +241,9 @@ class SOAPService extends LookupService { }, body: getPhysicalExamReqModel.toJson()); } - Future getPatientProgressNote( - GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { hasError = false; - await baseAppClient.post(GET_PROGRESS_NOTE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { print("Success"); patientProgressNoteList.clear(); response['ProgressNoteList']['entityList'].forEach((v) { @@ -287,11 +255,9 @@ class SOAPService extends LookupService { }, body: getGetProgressNoteReqModel.toJson()); } - Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 22f53226..84162053 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -12,18 +12,17 @@ class UcafService extends LookupService { List patientVitalSignsHistory = []; List patientAssessmentList = []; List orderProcedureList = []; - PrescriptionModel prescriptionList; + PrescriptionModel? prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientMRN ; + body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - body['EpisodeID'] = patient.episodeNo ; + body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - await baseAppClient.post(GET_CHIEF_COMPLAINT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientChiefComplaintList.clear(); response['List_ChiefComplaint']['entityList'].forEach((v) { @@ -35,8 +34,7 @@ class UcafService extends LookupService { }, body: body); } - Future getInPatientVitalSignHistory( - PatiantInformtion patient, bool isInPatient) async { + Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; @@ -65,8 +63,7 @@ class UcafService extends LookupService { ); } - Future getPatientVitalSignsHistory( - PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientId; // patient.patientMRN @@ -104,8 +101,7 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ASSESSMENT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -127,10 +123,8 @@ class UcafService extends LookupService { hasError = false; prescriptionList = null; - await baseAppClient.post(GET_PRESCRIPTION_LIST, - onSuccess: (dynamic response, int statusCode) { - prescriptionList = - PrescriptionModel.fromJson(response['PrescriptionList']); + await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { + prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -144,8 +138,7 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ORDER_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ORDER_PROCEDURE, onSuccess: (dynamic response, int statusCode) { print("Success"); orderProcedureList.clear(); response['OrderedProcedureList']['entityList'].forEach((v) { @@ -163,8 +156,7 @@ class UcafService extends LookupService { body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - await baseAppClient.post(POST_UCAF, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_UCAF, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart index 1c07aa48..a6bf9649 100644 --- a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart +++ b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class VitalSignsService extends BaseService { - VitalSignData patientVitalSigns; + VitalSignData? patientVitalSigns; List patientVitalSignsHistory = []; Future getPatientVitalSign(PatiantInformtion patient) async { @@ -21,8 +21,7 @@ class VitalSignsService extends BaseService { if (response['VitalSignsList'] != null) { if (response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0) { - patientVitalSigns = VitalSignData.fromJson( - response['VitalSignsList']['entityList'][0]); + patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); } } }, @@ -34,8 +33,7 @@ class VitalSignsService extends BaseService { ); } - Future getPatientVitalSignsHistory( - PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { patientVitalSigns = null; hasError = false; Map body = Map(); @@ -54,14 +52,14 @@ class VitalSignsService extends BaseService { body['ProjectID'] = patient.projectId; } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -84,22 +82,16 @@ class VitalSignsService extends BaseService { // body['InOutPatientType'] = 2; // } - - await baseAppClient.postPatient( - GET_PATIENT_VITAL_SIGN, - onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - });} - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, - body: body, - patient: patient - ); + await baseAppClient.postPatient(GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); } } diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index a73be2e3..2c375a7a 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// * MFG Labs, Copyright (C) 2012 by Daniel Bruce /// Author: MFG Labs /// License: SIL (http://scripts.sil.org/OFL) @@ -23,8 +23,8 @@ import 'package:flutter/widgets.dart'; class DoctorApp { DoctorApp._(); - static const _kFontFam = 'DoctorApp'; - static const String _kFontPkg = null; + static const _kFontFam = 'DoctorApp'; + static const String? _kFontPkg = null; static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); @@ -192,6 +192,7 @@ class DoctorApp { static const IconData verify_finger = IconData(0xe8a4, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_whtsapp = IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_sms = IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); + /// static const IconData 124 = IconData(0xe8a7, fontFamily: _kFontFam, fontPackage: _kFontPkg); ///static const IconData 123 = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData obese_bmi_r_1 = IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/models/SOAP/Allergy_model.dart index c3493832..3e0e9cbc 100644 --- a/lib/models/SOAP/Allergy_model.dart +++ b/lib/models/SOAP/Allergy_model.dart @@ -1,32 +1,32 @@ class AllergyModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; AllergyModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName}); - AllergyModel.fromJson(Map json) { + AllergyModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; allergyDiseaseName = json['allergyDiseaseName']; allergyDiseaseType = json['allergyDiseaseType']; @@ -41,8 +41,8 @@ class AllergyModel { severityName = json['severityName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allergyDiseaseId'] = this.allergyDiseaseId; data['allergyDiseaseName'] = this.allergyDiseaseName; data['allergyDiseaseType'] = this.allergyDiseaseType; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 80188dfe..878205fc 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -1,12 +1,11 @@ class GetChiefComplaintReqModel { - int patientMRN; - int appointmentNo; - int episodeId; - int episodeID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + int? episodeID; dynamic doctorID; - GetChiefComplaintReqModel( - {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); + GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -14,8 +13,7 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; - -} + } Map toJson() { final Map data = new Map(); diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart index 85ada324..f8a48ed0 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -1,32 +1,32 @@ class GetChiefComplaintResModel { - int appointmentNo; - String ccdate; - String chiefComplaint; - String clinicDescription; - int clinicID; - String currentMedication; - int doctorID; - String doctorName; - int episodeId; - String hopi; - int patientMRN; - int status; + int? appointmentNo; + String? ccdate; + String? chiefComplaint; + String? clinicDescription; + int? clinicID; + String? currentMedication; + int? doctorID; + String? doctorName; + int? episodeId; + String? hopi; + int? patientMRN; + int? status; GetChiefComplaintResModel( {this.appointmentNo, - this.ccdate, - this.chiefComplaint, - this.clinicDescription, - this.clinicID, - this.currentMedication, - this.doctorID, - this.doctorName, - this.episodeId, - this.hopi, - this.patientMRN, - this.status}); + this.ccdate, + this.chiefComplaint, + this.clinicDescription, + this.clinicID, + this.currentMedication, + this.doctorID, + this.doctorName, + this.episodeId, + this.hopi, + this.patientMRN, + this.status}); - GetChiefComplaintResModel.fromJson(Map json) { + GetChiefComplaintResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; ccdate = json['ccdate']; chiefComplaint = json['chiefComplaint']; @@ -41,8 +41,8 @@ class GetChiefComplaintResModel { status = json['status']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; data['ccdate'] = this.ccdate; data['chiefComplaint'] = this.chiefComplaint; diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 70e76313..65ba7d6b 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -1,7 +1,7 @@ class GeneralGetReqForSOAP { - int patientMRN; - int appointmentNo; - int episodeId; + int? patientMRN; + int? appointmentNo; + int? episodeId; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart index 1eeca63e..745b169a 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -1,31 +1,32 @@ class GetAllergiesResModel { - int allergyDiseaseId; - String allergyDiseaseName; - int allergyDiseaseType; - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - int episodeID; - bool isChecked; - bool isUpdatedByNurse; - int severity; - String severityName; - String remarks; + int? allergyDiseaseId; + String? allergyDiseaseName; + int? allergyDiseaseType; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + int? episodeID; + bool? isChecked; + bool? isUpdatedByNurse; + int? severity; + String? severityName; + String? remarks; GetAllergiesResModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName, this.remarks=''}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName, + this.remarks = ''}); GetAllergiesResModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index 965382b5..fffe4f92 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -1,22 +1,22 @@ class GetAssessmentReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; GetAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/models/SOAP/GetAssessmentResModel.dart index 4d1b1b68..fb92f994 100644 --- a/lib/models/SOAP/GetAssessmentResModel.dart +++ b/lib/models/SOAP/GetAssessmentResModel.dart @@ -1,36 +1,36 @@ class GetAssessmentResModel { - int appointmentNo; - String asciiDesc; - String clinicDescription; - int clinicID; - bool complexDiagnosis; - int conditionID; - int createdBy; - String createdOn; - int diagnosisTypeID; - int doctorID; - String doctorName; - int episodeId; - String icdCode10ID; - int patientMRN; - String remarks; + int? appointmentNo; + String? asciiDesc; + String? clinicDescription; + int? clinicID; + bool? complexDiagnosis; + int? conditionID; + int? createdBy; + String? createdOn; + int? diagnosisTypeID; + int? doctorID; + String? doctorName; + int? episodeId; + String? icdCode10ID; + int? patientMRN; + String? remarks; GetAssessmentResModel( {this.appointmentNo, - this.asciiDesc, - this.clinicDescription, - this.clinicID, - this.complexDiagnosis, - this.conditionID, - this.createdBy, - this.createdOn, - this.diagnosisTypeID, - this.doctorID, - this.doctorName, - this.episodeId, - this.icdCode10ID, - this.patientMRN, - this.remarks}); + this.asciiDesc, + this.clinicDescription, + this.clinicID, + this.complexDiagnosis, + this.conditionID, + this.createdBy, + this.createdOn, + this.diagnosisTypeID, + this.doctorID, + this.doctorName, + this.episodeId, + this.icdCode10ID, + this.patientMRN, + this.remarks}); GetAssessmentResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 1da4a8bf..0a36bb94 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -1,22 +1,22 @@ class GetGetProgressNoteReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; - int clinicID; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; + int? clinicID; dynamic doctorID; dynamic editedBy; GetGetProgressNoteReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetGetProgressNoteReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -27,7 +27,6 @@ class GetGetProgressNoteReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; - } Map toJson() { diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index 4ae7ed8c..e5923ac8 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,28 +1,28 @@ -class GetPatientProgressNoteResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - String dName; - String editedByName; - String editedOn; - int episodeId; - String mName; - int patientMRN; - String planNote; +class GetPatientProgressNoteResModel { + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + String? dName; + String? editedByName; + String? editedOn; + int? episodeId; + String? mName; + int? patientMRN; + String? planNote; GetPatientProgressNoteResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.dName, - this.editedByName, - this.editedOn, - this.episodeId, - this.mName, - this.patientMRN, - this.planNote}); + this.createdBy, + this.createdByName, + this.createdOn, + this.dName, + this.editedByName, + this.editedOn, + this.episodeId, + this.mName, + this.patientMRN, + this.planNote}); GetPatientProgressNoteResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 720b6342..b4a5f404 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -1,11 +1,11 @@ class GetHistoryReqModel { - int patientMRN; - int historyType; - String episodeID; - String from; - String to; - int clinicID; - int appointmentNo; + int? patientMRN; + int? historyType; + String? episodeID; + String? from; + String? to; + int? clinicID; + int? appointmentNo; dynamic editedBy; dynamic doctorID; @@ -30,7 +30,6 @@ class GetHistoryReqModel { doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; editedBy = json['EditedBy']; - } Map toJson() { diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/models/SOAP/GetHistoryResModel.dart index c4b4f129..9773aea8 100644 --- a/lib/models/SOAP/GetHistoryResModel.dart +++ b/lib/models/SOAP/GetHistoryResModel.dart @@ -1,20 +1,20 @@ class GetHistoryResModel { - int appointmentNo; - int episodeId; - int historyId; - int historyType; - bool isChecked; - int patientMRN; - String remarks; + int? appointmentNo; + int? episodeId; + int? historyId; + int? historyType; + bool? isChecked; + int? patientMRN; + String? remarks; GetHistoryResModel( {this.appointmentNo, - this.episodeId, - this.historyId, - this.historyType, - this.isChecked, - this.patientMRN, - this.remarks}); + this.episodeId, + this.historyId, + this.historyType, + this.isChecked, + this.patientMRN, + this.remarks}); GetHistoryResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index c97189b1..952e3a5c 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,44 +1,44 @@ class GetPhysicalExamResModel { - int appointmentNo; - int createdBy; - String createdByName; - String createdOn; - Null editedBy; - String editedByName; - String editedOn; - int episodeId; - int examId; - String examName; - int examType; - int examinationType; - String examinationTypeName; - bool isAbnormal; - bool isNew; - bool isNormal; - bool notExamined; - int patientMRN; - String remarks; + int? appointmentNo; + int? createdBy; + String? createdByName; + String? createdOn; + dynamic editedBy; + String? editedByName; + String? editedOn; + int? episodeId; + int? examId; + String? examName; + int? examType; + int? examinationType; + String? examinationTypeName; + bool? isAbnormal; + bool? isNew; + bool? isNormal; + bool? notExamined; + int? patientMRN; + String? remarks; GetPhysicalExamResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedOn, - this.episodeId, - this.examId, - this.examName, - this.examType, - this.examinationType, - this.examinationTypeName, - this.isAbnormal, - this.isNew, - this.isNormal, - this.notExamined, - this.patientMRN, - this.remarks}); + this.createdBy, + this.createdByName, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedOn, + this.episodeId, + this.examId, + this.examName, + this.examType, + this.examinationType, + this.examinationTypeName, + this.isAbnormal, + this.isNew, + this.isNormal, + this.notExamined, + this.patientMRN, + this.remarks}); GetPhysicalExamResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 5145c419..57d14a3f 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,9 +1,9 @@ class GetPhysicalExamReqModel { - int patientMRN; - int appointmentNo; - String episodeID; - String from; - String to; + int? patientMRN; + int? appointmentNo; + String? episodeID; + String? from; + String? to; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/models/SOAP/PatchAssessmentReqModel.dart index 8cbf5cb7..c52a6a51 100644 --- a/lib/models/SOAP/PatchAssessmentReqModel.dart +++ b/lib/models/SOAP/PatchAssessmentReqModel.dart @@ -1,24 +1,24 @@ class PatchAssessmentReqModel { - int patientMRN; - int appointmentNo; - int episodeID; - String icdcode10Id; - String prevIcdCode10ID; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + int? patientMRN; + int? appointmentNo; + int? episodeID; + String? icdcode10Id; + String? prevIcdCode10ID; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; PatchAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.icdcode10Id, - this.prevIcdCode10ID, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + this.appointmentNo, + this.episodeID, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); PatchAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart index 6d3ee45a..75402036 100644 --- a/lib/models/SOAP/PostEpisodeReqModel.dart +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -1,14 +1,10 @@ class PostEpisodeReqModel { - int appointmentNo; - int patientMRN; - int doctorID; - String vidaAuthTokenID; + int? appointmentNo; + int? patientMRN; + int? doctorID; + String? vidaAuthTokenID; - PostEpisodeReqModel( - {this.appointmentNo, - this.patientMRN, - this.doctorID, - this.vidaAuthTokenID}); + PostEpisodeReqModel({this.appointmentNo, this.patientMRN, this.doctorID, this.vidaAuthTokenID}); PostEpisodeReqModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/models/SOAP/get_Allergies_request_model.dart index 7676d530..25177e3e 100644 --- a/lib/models/SOAP/get_Allergies_request_model.dart +++ b/lib/models/SOAP/get_Allergies_request_model.dart @@ -1,16 +1,11 @@ class GetAllergiesRequestModel { - String vidaAuthTokenID; - int patientMRN; - int appointmentNo; - int episodeId; - String doctorID; + String? vidaAuthTokenID; + int? patientMRN; + int? appointmentNo; + int? episodeId; + String? doctorID; - GetAllergiesRequestModel( - {this.vidaAuthTokenID, - this.patientMRN, - this.appointmentNo, - this.episodeId, - this.doctorID}); + GetAllergiesRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); GetAllergiesRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart index a1c32039..0f1a4c5a 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/models/SOAP/master_key_model.dart @@ -1,6 +1,6 @@ class MasterKeyModel { - String alias; - String aliasN; + String? alias; + String? aliasN; dynamic code; dynamic description; dynamic detail1; @@ -8,31 +8,31 @@ class MasterKeyModel { dynamic detail3; dynamic detail4; dynamic detail5; - int groupID; - int id; - String nameAr; - String nameEn; + int? groupID; + int? id; + String? nameAr; + String? nameEn; dynamic remarks; - int typeId; - String valueList; + int? typeId; + String? valueList; MasterKeyModel( {this.alias, - this.aliasN, - this.code, - this.description, - this.detail1, - this.detail2, - this.detail3, - this.detail4, - this.detail5, - this.groupID, - this.id, - this.nameAr, - this.nameEn, - this.remarks, - this.typeId, - this.valueList}); + this.aliasN, + this.code, + this.description, + this.detail1, + this.detail2, + this.detail3, + this.detail4, + this.detail5, + this.groupID, + this.id, + this.nameAr, + this.nameEn, + this.remarks, + this.typeId, + this.valueList}); MasterKeyModel.fromJson(Map json) { alias = json['alias']; diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index c4e52af7..0347a5ba 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -1,28 +1,25 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAllergy { - MasterKeyModel selectedAllergySeverity; - MasterKeyModel selectedAllergy; - String remark; - bool isChecked; - bool isExpanded; - int createdBy; + MasterKeyModel? selectedAllergySeverity; + MasterKeyModel? selectedAllergy; + String? remark; + bool? isChecked; + bool? isExpanded; + int? createdBy; MySelectedAllergy( {this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked, - this.isExpanded = true, + this.isExpanded = true, this.createdBy}); MySelectedAllergy.fromJson(Map json) { - selectedAllergySeverity = json['selectedAllergySeverity'] != null - ? new MasterKeyModel.fromJson(json['selectedAllergySeverity']) - : null; - selectedAllergy = json['selectedAllergy'] != null - ? new MasterKeyModel.fromJson(json['selectedAllergy']) - : null; + selectedAllergySeverity = + json['selectedAllergySeverity'] != null ? new MasterKeyModel.fromJson(json['selectedAllergySeverity']) : null; + selectedAllergy = json['selectedAllergy'] != null ? new MasterKeyModel.fromJson(json['selectedAllergy']) : null; remark = json['remark']; isChecked = json['isChecked']; isExpanded = json['isExpanded']; @@ -32,10 +29,10 @@ class MySelectedAllergy { Map toJson() { final Map data = new Map(); if (this.selectedAllergySeverity != null) { - data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson(); + data['selectedAllergySeverity'] = this.selectedAllergySeverity!.toJson(); } if (this.selectedAllergy != null) { - data['selectedAllergy'] = this.selectedAllergy.toJson(); + data['selectedAllergy'] = this.selectedAllergy!.toJson(); } data['remark'] = this.remark; data['isChecked'] = this.isChecked; diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart index 4d4afc2d..f683f8b7 100644 --- a/lib/models/SOAP/my_selected_assement.dart +++ b/lib/models/SOAP/my_selected_assement.dart @@ -1,37 +1,36 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAssessment { - MasterKeyModel selectedICD; - MasterKeyModel selectedDiagnosisCondition; - MasterKeyModel selectedDiagnosisType; - String remark; - int appointmentId; - int createdBy; - String createdOn; - int doctorID; - String doctorName; - String icdCode10ID; + MasterKeyModel? selectedICD; + MasterKeyModel? selectedDiagnosisCondition; + MasterKeyModel? selectedDiagnosisType; + String? remark; + int? appointmentId; + int? createdBy; + String? createdOn; + int? doctorID; + String? doctorName; + String? icdCode10ID; MySelectedAssessment( {this.selectedICD, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, this.appointmentId, this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); + this.remark, + this.appointmentId, + this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); MySelectedAssessment.fromJson(Map json) { - selectedICD = json['selectedICD'] != null - ? new MasterKeyModel.fromJson(json['selectedICD']) - : null; + selectedICD = json['selectedICD'] != null ? new MasterKeyModel.fromJson(json['selectedICD']) : null; selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null ? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition']) : null; - selectedDiagnosisType = json['selectedDiagnosisType'] != null - ? new MasterKeyModel.fromJson(json['selectedDiagnosisType']) - : null; + selectedDiagnosisType = + json['selectedDiagnosisType'] != null ? new MasterKeyModel.fromJson(json['selectedDiagnosisType']) : null; remark = json['remark']; appointmentId = json['appointmentId']; createdBy = json['createdBy']; @@ -45,13 +44,13 @@ class MySelectedAssessment { final Map data = new Map(); if (this.selectedICD != null) { - data['selectedICD'] = this.selectedICD.toJson(); + data['selectedICD'] = this.selectedICD!.toJson(); } if (this.selectedDiagnosisCondition != null) { - data['selectedICD'] = this.selectedDiagnosisCondition.toJson(); + data['selectedICD'] = this.selectedDiagnosisCondition!.toJson(); } if (this.selectedDiagnosisType != null) { - data['selectedICD'] = this.selectedDiagnosisType.toJson(); + data['selectedICD'] = this.selectedDiagnosisType!.toJson(); } data['remark'] = this.remark; data['appointmentId'] = this.appointmentId; diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 393af944..fc147415 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedExamination { - MasterKeyModel selectedExamination; - String remark; - bool isNormal; - bool isAbnormal; - bool notExamined; - bool isNew; - int createdBy; + MasterKeyModel? selectedExamination; + String? remark; + bool? isNormal; + bool? isAbnormal; + bool? notExamined; + bool? isNew; + int? createdBy; MySelectedExamination( {this.selectedExamination, @@ -19,9 +19,8 @@ class MySelectedExamination { this.createdBy}); MySelectedExamination.fromJson(Map json) { - selectedExamination = json['selectedExamination'] != null - ? new MasterKeyModel.fromJson(json['selectedExamination']) - : null; + selectedExamination = + json['selectedExamination'] != null ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; remark = json['remark']; isNormal = json['isNormal']; isAbnormal = json['isAbnormal']; @@ -34,7 +33,7 @@ class MySelectedExamination { final Map data = new Map(); if (this.selectedExamination != null) { - data['selectedExamination'] = this.selectedExamination.toJson(); + data['selectedExamination'] = this.selectedExamination!.toJson(); } data['remark'] = this.remark; data['isNormal'] = this.isNormal; diff --git a/lib/models/SOAP/my_selected_history.dart b/lib/models/SOAP/my_selected_history.dart index 11e366c2..59ae412a 100644 --- a/lib/models/SOAP/my_selected_history.dart +++ b/lib/models/SOAP/my_selected_history.dart @@ -1,18 +1,14 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedHistory { - MasterKeyModel selectedHistory; - String remark; - bool isChecked; + MasterKeyModel? selectedHistory; + String? remark; + bool? isChecked; - MySelectedHistory( - { this.selectedHistory, this.remark, this.isChecked}); + MySelectedHistory({this.selectedHistory, this.remark, this.isChecked}); MySelectedHistory.fromJson(Map json) { - - selectedHistory = json['selectedHistory'] != null - ? new MasterKeyModel.fromJson(json['selectedHistory']) - : null; + selectedHistory = json['selectedHistory'] != null ? new MasterKeyModel.fromJson(json['selectedHistory']) : null; remark = json['remark']; remark = json['isChecked']; } @@ -21,7 +17,7 @@ class MySelectedHistory { final Map data = new Map(); if (this.selectedHistory != null) { - data['selectedHistory'] = this.selectedHistory.toJson(); + data['selectedHistory'] = this.selectedHistory!.toJson(); } data['remark'] = this.remark; data['isChecked'] = this.remark; diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart index 4e134a07..24865e44 100644 --- a/lib/models/SOAP/order-procedure.dart +++ b/lib/models/SOAP/order-procedure.dart @@ -1,55 +1,54 @@ class OrderProcedure { - - String achiCode; - String appointmentDate; - int appointmentNo; - int categoryID; - String clinicDescription; - String cptCode; - int createdBy; - String createdOn; - String doctorName; - bool isApprovalCreated; - bool isApprovalRequired; - bool isCovered; - bool isInvoiced; - bool isReferralInvoiced; - bool isUncoveredByDoctor; - int lineItemNo; - String orderDate; - int orderNo; - int orderType; - String procedureId; - String procedureName; - String remarks; - String status; - String template; + String? achiCode; + String? appointmentDate; + int? appointmentNo; + int? categoryID; + String? clinicDescription; + String? cptCode; + int? createdBy; + String? createdOn; + String? doctorName; + bool? isApprovalCreated; + bool? isApprovalRequired; + bool? isCovered; + bool? isInvoiced; + bool? isReferralInvoiced; + bool? isUncoveredByDoctor; + int? lineItemNo; + String? orderDate; + int? orderNo; + int? orderType; + String? procedureId; + String? procedureName; + String? remarks; + String? status; + String? template; OrderProcedure( {this.achiCode, - this.appointmentDate, - this.appointmentNo, - this.categoryID, - this.clinicDescription, - this.cptCode, - this.createdBy, - this.createdOn, - this.doctorName, - this.isApprovalCreated, - this.isApprovalRequired, - this.isCovered, - this.isInvoiced, - this.isReferralInvoiced, - this.isUncoveredByDoctor, - this.lineItemNo, - this.orderDate, - this.orderNo, - this.orderType, - this.procedureId, - this.procedureName, - this.remarks, - this.status, - this.template}); + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template}); OrderProcedure.fromJson(Map json) { achiCode = json['achiCode']; @@ -106,5 +105,4 @@ class OrderProcedure { data['template'] = this.template; return data; } - -} \ No newline at end of file +} diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/models/SOAP/post_allergy_request_model.dart index 6783d885..9488a965 100644 --- a/lib/models/SOAP/post_allergy_request_model.dart +++ b/lib/models/SOAP/post_allergy_request_model.dart @@ -1,16 +1,13 @@ class PostAllergyRequestModel { - List - listHisProgNotePatientAllergyDiseaseVM; + List? listHisProgNotePatientAllergyDiseaseVM; PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); PostAllergyRequestModel.fromJson(Map json) { if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { - listHisProgNotePatientAllergyDiseaseVM = - new List(); + listHisProgNotePatientAllergyDiseaseVM = []; json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { - listHisProgNotePatientAllergyDiseaseVM - .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); + listHisProgNotePatientAllergyDiseaseVM!.add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); }); } } @@ -18,44 +15,42 @@ class PostAllergyRequestModel { Map toJson() { final Map data = new Map(); if (this.listHisProgNotePatientAllergyDiseaseVM != null) { - data['listHisProgNotePatientAllergyDiseaseVM'] = this - .listHisProgNotePatientAllergyDiseaseVM - .map((v) => v.toJson()) - .toList(); + data['listHisProgNotePatientAllergyDiseaseVM'] = + this.listHisProgNotePatientAllergyDiseaseVM!.map((v) => v.toJson()).toList(); } return data; } } class ListHisProgNotePatientAllergyDiseaseVM { - int patientMRN; - int allergyDiseaseType; - int allergyDiseaseId; - int episodeId; - int appointmentNo; - int severity; - bool isChecked; - bool isUpdatedByNurse; - String remarks; - int createdBy; - String createdOn; - int editedBy; - String editedOn; + int? patientMRN; + int? allergyDiseaseType; + int? allergyDiseaseId; + int? episodeId; + int? appointmentNo; + int? severity; + bool? isChecked; + bool? isUpdatedByNurse; + String? remarks; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; ListHisProgNotePatientAllergyDiseaseVM( {this.patientMRN, - this.allergyDiseaseType, - this.allergyDiseaseId, - this.episodeId, - this.appointmentNo, - this.severity, - this.isChecked, - this.isUpdatedByNurse, - this.remarks, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn}); + this.allergyDiseaseType, + this.allergyDiseaseId, + this.episodeId, + this.appointmentNo, + this.severity, + this.isChecked, + this.isUpdatedByNurse, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); ListHisProgNotePatientAllergyDiseaseVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart index af577671..3222f248 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -1,23 +1,19 @@ class PostAssessmentRequestModel { - int patientMRN; - int appointmentNo; - int episodeId; - List icdCodeDetails; + int? patientMRN; + int? appointmentNo; + int? episodeId; + List? icdCodeDetails; - PostAssessmentRequestModel( - {this.patientMRN, - this.appointmentNo, - this.episodeId, - this.icdCodeDetails}); + PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; if (json['icdCodeDetails'] != null) { - icdCodeDetails = new List(); + icdCodeDetails = []; json['icdCodeDetails'].forEach((v) { - icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -28,26 +24,20 @@ class PostAssessmentRequestModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeId; if (this.icdCodeDetails != null) { - data['icdCodeDetails'] = - this.icdCodeDetails.map((v) => v.toJson()).toList(); + data['icdCodeDetails'] = this.icdCodeDetails!.map((v) => v.toJson()).toList(); } return data; } } class IcdCodeDetails { - String icdcode10Id; - int conditionId; - int diagnosisTypeId; - bool complexDiagnosis; - String remarks; + String? icdcode10Id; + int? conditionId; + int? diagnosisTypeId; + bool? complexDiagnosis; + String? remarks; - IcdCodeDetails( - {this.icdcode10Id, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks}); IcdCodeDetails.fromJson(Map json) { icdcode10Id = json['icdcode10Id']; diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index f1e9c2b4..fa4c1684 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -1,17 +1,16 @@ class PostChiefComplaintRequestModel { - int appointmentNo; - int episodeID; - int patientMRN; - String chiefComplaint; - String hopi; - String currentMedication; - bool ispregnant; - bool isLactation; - int numberOfWeeks; + int? appointmentNo; + int? episodeID; + int? patientMRN; + String? chiefComplaint; + String? hopi; + String? currentMedication; + bool? ispregnant; + bool? isLactation; + int? numberOfWeeks; dynamic doctorID; dynamic editedBy; - PostChiefComplaintRequestModel( {this.appointmentNo, this.episodeID, diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index d8be3fb2..89b6586d 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,14 +1,14 @@ class PostHistoriesRequestModel { - List listMedicalHistoryVM; + List? listMedicalHistoryVM; dynamic doctorID; PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { - listMedicalHistoryVM = new List(); + listMedicalHistoryVM = []; json['listMedicalHistoryVM'].forEach((v) { - listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); + listMedicalHistoryVM!.add(new ListMedicalHistoryVM.fromJson(v)); }); } doctorID = json['DoctorID']; @@ -17,8 +17,7 @@ class PostHistoriesRequestModel { Map toJson() { final Map data = new Map(); if (this.listMedicalHistoryVM != null) { - data['listMedicalHistoryVM'] = - this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); + data['listMedicalHistoryVM'] = this.listMedicalHistoryVM!.map((v) => v.toJson()).toList(); } data['DoctorID'] = this.doctorID; return data; @@ -26,22 +25,22 @@ class PostHistoriesRequestModel { } class ListMedicalHistoryVM { - int patientMRN; - int historyType; - int historyId; - int episodeId; - int appointmentNo; - bool isChecked; - String remarks; + int? patientMRN; + int? historyType; + int? historyId; + int? episodeId; + int? appointmentNo; + bool? isChecked; + String? remarks; ListMedicalHistoryVM( {this.patientMRN, - this.historyType, - this.historyId, - this.episodeId, - this.appointmentNo, - this.isChecked, - this.remarks}); + this.historyType, + this.historyId, + this.episodeId, + this.appointmentNo, + this.isChecked, + this.remarks}); ListMedicalHistoryVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 52836232..d1b44e04 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,15 +1,13 @@ - class PostPhysicalExamRequestModel { - List listHisProgNotePhysicalExaminationVM; + List? listHisProgNotePhysicalExaminationVM; PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { if (json['listHisProgNotePhysicalExaminationVM'] != null) { - listHisProgNotePhysicalExaminationVM = new List(); + listHisProgNotePhysicalExaminationVM = []; json['listHisProgNotePhysicalExaminationVM'].forEach((v) { - listHisProgNotePhysicalExaminationVM - .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); + listHisProgNotePhysicalExaminationVM!.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); }); } } @@ -18,97 +16,97 @@ class PostPhysicalExamRequestModel { final Map data = new Map(); if (this.listHisProgNotePhysicalExaminationVM != null) { data['listHisProgNotePhysicalExaminationVM'] = - this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList(); + this.listHisProgNotePhysicalExaminationVM!.map((v) => v.toJson()).toList(); } return data; } } - class ListHisProgNotePhysicalExaminationVM { - int episodeId; - int appointmentNo; - int examType; - int examId; - int patientMRN; - bool isNormal; - bool isAbnormal; - bool notExamined; - String examName; - String examinationTypeName; - int examinationType; - String remarks; - bool isNew; - int createdBy; - String createdOn; - String createdByName; - int editedBy; - String editedOn; - String editedByName; +class ListHisProgNotePhysicalExaminationVM { + int? episodeId; + int? appointmentNo; + int? examType; + int? examId; + int? patientMRN; + bool? isNormal; + bool? isAbnormal; + bool? notExamined; + String? examName; + String? examinationTypeName; + int? examinationType; + String? remarks; + bool? isNew; + int? createdBy; + String? createdOn; + String? createdByName; + int? editedBy; + String? editedOn; + String? editedByName; - ListHisProgNotePhysicalExaminationVM( - {this.episodeId, - this.appointmentNo, - this.examType, - this.examId, - this.patientMRN, - this.isNormal, - this.isAbnormal, - this.notExamined, - this.examName, - this.examinationTypeName, - this.examinationType, - this.remarks, - this.isNew, - this.createdBy, - this.createdOn, - this.createdByName, - this.editedBy, - this.editedOn, - this.editedByName}); + ListHisProgNotePhysicalExaminationVM( + {this.episodeId, + this.appointmentNo, + this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.notExamined, + this.examName, + this.examinationTypeName, + this.examinationType, + this.remarks, + this.isNew, + this.createdBy, + this.createdOn, + this.createdByName, + this.editedBy, + this.editedOn, + this.editedByName}); - ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { - episodeId = json['episodeId']; - appointmentNo = json['appointmentNo']; - examType = json['examType']; - examId = json['examId']; - patientMRN = json['patientMRN']; - isNormal = json['isNormal']; - isAbnormal = json['isAbnormal']; - notExamined = json['notExamined']; - examName = json['examName']; - examinationTypeName = json['examinationTypeName']; - examinationType = json['examinationType']; - remarks = json['remarks']; - isNew = json['isNew']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - createdByName = json['createdByName']; - editedBy = json['editedBy']; - editedOn = json['editedOn']; - editedByName = json['editedByName']; - } + ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + examType = json['examType']; + examId = json['examId']; + patientMRN = json['patientMRN']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + notExamined = json['notExamined']; + examName = json['examName']; + examinationTypeName = json['examinationTypeName']; + examinationType = json['examinationType']; + remarks = json['remarks']; + isNew = json['isNew']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + createdByName = json['createdByName']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + editedByName = json['editedByName']; + } - Map toJson() { - final Map data = new Map(); - data['episodeId'] = this.episodeId; - data['appointmentNo'] = this.appointmentNo; - data['examType'] = this.examType; - data['examId'] = this.examId; - data['patientMRN'] = this.patientMRN; - data['isNormal'] = this.isNormal; - data['isAbnormal'] = this.isAbnormal; - data['notExamined'] = this.notExamined; - data['examName'] = this.examName; - data['examinationTypeName'] = this.examinationTypeName; - data['examinationType'] = this.examinationType; - data['remarks'] = this.remarks; - data['isNew'] = this.isNew; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['createdByName'] = this.createdByName; - data['editedBy'] = this.editedBy; - data['editedOn'] = this.editedOn; - data['editedByName'] = this.editedByName; - return data; - } + Map toJson() { + final Map data = new Map(); + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['examType'] = this.examType; + data['examId'] = this.examId; + data['patientMRN'] = this.patientMRN; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + data['notExamined'] = this.notExamined; + data['examName'] = this.examName; + data['examinationTypeName'] = this.examinationTypeName; + data['examinationType'] = this.examinationType; + data['remarks'] = this.remarks; + data['isNew'] = this.isNew; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['createdByName'] = this.createdByName; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['editedByName'] = this.editedByName; + return data; } +} diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 2925819d..da603bee 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -1,18 +1,13 @@ class PostProgressNoteRequestModel { - int appointmentNo; - int episodeId; - int patientMRN; - String planNote; + int? appointmentNo; + int? episodeId; + int? patientMRN; + String? planNote; dynamic doctorID; dynamic editedBy; PostProgressNoteRequestModel( - {this.appointmentNo, - this.episodeId, - this.patientMRN, - this.planNote, - this.doctorID, - this.editedBy}); + {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote, this.doctorID, this.editedBy}); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/models/dashboard/dashboard_model.dart index 0e03e899..5719b06b 100644 --- a/lib/models/dashboard/dashboard_model.dart +++ b/lib/models/dashboard/dashboard_model.dart @@ -1,7 +1,7 @@ class DashboardModel { - String kPIName; - int displaySequence; - List summaryoptions; + String? kPIName; + int? displaySequence; + List? summaryoptions; DashboardModel({this.kPIName, this.displaySequence, this.summaryoptions}); @@ -9,9 +9,9 @@ class DashboardModel { kPIName = json['KPIName']; displaySequence = json['displaySequence']; if (json['summaryoptions'] != null) { - summaryoptions = new List(); + summaryoptions = []; json['summaryoptions'].forEach((v) { - summaryoptions.add(new Summaryoptions.fromJson(v)); + summaryoptions!.add(new Summaryoptions.fromJson(v)); }); } } @@ -21,21 +21,20 @@ class DashboardModel { data['KPIName'] = this.kPIName; data['displaySequence'] = this.displaySequence; if (this.summaryoptions != null) { - data['summaryoptions'] = - this.summaryoptions.map((v) => v.toJson()).toList(); + data['summaryoptions'] = this.summaryoptions!.map((v) => v.toJson()).toList(); } return data; } } class Summaryoptions { - String kPIParameter; - String captionColor; - bool isCaptionBold; - bool isValueBold; - int order; - int value; - String valueColor; + String? kPIParameter; + String? captionColor; + bool? isCaptionBold; + bool? isValueBold; + int? order; + int? value; + String? valueColor; Summaryoptions( {this.kPIParameter, diff --git a/lib/models/doctor/clinic_model.dart b/lib/models/doctor/clinic_model.dart index e5eb8eee..690837fe 100644 --- a/lib/models/doctor/clinic_model.dart +++ b/lib/models/doctor/clinic_model.dart @@ -6,20 +6,14 @@ *@desc: Clinic Model */ class ClinicModel { - Null setupID; - int projectID; - int doctorID; - int clinicID; - bool isActive; - String clinicName; + dynamic setupID; + int? projectID; + int? doctorID; + int? clinicID; + bool? isActive; + String? clinicName; - ClinicModel( - {this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ClinicModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index 7c7f6e37..f0221c34 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -1,45 +1,45 @@ class DoctorProfileModel { - int doctorID; - String doctorName; - Null doctorNameN; - int clinicID; - String clinicDescription; - Null clinicDescriptionN; - Null licenseExpiry; - int employmentType; + int? doctorID; + String? doctorName; + dynamic doctorNameN; + int? clinicID; + String? clinicDescription; + dynamic clinicDescriptionN; + dynamic licenseExpiry; + int? employmentType; dynamic setupID; - int projectID; - String projectName; - String nationalityID; - String nationalityName; - Null nationalityNameN; - int gender; - String genderDescription; - Null genderDescriptionN; - Null doctorTitle; - Null projectNameN; - bool isAllowWaitList; - String titleDescription; - Null titleDescriptionN; - Null isRegistered; - Null isDoctorDummy; - bool isActive; - Null isDoctorAppointmentDisplayed; - bool doctorClinicActive; - Null isbookingAllowed; - String doctorCases; - Null doctorPicture; - String doctorProfileInfo; - List specialty; - int actualDoctorRate; - String doctorImageURL; - int doctorRate; - String doctorTitleForProfile; - bool isAppointmentAllowed; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - int serviceID; + int? projectID; + String? projectName; + String? nationalityID; + String? nationalityName; + dynamic nationalityNameN; + int? gender; + String? genderDescription; + dynamic genderDescriptionN; + dynamic doctorTitle; + dynamic projectNameN; + bool? isAllowWaitList; + String? titleDescription; + dynamic titleDescriptionN; + dynamic isRegistered; + dynamic isDoctorDummy; + bool? isActive; + dynamic isDoctorAppointmentDisplayed; + bool? doctorClinicActive; + dynamic isbookingAllowed; + String? doctorCases; + dynamic doctorPicture; + String? doctorProfileInfo; + List? specialty; + int? actualDoctorRate; + String? doctorImageURL; + int? doctorRate; + String? doctorTitleForProfile; + bool? isAppointmentAllowed; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + int? serviceID; DoctorProfileModel( {this.doctorID, @@ -84,7 +84,7 @@ class DoctorProfileModel { this.qR, this.serviceID}); - DoctorProfileModel.fromJson(Map json) { + DoctorProfileModel.fromJson(Map json) { doctorID = json['DoctorID']; doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; @@ -110,26 +110,26 @@ class DoctorProfileModel { isRegistered = json['IsRegistered']; isDoctorDummy = json['IsDoctorDummy']; isActive = json['IsActive']; - isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; + isDoctorAppointmentDisplayed = json['IsDoctorAppoint?mentDisplayed']; doctorClinicActive = json['DoctorClinicActive']; isbookingAllowed = json['IsbookingAllowed']; doctorCases = json['DoctorCases']; doctorPicture = json['DoctorPicture']; doctorProfileInfo = json['DoctorProfileInfo']; - specialty = json['Specialty'].cast(); + specialty = json['Specialty'].cast(); actualDoctorRate = json['ActualDoctorRate']; doctorImageURL = json['DoctorImageURL']; doctorRate = json['DoctorRate']; doctorTitleForProfile = json['DoctorTitleForProfile']; - isAppointmentAllowed = json['IsAppointmentAllowed']; + isAppointmentAllowed = json['IsAppoint?mentAllowed']; nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; serviceID = json['ServiceID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['DoctorName'] = this.doctorName; data['DoctorNameN'] = this.doctorNameN; @@ -155,7 +155,7 @@ class DoctorProfileModel { data['IsRegistered'] = this.isRegistered; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsActive'] = this.isActive; - data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['IsDoctorAppoint?mentDisplayed'] = this.isDoctorAppointmentDisplayed; data['DoctorClinicActive'] = this.doctorClinicActive; data['IsbookingAllowed'] = this.isbookingAllowed; data['DoctorCases'] = this.doctorCases; @@ -166,7 +166,7 @@ class DoctorProfileModel { data['DoctorImageURL'] = this.doctorImageURL; data['DoctorRate'] = this.doctorRate; data['DoctorTitleForProfile'] = this.doctorTitleForProfile; - data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; data['NationalityFlagURL'] = this.nationalityFlagURL; data['NoOfPatientsRate'] = this.noOfPatientsRate; data['QR'] = this.qR; diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 4712d285..94e507c8 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,12 +1,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class ListDoctorWorkingHoursTable { - DateTime date; - String dayName; - String workingHours; - String projectName; - String clinicName; - + DateTime? date; + String? dayName; + String? workingHours; + String? projectName; + String? clinicName; ListDoctorWorkingHoursTable({ this.date, @@ -37,5 +36,5 @@ class ListDoctorWorkingHoursTable { class WorkingHours { String from; String to; - WorkingHours({this.from, this.to}); + WorkingHours({required this.from, required this.to}); } diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index 35d09812..a5b881f1 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,68 +1,64 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; - - - - class ListGtMyPatientsQuestions { - String setupID; - int projectID; - int transactionNo; - int patientType; - int patientID; - int doctorID; - int requestType; - DateTime requestDate; - String requestTime; - String remarks; - int status; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String patientName; - Null patientNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - int admissionNo; - int referringDoctor; - int lineItemNo; - String age; - String genderDescription; - bool isVidaCall; + String? setupID; + int? projectID; + int? transactionNo; + int? patientType; + int? patientID; + int? doctorID; + int? requestType; + DateTime? requestDate; + String? requestTime; + String? remarks; + int? status; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? patientName; + dynamic patientNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + int? admissionNo; + int? referringDoctor; + int? lineItemNo; + String? age; + String? genderDescription; + bool? isVidaCall; ListGtMyPatientsQuestions( {this.setupID, - this.projectID, - this.transactionNo, - this.patientType, - this.patientID, - this.doctorID, - this.requestType, - this.requestDate, - this.requestTime, - this.remarks, - this.status, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.patientName, - this.patientNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.admissionNo, - this.referringDoctor, - this.lineItemNo, - this.age, - this.genderDescription, - this.isVidaCall}); + this.projectID, + this.transactionNo, + this.patientType, + this.patientID, + this.doctorID, + this.requestType, + this.requestDate, + this.requestTime, + this.remarks, + this.status, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.patientName, + this.patientNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.admissionNo, + this.referringDoctor, + this.lineItemNo, + this.age, + this.genderDescription, + this.isVidaCall}); - ListGtMyPatientsQuestions.fromJson(Map json) { + ListGtMyPatientsQuestions.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; transactionNo = json['TransactionNo']; @@ -70,7 +66,7 @@ class ListGtMyPatientsQuestions { patientID = json['PatientID']; doctorID = json['DoctorID']; requestType = json['RequestType']; - requestDate = AppDateUtils.convertStringToDate(json['RequestDate']) ; + requestDate = AppDateUtils.convertStringToDate(json['RequestDate']); requestTime = json['RequestTime']; remarks = json['Remarks']; status = json['Status']; @@ -92,8 +88,8 @@ class ListGtMyPatientsQuestions { isVidaCall = json['IsVidaCall']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['TransactionNo'] = this.transactionNo; @@ -124,4 +120,3 @@ class ListGtMyPatientsQuestions { return data; } } - diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 8f2ef985..56d937da 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -6,32 +6,32 @@ *@desc: ProfileReqModel */ class ProfileReqModel { - int projectID; - int clinicID; - int doctorID; - bool isRegistered; - bool license; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; + int? projectID; + int? clinicID; + int? doctorID; + bool? isRegistered; + bool? license; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; ProfileReqModel( {this.projectID, this.clinicID, this.doctorID, - this.isRegistered =true, + this.isRegistered = true, this.license, this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.5, - this.channel=9, - this.sessionID='E2bsEeYEJo', + this.iPAdress = '11.11.11.11', + this.versionID = 5.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', this.tokenID, this.isLoginForDoctorApp = true}); diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/models/doctor/request_add_referred_doctor_remarks.dart index b396c47f..e4d3ecdb 100644 --- a/lib/models/doctor/request_add_referred_doctor_remarks.dart +++ b/lib/models/doctor/request_add_referred_doctor_remarks.dart @@ -1,41 +1,40 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestAddReferredDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestAddReferredDoctorRemarks( {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel= CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA}); + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel = CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA}); RequestAddReferredDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/doctor/request_doctor_reply.dart b/lib/models/doctor/request_doctor_reply.dart index 707336d6..3720d647 100644 --- a/lib/models/doctor/request_doctor_reply.dart +++ b/lib/models/doctor/request_doctor_reply.dart @@ -1,34 +1,34 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestDoctorReply { - int projectID; - int doctorID; - int transactionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? doctorID; + int? transactionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestDoctorReply( - {this.projectID , - this.doctorID , - this.transactionNo = TRANSACTION_NO , - this.languageID , - this.stamp , + {this.projectID, + this.doctorID, + this.transactionNo = TRANSACTION_NO, + this.languageID, + this.stamp, this.iPAdress, - this.versionID , + this.versionID, this.channel, - this.tokenID , + this.tokenID, this.sessionID, - this.isLoginForDoctorApp , - this.patientOutSA }); + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestDoctorReply.fromJson(Map json) { + RequestDoctorReply.fromJson(Map json) { projectID = json['ProjectID']; doctorID = json['DoctorID']; transactionNo = json['TransactionNo']; diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index 03bafeca..55e70a9a 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -1,20 +1,18 @@ - - class RequestSchedule { - int projectID; - int clinicID; - int doctorID; - int doctorWorkingHoursDays; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? clinicID; + int? doctorID; + int? doctorWorkingHoursDays; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestSchedule( {this.projectID, diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/models/doctor/statstics_for_certain_doctor_request.dart index 08fa03f3..8b810fe0 100644 --- a/lib/models/doctor/statstics_for_certain_doctor_request.dart +++ b/lib/models/doctor/statstics_for_certain_doctor_request.dart @@ -1,18 +1,13 @@ class StatsticsForCertainDoctorRequest { - bool outSA; - int doctorID; - String tokenID; - int channel; - int projectID; - String generalid; + bool? outSA; + int? doctorID; + String? tokenID; + int? channel; + int? projectID; + String? generalid; StatsticsForCertainDoctorRequest( - {this.outSA, - this.doctorID, - this.tokenID, - this.channel, - this.projectID, - this.generalid}); + {this.outSA, this.doctorID, this.tokenID, this.channel, this.projectID, this.generalid}); StatsticsForCertainDoctorRequest.fromJson(Map json) { outSA = json['OutSA']; diff --git a/lib/models/doctor/user_model.dart b/lib/models/doctor/user_model.dart index 95035f8d..2500bfd7 100644 --- a/lib/models/doctor/user_model.dart +++ b/lib/models/doctor/user_model.dart @@ -1,16 +1,16 @@ class UserModel { - String userID; - String password; - int projectID; - int languageID; - String iPAdress; - double versionID; - int channel; - String sessionID; - String tokenID; - String stamp; - bool isLoginForDoctorApp; - int patientOutSA; + String? userID; + String? password; + int? projectID; + int? languageID; + String? iPAdress; + double? versionID; + int? channel; + String? sessionID; + String? tokenID; + String? stamp; + bool? isLoginForDoctorApp; + int? patientOutSA; UserModel( {this.userID, @@ -26,7 +26,7 @@ class UserModel { this.isLoginForDoctorApp, this.patientOutSA}); - UserModel.fromJson(Map json) { + UserModel.fromJson(Map json) { userID = json['UserID']; password = json['Password']; projectID = json['ProjectID']; diff --git a/lib/models/doctor/verify_referral_doctor_remarks.dart b/lib/models/doctor/verify_referral_doctor_remarks.dart index b9bfce0a..97c00390 100644 --- a/lib/models/doctor/verify_referral_doctor_remarks.dart +++ b/lib/models/doctor/verify_referral_doctor_remarks.dart @@ -1,54 +1,54 @@ import 'package:doctor_app_flutter/config/config.dart'; class VerifyReferralDoctorRemarks { - int projectID; - String admissionNo; - int lineItemNo; - String referredDoctorRemarks; - int editedBy; - int patientID; - int referringDoctor; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - String firstName; + int? projectID; + String? admissionNo; + int? lineItemNo; + String? referredDoctorRemarks; + int? editedBy; + int? patientID; + int? referringDoctor; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + String? firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; - VerifyReferralDoctorRemarks( - {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel= CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - }); + VerifyReferralDoctorRemarks({ + this.projectID, + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel = CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA, + this.firstName, + this.middleName, + this.lastName, + this.patientMobileNumber, + this.patientIdentificationID, + }); - VerifyReferralDoctorRemarks.fromJson(Map json) { + VerifyReferralDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; lineItemNo = json['LineItemNo']; @@ -65,18 +65,15 @@ class VerifyReferralDoctorRemarks { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; - firstName= json["FirstName"]; - middleName= json["MiddleName"]; - lastName= json["LastName"]; - patientMobileNumber= json["PatientMobileNumber"]; - patientIdentificationID = json["PatientIdentificationID"]; - - - + firstName = json["FirstName"]; + middleName = json["MiddleName"]; + lastName = json["LastName"]; + patientMobileNumber = json["PatientMobileNumber"]; + patientIdentificationID = json["PatientIdentificationID"]; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/models/livecare/end_call_req.dart b/lib/models/livecare/end_call_req.dart index 7a1ae8eb..e3cc2722 100644 --- a/lib/models/livecare/end_call_req.dart +++ b/lib/models/livecare/end_call_req.dart @@ -1,12 +1,11 @@ class EndCallReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isDestroy; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isDestroy; - EndCallReq( - {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); + EndCallReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); EndCallReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/livecare/get_panding_req_list.dart b/lib/models/livecare/get_panding_req_list.dart index 719b9134..2ed2638a 100644 --- a/lib/models/livecare/get_panding_req_list.dart +++ b/lib/models/livecare/get_panding_req_list.dart @@ -1,16 +1,11 @@ class LiveCarePendingListRequest { - PatientData patientData; - int doctorID; - String sErServiceID; - int projectID; - int sourceID; - - LiveCarePendingListRequest( - {this.patientData, - this.doctorID, - this.sErServiceID, - this.projectID, - this.sourceID}); + PatientData? patientData; + int? doctorID; + String? sErServiceID; + int? projectID; + int? sourceID; + + LiveCarePendingListRequest({this.patientData, this.doctorID, this.sErServiceID, this.projectID, this.sourceID}); LiveCarePendingListRequest.fromJson(Map json) { patientData = new PatientData.fromJson(json['PatientData']); @@ -23,7 +18,7 @@ class LiveCarePendingListRequest { Map toJson() { final Map data = new Map(); - data['PatientData'] = this.patientData.toJson(); + data['PatientData'] = this.patientData!.toJson(); data['DoctorID'] = this.doctorID; data['SErServiceID'] = this.sErServiceID; data['ProjectID'] = this.projectID; @@ -33,9 +28,9 @@ class LiveCarePendingListRequest { } class PatientData { - bool isOutKSA; + bool? isOutKSA; - PatientData({this.isOutKSA}); + PatientData({required this.isOutKSA}); PatientData.fromJson(Map json) { isOutKSA = json['IsOutKSA']; diff --git a/lib/models/livecare/get_pending_res_list.dart b/lib/models/livecare/get_pending_res_list.dart index b45c53b9..85d62d35 100644 --- a/lib/models/livecare/get_pending_res_list.dart +++ b/lib/models/livecare/get_pending_res_list.dart @@ -1,43 +1,43 @@ class LiveCarePendingListResponse { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestID; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestID; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - String dateOfBirth; - String deviceToken; - String deviceType; + String? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUP; + String? editOn; + String? gender; + bool? isFollowUP; dynamic isFromVida; - int isLoginB; - bool isOutKSA; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKSA; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenID; - String patientID; - String patientName; - int patientStatus; - String preferredLanguage; - int projectID; - double scoring; - int serviceID; + String? patientID; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectID; + double? scoring; + int? serviceID; dynamic tokenID; - int vCID; - String voipToken; + int? vCID; + String? voipToken; LiveCarePendingListResponse( {this.acceptedBy, @@ -80,11 +80,11 @@ class LiveCarePendingListResponse { this.vCID, this.voipToken}); - LiveCarePendingListResponse.fromJson(Map json) { + LiveCarePendingListResponse.fromJson(Map json) { acceptedBy = json['AcceptedBy']; acceptedOn = json['AcceptedOn']; age = json['Age']; - appointmentNo = json['AppointmentNo']; + appointmentNo = json['Appoint?mentNo']; arrivalTime = json['ArrivalTime']; arrivalTimeD = json['ArrivalTimeD']; callStatus = json['CallStatus']; @@ -122,12 +122,12 @@ class LiveCarePendingListResponse { voipToken = json['VoipToken']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AcceptedBy'] = this.acceptedBy; data['AcceptedOn'] = this.acceptedOn; data['Age'] = this.age; - data['AppointmentNo'] = this.appointmentNo; + data['Appoint?mentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; data['ArrivalTimeD'] = this.arrivalTimeD; data['CallStatus'] = this.callStatus; diff --git a/lib/models/livecare/session_status_model.dart b/lib/models/livecare/session_status_model.dart index 7e7a3e43..18d5ae6b 100644 --- a/lib/models/livecare/session_status_model.dart +++ b/lib/models/livecare/session_status_model.dart @@ -1,14 +1,10 @@ class SessionStatusModel { - bool isAuthenticated; - int messageStatus; - String result; - int sessionStatus; + bool? isAuthenticated; + int? messageStatus; + String? result; + int? sessionStatus; - SessionStatusModel( - {this.isAuthenticated, - this.messageStatus, - this.result, - this.sessionStatus}); + SessionStatusModel({this.isAuthenticated, this.messageStatus, this.result, this.sessionStatus}); SessionStatusModel.fromJson(Map json) { isAuthenticated = json['IsAuthenticated']; diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index 1ad04480..9dabccc1 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - int vCID; - bool isrecall; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; - String projectName; - String docotrName; - String clincName; - String docSpec; - int clinicId; + int? vCID; + bool? isrecall; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; + String? projectName; + String? docotrName; + String? clincName; + String? docSpec; + int? clinicId; StartCallReq( {this.vCID, diff --git a/lib/models/livecare/start_call_res.dart b/lib/models/livecare/start_call_res.dart index 67259996..acbe9c4b 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/models/livecare/start_call_res.dart @@ -1,10 +1,10 @@ class StartCallRes { - String result; - String openSessionID; - String openTokenID; - bool isAuthenticated; - int messageStatus; - String appointmentNo; + String? result; + String? openSessionID; + String? openTokenID; + bool? isAuthenticated; + int? messageStatus; + String? appointmentNo; StartCallRes( {this.result, diff --git a/lib/models/livecare/transfer_to_admin.dart b/lib/models/livecare/transfer_to_admin.dart index 841f5e7d..291528b9 100644 --- a/lib/models/livecare/transfer_to_admin.dart +++ b/lib/models/livecare/transfer_to_admin.dart @@ -1,18 +1,12 @@ class TransferToAdminReq { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; - String notes; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; + String? notes; - TransferToAdminReq( - {this.vCID, - this.tokenID, - this.generalid, - this.doctorId, - this.isOutKsa, - this.notes}); + TransferToAdminReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.notes}); TransferToAdminReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart index f00e84a0..aa0d1279 100644 --- a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart +++ b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart @@ -1,32 +1,32 @@ class MedicalReportTemplate { - String setupID; - int projectID; - int templateID; - String procedureID; - int reportType; - String templateName; - String templateNameN; - String templateText; - String templateTextN; - bool isActive; - String templateTextHtml; - String templateTextNHtml; + String? setupID; + int? projectID; + int? templateID; + String? procedureID; + int? reportType; + String? templateName; + String? templateNameN; + String? templateText; + String? templateTextN; + bool? isActive; + String? templateTextHtml; + String? templateTextNHtml; MedicalReportTemplate( {this.setupID, - this.projectID, - this.templateID, - this.procedureID, - this.reportType, - this.templateName, - this.templateNameN, - this.templateText, - this.templateTextN, - this.isActive, - this.templateTextHtml, - this.templateTextNHtml}); + this.projectID, + this.templateID, + this.procedureID, + this.reportType, + this.templateName, + this.templateNameN, + this.templateText, + this.templateTextN, + this.isActive, + this.templateTextHtml, + this.templateTextNHtml}); - MedicalReportTemplate.fromJson(Map json) { + MedicalReportTemplate.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; templateID = json['TemplateID']; @@ -41,8 +41,8 @@ class MedicalReportTemplate { templateTextNHtml = json['TemplateTextNHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['TemplateID'] = this.templateID; diff --git a/lib/models/patient/MedicalReport/MeidcalReportModel.dart b/lib/models/patient/MedicalReport/MeidcalReportModel.dart index 74ee53a5..6cfe81ca 100644 --- a/lib/models/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/models/patient/MedicalReport/MeidcalReportModel.dart @@ -1,60 +1,60 @@ class MedicalReportModel { - String reportData; - String setupID; - int projectID; - String projectName; - String projectNameN; - int patientID; - String invoiceNo; - int status; - String verifiedOn; + String? reportData; + String? setupID; + int? projectID; + String? projectName; + String? projectNameN; + int? patientID; + String? invoiceNo; + int? status; + String? verifiedOn; dynamic verifiedBy; - String editedOn; - int editedBy; - int lineItemNo; - String createdOn; - int templateID; - int doctorID; - int doctorGender; - String doctorGenderDescription; - String doctorGenderDescriptionN; - String doctorImageURL; - String doctorName; - String doctorNameN; - int clinicID; - String clinicName; - String clinicNameN; - String reportDataHtml; + String? editedOn; + int? editedBy; + int? lineItemNo; + String? createdOn; + int? templateID; + int? doctorID; + int? doctorGender; + String? doctorGenderDescription; + String? doctorGenderDescriptionN; + String? doctorImageURL; + String? doctorName; + String? doctorNameN; + int? clinicID; + String? clinicName; + String? clinicNameN; + String? reportDataHtml; MedicalReportModel( {this.reportData, - this.setupID, - this.projectID, - this.projectName, - this.projectNameN, - this.patientID, - this.invoiceNo, - this.status, - this.verifiedOn, - this.verifiedBy, - this.editedOn, - this.editedBy, - this.lineItemNo, - this.createdOn, - this.templateID, - this.doctorID, - this.doctorGender, - this.doctorGenderDescription, - this.doctorGenderDescriptionN, - this.doctorImageURL, - this.doctorName, - this.doctorNameN, - this.clinicID, - this.clinicName, - this.clinicNameN, - this.reportDataHtml}); + this.setupID, + this.projectID, + this.projectName, + this.projectNameN, + this.patientID, + this.invoiceNo, + this.status, + this.verifiedOn, + this.verifiedBy, + this.editedOn, + this.editedBy, + this.lineItemNo, + this.createdOn, + this.templateID, + this.doctorID, + this.doctorGender, + this.doctorGenderDescription, + this.doctorGenderDescriptionN, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicName, + this.clinicNameN, + this.reportDataHtml}); - MedicalReportModel.fromJson(Map json) { + MedicalReportModel.fromJson(Map json) { reportData = json['ReportData']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -83,8 +83,8 @@ class MedicalReportModel { reportDataHtml = json['ReportDataHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ReportData'] = this.reportData; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/models/patient/PatientArrivalEntity.dart index 54622cd7..710cd70f 100644 --- a/lib/models/patient/PatientArrivalEntity.dart +++ b/lib/models/patient/PatientArrivalEntity.dart @@ -1,44 +1,44 @@ class PatientArrivalEntity { - String age; - String appointmentDate; - int appointmentNo; - String appointmentType; - String arrivedOn; - String companyName; - String endTime; - int episodeNo; - int fallRiskScore; - String gender; - int medicationOrders; - String mobileNumber; - String nationality; - int patientMRN; - String patientName; - int rowCount; - String startTime; - String visitType; + String? age; + String? appointmentDate; + int? appointmentNo; + String? appointmentType; + String? arrivedOn; + String? companyName; + String? endTime; + int? episodeNo; + int? fallRiskScore; + String? gender; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? patientMRN; + String? patientName; + int? rowCount; + String? startTime; + String? visitType; PatientArrivalEntity( {this.age, - this.appointmentDate, - this.appointmentNo, - this.appointmentType, - this.arrivedOn, - this.companyName, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.gender, - this.medicationOrders, - this.mobileNumber, - this.nationality, - this.patientMRN, - this.patientName, - this.rowCount, - this.startTime, - this.visitType}); + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.companyName, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.gender, + this.medicationOrders, + this.mobileNumber, + this.nationality, + this.patientMRN, + this.patientName, + this.rowCount, + this.startTime, + this.visitType}); - PatientArrivalEntity.fromJson(Map json) { + PatientArrivalEntity.fromJson(Map json) { age = json['age']; appointmentDate = json['appointmentDate']; appointmentNo = json['appointmentNo']; @@ -59,8 +59,8 @@ class PatientArrivalEntity { visitType = json['visitType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['age'] = this.age; data['appointmentDate'] = this.appointmentDate; data['appointmentNo'] = this.appointmentNo; @@ -81,4 +81,4 @@ class PatientArrivalEntity { data['visitType'] = this.visitType; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 09198dc0..c3ba279d 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -1,6 +1,5 @@ class ClinicByProjectIdRequest { - - /* + /* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -8,17 +7,17 @@ class ClinicByProjectIdRequest { *@desc: ClinicByProjectIdRequest */ - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "ProjectID": 21, @@ -48,7 +47,7 @@ class ClinicByProjectIdRequest { this.patientOutSA = false, this.patientTypeID = 1}); - ClinicByProjectIdRequest.fromJson(Map json) { + ClinicByProjectIdRequest.fromJson(Map json) { projectID = json['ProjectID']; languageID = json['LanguageID']; stamp = json['stamp']; diff --git a/lib/models/patient/get_doctor_by_clinic_id_request.dart b/lib/models/patient/get_doctor_by_clinic_id_request.dart index 9504fc35..351f19f7 100644 --- a/lib/models/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/models/patient/get_doctor_by_clinic_id_request.dart @@ -1,35 +1,31 @@ class DoctorsByClinicIdRequest { + int? clinicID; + int? projectID; + bool? continueDentalPlan; + bool? isSearchAppointmnetByClinicID; + int? patientID; + int? gender; + bool? isGetNearAppointment; + bool? isVoiceCommand; + int? latitude; + int? longitude; + bool? license; + bool? isDentalAllowedBackend; - int clinicID; - int projectID; - bool continueDentalPlan; - bool isSearchAppointmnetByClinicID; - int patientID; - int gender; - bool isGetNearAppointment; - bool isVoiceCommand; - int latitude; - int longitude; - bool license; - bool isDentalAllowedBackend; - - - DoctorsByClinicIdRequest( - { - this.clinicID, - this.projectID, - this.continueDentalPlan = false, - this.isSearchAppointmnetByClinicID = true, - this.patientID, - this.gender, - this.isGetNearAppointment = false, - this.isVoiceCommand = true, - this.latitude = 0, - this.longitude = 0, - this.license = true, - this.isDentalAllowedBackend = false, - }); - + DoctorsByClinicIdRequest({ + this.clinicID, + this.projectID, + this.continueDentalPlan = false, + this.isSearchAppointmnetByClinicID = true, + this.patientID, + this.gender, + this.isGetNearAppointment = false, + this.isVoiceCommand = true, + this.latitude = 0, + this.longitude = 0, + this.license = true, + this.isDentalAllowedBackend = false, + }); DoctorsByClinicIdRequest.fromJson(Map json) { clinicID = json['ClinicID']; @@ -61,6 +57,5 @@ class DoctorsByClinicIdRequest { data['License'] = this.license; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; return data; - } } diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index 7f466deb..ca4f3bd3 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -1,6 +1,5 @@ class STPReferralFrequencyRequest { - -/* +/* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -8,16 +7,16 @@ class STPReferralFrequencyRequest { *@desc: */ - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; /* { "LanguageID": 2, @@ -45,7 +44,7 @@ class STPReferralFrequencyRequest { this.patientOutSA = false, this.patientTypeID = 1}); - STPReferralFrequencyRequest.fromJson(Map json) { + STPReferralFrequencyRequest.fromJson(Map json) { languageID = json['LanguageID']; stamp = json['stamp']; iPAdress = json['IPAdress']; diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart index e1b50a81..e16024ac 100644 --- a/lib/models/patient/get_pending_patient_er_model.dart +++ b/lib/models/patient/get_pending_patient_er_model.dart @@ -7,9 +7,10 @@ */ import 'dart:convert'; -ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => ListPendingPatientListModel.fromJson(json.decode(str)); +ListPendingPatientListModel listPendingPatientListModelFromJson(String? str) => + ListPendingPatientListModel.fromJson(json.decode(str!)); -String listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); +String? listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); class ListPendingPatientListModel { ListPendingPatientListModel({ @@ -56,127 +57,128 @@ class ListPendingPatientListModel { dynamic acceptedBy; dynamic acceptedOn; - int age; + int? age; dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestId; - String clinicName; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; + String? clientRequestId; + String? clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - DateTime dateOfBirth; - String deviceToken; - String deviceType; + DateTime? dateOfBirth; + String? deviceToken; + String? deviceType; dynamic doctorName; - String editOn; - String gender; - bool isFollowUp; + String? editOn; + String? gender; + bool? isFollowUp; dynamic isFromVida; - int isLoginB; - bool isOutKsa; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; + int? isLoginB; + bool? isOutKsa; + int? isRejected; + String? language; + double? latitude; + double? longitude; + String? mobileNumber; dynamic openSession; dynamic openTokenId; - String patientId; - String patientName; - int patientStatus; - String preferredLanguage; - int projectId; - int scoring; - int serviceId; + String? patientId; + String? patientName; + int? patientStatus; + String? preferredLanguage; + int? projectId; + int? scoring; + int? serviceId; dynamic tokenId; - int vcId; - String voipToken; + int? vcId; + String? voipToken; - factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( - acceptedBy: json["AcceptedBy"], - acceptedOn: json["AcceptedOn"], - age: json["Age"], - appointmentNo: json["AppointmentNo"], - arrivalTime: json["ArrivalTime"], - arrivalTimeD: json["ArrivalTimeD"], - callStatus: json["CallStatus"], - clientRequestId: json["ClientRequestID"], - clinicName: json["ClinicName"], - consoltationEnd: json["ConsoltationEnd"], - consultationNotes: json["ConsultationNotes"], - createdOn: json["CreatedOn"], - dateOfBirth: DateTime.parse(json["DateOfBirth"]), - deviceToken: json["DeviceToken"], - deviceType: json["DeviceType"], - doctorName: json["DoctorName"], - editOn: json["EditOn"], - gender: json["Gender"], - isFollowUp: json["IsFollowUP"], - isFromVida: json["IsFromVida"], - isLoginB: json["IsLoginB"], - isOutKsa: json["IsOutKSA"], - isRejected: json["IsRejected"], - language: json["Language"], - latitude: json["Latitude"].toDouble(), - longitude: json["Longitude"].toDouble(), - mobileNumber: json["MobileNumber"], - openSession: json["OpenSession"], - openTokenId: json["OpenTokenID"], - patientId: json["PatientID"], - patientName: json["PatientName"], - patientStatus: json["PatientStatus"], - preferredLanguage: json["PreferredLanguage"], - projectId: json["ProjectID"], - scoring: json["Scoring"], - serviceId: json["ServiceID"], - tokenId: json["TokenID"], - vcId: json["VC_ID"], - voipToken: json["VoipToken"], - ); + factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( + acceptedBy: json["AcceptedBy"], + acceptedOn: json["AcceptedOn"], + age: json["Age"], + appointmentNo: json["AppointmentNo"], + arrivalTime: json["ArrivalTime"], + arrivalTimeD: json["ArrivalTimeD"], + callStatus: json["CallStatus"], + clientRequestId: json["ClientRequestID"], + clinicName: json["ClinicName"], + consoltationEnd: json["ConsoltationEnd"], + consultationNotes: json["ConsultationNotes"], + createdOn: json["CreatedOn"], + dateOfBirth: DateTime.parse(json["DateOfBirth"]), + deviceToken: json["DeviceToken"], + deviceType: json["DeviceType"], + doctorName: json["DoctorName"], + editOn: json["EditOn"], + gender: json["Gender"], + isFollowUp: json["IsFollowUP"], + isFromVida: json["IsFromVida"], + isLoginB: json["IsLoginB"], + isOutKsa: json["IsOutKSA"], + isRejected: json["IsRejected"], + language: json["Language"], + latitude: json["Latitude"].toDouble(), + longitude: json["Longitude"].toDouble(), + mobileNumber: json["MobileNumber"], + openSession: json["OpenSession"], + openTokenId: json["OpenTokenID"], + patientId: json["PatientID"], + patientName: json["PatientName"], + patientStatus: json["PatientStatus"], + preferredLanguage: json["PreferredLanguage"], + projectId: json["ProjectID"], + scoring: json["Scoring"], + serviceId: json["ServiceID"], + tokenId: json["TokenID"], + vcId: json["VC_ID"], + voipToken: json["VoipToken"], + ); - Map toJson() => { - "AcceptedBy": acceptedBy, - "AcceptedOn": acceptedOn, - "Age": age, - "AppointmentNo": appointmentNo, - "ArrivalTime": arrivalTime, - "ArrivalTimeD": arrivalTimeD, - "CallStatus": callStatus, - "ClientRequestID": clientRequestId, - "ClinicName": clinicName, - "ConsoltationEnd": consoltationEnd, - "ConsultationNotes": consultationNotes, - "CreatedOn": createdOn, - "DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", - "DeviceToken": deviceToken, - "DeviceType": deviceType, - "DoctorName": doctorName, - "EditOn": editOn, - "Gender": gender, - "IsFollowUP": isFollowUp, - "IsFromVida": isFromVida, - "IsLoginB": isLoginB, - "IsOutKSA": isOutKsa, - "IsRejected": isRejected, - "Language": language, - "Latitude": latitude, - "Longitude": longitude, - "MobileNumber": mobileNumber, - "OpenSession": openSession, - "OpenTokenID": openTokenId, - "PatientID": patientId, - "PatientName": patientName, - "PatientStatus": patientStatus, - "PreferredLanguage": preferredLanguage, - "ProjectID": projectId, - "Scoring": scoring, - "ServiceID": serviceId, - "TokenID": tokenId, - "VC_ID": vcId, - "VoipToken": voipToken, - }; + Map toJson() => { + "AcceptedBy": acceptedBy, + "AcceptedOn": acceptedOn, + "Age": age, + "AppointmentNo": appointmentNo, + "ArrivalTime": arrivalTime, + "ArrivalTimeD": arrivalTimeD, + "CallStatus": callStatus, + "ClientRequestID": clientRequestId, + "ClinicName": clinicName, + "ConsoltationEnd": consoltationEnd, + "ConsultationNotes": consultationNotes, + "CreatedOn": createdOn, + "DateOfBirth": + "${dateOfBirth!.year.toString().padLeft(4, '0')}-${dateOfBirth!.month.toString().padLeft(2, '0')}-${dateOfBirth!.day.toString().padLeft(2, '0')}", + "DeviceToken": deviceToken, + "DeviceType": deviceType, + "DoctorName": doctorName, + "EditOn": editOn, + "Gender": gender, + "IsFollowUP": isFollowUp, + "IsFromVida": isFromVida, + "IsLoginB": isLoginB, + "IsOutKSA": isOutKsa, + "IsRejected": isRejected, + "Language": language, + "Latitude": latitude, + "Longitude": longitude, + "MobileNumber": mobileNumber, + "OpenSession": openSession, + "OpenTokenID": openTokenId, + "PatientID": patientId, + "PatientName": patientName, + "PatientStatus": patientStatus, + "PreferredLanguage": preferredLanguage, + "ProjectID": projectId, + "Scoring": scoring, + "ServiceID": serviceId, + "TokenID": tokenId, + "VC_ID": vcId, + "VoipToken": voipToken, + }; } // To parse this JSON data, do // diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index 2d3ac663..eb505c34 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -21,23 +21,22 @@ *@desc: */ class InsuranceAprovalsRequest { - int exuldAppNO; - int patientID; - int channel; - int projectID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? exuldAppNO; + int? patientID; + int? channel; + int? projectID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; InsuranceAprovalsRequest( - { - this.exuldAppNO, + {this.exuldAppNO, this.patientID, this.channel = 9, this.projectID = 12, @@ -46,12 +45,12 @@ class InsuranceAprovalsRequest { this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', this.versionID = 5.8, - this.tokenID , + this.tokenID, this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, this.patientOutSA = false}); - InsuranceAprovalsRequest.fromJson(Map json) { + InsuranceAprovalsRequest.fromJson(Map json) { exuldAppNO = json['EXuldAPPNO']; patientID = json['PatientID']; channel = json['Channel']; @@ -67,8 +66,8 @@ class InsuranceAprovalsRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['EXuldAPPNO'] = this.exuldAppNO; data['PatientID'] = this.patientID; data['Channel'] = this.channel; diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/models/patient/lab_orders/lab_orders_req_model.dart index a97f4093..15efb56e 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -1,24 +1,23 @@ - -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: *@return:LabOrdersReqModel *@desc: LabOrdersReqModel class */ class LabOrdersReqModel { - int patientID; - int patientTypeID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? patientTypeID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; LabOrdersReqModel( {this.patientID, @@ -27,12 +26,12 @@ class LabOrdersReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.5, - this.channel=9, - this.sessionID='E2bsEeYEJo', - this.isLoginForDoctorApp =true, - this.patientOutSA=false}); + this.iPAdress = '11.11.11.11', + this.versionID = 5.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.isLoginForDoctorApp = true, + this.patientOutSA = false}); LabOrdersReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 7f463933..3aa46535 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -1,29 +1,27 @@ - - import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { - String setupID; - int projectID; - int patientID; - int patientType; - int orderNo; - String orderDate; - int invoiceTransactionType; - int invoiceNo; - int clinicId; - int doctorId; - int status; - String createdBy; - Null createdByN; - DateTime createdOn; - String editedBy; - Null editedByN; - String editedOn; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; + String? setupID; + int? projectID; + int? patientID; + int? patientType; + int? orderNo; + String? orderDate; + int? invoiceTransactionType; + int? invoiceNo; + int? clinicId; + int? doctorId; + int? status; + String? createdBy; + dynamic createdByN; + DateTime? createdOn; + String? editedBy; + dynamic editedByN; + String? editedOn; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; LabOrdersResModel( {this.setupID, @@ -48,7 +46,7 @@ class LabOrdersResModel { this.doctorName, this.projectName}); - LabOrdersResModel.fromJson(Map json) { + LabOrdersResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -72,8 +70,8 @@ class LabOrdersResModel { projectName = json['ProjectName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/models/patient/lab_result/lab_result.dart index ca753f2d..6e740e16 100644 --- a/lib/models/patient/lab_result/lab_result.dart +++ b/lib/models/patient/lab_result/lab_result.dart @@ -1,64 +1,64 @@ class LabResult { - String setupID; - int projectID; - int orderNo; - int lineItemNo; - int packageID; - int testID; - String description; - String resultValue; - String referenceRange; - Null convertedResultValue; - Null convertedReferenceRange; - Null resultValueFlag; - int status; - String createdBy; - Null createdByN; - String createdOn; - String editedBy; - Null editedByN; - String editedOn; - String verifiedBy; - Null verifiedByN; - String verifiedOn; + String? setupID; + int? projectID; + int? orderNo; + int? lineItemNo; + int? packageID; + int? testID; + String? description; + String? resultValue; + String? referenceRange; + dynamic convertedResultValue; + dynamic convertedReferenceRange; + dynamic resultValueFlag; + int? status; + String? createdBy; + dynamic createdByN; + String? createdOn; + String? editedBy; + dynamic editedByN; + String? editedOn; + String? verifiedBy; + dynamic verifiedByN; + String? verifiedOn; Null patientID; - int gender; - Null maleInterpretativeData; - Null femaleInterpretativeData; - String testCode; - String statusDescription; + int? gender; + dynamic maleinterpretativeData; + dynamic femaleinterpretativeData; + String? testCode; + String? statusDescription; LabResult( {this.setupID, - this.projectID, - this.orderNo, - this.lineItemNo, - this.packageID, - this.testID, - this.description, - this.resultValue, - this.referenceRange, - this.convertedResultValue, - this.convertedReferenceRange, - this.resultValueFlag, - this.status, - this.createdBy, - this.createdByN, - this.createdOn, - this.editedBy, - this.editedByN, - this.editedOn, - this.verifiedBy, - this.verifiedByN, - this.verifiedOn, - this.patientID, - this.gender, - this.maleInterpretativeData, - this.femaleInterpretativeData, - this.testCode, - this.statusDescription}); + this.projectID, + this.orderNo, + this.lineItemNo, + this.packageID, + this.testID, + this.description, + this.resultValue, + this.referenceRange, + this.convertedResultValue, + this.convertedReferenceRange, + this.resultValueFlag, + this.status, + this.createdBy, + this.createdByN, + this.createdOn, + this.editedBy, + this.editedByN, + this.editedOn, + this.verifiedBy, + this.verifiedByN, + this.verifiedOn, + this.patientID, + this.gender, + this.maleinterpretativeData, + this.femaleinterpretativeData, + this.testCode, + this.statusDescription}); - LabResult.fromJson(Map json) { + LabResult.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; orderNo = json['OrderNo']; @@ -83,14 +83,14 @@ class LabResult { verifiedOn = json['VerifiedOn']; patientID = json['PatientID']; gender = json['Gender']; - maleInterpretativeData = json['MaleInterpretativeData']; - femaleInterpretativeData = json['FemaleInterpretativeData']; + maleinterpretativeData = json['Maleint?erpretativeData']; + femaleinterpretativeData = json['Femaleint?erpretativeData']; testCode = json['TestCode']; statusDescription = json['StatusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; @@ -115,8 +115,8 @@ class LabResult { data['VerifiedOn'] = this.verifiedOn; data['PatientID'] = this.patientID; data['Gender'] = this.gender; - data['MaleInterpretativeData'] = this.maleInterpretativeData; - data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Maleint?erpretativeData'] = this.maleinterpretativeData; + data['Femaleint?erpretativeData'] = this.femaleinterpretativeData; data['TestCode'] = this.testCode; data['StatusDescription'] = this.statusDescription; return data; diff --git a/lib/models/patient/lab_result/lab_result_req_model.dart b/lib/models/patient/lab_result/lab_result_req_model.dart index 5e58a4a5..91510d38 100644 --- a/lib/models/patient/lab_result/lab_result_req_model.dart +++ b/lib/models/patient/lab_result/lab_result_req_model.dart @@ -1,36 +1,36 @@ class RequestLabResult { - int projectID; - String setupID; - int orderNo; - int invoiceNo; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + String? setupID; + int? orderNo; + int? invoiceNo; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestLabResult( {this.projectID, - this.setupID, - this.orderNo, - this.invoiceNo, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.setupID, + this.orderNo, + this.invoiceNo, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestLabResult.fromJson(Map json) { + RequestLabResult.fromJson(Map json) { projectID = json['ProjectID']; setupID = json['SetupID']; orderNo = json['OrderNo']; diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/models/patient/my_referral/PendingReferral.dart index 6d3f0b83..58f12baf 100644 --- a/lib/models/patient/my_referral/PendingReferral.dart +++ b/lib/models/patient/my_referral/PendingReferral.dart @@ -1,37 +1,37 @@ import '../patiant_info_model.dart'; class PendingReferral { - PatiantInformtion patientDetails; - String doctorImageUrl; - String nationalityFlagUrl; - String responded; - String answerFromTarget; - String createdOn; - int data; - int isSameBranch; - String editedOn; - int interBranchReferral; - int patientID; - String patientName; - int patientType; - int referralNo; - String referralStatus; - String referredByDoctorInfo; - String referredFromBranchName; - String referredOn; - String referredType; - String remarksFromSource; - String respondedOn; - int sourceAppointmentNo; - int sourceProjectId; - String sourceSetupID; - String startDate; - int targetAppointmentNo; - String targetClinicID; - String targetDoctorID; - int targetProjectId; - String targetSetupID; - bool isReferralDoctorSameBranch; + PatiantInformtion? patientDetails; + String? doctorImageUrl; + String? nationalityFlagUrl; + String? responded; + String? answerFromTarget; + String? createdOn; + int? data; + int? isSameBranch; + String? editedOn; + int? interBranchReferral; + int? patientID; + String? patientName; + int? patientType; + int? referralNo; + String? referralStatus; + String? referredByDoctorInfo; + String? referredFromBranchName; + String? referredOn; + String? referredType; + String? remarksFromSource; + String? respondedOn; + int? sourceAppointmentNo; + int? sourceProjectId; + String? sourceSetupID; + String? startDate; + int? targetAppointmentNo; + String? targetClinicID; + String? targetDoctorID; + int? targetProjectId; + String? targetSetupID; + bool? isReferralDoctorSameBranch; PendingReferral({ this.patientDetails, @@ -68,9 +68,7 @@ class PendingReferral { }); PendingReferral.fromJson(Map json) { - patientDetails = json['patientDetails'] != null - ? PatiantInformtion.fromJson(json['patientDetails']) - : null; + patientDetails = json['patientDetails'] != null ? PatiantInformtion.fromJson(json['patientDetails']) : null; doctorImageUrl = json['DoctorImageURL']; nationalityFlagUrl = json['NationalityFlagURL']; responded = json['Responded']; @@ -79,7 +77,7 @@ class PendingReferral { data = json['data']; isSameBranch = json['isSameBranch']; editedOn = json['editedOn']; - interBranchReferral = json['interBranchReferral']; + int? erBranchReferral = json['int?erBranchReferral']; patientID = json['patientID']; patientName = json['patientName']; patientType = json['patientType']; @@ -91,19 +89,19 @@ class PendingReferral { referredType = json['referredType']; remarksFromSource = json['remarksFromSource']; respondedOn = json['respondedOn']; - sourceAppointmentNo = json['sourceAppointmentNo']; + sourceAppointmentNo = json['sourceAppoint?mentNo']; sourceProjectId = json['sourceProjectId']; sourceSetupID = json['sourceSetupID']; startDate = json['startDate']; - targetAppointmentNo = json['targetAppointmentNo']; + targetAppointmentNo = json['targetAppoint?mentNo']; targetClinicID = json['targetClinicID']; targetDoctorID = json['targetDoctorID']; targetProjectId = json['targetProjectId']; targetSetupID = json['targetSetupID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorImageURL'] = this.doctorImageUrl; data['NationalityFlagURL'] = this.nationalityFlagUrl; data['Responded'] = this.responded; @@ -112,7 +110,7 @@ class PendingReferral { data['data'] = this.data; data['isSameBranch'] = this.isSameBranch; data['editedOn'] = this.editedOn; - data['interBranchReferral'] = this.interBranchReferral; + data['int?erBranchReferral'] = this.interBranchReferral; data['patientID'] = this.patientID; data['patientName'] = this.patientName; data['patientType'] = this.patientType; @@ -124,11 +122,11 @@ class PendingReferral { data['referredType'] = this.referredType; data['remarksFromSource'] = this.remarksFromSource; data['respondedOn'] = this.respondedOn; - data['sourceAppointmentNo'] = this.sourceAppointmentNo; + data['sourceAppoint?mentNo'] = this.sourceAppointmentNo; data['sourceProjectId'] = this.sourceProjectId; data['sourceSetupID'] = this.sourceSetupID; data['startDate'] = this.startDate; - data['targetAppointmentNo'] = this.targetAppointmentNo; + data['targetAppoint?mentNo'] = this.targetAppointmentNo; data['targetClinicID'] = this.targetClinicID; data['targetDoctorID'] = this.targetDoctorID; data['targetProjectId'] = this.targetProjectId; diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/models/patient/my_referral/clinic-doctor.dart index 843f636c..a8c541cf 100644 --- a/lib/models/patient/my_referral/clinic-doctor.dart +++ b/lib/models/patient/my_referral/clinic-doctor.dart @@ -1,86 +1,86 @@ class ClinicDoctor { - int clinicID; - String clinicName; - String doctorTitle; - int iD; - String name; - int projectID; - String projectName; - int actualDoctorRate; - int clinicRoomNo; - String date; - String dayName; - int doctorID; - String doctorImageURL; - String doctorProfile; - String doctorProfileInfo; - int doctorRate; - int gender; - String genderDescription; - bool isAppointmentAllowed; - bool isDoctorAllowVedioCall; - bool isDoctorDummy; - bool isLiveCare; - String latitude; - String longitude; - String nationalityFlagURL; - String nationalityID; - String nationalityName; - String nearestFreeSlot; - int noOfPatientsRate; - String originalClinicID; - int personRate; - int projectDistanceInKiloMeters; - String qR; - String qRString; - int rateNumber; - String serviceID; - String setupID; - List speciality; - String workingHours; + int? clinicID; + String? clinicName; + String? doctorTitle; + int? iD; + String? name; + int? projectID; + String? projectName; + int? actualDoctorRate; + int? clinicRoomNo; + String? date; + String? dayName; + int? doctorID; + String? doctorImageURL; + String? doctorProfile; + String? doctorProfileInfo; + int? doctorRate; + int? gender; + String? genderDescription; + bool? isAppointmentAllowed; + bool? isDoctorAllowVedioCall; + bool? isDoctorDummy; + bool? isLiveCare; + String? latitude; + String? longitude; + String? nationalityFlagURL; + String? nationalityID; + String? nationalityName; + String? nearestFreeSlot; + int? noOfPatientsRate; + String? originalClinicID; + int? personRate; + int? projectDistanceInKiloMeters; + String? qR; + String? qRString; + int? rateNumber; + String? serviceID; + String? setupID; + List? speciality; + String? workingHours; ClinicDoctor( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); - ClinicDoctor.fromJson(Map json) { + ClinicDoctor.fromJson(Map json) { clinicID = json['ClinicID']; clinicName = json['ClinicName']; doctorTitle = json['DoctorTitle']; @@ -99,7 +99,7 @@ class ClinicDoctor { doctorRate = json['DoctorRate']; gender = json['Gender']; genderDescription = json['GenderDescription']; - isAppointmentAllowed = json['IsAppointmentAllowed']; + isAppointmentAllowed = json['IsAppoint?mentAllowed']; isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isDoctorDummy = json['IsDoctorDummy']; isLiveCare = json['IsLiveCare']; @@ -114,16 +114,16 @@ class ClinicDoctor { personRate = json['PersonRate']; projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters']; qR = json['QR']; - qRString = json['QRString']; + qRString = json['QRString?']; rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - speciality = json['Speciality'].cast(); + speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ClinicID'] = this.clinicID; data['ClinicName'] = this.clinicName; data['DoctorTitle'] = this.doctorTitle; @@ -142,7 +142,7 @@ class ClinicDoctor { data['DoctorRate'] = this.doctorRate; data['Gender'] = this.gender; data['GenderDescription'] = this.genderDescription; - data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsLiveCare'] = this.isLiveCare; @@ -157,7 +157,7 @@ class ClinicDoctor { data['PersonRate'] = this.personRate; data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters; data['QR'] = this.qR; - data['QRString'] = this.qRString; + data['QRString?'] = this.qRString; data['RateNumber'] = this.rateNumber; data['ServiceID'] = this.serviceID; data['SetupID'] = this.setupID; @@ -165,5 +165,4 @@ class ClinicDoctor { data['WorkingHours'] = this.workingHours; return data; } - -} \ No newline at end of file +} diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index f1506f8e..f79a57c3 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -1,108 +1,108 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - DateTime mAXResponseTime; - String age; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referringDoctorName; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + DateTime? mAXResponseTime; + String? age; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referringDoctorName; MyReferralPatientModel( {this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.age, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName}); + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.age, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; doctorID = json['DoctorID']; @@ -154,8 +154,8 @@ class MyReferralPatientModel { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; data['DoctorID'] = this.doctorID; 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..0dad14af 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -1,136 +1,134 @@ - - class MyReferredPatientModel { - String rowID; - int projectID; - int lineItemNo; - int doctorID; - int patientID; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomID; - String bedID; - String nursingStationID; - String description; - String nationalityName; - String nationalityNameN; - String clinicDescription; - String clinicDescriptionN; - int referralDoctor; - int referringDoctor; - int referralClinic; - int referringClinic; - int referralStatus; - String referralDate; - String referringDoctorRemarks; - String referredDoctorRemarks; - String referralResponseOn; - int priority; - int frequency; - String mAXResponseTime; - int episodeID; - int appointmentNo; - String appointmentDate; - int appointmentType; - int patientMRN; - String createdOn; - int clinicID; - String nationalityID; - String age; - String doctorImageURL; - String frequencyDescription; - String genderDescription; - bool isDoctorLate; - bool isDoctorResponse; - String nationalityFlagURL; - String nursingStationName; - String priorityDescription; - String referringClinicDescription; - String referralDoctorName; - String referralClinicDescription; - String referringDoctorName; - bool isReferralDoctorSameBranch; - String referralStatusDesc; + String? rowID; + int? projectID; + int? lineItemNo; + int? doctorID; + int? patientID; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + int? gender; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + String? admissionNo; + String? admissionDate; + String? roomID; + String? bedID; + String? nursingStationID; + String? description; + String? nationalityName; + String? nationalityNameN; + String? clinicDescription; + String? clinicDescriptionN; + int? referralDoctor; + int? referringDoctor; + int? referralClinic; + int? referringClinic; + int? referralStatus; + String? referralDate; + String? referringDoctorRemarks; + String? referredDoctorRemarks; + String? referralResponseOn; + int? priority; + int? frequency; + String? mAXResponseTime; + int? episodeID; + int? appointmentNo; + String? appointmentDate; + int? appointmentType; + int? patientMRN; + String? createdOn; + int? clinicID; + String? nationalityID; + String? age; + String? doctorImageURL; + String? frequencyDescription; + String? genderDescription; + bool? isDoctorLate; + bool? isDoctorResponse; + String? nationalityFlagURL; + String? nursingStationName; + String? priorityDescription; + String? referringClinicDescription; + String? referralDoctorName; + String? referralClinicDescription; + String? referringDoctorName; + bool? isReferralDoctorSameBranch; + String? referralStatusDesc; - MyReferredPatientModel({ - this.rowID, - this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.isReferralDoctorSameBranch, - this.referralDoctorName, - this.referralClinicDescription,this.referralStatusDesc - }); + MyReferredPatientModel( + {this.rowID, + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.isReferralDoctorSameBranch, + this.referralDoctorName, + this.referralClinicDescription, + this.referralStatusDesc}); MyReferredPatientModel.fromJson(Map json) { rowID = json['RowID']; diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 1372cfd6..8fb336aa 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -1,4 +1,3 @@ - /* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -23,36 +22,36 @@ */ class OrdersRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - double versionID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; OrdersRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID , + this.tokenID, this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, this.versionID = 5.5, this.patientOutSA = false}); - OrdersRequest.fromJson(Map json) { + OrdersRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; @@ -68,8 +67,8 @@ class OrdersRequest { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -85,4 +84,4 @@ class OrdersRequest { data['VersionID'] = this.versionID; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 71d46dc9..16377e7a 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,79 +1,79 @@ // TODO : it have to be changed. class PatiantInformtion { - final PatiantInformtion patientDetails; - int genderInt; + final PatiantInformtion? patientDetails; + int? genderInt; dynamic age; - String appointmentDate; + String? appointmentDate; dynamic appointmentNo; dynamic appointmentType; - String arrivalTime; - String arrivalTimeD; - int callStatus; + String? arrivalTime; + String? arrivalTimeD; + int? callStatus; dynamic callStatusDisc; - int callTypeID; - String clientRequestID; - String clinicName; - String consoltationEnd; - String consultationNotes; - int appointmentTypeId; - String arrivedOn; - int clinicGroupId; - String companyName; + int? callTypeID; + String? clientRequestID; + String? clinicName; + String? consoltationEnd; + String? consultationNotes; + int? appointmentTypeId; + String? arrivedOn; + int? clinicGroupId; + String? companyName; dynamic dischargeStatus; dynamic doctorDetails; - int doctorId; - String endTime; - int episodeNo; - int fallRiskScore; - bool isSigned; - int medicationOrders; - String mobileNumber; - String nationality; - int projectId; - int clinicId; + int? doctorId; + String? endTime; + int? episodeNo; + int? fallRiskScore; + bool? isSigned; + int? medicationOrders; + String? mobileNumber; + String? nationality; + int? projectId; + int? clinicId; dynamic patientId; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - String fullName; - String fullNameN; - int gender; - String dateofBirth; - String nationalityId; - String emailAddress; - String patientIdentificationNo; - int patientType; - int patientMRN; - String admissionNo; - String admissionDate; - String createdOn; - String roomId; - String bedId; - String nursingStationId; - String description; - String clinicDescription; - String clinicDescriptionN; - String nationalityName; - String nationalityNameN; - String genderDescription; - String nursingStationName; - String startTime; - String visitType; - String nationalityFlagURL; - int patientStatus; - int patientStatusType; - int visitTypeId; - String startTimes; - String dischargeDate; - int status; - int vcId; - String voipToken; + String? doctorName; + String? doctorNameN; + String? firstName; + String? middleName; + String? lastName; + String? firstNameN; + String? middleNameN; + String? lastNameN; + String? fullName; + String? fullNameN; + int? gender; + String? dateofBirth; + String? nationalityId; + String? emailAddress; + String? patientIdentificationNo; + int? patientType; + int? patientMRN; + String? admissionNo; + String? admissionDate; + String? createdOn; + String? roomId; + String? bedId; + String? nursingStationId; + String? description; + String? clinicDescription; + String? clinicDescriptionN; + String? nationalityName; + String? nationalityNameN; + String? genderDescription; + String? nursingStationName; + String? startTime; + String? visitType; + String? nationalityFlagURL; + int? patientStatus; + int? patientStatusType; + int? visitTypeId; + String? startTimes; + String? dischargeDate; + int? status; + int? vcId; + String? voipToken; PatiantInformtion( {this.patientDetails, @@ -150,17 +150,14 @@ class PatiantInformtion { this.vcId, this.voipToken}); - factory PatiantInformtion.fromJson(Map json) => - PatiantInformtion( - patientDetails: json['patientDetails'] != null - ? new PatiantInformtion.fromJson(json['patientDetails']) - : null, + factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( + patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null, projectId: json["ProjectID"] ?? json["projectID"], clinicId: json["ClinicID"] ?? json["clinicID"], doctorId: json["DoctorID"] ?? json["doctorID"], patientId: json["PatientID"] != null ? json["PatientID"] is String - ? int.parse(json["PatientID"]) + ? int?.parse(json["PatientID"]) : json["PatientID"] : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], doctorName: json["DoctorName"] ?? json["doctorName"], @@ -173,18 +170,16 @@ class PatiantInformtion { lastNameN: json["LastNameN"] ?? json["lastNameN"], gender: json["Gender"] != null ? json["Gender"] is String - ? int.parse(json["Gender"]) + ? int?.parse(json["Gender"]) : json["Gender"] : json["gender"], fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"], - fullNameN: - json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], + fullNameN: json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'], nationalityId: json["NationalityID"] ?? json["nationalityID"], mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], emailAddress: json["EmailAddress"] ?? json["emailAddress"], - patientIdentificationNo: - json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], + patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], //TODO make 7 dynamic when the backend retrun it in patient arrival patientType: json["PatientType"] ?? json["patientType"] ?? 1, admissionNo: json["AdmissionNo"] ?? json["admissionNo"], @@ -194,16 +189,10 @@ class PatiantInformtion { bedId: json["BedID"] ?? json["bedID"], nursingStationId: json["NursingStationID"] ?? json["nursingStationID"], description: json["Description"] ?? json["description"], - clinicDescription: - json["ClinicDescription"] ?? json["clinicDescription"], - clinicDescriptionN: - json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"] ?? - json["nationalityName"] ?? - json['NationalityName'], - nationalityNameN: json["NationalityNameN"] ?? - json["nationalityNameN"] ?? - json['NationalityNameN'], + clinicDescription: json["ClinicDescription"] ?? json["clinicDescription"], + clinicDescriptionN: json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], + nationalityName: json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'], + nationalityNameN: json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'], age: json["Age"] ?? json["age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], @@ -211,8 +200,7 @@ class PatiantInformtion { startTime: json["startTime"] ?? json['StartTime'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], - appointmentTypeId: - json['appointmentTypeId'] ?? json['appointmentTypeid'], + appointmentTypeId: json['appointmentTypeId'] ?? json['appointmentTypeid'], arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], clinicGroupId: json['clinicGroupId'], companyName: json['companyName'], @@ -224,17 +212,15 @@ 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()) + : int?.parse(json["patientID"].toString())), visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], - nationalityFlagURL: - json['NationalityFlagURL'] ?? json['NationalityFlagURL'], - patientStatusType: - json['patientStatusType'] ?? json['PatientStatusType'], - visitTypeId: - json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], + nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], + patientStatusType: json['patientStatusType'] ?? json['PatientStatusType'], + visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], startTimes: json['StartTime'] ?? json['StartTime'], dischargeDate: json['DischargeDate'], status: json['Status'], diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 1d0da9c5..c37cd72b 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -1,12 +1,12 @@ class GetPatientArrivalListRequestModel { - String vidaAuthTokenID; - String from; - String to; - String doctorID; - int pageIndex; - int pageSize; - int clinicID; - int patientMRN; + String? vidaAuthTokenID; + String? from; + String? to; + String? doctorID; + int? pageIndex; + int? pageSize; + int? clinicID; + int? patientMRN; GetPatientArrivalListRequestModel( {this.vidaAuthTokenID, @@ -40,7 +40,6 @@ class GetPatientArrivalListRequestModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; - return data; } } diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 7368c538..27da32f1 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -7,110 +7,108 @@ *@desc: */ class PatientModel { - int ProjectID; - int ClinicID; - int DoctorID; - String FirstName; + int? ProjectID; + int? ClinicID; + int? DoctorID; + String? FirstName; - String MiddleName; - String LastName; - String PatientMobileNumber; - String PatientIdentificationID; - int PatientID; - String From; - String To; - int LanguageID; - String stamp; - String IPAdress; - double VersionID; - int Channel; - String TokenID; - String SessionID; - bool IsLoginForDoctorApp; - bool PatientOutSA; - int Searchtype; - String IdentificationNo; - String MobileNo; - int get getProjectID => ProjectID; + String? MiddleName; + String? LastName; + String? PatientMobileNumber; + String? PatientIdentificationID; + int? PatientID; + String? From; + String? To; + int? LanguageID; + String? stamp; + String? IPAdress; + double? VersionID; + int? Channel; + String? TokenID; + String? SessionID; + bool? IsLoginForDoctorApp; + bool? PatientOutSA; + int? Searchtype; + String? IdentificationNo; + String? MobileNo; + int? get getProjectID => ProjectID; - set setProjectID(int ProjectID) => this.ProjectID = ProjectID; + set setProjectID(int? ProjectID) => this.ProjectID = ProjectID; - int get getClinicID => ClinicID; + int? get getClinicID => ClinicID; - set setClinicID(int ClinicID) => this.ClinicID = ClinicID; + set setClinicID(int? ClinicID) => this.ClinicID = ClinicID; - int get getDoctorID => DoctorID; + int? get getDoctorID => DoctorID; - set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; - String get getFirstName => FirstName; + set setDoctorID(int? DoctorID) => this.DoctorID = DoctorID; + String? get getFirstName => FirstName; - set setFirstName(String FirstName) => this.FirstName = FirstName; + set setFirstName(String? FirstName) => this.FirstName = FirstName; - String get getMiddleName => MiddleName; + String? get getMiddleName => MiddleName; - set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; + set setMiddleName(String? MiddleName) => this.MiddleName = MiddleName; - String get getLastName => LastName; + String? get getLastName => LastName; - set setLastName(String LastName) => this.LastName = LastName; + set setLastName(String? LastName) => this.LastName = LastName; - String get getPatientMobileNumber => PatientMobileNumber; + String? get getPatientMobileNumber => PatientMobileNumber; - set setPatientMobileNumber(String PatientMobileNumber) => - this.PatientMobileNumber = PatientMobileNumber; + set setPatientMobileNumber(String? PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; -// String get getPatientIdentificationID => PatientIdentificationID; +// String? get getPatientIdentificationID => PatientIdentificationID; -// set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; +// set setPatientIdentificationID(String? PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; - int get getPatientID => PatientID; + int? get getPatientID => PatientID; - set setPatientID(int PatientID) => this.PatientID = PatientID; + set setPatientID(int? PatientID) => this.PatientID = PatientID; - String get getFrom => From; + String? get getFrom => From; - set setFrom(String From) => this.From = From; + set setFrom(String? From) => this.From = From; - String get getTo => To; + String? get getTo => To; - set setTo(String To) => this.To = To; + set setTo(String? To) => this.To = To; - int get getLanguageID => LanguageID; + int? get getLanguageID => LanguageID; - set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; + set setLanguageID(int? LanguageID) => this.LanguageID = LanguageID; - String get getStamp => stamp; + String? get getStamp => stamp; - set setStamp(String stamp) => this.stamp = stamp; + set setStamp(String? stamp) => this.stamp = stamp; - String get getIPAdress => IPAdress; + String? get getIPAdress => IPAdress; - set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; + set setIPAdress(String? IPAdress) => this.IPAdress = IPAdress; - double get getVersionID => VersionID; + double? get getVersionID => VersionID; - set setVersionID(double VersionID) => this.VersionID = VersionID; + set setVersionID(double? VersionID) => this.VersionID = VersionID; - int get getChannel => Channel; + int? get getChannel => Channel; - set setChannel(int Channel) => this.Channel = Channel; + set setChannel(int? Channel) => this.Channel = Channel; - String get getTokenID => TokenID; + String? get getTokenID => TokenID; - set setTokenID(String TokenID) => this.TokenID = TokenID; + set setTokenID(String? TokenID) => this.TokenID = TokenID; - String get getSessionID => SessionID; + String? get getSessionID => SessionID; - set setSessionID(String SessionID) => this.SessionID = SessionID; + set setSessionID(String? SessionID) => this.SessionID = SessionID; - bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; + bool? get getIsLoginForDoctorApp => IsLoginForDoctorApp; - set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => - this.IsLoginForDoctorApp = IsLoginForDoctorApp; + set setIsLoginForDoctorApp(bool? IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; - bool get getPatientOutSA => PatientOutSA; + bool? get getPatientOutSA => PatientOutSA; - set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; + set setPatientOutSA(bool? PatientOutSA) => this.PatientOutSA = PatientOutSA; PatientModel( {this.ProjectID, @@ -137,12 +135,12 @@ class PatientModel { this.IdentificationNo, this.MobileNo}); - factory PatientModel.fromJson(Map json) => PatientModel( + factory PatientModel.fromJson(Map json) => PatientModel( FirstName: json["FirstName"], LastName: json["LasttName"], ); - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.ProjectID; data['ClinicID'] = this.ClinicID; data['DoctorID'] = this.DoctorID; diff --git a/lib/models/patient/prescription/prescription_report.dart b/lib/models/patient/prescription/prescription_report.dart index 05d28bdc..10119e75 100644 --- a/lib/models/patient/prescription/prescription_report.dart +++ b/lib/models/patient/prescription/prescription_report.dart @@ -1,70 +1,70 @@ class PrescriptionReport { - String address; - int appointmentNo; - String clinic; - String companyName; - int days; - String doctorName; - int doseDailyQuantity; - String frequency; - int frequencyNumber; + String? address; + int? appointmentNo; + String? clinic; + String? companyName; + int? days; + String? doctorName; + int? doseDailyQuantity; + String? frequency; + int? frequencyNumber; Null imageExtension; Null imageSRCUrl; Null imageString; Null imageThumbUrl; - String isCovered; - String itemDescription; - int itemID; - String orderDate; - int patientID; - String patientName; - String phoneOffice1; + String? isCovered; + String? itemDescription; + int? itemID; + String? orderDate; + int? patientID; + String? patientName; + String? phoneOffice1; Null prescriptionQR; - int prescriptionTimes; + int? prescriptionTimes; Null productImage; - String productImageBase64; - String productImageString; - int projectID; - String projectName; - String remarks; - String route; - String sKU; - int scaleOffset; - String startDate; + String? productImageBase64; + String? productImageString; + int? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + int? scaleOffset; + String? startDate; PrescriptionReport( {this.address, - this.appointmentNo, - this.clinic, - this.companyName, - this.days, - this.doctorName, - this.doseDailyQuantity, - this.frequency, - this.frequencyNumber, - this.imageExtension, - this.imageSRCUrl, - this.imageString, - this.imageThumbUrl, - this.isCovered, - this.itemDescription, - this.itemID, - this.orderDate, - this.patientID, - this.patientName, - this.phoneOffice1, - this.prescriptionQR, - this.prescriptionTimes, - this.productImage, - this.productImageBase64, - this.productImageString, - this.projectID, - this.projectName, - this.remarks, - this.route, - this.sKU, - this.scaleOffset, - this.startDate}); + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); PrescriptionReport.fromJson(Map json) { address = json['Address']; diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index 21cb13b1..f6285885 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,104 +1,104 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionReportForInPatient { - int admissionNo; - int authorizedBy; + int? admissionNo; + int? authorizedBy; Null bedNo; - String comments; - int createdBy; - String createdByName; + String? comments; + int? createdBy; + String? createdByName; Null createdByNameN; - String createdOn; - String direction; - int directionID; + String? createdOn; + String? direction; + int? directionID; Null directionN; - String dose; - int editedBy; + String? dose; + int? editedBy; Null iVDiluentLine; - int iVDiluentType; + int? iVDiluentType; Null iVDiluentVolume; Null iVRate; Null iVStability; - String itemDescription; - int itemID; - int lineItemNo; - int locationId; - int noOfDoses; - int orderNo; - int patientID; - String pharmacyRemarks; - DateTime prescriptionDatetime; - int prescriptionNo; - String processedBy; - int projectID; - int refillID; - String refillType; + String? itemDescription; + int? itemID; + int? lineItemNo; + int? locationId; + int? noOfDoses; + int? orderNo; + int? patientID; + String? pharmacyRemarks; + DateTime? prescriptionDatetime; + int? prescriptionNo; + String? processedBy; + int? projectID; + int? refillID; + String? refillType; Null refillTypeN; - int reviewedPharmacist; + int? reviewedPharmacist; Null roomId; - String route; - int routeId; + String? route; + int? routeId; Null routeN; Null setupID; - DateTime startDatetime; - int status; - String statusDescription; + DateTime? startDatetime; + int? status; + String? statusDescription; Null statusDescriptionN; - DateTime stopDatetime; - int unitofMeasurement; - String unitofMeasurementDescription; + DateTime? stopDatetime; + int? unitofMeasurement; + String? unitofMeasurementDescription; Null unitofMeasurementDescriptionN; PrescriptionReportForInPatient( {this.admissionNo, - this.authorizedBy, - this.bedNo, - this.comments, - this.createdBy, - this.createdByName, - this.createdByNameN, - this.createdOn, - this.direction, - this.directionID, - this.directionN, - this.dose, - this.editedBy, - this.iVDiluentLine, - this.iVDiluentType, - this.iVDiluentVolume, - this.iVRate, - this.iVStability, - this.itemDescription, - this.itemID, - this.lineItemNo, - this.locationId, - this.noOfDoses, - this.orderNo, - this.patientID, - this.pharmacyRemarks, - this.prescriptionDatetime, - this.prescriptionNo, - this.processedBy, - this.projectID, - this.refillID, - this.refillType, - this.refillTypeN, - this.reviewedPharmacist, - this.roomId, - this.route, - this.routeId, - this.routeN, - this.setupID, - this.startDatetime, - this.status, - this.statusDescription, - this.statusDescriptionN, - this.stopDatetime, - this.unitofMeasurement, - this.unitofMeasurementDescription, - this.unitofMeasurementDescriptionN}); + this.authorizedBy, + this.bedNo, + this.comments, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.direction, + this.directionID, + this.directionN, + this.dose, + this.editedBy, + this.iVDiluentLine, + this.iVDiluentType, + this.iVDiluentVolume, + this.iVRate, + this.iVStability, + this.itemDescription, + this.itemID, + this.lineItemNo, + this.locationId, + this.noOfDoses, + this.orderNo, + this.patientID, + this.pharmacyRemarks, + this.prescriptionDatetime, + this.prescriptionNo, + this.processedBy, + this.projectID, + this.refillID, + this.refillType, + this.refillTypeN, + this.reviewedPharmacist, + this.roomId, + this.route, + this.routeId, + this.routeN, + this.setupID, + this.startDatetime, + this.status, + this.statusDescription, + this.statusDescriptionN, + this.stopDatetime, + this.unitofMeasurement, + this.unitofMeasurementDescription, + this.unitofMeasurementDescriptionN}); - PrescriptionReportForInPatient.fromJson(Map json) { + PrescriptionReportForInPatient.fromJson(Map json) { admissionNo = json['AdmissionNo']; authorizedBy = json['AuthorizedBy']; bedNo = json['BedNo']; @@ -138,7 +138,7 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ; + startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']); status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; @@ -148,8 +148,8 @@ class PrescriptionReportForInPatient { unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AdmissionNo'] = this.admissionNo; data['AuthorizedBy'] = this.authorizedBy; data['BedNo'] = this.bedNo; diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/models/patient/prescription/prescription_req_model.dart deleted file mode 100644 index 9141c282..00000000 --- a/lib/models/patient/prescription/prescription_req_model.dart +++ /dev/null @@ -1,71 +0,0 @@ -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: - *@return:PrescriptionReqModel - *@desc: PrescriptionReqModel class - */ -class PrescriptionReqModel { - int patientID; - int setupID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - - PrescriptionReqModel( - {this.patientID, - this.setupID, - this.projectID, - this.languageID, - this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress = '11.11.11.11', - this.versionID = 5.5, - this.channel = 9, - this.sessionID = 'E2bsEeYEJo', - this.tokenID, - this.isLoginForDoctorApp = true, - this.patientOutSA = false, - this.patientTypeID}); - - PrescriptionReqModel.fromJson(Map json) { - patientID = json['PatientID']; - setupID = json['SetupID']; - projectID = json['ProjectID']; - languageID = json['LanguageID']; - stamp = json['stamp']; - iPAdress = json['IPAdress']; - versionID = json['VersionID']; - channel = json['Channel']; - tokenID = json['TokenID']; - sessionID = json['SessionID']; - isLoginForDoctorApp = json['IsLoginForDoctorApp']; - patientOutSA = json['PatientOutSA']; - patientTypeID = json['PatientTypeID']; - } - - Map toJson() { - final Map data = new Map(); - data['PatientID'] = this.patientID; - data['SetupID'] = this.setupID; - data['ProjectID'] = this.projectID; - data['LanguageID'] = this.languageID; - data['stamp'] = this.stamp; - data['IPAdress'] = this.iPAdress; - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['TokenID'] = this.tokenID; - data['SessionID'] = this.sessionID; - data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; - data['PatientOutSA'] = this.patientOutSA; - data['PatientTypeID'] = this.patientTypeID; - return data; - } -} diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/models/patient/prescription/prescription_res_model.dart index 9c7e296d..cc7fc44d 100644 --- a/lib/models/patient/prescription/prescription_res_model.dart +++ b/lib/models/patient/prescription/prescription_res_model.dart @@ -6,39 +6,39 @@ *@desc: PrescriptionResModel class */ class PrescriptionResModel { - String setupID; - int projectID; - int patientID; - int appointmentNo; - String appointmentDate; - String doctorName; - String clinicDescription; - String name; - int episodeID; - int actualDoctorRate; - int admission; - int clinicID; - String companyName; - String despensedStatus; - String dischargeDate; - int dischargeNo; - int doctorID; - String doctorImageURL; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - bool isInsurancePatient; - String nationalityFlagURL; - int noOfPatientsRate; - String qR; - List speciality; + String? setupID; + int? projectID; + int? patientID; + int? appointmentNo; + String? appointmentDate; + String? doctorName; + String? clinicDescription; + String? name; + int? episodeID; + int? actualDoctorRate; + int? admission; + int? clinicID; + String? companyName; + String? despensedStatus; + String? dischargeDate; + int? dischargeNo; + int? doctorID; + String? doctorImageURL; + int? doctorRate; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; + String? isInOutPatientDescription; + String? isInOutPatientDescriptionN; + bool? isInsurancePatient; + String? nationalityFlagURL; + int? noOfPatientsRate; + String? qR; + List? speciality; PrescriptionResModel( {this.setupID, @@ -75,7 +75,7 @@ class PrescriptionResModel { this.qR, this.speciality}); - PrescriptionResModel.fromJson(Map json) { + PrescriptionResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -111,8 +111,8 @@ class PrescriptionResModel { speciality = json['Speciality']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/models/patient/prescription/request_prescription_report.dart index 0581692e..078fd874 100644 --- a/lib/models/patient/prescription/request_prescription_report.dart +++ b/lib/models/patient/prescription/request_prescription_report.dart @@ -1,34 +1,34 @@ class RequestPrescriptionReport { - int projectID; - int appointmentNo; - int episodeID; - String setupID; - int patientTypeID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? appointmentNo; + int? episodeID; + String? setupID; + int? patientTypeID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestPrescriptionReport( {this.projectID, - this.appointmentNo, - this.episodeID, - this.setupID, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.appointmentNo, + this.episodeID, + this.setupID, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); RequestPrescriptionReport.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index fe0add5f..e19c50ed 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -1,4 +1,3 @@ - /* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -23,36 +22,36 @@ */ class ProgressNoteRequest { - int visitType; - int admissionNo; - int projectID; - int languageID; - String stamp; - String iPAdress; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - double versionID; + int? visitType; + int? admissionNo; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + double? versionID; ProgressNoteRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID , + this.tokenID, this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, this.versionID = 5.5, this.patientOutSA = false}); - ProgressNoteRequest.fromJson(Map json) { + ProgressNoteRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; @@ -68,8 +67,8 @@ class ProgressNoteRequest { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -85,4 +84,4 @@ class ProgressNoteRequest { data['VersionID'] = this.versionID; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index 47154d8b..3b510019 100644 --- a/lib/models/patient/radiology/radiology_req_model.dart +++ b/lib/models/patient/radiology/radiology_req_model.dart @@ -6,18 +6,18 @@ *@desc: RadiologyReqModel class */ class RadiologyReqModel { - int patientID; - int projectID; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RadiologyReqModel( {this.patientID, @@ -33,7 +33,7 @@ class RadiologyReqModel { this.patientOutSA = false, this.patientTypeID}); - RadiologyReqModel.fromJson(Map json) { + RadiologyReqModel.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; languageID = json['LanguageID']; @@ -48,8 +48,8 @@ class RadiologyReqModel { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['LanguageID'] = this.languageID; diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/models/patient/radiology/radiology_res_model.dart index 6c6509a9..cf618dd7 100644 --- a/lib/models/patient/radiology/radiology_res_model.dart +++ b/lib/models/patient/radiology/radiology_res_model.dart @@ -6,21 +6,21 @@ *@desc: RadiologyResModel class */ class RadiologyResModel { - String setupID; - int projectID; - int patientID; - int invoiceLineItemNo; - int invoiceNo; - String reportData; - String imageURL; - int clinicId; - int doctorId; - String reportDate; - String clinicName; - String doctorImageURL; - String doctorName; - String projectName; - Null statusDescription; + String? setupID; + int? projectID; + int? patientID; + int? invoiceLineItemNo; + int? invoiceNo; + String? reportData; + String? imageURL; + int? clinicId; + int? doctorId; + String? reportDate; + String? clinicName; + String? doctorImageURL; + String? doctorName; + String? projectName; + dynamic statusDescription; RadiologyResModel( {this.setupID, @@ -39,7 +39,7 @@ class RadiologyResModel { this.projectName, this.statusDescription}); - RadiologyResModel.fromJson(Map json) { + RadiologyResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -57,8 +57,8 @@ class RadiologyResModel { statusDescription = json['StatusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/reauest_prescription_report_for_in_patient.dart b/lib/models/patient/reauest_prescription_report_for_in_patient.dart index 857705c4..fe8bc3f1 100644 --- a/lib/models/patient/reauest_prescription_report_for_in_patient.dart +++ b/lib/models/patient/reauest_prescription_report_for_in_patient.dart @@ -1,34 +1,34 @@ class RequestPrescriptionReportForInPatient { - int patientID; - int projectID; - int admissionNo; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; + int? patientID; + int? projectID; + int? admissionNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; RequestPrescriptionReportForInPatient( {this.patientID, - this.projectID, - this.admissionNo, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.projectID, + this.admissionNo, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); - RequestPrescriptionReportForInPatient.fromJson(Map json) { + RequestPrescriptionReportForInPatient.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; @@ -44,8 +44,8 @@ class RequestPrescriptionReportForInPatient { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index 83db54f4..fc1fd80d 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -1,40 +1,38 @@ import 'package:flutter/cupertino.dart'; class ReferToDoctorRequest { - -/* - *@author: Ibrahim Albitar - *@Date:03/06/2020 - *@param: +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: *@return: *@desc: ReferToDoctor */ - int projectID; - int admissionNo; - String roomID; - String referralClinic; - String referralDoctor; - int createdBy; - int editedBy; - int patientID; - int patientTypeID; - int referringClinic; - int referringDoctor; - String referringDoctorRemarks; - String priority; - String frequency; - String extension; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - + int? projectID; + int? admissionNo; + String? roomID; + String? referralClinic; + String? referralDoctor; + int? createdBy; + int? editedBy; + int? patientID; + int? patientTypeID; + int? referringClinic; + int? referringDoctor; + String? referringDoctorRemarks; + String? priority; + String? frequency; + String? extension; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; /* { @@ -68,17 +66,17 @@ class ReferToDoctorRequest { ReferToDoctorRequest( {@required this.projectID, @required this.admissionNo, - @required this.roomID , + @required this.roomID, @required this.referralClinic, - @required this.referralDoctor , + @required this.referralDoctor, @required this.createdBy, - @required this.editedBy , + @required this.editedBy, @required this.patientID, @required this.patientTypeID, @required this.referringClinic, @required this.referringDoctor, @required this.referringDoctorRemarks, - @required this.priority , + @required this.priority, @required this.frequency, @required this.extension, this.languageID = 2, @@ -91,7 +89,7 @@ class ReferToDoctorRequest { this.isLoginForDoctorApp = true, this.patientOutSA = false}); - ReferToDoctorRequest.fromJson(Map json) { + ReferToDoctorRequest.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; roomID = json['RoomID']; diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/models/patient/request_my_referral_patient_model.dart index 219b7b2a..21e725d2 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/models/patient/request_my_referral_patient_model.dart @@ -1,26 +1,24 @@ - - class RequestMyReferralPatientModel { - int projectID; - int clinicID; - int doctorID; - String firstName; - String middleName; - String lastName; - String patientMobileNumber; - String patientIdentificationID; - int patientID; - String from; - String to; - int languageID; - String stamp; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? projectID; + int? clinicID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; + String? from; + String? to; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; RequestMyReferralPatientModel( {this.projectID, @@ -34,17 +32,17 @@ class RequestMyReferralPatientModel { this.patientID = 0, this.from = "0", this.to = "0", - this.languageID , - this.stamp , - this.iPAdress , - this.versionID , - this.channel , + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, this.tokenID, - this.sessionID , - this.isLoginForDoctorApp , - this.patientOutSA }); + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestMyReferralPatientModel.fromJson(Map json) { + RequestMyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/models/patient/topten_users_res_model.dart index 3454568f..b1144d9a 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/models/patient/topten_users_res_model.dart @@ -1,4 +1,3 @@ - /* *@author: Amjad Amireh *@Date:27/4/2020 @@ -8,25 +7,23 @@ *@desc: */ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + //ModelResponse class ModelResponse { - final List list; - String firstName; + final List? list; + String? firstName; ModelResponse({ this.list, this.firstName, }); factory ModelResponse.fromJson(List parsedJson) { - - - List list = new List(); - + List list = []; + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); return new ModelResponse(list: list); } } -class PatiantInformtionl { -} \ No newline at end of file +class PatiantInformtionl {} diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index 57133a08..c02c2464 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,68 +1,68 @@ class VitalSignData { - int appointmentNo; - int bloodPressureCuffLocation; - int bloodPressureCuffSize; - int bloodPressureHigher; - int bloodPressureLower; - int bloodPressurePatientPosition; + int? appointmentNo; + int? bloodPressureCuffLocation; + int? bloodPressureCuffSize; + int? bloodPressureHigher; + int? bloodPressureLower; + int? bloodPressurePatientPosition; var bodyMassIndex; - int fio2; - int headCircumCm; + int? fio2; + int? headCircumCm; var heightCm; - int idealBodyWeightLbs; - bool isPainManagementDone; - bool isVitalsRequired; - int leanBodyWeightLbs; - String painCharacter; - String painDuration; - String painFrequency; - String painLocation; - int painScore; - int patientMRN; - int patientType; - int pulseBeatPerMinute; - int pulseRhythm; - int respirationBeatPerMinute; - int respirationPattern; - int sao2; - int status; + int? idealBodyWeightLbs; + bool? isPainManagementDone; + bool? isVitalsRequired; + int? leanBodyWeightLbs; + String? painCharacter; + String? painDuration; + String? painFrequency; + String? painLocation; + int? painScore; + int? patientMRN; + int? patientType; + int? pulseBeatPerMinute; + int? pulseRhythm; + int? respirationBeatPerMinute; + int? respirationPattern; + int? sao2; + int? status; var temperatureCelcius; - int temperatureCelciusMethod; + int? temperatureCelciusMethod; var waistSizeInch; var weightKg; VitalSignData( {this.appointmentNo, - this.bloodPressureCuffLocation, - this.bloodPressureCuffSize, - this.bloodPressureHigher, - this.bloodPressureLower, - this.bloodPressurePatientPosition, - this.bodyMassIndex, - this.fio2, - this.headCircumCm, - this.heightCm, - this.idealBodyWeightLbs, - this.isPainManagementDone, - this.isVitalsRequired, - this.leanBodyWeightLbs, - this.painCharacter, - this.painDuration, - this.painFrequency, - this.painLocation, - this.painScore, - this.patientMRN, - this.patientType, - this.pulseBeatPerMinute, - this.pulseRhythm, - this.respirationBeatPerMinute, - this.respirationPattern, - this.sao2, - this.status, - this.temperatureCelcius, - this.temperatureCelciusMethod, - this.waistSizeInch, - this.weightKg}); + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressureHigher, + this.bloodPressureLower, + this.bloodPressurePatientPosition, + this.bodyMassIndex, + this.fio2, + this.headCircumCm, + this.heightCm, + this.idealBodyWeightLbs, + this.isPainManagementDone, + this.isVitalsRequired, + this.leanBodyWeightLbs, + this.painCharacter, + this.painDuration, + this.painFrequency, + this.painLocation, + this.painScore, + this.patientMRN, + this.patientType, + this.pulseBeatPerMinute, + this.pulseRhythm, + this.respirationBeatPerMinute, + this.respirationPattern, + this.sao2, + this.status, + this.temperatureCelcius, + this.temperatureCelciusMethod, + this.waistSizeInch, + this.weightKg}); VitalSignData.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -133,5 +133,4 @@ class VitalSignData { data['weightKg'] = this.weightKg; return data; } - } diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/models/patient/vital_sign/patient-vital-sign-history.dart index ed39a86e..9b125216 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-history.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-history.dart @@ -25,9 +25,9 @@ class VitalSignHistory { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; var createdOn; var doctorID; @@ -242,8 +242,7 @@ class VitalSignHistory { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = - this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index 2cfd24c2..e18e3a0a 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -1,26 +1,25 @@ - -/* - *@author: Elham Rababah - *@Date:27/4/2020 - *@param: +/* + *@author: Elham Rababah + *@Date:27/4/2020 + *@param: *@return: *@desc: VitalSignReqModel */ class VitalSignReqModel { - int patientID; - int projectID; - int patientTypeID; - int inOutpatientType; - int transNo; - int languageID; - String stamp ; - String iPAdress; - double versionID; - int channel; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; + int? patientID; + int? projectID; + int? patientTypeID; + int? inOutpatientType; + int? transNo; + int? languageID; + String? stamp; + String? iPAdress; + double? versionID; + int? channel; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; VitalSignReqModel( {this.patientID, @@ -30,13 +29,13 @@ class VitalSignReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.8, - this.channel=9, - this.sessionID='E2bsEeYEJo', - this.isLoginForDoctorApp=true, + this.iPAdress = '11.11.11.11', + this.versionID = 5.8, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.isLoginForDoctorApp = true, this.patientTypeID, - this.patientOutSA=false}); + this.patientOutSA = false}); VitalSignReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -73,5 +72,4 @@ class VitalSignReqModel { data['PatientTypeID'] = this.patientTypeID; return data; } - } diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index 78af108d..e5af8aef 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -34,17 +34,17 @@ class VitalSignResModel { var painDuration; var painCharacter; var painFrequency; - bool isPainManagementDone; + bool? isPainManagementDone; var status; - bool isVitalsRequired; + bool? isVitalsRequired; var patientID; - var createdOn; + var createdOn; var doctorID; var clinicID; var triageCategory; var gCScore; var lineItemNo; - DateTime vitalSignDate; + DateTime? vitalSignDate; var actualTimeTaken; var sugarLevel; var fBS; @@ -61,9 +61,9 @@ class VitalSignResModel { var bloodPressureCuffLocationDesc; var bloodPressureCuffSizeDesc; var bloodPressurePatientPositionDesc; - var clinicName; - var doctorImageURL; - var doctorName; + var clinicName; + var doctorImageURL; + var doctorName; var painScoreDesc; var pulseRhythmDesc; var respirationPatternDesc; @@ -170,7 +170,8 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); + vitalSignDate = + json['VitalSignDate'] != null ? AppDateUtils.convertStringToDate(json['VitalSignDate']) : new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; @@ -251,8 +252,7 @@ class VitalSignResModel { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = - this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 90b5c378..31c3f758 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -1,4 +1,3 @@ - /* *@author: Ibrahim Albitar *@Date:27/4/2020 @@ -8,17 +7,17 @@ */ class PharmaciesListRequestModel { - int itemID; - int languageID; - String stamp; - String ipAdress; - double versionID; - String tokenID; - String sessionID; - bool isLoginForDoctorApp; - bool patientOutSA; - int patientTypeID; - int channel; + int? itemID; + int? languageID; + String? stamp; + String? ipAdress; + double? versionID; + String? tokenID; + String? sessionID; + bool? isLoginForDoctorApp; + bool? patientOutSA; + int? patientTypeID; + int? channel; PharmaciesListRequestModel( {this.itemID, @@ -62,4 +61,4 @@ class PharmaciesListRequestModel { data['Channel'] = this.channel; return data; } -} \ No newline at end of file +} diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 4f2e947a..801fed36 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -7,18 +7,18 @@ */ class PharmaciesItemsRequestModel { - String pHRItemName; - int pageIndex = 0; - int pageSize = 20; - double versionID = 5.5; - int channel = 3; - int languageID = 2; - String iPAdress = "10.20.10.20"; - String generalid = "Cs2020@2016\$2958"; - int patientOutSA = 0; - String sessionID = "KvFJENeAUCxyVdIfEkHw"; - bool isDentalAllowedBackend = false; - int deviceTypeID = 2; + String? pHRItemName; + int? pageIndex = 0; + int? pageSize = 20; + double? versionID = 5.5; + int? channel = 3; + int? languageID = 2; + String? iPAdress = "10.20.10.20"; + String? generalid = "Cs2020@2016\$2958"; + int? patientOutSA = 0; + String? sessionID = "KvFJENeAUCxyVdIfEkHw"; + bool? isDentalAllowedBackend = false; + int? deviceTypeID = 2; PharmaciesItemsRequestModel( {this.pHRItemName, diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/models/sickleave/add_sickleave_request.dart index d398153b..05d839f1 100644 --- a/lib/models/sickleave/add_sickleave_request.dart +++ b/lib/models/sickleave/add_sickleave_request.dart @@ -1,16 +1,11 @@ class AddSickLeaveRequest { - String patientMRN; - String appointmentNo; - String startDate; - String noOfDays; - String remarks; + String? patientMRN; + String? appointmentNo; + String? startDate; + String? noOfDays; + String? remarks; - AddSickLeaveRequest( - {this.patientMRN, - this.appointmentNo, - this.startDate, - this.noOfDays, - this.remarks}); + AddSickLeaveRequest({this.patientMRN, this.appointmentNo, this.startDate, this.noOfDays, this.remarks}); AddSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/models/sickleave/extend_sick_leave_request.dart index 8b61eb90..e25c2eb8 100644 --- a/lib/models/sickleave/extend_sick_leave_request.dart +++ b/lib/models/sickleave/extend_sick_leave_request.dart @@ -1,11 +1,10 @@ class ExtendSickLeaveRequest { - String patientMRN; - String previousRequestNo; - String noOfDays; - String remarks; + String? patientMRN; + String? previousRequestNo; + String? noOfDays; + String? remarks; - ExtendSickLeaveRequest( - {this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); + ExtendSickLeaveRequest({this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); ExtendSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index de831213..7cfb292b 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -1,13 +1,13 @@ class GetAllSickLeaveResponse { - int appointmentNo; - bool isExtendedLeave; - int noOfDays; - int patientMRN; - String remarks; - int requestNo; - String startDate; - int status; - String statusDescription; + int? appointmentNo; + bool? isExtendedLeave; + int? noOfDays; + int? patientMRN; + String? remarks; + int? requestNo; + String? startDate; + int? status; + String? statusDescription; GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, From ecb600c4fc0075b8f4e137d15f73aa14f7e846a2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 7 Jun 2021 17:49:46 +0300 Subject: [PATCH 033/199] 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 110a1983c71f4168ca04ff9a4b0ce00ef6f15288 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 13 Jun 2021 10:01:05 +0300 Subject: [PATCH 034/199] flutter vervion 2 migration --- android/app/build.gradle | 2 +- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- android/settings_aar.gradle | 1 + lib/UpdatePage.dart | 36 +- lib/config/size_config.dart | 19 +- .../admissionRequest/admission-request.dart | 19 +- .../sick_leave/sickleave_service.dart | 2 +- .../viewModel/DischargedPatientViewModel.dart | 12 +- .../viewModel/LiveCarePatientViewModel.dart | 27 +- lib/core/viewModel/PatientMuseViewModel.dart | 12 +- .../viewModel/PatientSearchViewModel.dart | 89 +- lib/core/viewModel/SOAP_view_model.dart | 205 +-- .../viewModel/authentication_view_model.dart | 141 +- lib/core/viewModel/dashboard_view_model.dart | 14 +- lib/core/viewModel/medicine_view_model.dart | 7 +- .../viewModel/patient-referral-viewmodel.dart | 82 +- .../viewModel/patient-ucaf-viewmodel.dart | 48 +- .../patient-vital-sign-viewmodel.dart | 55 +- .../viewModel/prescription_view_model.dart | 137 +- .../viewModel/prescriptions_view_model.dart | 82 +- lib/core/viewModel/procedure_View_model.dart | 66 +- lib/core/viewModel/project_view_model.dart | 17 +- lib/core/viewModel/radiology_view_model.dart | 62 +- lib/core/viewModel/referral_view_model.dart | 13 +- lib/core/viewModel/referred_view_model.dart | 8 +- lib/core/viewModel/schedule_view_model.dart | 5 +- lib/core/viewModel/sick_leave_view_model.dart | 24 +- lib/landing_page.dart | 12 +- ...list_doctor_working_hours_table_model.dart | 6 +- lib/models/doctor/user_model.dart | 2 +- lib/screens/auth/login_screen.dart | 302 ++-- .../auth/verification_methods_screen.dart | 638 +++---- lib/screens/base/base_view.dart | 12 +- lib/screens/doctor/doctor_repaly_chat.dart | 72 +- lib/screens/doctor/doctor_reply_screen.dart | 32 +- .../doctor/my_referral_patient_screen.dart | 11 +- .../doctor/patient_arrival_screen.dart | 26 +- .../home/dashboard_slider-item-widget.dart | 5 +- lib/screens/home/dashboard_swipe_widget.dart | 97 +- lib/screens/home/home_page_card.dart | 21 +- lib/screens/home/home_patient_card.dart | 12 +- lib/screens/home/home_screen.dart | 198 +-- lib/screens/live_care/end_call_screen.dart | 135 +- .../live-care_transfer_to_admin.dart | 61 +- .../live_care/live_care_patient_screen.dart | 137 +- lib/screens/live_care/panding_list.dart | 104 +- lib/screens/live_care/video_call.dart | 77 +- .../medical-file/health_summary_page.dart | 131 +- .../medical-file/medical_file_details.dart | 656 +++---- .../medicine/medicine_search_screen.dart | 58 +- .../medicine/pharmacies_list_screen.dart | 179 +- .../patients/DischargedPatientPage.dart | 609 ++++--- lib/screens/patients/ECGPage.dart | 183 +- lib/screens/patients/InPatientPage.dart | 78 +- .../patients/PatientsInPatientScreen.dart | 27 +- .../ReferralDischargedPatientDetails.dart | 141 +- .../ReferralDischargedPatientPage.dart | 133 +- .../insurance_approval_screen_patient.dart | 87 +- .../patients/insurance_approvals_details.dart | 1235 ++++++------- .../out_patient/filter_date_page.dart | 87 +- .../out_patient/out_patient_screen.dart | 179 +- ...t_patient_prescription_details_screen.dart | 40 +- .../patient_search/patient_search_header.dart | 7 +- .../patient_search_result_screen.dart | 109 +- .../patient_search/patient_search_screen.dart | 119 +- .../patients/patient_search/time_bar.dart | 110 -- .../profile/UCAF/UCAF-detail-screen.dart | 79 +- .../profile/UCAF/UCAF-input-screen.dart | 61 +- .../profile/UCAF/page-stepper-widget.dart | 46 +- .../admission-request-first-screen.dart | 214 +-- .../admission-request-third-screen.dart | 153 +- .../admission-request_second-screen.dart | 372 ++-- .../profile/lab_result/FlowChartPage.dart | 43 +- .../profile/lab_result/LabResultWidget.dart | 71 +- .../Lab_Result_details_wideget.dart | 12 +- .../profile/lab_result/LineChartCurved.dart | 58 +- .../lab_result_chart_and_detials.dart | 27 +- .../lab_result/lab_result_secreen.dart | 11 +- .../lab_result/laboratory_result_page.dart | 22 +- .../lab_result/laboratory_result_widget.dart | 59 +- .../profile/lab_result/labs_home_page.dart | 82 +- .../AddVerifyMedicalReport.dart | 23 +- .../MedicalReportDetailPage.dart | 44 +- .../medical_report/MedicalReportPage.dart | 96 +- .../profile/note/progress_note_screen.dart | 659 +++---- .../patients/profile/note/update_note.dart | 145 +- ...n_patient_prescription_details_screen.dart | 80 +- ...out_patient_prescription_details_item.dart | 2 +- .../PatientProfileCardModel.dart | 26 +- .../patient_profile_screen.dart | 438 +++-- .../profile_gird_for_InPatient.dart | 109 +- .../profile_gird_for_other.dart | 148 +- .../profile_gird_for_search.dart | 103 +- .../radiology/radiology_details_page.dart | 21 +- .../radiology/radiology_home_page.dart | 89 +- .../radiology/radiology_report_screen.dart | 8 +- .../referral/AddReplayOnReferralPatient.dart | 33 +- .../referral/my-referral-detail-screen.dart | 222 +-- .../my-referral-inpatient-screen.dart | 18 +- .../referral/my-referral-patient-screen.dart | 56 +- .../referral/patient_referral_screen.dart | 43 +- .../refer-patient-screen-in-patient.dart | 247 +-- .../referral/refer-patient-screen.dart | 256 +-- .../referral_patient_detail_in-paint.dart | 167 +- .../referral/referred-patient-screen.dart | 57 +- .../referred_patient_detail_in-paint.dart | 211 +-- .../assessment/add_assessment_details.dart | 485 +++-- .../assessment/update_assessment_page.dart | 710 ++++---- .../objective/add_examination_page.dart | 142 +- .../objective/add_examination_widget.dart | 30 +- .../objective/examination_item_card.dart | 19 +- .../examinations_list_search_widget.dart | 31 +- .../objective/update_objective_page.dart | 340 ++-- .../soap_update/plan/update_plan_page.dart | 496 +++--- .../shared_soap_widgets/SOAP_open_items.dart | 49 +- .../shared_soap_widgets/SOAP_step_header.dart | 12 +- .../bottom_sheet_title.dart | 21 +- .../expandable_SOAP_widget.dart | 39 +- .../shared_soap_widgets/steps_widget.dart | 102 +- .../subjective/allergies/add_allergies.dart | 209 +-- .../allergies/update_allergies_widget.dart | 104 +- .../update_Chief_complaints.dart | 73 +- .../history/add_history_dialog.dart | 219 ++- .../subjective/history/priority_bar.dart | 21 +- .../history/update_history_widget.dart | 65 +- .../subjective/medication/add_medication.dart | 552 +++--- .../medication/update_medication_widget.dart | 19 +- .../subjective/update_subjective_page.dart | 306 ++-- .../soap_update/update_soap_index.dart | 167 +- .../profile/vital_sign/LineChartCurved.dart | 13 +- .../LineChartCurvedBloodPressure.dart | 53 +- .../vital_sign/vital-signs-screen.dart | 1074 ----------- ...al_sign_details_blood_pressurewideget.dart | 22 +- .../vital_sign/vital_sign_details_screen.dart | 345 ++-- .../vital_sign_details_wideget.dart | 9 +- .../profile/vital_sign/vital_sign_item.dart | 10 +- .../vital_sign_item_details_screen.dart | 51 +- .../vital_sing_chart_and_detials.dart | 106 +- .../vital_sing_chart_blood_pressure.dart | 35 +- .../add_favourite_prescription.dart | 22 +- .../prescription/add_prescription_form.dart | 125 +- lib/screens/prescription/drugtodrug.dart | 67 +- .../prescription_checkout_screen.dart | 156 +- .../prescription_details_page.dart | 33 +- .../prescription_home_screen.dart | 10 +- .../prescription_item_in_patient_page.dart | 91 +- .../prescription/prescription_items_page.dart | 320 ++-- .../prescription/prescription_screen.dart | 1186 ++++++------- .../prescription_screen_history.dart | 819 ++++----- .../prescription/prescription_text_filed.dart | 24 +- .../prescription/prescriptions_page.dart | 22 +- .../update_prescription_form.dart | 656 +++---- .../procedures/ExpansionProcedure.dart | 28 +- lib/screens/procedures/ProcedureCard.dart | 47 +- .../procedures/add-favourite-procedure.dart | 37 +- .../procedures/add-procedure-form.dart | 133 +- .../procedures/add_lab_home_screen.dart | 219 ++- lib/screens/procedures/add_lab_orders.dart | 85 +- .../procedures/add_procedure_homeScreen.dart | 71 +- .../procedures/add_radiology_order.dart | 85 +- .../procedures/add_radiology_screen.dart | 219 ++- .../entity_list_checkbox_search_widget.dart | 117 +- .../procedures/entity_list_fav_procedure.dart | 58 +- .../entity_list_procedure_widget.dart | 63 +- .../procedures/procedure_checkout_screen.dart | 57 +- lib/screens/procedures/procedure_screen.dart | 60 +- lib/screens/procedures/update-procedure.dart | 119 +- lib/screens/qr_reader/QR_reader_screen.dart | 28 +- .../add-rescheduleleave.dart | 157 +- .../reschedule-leaves/reschedule_leave.dart | 475 ++--- lib/screens/sick-leave/add-sickleave.dart | 98 +- lib/screens/sick-leave/show-sickleave.dart | 122 +- lib/screens/sick-leave/sick_leave.dart | 279 ++- lib/util/VideoChannel.dart | 42 +- lib/util/dr_app_shared_pref.dart | 10 +- lib/util/extenstions.dart | 7 +- lib/util/helpers.dart | 48 +- lib/util/translations_delegate_base.dart | 1568 +++++++---------- lib/widgets/auth/method_type_card.dart | 17 +- lib/widgets/auth/sms-popup.dart | 157 +- .../auth/verification_methods_list.dart | 51 +- lib/widgets/charts/app_bar_chart.dart | 43 - lib/widgets/charts/app_line_chart.dart | 10 +- lib/widgets/charts/app_time_series_chart.dart | 11 +- .../dashboard_item_texts_widget.dart | 66 - lib/widgets/dashboard/guage_chart.dart | 12 +- lib/widgets/dashboard/out_patient_stack.dart | 19 +- .../data_display/list/custom_Item.dart | 24 +- .../data_display/list/flexible_container.dart | 10 +- lib/widgets/doctor/doctor_reply_widget.dart | 191 +- lib/widgets/doctor/lab_result_widget.dart | 24 +- .../doctor/my_referral_patient_widget.dart | 63 +- lib/widgets/doctor/my_schedule_widget.dart | 47 +- .../medicine/medicine_item_widget.dart | 10 +- lib/widgets/patients/PatientCard.dart | 370 ++-- .../patients/clinic_list_dropdwon.dart | 99 -- lib/widgets/patients/dynamic_elements.dart | 163 -- .../patient-referral-item-widget.dart | 132 +- .../profile/PatientHeaderWidgetNoAvatar.dart | 2 +- .../profile/PatientProfileButton.dart | 51 +- .../profile/Profile_general_info_Widget.dart | 45 - .../profile/add-order/addNewOrder.dart | 9 +- .../patients/profile/large_avatar.dart | 34 +- .../profile/patient-page-header-widget.dart | 32 +- ...ent-profile-header-new-design-app-bar.dart | 143 +- .../patient-profile-header-new-design.dart | 79 +- ...-profile-header-new-design_in_patient.dart | 242 --- ..._profile_header_with_appointment_card.dart | 507 ------ ..._header_with_appointment_card_app_bar.dart | 262 ++- .../prescription_in_patinets_widget.dart | 39 +- .../prescription_out_patinets_widget.dart | 38 +- .../profile/profile-welcome-widget.dart | 28 +- .../profile_general_info_content_widget.dart | 45 - .../profile/profile_header_widget.dart | 39 - .../profile/profile_medical_info_widget.dart | 184 -- ...rofile_medical_info_widget_in_patient.dart | 176 -- .../profile_medical_info_widget_search.dart | 352 ++-- .../profile/profile_status_info_widget.dart | 5 +- .../patients/vital_sign_details_wideget.dart | 14 +- lib/widgets/shared/StarRating.dart | 15 +- lib/widgets/shared/app_drawer_widget.dart | 18 +- .../shared/app_expandable_notifier.dart | 58 - .../shared/app_expandable_notifier_new.dart | 127 -- lib/widgets/shared/app_loader_widget.dart | 15 +- lib/widgets/shared/app_scaffold_widget.dart | 28 +- lib/widgets/shared/app_texts_widget.dart | 133 +- lib/widgets/shared/bottom_nav_bar.dart | 2 +- .../shared/bottom_navigation_item.dart | 34 +- .../shared/buttons/app_buttons_widget.dart | 71 +- .../shared/buttons/button_bottom_sheet.dart | 39 +- .../shared/buttons/secondary_button.dart | 80 +- .../shared/card_with_bgNew_widget.dart | 28 +- lib/widgets/shared/card_with_bg_widget.dart | 35 +- lib/widgets/shared/charts/app_line_chart.dart | 41 - .../shared/charts/app_time_series_chart.dart | 121 -- lib/widgets/shared/custom_shape_clipper.dart | 26 - .../shared/dialogs/ShowImageDialog.dart | 10 +- .../shared/dialogs/dailog-list-select.dart | 39 +- .../shared/dialogs/master_key_dailog.dart | 46 +- .../dialogs/search-drugs-dailog-list.dart | 92 - .../shared/divider_with_spaces_around.dart | 5 +- lib/widgets/shared/doctor_card.dart | 145 +- lib/widgets/shared/doctor_card_insurance.dart | 178 +- .../dr_app_circular_progress_Indeicator.dart | 5 +- lib/widgets/shared/drawer_item_widget.dart | 26 +- .../shared/errors/dr_app_embedded_error.dart | 27 +- lib/widgets/shared/errors/error_message.dart | 17 +- .../shared/expandable-widget-header-body.dart | 21 +- .../shared/expandable_item_widget.dart | 91 - .../shared/in_patient_doctor_card.dart | 194 ++ .../shared/loader/gif_loader_container.dart | 29 +- ..._key_checkbox_search_allergies_widget.dart | 299 ++-- .../master_key_checkbox_search_widget.dart | 56 +- lib/widgets/shared/network_base_view.dart | 12 +- lib/widgets/shared/profile_image_widget.dart | 61 +- .../shared/rounded_container_widget.dart | 69 +- lib/widgets/shared/speech-text-popup.dart | 17 +- .../shared/{ => text_fields}/TextFields.dart | 281 ++- .../text_fields/app-textfield-custom.dart | 95 +- .../text_fields/app_text_form_field.dart | 43 +- .../text_fields/auto_complete_text_field.dart | 13 +- .../shared/text_fields/html_rich_editor.dart | 25 +- .../shared/text_fields/new_text_Field.dart | 213 +-- .../shared/text_fields/text_field_error.dart | 4 +- .../shared/text_fields/text_fields_utils.dart | 19 +- .../app_anchored_overlay_widget.dart | 183 -- .../shared/user-guid/app_get_position.dart | 75 - .../shared/user-guid/app_shape_painter.dart | 42 - .../shared/user-guid/app_showcase.dart | 349 ---- .../shared/user-guid/app_showcase_widget.dart | 97 - .../shared/user-guid/app_tool_tip_widget.dart | 290 --- .../user-guid/custom_validation_error.dart | 21 +- .../user-guid/in_patient_doctor_card.dart | 196 --- lib/widgets/transitions/fade_page.dart | 48 +- lib/widgets/transitions/slide_up_page.dart | 15 +- pubspec.lock | 2 +- pubspec.yaml | 1 + 278 files changed, 12170 insertions(+), 21619 deletions(-) create mode 100644 android/settings_aar.gradle delete mode 100644 lib/screens/patients/patient_search/time_bar.dart delete mode 100644 lib/screens/patients/profile/vital_sign/vital-signs-screen.dart delete mode 100644 lib/widgets/charts/app_bar_chart.dart delete mode 100644 lib/widgets/dashboard/dashboard_item_texts_widget.dart delete mode 100644 lib/widgets/patients/clinic_list_dropdwon.dart delete mode 100644 lib/widgets/patients/dynamic_elements.dart delete mode 100644 lib/widgets/patients/profile/Profile_general_info_Widget.dart 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 delete mode 100644 lib/widgets/patients/profile/profile_general_info_content_widget.dart delete mode 100644 lib/widgets/patients/profile/profile_header_widget.dart delete mode 100644 lib/widgets/patients/profile/profile_medical_info_widget.dart delete mode 100644 lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart delete mode 100644 lib/widgets/shared/app_expandable_notifier.dart delete mode 100644 lib/widgets/shared/app_expandable_notifier_new.dart delete mode 100644 lib/widgets/shared/charts/app_line_chart.dart delete mode 100644 lib/widgets/shared/charts/app_time_series_chart.dart delete mode 100644 lib/widgets/shared/custom_shape_clipper.dart delete mode 100644 lib/widgets/shared/dialogs/search-drugs-dailog-list.dart delete mode 100644 lib/widgets/shared/expandable_item_widget.dart create mode 100644 lib/widgets/shared/in_patient_doctor_card.dart rename lib/widgets/shared/{ => text_fields}/TextFields.dart (52%) delete mode 100644 lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart delete mode 100644 lib/widgets/shared/user-guid/app_get_position.dart delete mode 100644 lib/widgets/shared/user-guid/app_shape_painter.dart delete mode 100644 lib/widgets/shared/user-guid/app_showcase.dart delete mode 100644 lib/widgets/shared/user-guid/app_showcase_widget.dart delete mode 100644 lib/widgets/shared/user-guid/app_tool_tip_widget.dart delete mode 100644 lib/widgets/shared/user-guid/in_patient_doctor_card.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index b7605ad0..26a2484d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -39,7 +39,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.hmg.hmgDr" - minSdkVersion 18 + minSdkVersion 21 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/build.gradle b/android/build.gradle index ea0f0026..49bd99ef 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.2' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..bfae97b2 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Sun Jun 13 08:51:58 EEST 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 00000000..e7b4def4 --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index 16284ed1..b3202c52 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -10,12 +10,11 @@ import 'package:url_launcher/url_launcher.dart'; import 'widgets/shared/buttons/secondary_button.dart'; class UpdatePage extends StatelessWidget { - final String message; - final String androidLink; - final String iosLink; + final String? message; + final String? androidLink; + final String? iosLink; - const UpdatePage({Key key, this.message, this.androidLink, this.iosLink}) - : super(key: key); + const UpdatePage({Key? key, this.message, this.androidLink, this.iosLink}) : super(key: key); @override Widget build(BuildContext context) { @@ -30,18 +29,27 @@ class UpdatePage extends StatelessWidget { children: [ Image.asset( 'assets/images/update_rocket_image.png', - width: double.maxFinite,fit: BoxFit.fill, + width: double.maxFinite, + fit: BoxFit.fill, ), Image.asset('assets/images/HMG_logo.png'), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), AppText( - TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, + TranslationBase.of(context).updateTheApp!.toUpperCase(), + fontSize: 17, fontWeight: FontWeight.w600, ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(message??"Update the app",fontSize: 12,), + child: AppText( + message ?? "Update the app", + fontSize: 12, + ), ) ], ), @@ -52,14 +60,14 @@ class UpdatePage extends StatelessWidget { // padding: const EdgeInsets.all(8.0), margin: EdgeInsets.all(15), child: SecondaryButton( - color: Colors.red[800], + color: Colors.red[800]!, onTap: () { if (Platform.isIOS) - launch(iosLink); + launch(iosLink!); else - launch(androidLink); + launch(androidLink!); }, - label: TranslationBase.of(context).updateNow.toUpperCase(), + label: TranslationBase.of(context).updateNow!.toUpperCase(), ), ), ), diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 06dc3cda..e4b1e745 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,14 +5,14 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - static double ? realScreenWidth; - static double ? realScreenHeight; - static double ? screenWidth; - static double ? screenHeight; - static double ? textMultiplier; - static double ? imageSizeMultiplier; - static double ? heightMultiplier; - static double ? widthMultiplier; + static late double realScreenWidth; + static late double realScreenHeight; + static late double screenWidth; + static late double screenHeight; + static late double textMultiplier; + static late double imageSizeMultiplier; + static late double heightMultiplier; + static late double widthMultiplier; static bool isPortrait = true; static bool isMobilePortrait = false; @@ -22,7 +22,6 @@ class SizeConfig { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; - if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } @@ -45,7 +44,7 @@ class SizeConfig { } _blockWidth = (screenWidth! / 100); _blockHeight = (screenHeight! / 100)!; - + textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; heightMultiplier = _blockHeight; diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 5cf56e8e..94fe46cc 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,5 +1,5 @@ class AdmissionRequest { - late int patientMRN; + late int? patientMRN; late int? admitToClinic; late bool? isPregnant; late int pregnancyWeeks; @@ -42,7 +42,7 @@ class AdmissionRequest { late int? admissionRequestNo; AdmissionRequest( - {required this.patientMRN, + {this.patientMRN, this.admitToClinic, this.isPregnant, this.pregnancyWeeks = 0, @@ -110,8 +110,7 @@ class AdmissionRequest { dietType = json['dietType']; dietRemarks = json['dietRemarks']; isPhysicalActivityModification = json['isPhysicalActivityModification']; - physicalActivityModificationComments = - json['physicalActivityModificationComments']; + physicalActivityModificationComments = json['physicalActivityModificationComments']; orStatus = json['orStatus']; mainLineOfTreatment = json['mainLineOfTreatment']; estimatedCost = json['estimatedCost']; @@ -164,16 +163,13 @@ class AdmissionRequest { data['transportComments'] = this.transportComments; data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded; data['physioAppointmentComments'] = this.physioAppointmentComments; - data['isOPDFollowupAppointmentNeeded'] = - this.isOPDFollowupAppointmentNeeded; + data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded; data['opdFollowUpComments'] = this.opdFollowUpComments; data['isDietType'] = this.isDietType; data['dietType'] = this.dietType; data['dietRemarks'] = this.dietRemarks; - data['isPhysicalActivityModification'] = - this.isPhysicalActivityModification; - data['physicalActivityModificationComments'] = - this.physicalActivityModificationComments; + data['isPhysicalActivityModification'] = this.isPhysicalActivityModification; + data['physicalActivityModificationComments'] = this.physicalActivityModificationComments; data['orStatus'] = this.orStatus; data['mainLineOfTreatment'] = this.mainLineOfTreatment; data['estimatedCost'] = this.estimatedCost; @@ -189,8 +185,7 @@ class AdmissionRequest { // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); } if (this.admissionRequestProcedures != null) { - data['admissionRequestProcedures'] = - this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); + data['admissionRequestProcedures'] = this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 63b5d82a..bbddbde2 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -146,7 +146,7 @@ class SickLeaveService extends BaseService { _getReScheduleLeave.sort((a, b) { var adate = a.dateTimeFrom; //before -> var adate = a.date; var bdate = b.dateTimeFrom; //var bdate = b.date; - return -adate.compareTo(bdate); + return -adate!.compareTo(bdate!); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index f8e30851..4d1ea631 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -6,11 +6,9 @@ import '../../locator.dart'; import 'base_view_model.dart'; class DischargedPatientViewModel extends BaseViewModel { - DischargedPatientService _dischargedPatientService = - locator(); + DischargedPatientService _dischargedPatientService = locator(); - List get myDischargedPatient => - _dischargedPatientService.myDischargedPatients; + List get myDischargedPatient => _dischargedPatientService.myDischargedPatients; List filterData = []; @@ -19,9 +17,9 @@ class DischargedPatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < myDischargedPatient.length; i++) { - String firstName = myDischargedPatient[i].firstName.toUpperCase(); - String lastName = myDischargedPatient[i].lastName.toUpperCase(); - String mobile = myDischargedPatient[i].mobileNumber.toUpperCase(); + String firstName = myDischargedPatient[i].firstName!.toUpperCase(); + String lastName = myDischargedPatient[i].lastName!.toUpperCase(); + String mobile = myDischargedPatient[i].mobileNumber!.toUpperCase(); String patientID = myDischargedPatient[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 1899028a..c963e0f9 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -14,8 +14,7 @@ import '../../locator.dart'; class LiveCarePatientViewModel extends BaseViewModel { List filterData = []; - LiveCarePatientServices _liveCarePatientServices = - locator(); + LiveCarePatientServices _liveCarePatientServices = locator(); StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; @@ -28,12 +27,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 +116,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]); } } diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 312d6ebb..80f917b7 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -8,17 +8,13 @@ import '../../locator.dart'; class PatientMuseViewModel extends BaseViewModel { PatientMuseService _patientMuseService = locator(); - List get patientMuseResultsModelList => - _patientMuseService.patientMuseResultsModelList; + List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; - getECGPatient({int patientType, int patientOutSA, int patientID}) async { + getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { setState(ViewState.Busy); - await _patientMuseService.getECGPatient( - patientID: patientID, - patientOutSA: patientOutSA, - patientType: patientType); + await _patientMuseService.getECGPatient(patientID: patientID, patientOutSA: patientOutSA, patientType: patientType); if (_patientMuseService.hasError) { - error = _patientMuseService.error; + error = _patientMuseService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index a0cd68d9..9cc1110b 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -17,22 +17,18 @@ class PatientSearchViewModel extends BaseViewModel { List filterData = []; - DateTime selectedFromDate; - DateTime selectedToDate; + DateTime? selectedFromDate; + DateTime? selectedToDate; searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { filterData = []; for (var i = 0; i < _outPatientService.patientList.length; i++) { - String firstName = - _outPatientService.patientList[i].firstName.toUpperCase(); - String lastName = - _outPatientService.patientList[i].lastName.toUpperCase(); - String mobile = - _outPatientService.patientList[i].mobileNumber.toUpperCase(); - String patientID = - _outPatientService.patientList[i].patientId.toString(); + String firstName = _outPatientService.patientList[i].firstName!.toUpperCase(); + String lastName = _outPatientService.patientList[i].lastName!.toUpperCase(); + String mobile = _outPatientService.patientList[i].mobileNumber!.toUpperCase(); + String patientID = _outPatientService.patientList[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) || @@ -48,18 +44,17 @@ class PatientSearchViewModel extends BaseViewModel { } } - getOutPatient(PatientSearchRequestModel patientSearchRequestModel, - {bool isLocalBusy = false}) async { + getOutPatient(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } await getDoctorProfile(isGetProfile: true); - patientSearchRequestModel.doctorID = doctorProfile.doctorID; + patientSearchRequestModel.doctorID = doctorProfile!.doctorID; await _outPatientService.getOutPatient(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error; + error = _outPatientService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -71,13 +66,11 @@ class PatientSearchViewModel extends BaseViewModel { } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, - {bool isLocalBusy = false}) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService - .getPatientFileInformation(patientSearchRequestModel); + await _outPatientService.getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error; + error = _outPatientService.error!; setState(ViewState.Error); } else { filterData = _outPatientService.patientList; @@ -87,41 +80,31 @@ class PatientSearchViewModel extends BaseViewModel { getPatientBasedOnDate( {item, - PatientSearchRequestModel patientSearchRequestModel, - PatientType selectedPatientType, - bool isSearchWithKeyInfo, - OutPatientFilterType outPatientFilterType}) async { + PatientSearchRequestModel? patientSearchRequestModel, + PatientType? selectedPatientType, + bool? isSearchWithKeyInfo, + OutPatientFilterType? outPatientFilterType}) async { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { - selectedFromDate = DateTime( - DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); - selectedToDate = DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); - dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); - dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); + selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); + selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + dateTo = AppDateUtils.convertDateToFormat(selectedToDate!, 'yyyy-MM-dd'); + dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); dateFrom = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); } else { dateFrom = AppDateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); dateTo = AppDateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); } PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.patientID = patientSearchRequestModel.patientID; + currentModel.patientID = patientSearchRequestModel!.patientID; currentModel.firstName = patientSearchRequestModel.firstName; currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; @@ -132,25 +115,21 @@ class PatientSearchViewModel extends BaseViewModel { filterData = _outPatientService.patientList; } - PatientInPatientService _inPatientService = - locator(); + PatientInPatientService _inPatientService = locator(); List get inPatientList => _inPatientService.inPatientList; - List get myIinPatientList => - _inPatientService.myInPatientList; + List get myIinPatientList => _inPatientService.myInPatientList; - List filteredInPatientItems = List(); + List filteredInPatientItems = []; - Future getInPatientList(PatientSearchRequestModel requestModel, - {bool isMyInpatient = false}) async { + Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { await getDoctorProfile(); setState(ViewState.Busy); - if (inPatientList.length == 0) - await _inPatientService.getInPatientList(requestModel, false); + if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { - error = _inPatientService.error; + error = _inPatientService.error!; setState(ViewState.Error); } else { // setDefaultInPatientList(); @@ -176,9 +155,9 @@ class PatientSearchViewModel extends BaseViewModel { if (strExist) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { - String firstName = inPatientList[i].firstName.toUpperCase(); - String lastName = inPatientList[i].lastName.toUpperCase(); - String mobile = inPatientList[i].mobileNumber.toUpperCase(); + String firstName = inPatientList[i].firstName!.toUpperCase(); + String lastName = inPatientList[i].lastName!.toUpperCase(); + String mobile = inPatientList[i].mobileNumber!.toUpperCase(); String patientID = inPatientList[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 8b789cbc..9c3bf75a 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -37,80 +37,67 @@ class SOAPViewModel extends BaseViewModel { List get allergiesList => _SOAPService.allergiesList; - List get allergySeverityList => - _SOAPService.allergySeverityList; + List get allergySeverityList => _SOAPService.allergySeverityList; List get historyFamilyList => _SOAPService.historyFamilyList; - List get historyMedicalList => - _SOAPService.historyMedicalList; + List get historyMedicalList => _SOAPService.historyMedicalList; List get historySportList => _SOAPService.historySportList; List get historySocialList => _SOAPService.historySocialList; - List get historySurgicalList => - _SOAPService.historySurgicalList; + List get historySurgicalList => _SOAPService.historySurgicalList; - List get mergeHistorySurgicalWithHistorySportList => - [...historySurgicalList, ...historySportList]; + List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList]; - List get physicalExaminationList => - _SOAPService.physicalExaminationList; + List get physicalExaminationList => _SOAPService.physicalExaminationList; - List get listOfDiagnosisType => - _SOAPService.listOfDiagnosisType; + List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; - List get listOfDiagnosisCondition => - _SOAPService.listOfDiagnosisCondition; + List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; List get listOfICD10 => _SOAPService.listOfICD10; - List get patientChiefComplaintList => - _SOAPService.patientChiefComplaintList; + List get patientChiefComplaintList => _SOAPService.patientChiefComplaintList; - List get patientAllergiesList => - _SOAPService.patientAllergiesList; + List get patientAllergiesList => _SOAPService.patientAllergiesList; - List get patientHistoryList => - _SOAPService.patientHistoryList; + List get patientHistoryList => _SOAPService.patientHistoryList; - List get patientPhysicalExamList => - _SOAPService.patientPhysicalExamList; + List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => - _SOAPService.patientProgressNoteList; + List get patientProgressNoteList => _SOAPService.patientProgressNoteList; - List get patientAssessmentList => - _SOAPService.patientAssessmentList; - int get episodeID => _SOAPService.episodeID; + List get patientAssessmentList => _SOAPService.patientAssessmentList; + int? get episodeID => _SOAPService.episodeID; get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; get medicationRouteList => _SOAPService.medicationRouteListWithModel; get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; - List get allMedicationList => - _prescriptionService.allMedicationList; + List get allMedicationList => _prescriptionService.allMedicationList; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMasterLookup(MasterKeysService masterKeys, - {bool isBusyLocal = false}) async { + Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.Busy); } else setState(ViewState.Busy); await _SOAPService.getMasterLookup(masterKeys); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); @@ -120,7 +107,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postEpisode(postEpisodeReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -130,62 +118,63 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postAllergy(postAllergyRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postHistories( - PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postHistories(postHistoriesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postChiefComplaint( - PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postPhysicalExam( - PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postProgressNote( - PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postProgressNote(postProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postAssessment( - PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAssessment(postAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -195,76 +184,77 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.patchAllergy(patchAllergyRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchHistories( - PostHistoriesRequestModel patchHistoriesRequestModel) async { + Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchHistories(patchHistoriesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchChiefComplaint( - PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchPhysicalExam( - PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchProgressNote( - PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchAssessment( - PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchAssessment(patchAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, - {isLocalBusy = false}) async { + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + if (isLocalBusy) { setState(ViewState.ErrorLocal); } else @@ -276,69 +266,64 @@ class SOAPViewModel extends BaseViewModel { String getAllergicNames(isArabic) { String allergiesString = ''; patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked) - allergiesString += - (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + - ' , '; + MasterKeyModel? selectedAllergy = getOneMasterKey( + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + if (selectedAllergy != null && element.isChecked!) + allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , '; }); return allergiesString; } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, - {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { setState(ViewState.Busy); - await _SOAPService.getPatientHistories(getHistoryReqModel, - isFirst: isFirst); + await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientChiefComplaint( - GetChiefComplaintReqModel getChiefComplaintReqModel) async { + Future getPatientChiefComplaint(GetChiefComplaintReqModel getChiefComplaintReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientPhysicalExam( - GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientProgressNote( - GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientAssessment(getAssessmentReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; + setState(ViewState.Error); } else setState(ViewState.Idle); @@ -348,20 +333,18 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMedicationList(); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } // ignore: missing_return - MasterKeyModel getOneMasterKey( - {@required MasterKeysService masterKeys, dynamic id, int typeId}) { + MasterKeyModel? getOneMasterKey({@required MasterKeysService? masterKeys, dynamic id, int? typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -370,8 +353,7 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.HistoryFamily: List result = historyFamilyList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -379,8 +361,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistoryMedical: List result = historyMedicalList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -388,8 +369,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySocial: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -397,8 +377,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySports: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -414,8 +393,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.PhysicalExamination: List result = physicalExaminationList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -423,8 +401,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.AllergySeverity: List result = allergySeverityList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -439,8 +416,7 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.DiagnosisType: List result = listOfDiagnosisType.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -448,8 +424,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.DiagnosisCondition: List result = listOfDiagnosisCondition.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index c547b150..bf7a20ec 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -47,20 +47,17 @@ class AuthenticationViewModel extends BaseViewModel { List get doctorProfilesList => _authService.doctorProfilesList; - SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _authService.activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => + SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _authService.activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; late NewLoginInformationModel loggedUser; - late GetIMEIDetailsModel ? user; + late GetIMEIDetailsModel? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); @@ -101,8 +98,7 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = DEVICE_TOKEN; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = - loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; @@ -110,13 +106,11 @@ class AuthenticationViewModel extends BaseViewModel { insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = loggedIn != null - ? loggedIn['List_MemberInformation'][0]['MemberID'] - : user.doctorID; + insertIMEIDetailsModel.doctorID = + loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = await sharedPref.getString(PASSWORD); await _authService.insertDeviceImei(insertIMEIDetailsModel); @@ -127,7 +121,6 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// first step login Future login(UserModel userInfo) async { setState(ViewState.BusyLocal); @@ -136,7 +129,7 @@ class AuthenticationViewModel extends BaseViewModel { error = _authService.error!; setState(ViewState.ErrorLocal); } else { - sharedPref.setInt(PROJECT_ID, userInfo.projectID); + sharedPref.setInt(PROJECT_ID, userInfo.projectID!); loggedUser = loginInfo; saveObjToString(LOGGED_IN_USER, loginInfo); sharedPref.remove(LAST_LOGIN_USER); @@ -146,10 +139,9 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen( AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); - ActivationCodeForVerificationScreenModel activationCodeModel = - ActivationCodeForVerificationScreenModel( + ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( iMEI: user!.iMEI, facilityId: user!.projectID, memberID: user!.doctorID, @@ -168,7 +160,7 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password }) async { + Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( @@ -186,19 +178,13 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// check activation code for sms and whats app Future checkActivationCodeForDoctorApp({required String activationCode}) async { setState(ViewState.BusyLocal); - CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = - new CheckActivationCodeRequestModel( - zipCode: - loggedUser != null ? loggedUser.zipCode :user!.zipCode, - mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user!.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null - ? await sharedPref.getInt(PROJECT_ID) - : user!.projectID, + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( + zipCode: loggedUser != null ? loggedUser.zipCode : user!.zipCode, + mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user!.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), activationCode: activationCode ?? '0000', oTPSendType: await sharedPref.getInt(OTP_TYPE), @@ -214,7 +200,7 @@ class AuthenticationViewModel extends BaseViewModel { /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { @@ -224,24 +210,17 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// get type name based on id. getType(type, context) { switch (type) { case 1: - return TranslationBase - .of(context) - .verifySMS; + return TranslationBase.of(context).verifySMS; break; case 3: - return TranslationBase - .of(context) - .verifyFingerprint; + return TranslationBase.of(context).verifyFingerprint; break; case 4: - return TranslationBase - .of(context) - .verifyFaceID; + return TranslationBase.of(context).verifyFaceID; break; case 2: return TranslationBase.of(context).verifyWhatsApp; @@ -253,15 +232,12 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " + - sendActivationCodeForDoctorAppResponseModel.verificationCode!); - sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); - sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); - sharedPref.setString(LOGIN_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.logInTokenID!); + setDataAfterSendActivationSuccess( + SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { + print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!); + sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); + sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); + sharedPref.setString(LOGIN_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.logInTokenID!); } saveObjToString(String key, value) async { @@ -300,7 +276,7 @@ class AuthenticationViewModel extends BaseViewModel { license: true, projectID: clinicInfo.projectID, tokenID: '', - languageID: 2);//TODO change the lan + languageID: 2); //TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error!; @@ -313,27 +289,19 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess() async { - sharedPref.setString( - TOKEN, - checkActivationCodeForDoctorAppRes.authenticationTokenID!); + sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile! - .isNotEmpty) { - localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); + checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { + localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { - sharedPref.setObj( - CLINIC_NAME, - checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic![0] - .toJson()); + sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); + ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } /// check specific biometric if it available or not - Future checkIfBiometricAvailable(BiometricType biometricType) async { + Future checkIfBiometricAvailable(BiometricType biometricType) async { bool isAvailable = false; await _getAvailableBiometrics(); for (var i = 0; i < _availableBiometrics.length; i++) { @@ -355,13 +323,13 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); + await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); } try { setState(ViewState.Busy); } catch (e) { - Helpers.showErrorToast("fdfdfdfdf"+e.toString()); + Helpers.showErrorToast("fdfdfdfdf" + e.toString()); } var token = await _firebaseMessaging.getToken(); if (DEVICE_TOKEN == "") { @@ -373,9 +341,8 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user =_authService.dashboardItemsList[0]; - sharedPref.setObj( - LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + user = _authService.dashboardItemsList[0]; + sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); this.unverified = true; } setState(ViewState.Idle); @@ -390,9 +357,9 @@ class AuthenticationViewModel extends BaseViewModel { if (state == ViewState.Busy) { app_status = APP_STATUS.LOADING; } else { - if(this.doctorProfile !=null) + if (this.doctorProfile != null) app_status = APP_STATUS.AUTHENTICATED; - else if (this.unverified) { + else if (this.unverified) { app_status = APP_STATUS.UNVERIFIED; } else if (this.isLogin) { app_status = APP_STATUS.AUTHENTICATED; @@ -402,12 +369,13 @@ class AuthenticationViewModel extends BaseViewModel { } return app_status; } - setAppStatus(APP_STATUS status){ + + setAppStatus(APP_STATUS status) { this.app_status = status; notifyListeners(); } - setUnverified(bool unverified,{bool isFromLogin = false}){ + setUnverified(bool unverified, {bool isFromLogin = false}) { this.unverified = unverified; this.isFromLogin = isFromLogin; notifyListeners(); @@ -415,24 +383,21 @@ 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); + 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); } - deleteUser(){ + deleteUser() { user = null; unverified = false; isLogin = false; } - } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 706b828e..8fe5a88c 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -15,23 +15,20 @@ class DashboardViewModel extends BaseViewModel { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); - List get dashboardItemsList => - _dashboardService.dashboardItemsList; + List get dashboardItemsList => _dashboardService.dashboardItemsList; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; String? get sServiceID => _dashboardService.sServiceID; - Future setFirebaseNotification(ProjectViewModel projectsProvider, - AuthenticationViewModel authProvider) async { + Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); await projectsProvider.getDoctorClinicsList(); // _firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - - _firebaseMessaging.getToken().then((String ?token) async { + _firebaseMessaging.getToken().then((String? token) async { if (token != '') { DEVICE_TOKEN = token!; authProvider.insertDeviceImei(); @@ -59,8 +56,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future changeClinic( - int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( @@ -76,7 +72,7 @@ class DashboardViewModel extends BaseViewModel { getPatientCount(DashboardModel inPatientCount) { int value = 0; - inPatientCount.summaryoptions.forEach((result) => {value += result.value}); + inPatientCount.summaryoptions!.forEach((result) => {value += result.value!}); return value.toString(); } diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 8fa484ea..f95702a5 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -105,9 +105,9 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationList({required String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); + await _prescriptionService.getMedicationList(drug: drug!); if (_prescriptionService.hasError) { error = _prescriptionService.error!; setState(ViewState.Error); @@ -185,7 +185,8 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getBoxQuantity({required int itemCode, required int duration, required double strength, required int freq}) async { + Future getBoxQuantity( + {required int itemCode, required int duration, required double strength, required int freq}) async { setState(ViewState.Busy); await _prescriptionService.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index f93b057e..6e67aea3 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -18,16 +18,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; @@ -35,28 +32,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); @@ -105,8 +95,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) { @@ -124,10 +113,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; @@ -167,8 +153,7 @@ class PatientReferralViewModel extends BaseViewModel { 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) { @@ -178,8 +163,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) { @@ -189,11 +173,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); @@ -233,12 +216,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); @@ -257,8 +238,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) { @@ -283,22 +263,21 @@ class PatientReferralViewModel extends BaseViewModel { String getReferralStatusNameByCode(int statusCode, BuildContext context) { switch (statusCode) { case 1: - return TranslationBase.of(context).pending /*referralStatusHold*/; + return TranslationBase.of(context).pending ?? "" /*referralStatusHold*/; case 2: - return TranslationBase.of(context).accepted /*referralStatusActive*/; + return TranslationBase.of(context).accepted ?? "" /*referralStatusActive*/; case 4: - return TranslationBase.of(context).rejected /*referralStatusCancelled*/; + return TranslationBase.of(context).rejected ?? "" /*referralStatusCancelled*/; case 46: - return TranslationBase.of(context).accepted /*referralStatusCompleted*/; + return TranslationBase.of(context).accepted ?? "" /*referralStatusCompleted*/; case 63: - return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; + return TranslationBase.of(context).rejected ?? "" /*referralStatusNotSeen*/; default: return "-"; } } - PatiantInformtion getPatientFromReferral( - MyReferredPatientModel referredPatient) { + PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -323,8 +302,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!; @@ -349,8 +327,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!; @@ -369,8 +346,7 @@ 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; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index b665a385..4c4d6e56 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -18,21 +18,17 @@ import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => - _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => - _ucafService.patientVitalSignsHistory; + List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; - List get patientAssessmentList => - _ucafService.patientAssessmentList; + List get patientAssessmentList => _ucafService.patientAssessmentList; List get diagnosisTypes => _ucafService.listOfDiagnosisType; - List get diagnosisConditions => - _ucafService.listOfDiagnosisCondition; + List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; - PrescriptionModel get prescriptionList => _ucafService.prescriptionList; + PrescriptionModel? get prescriptionList => _ucafService.prescriptionList; List get orderProcedures => _ucafService.orderProcedureList; @@ -61,11 +57,9 @@ class UcafViewModel extends BaseViewModel { String from; String to; - 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'); // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); @@ -85,22 +79,16 @@ class UcafViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || - temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || - respirationBeatPerMinute == null || - respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = - element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || - bloodPressure == null || - bloodPressure == 'null') { + if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } }); @@ -119,8 +107,7 @@ class UcafViewModel extends BaseViewModel { } else { if (patientAssessmentList.isNotEmpty) { if (diagnosisConditions.length == 0) { - await _ucafService - .getMasterLookup(MasterKeysService.DiagnosisCondition); + await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition); } if (diagnosisTypes.length == 0) { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); @@ -162,13 +149,11 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel ? findMasterDataById( - {required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel? findMasterDataById({required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -176,8 +161,7 @@ class UcafViewModel extends BaseViewModel { return null; case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -192,7 +176,7 @@ class UcafViewModel extends BaseViewModel { setState(ViewState.Busy); await _ucafService.postUCAF(patient); if (_ucafService.hasError) { - error = _ucafService.error; + error = _ucafService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); // but with empty list diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 4f22d9e3..83148044 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -11,10 +11,9 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel { VitalSignsService _vitalSignService = locator(); - VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; + VitalSignData? get patientVitalSigns => _vitalSignService.patientVitalSigns; - List get patientVitalSignsHistory => - _vitalSignService.patientVitalSignsHistory; + List get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory; String heightCm = "0"; String weightKg = "0"; @@ -42,8 +41,7 @@ class VitalSignsViewModel extends BaseViewModel { } } - Future getPatientVitalSignHistory(PatiantInformtion patient, String from, - String to, bool isInPatient) async { + Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -72,50 +70,29 @@ class VitalSignsViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || - temperatureCelcius == null || - temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || - respirationBeatPerMinute == null || - respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = - element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || - bloodPressure == null || - bloodPressure == 'null') { + if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } - if (oxygenation == "0" || - oxygenation == null || - oxygenation == 'null') { - oxygenation = - "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ + if (oxygenation == "0" || oxygenation == null || oxygenation == 'null') { + oxygenation = "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { - painScore = element.painScoreDesc.toString() != 'null' - ? element.painScoreDesc.toString() - : "-"; - painLocation = element.painLocation.toString() != 'null' - ? element.painLocation.toString() - : "-"; - painCharacter = element.painCharacter.toString() != 'null' - ? element.painCharacter.toString() - : "-"; - painDuration = element.painDuration.toString() != 'null' - ? element.painDuration.toString() - : "-"; - isPainDone = element.isPainManagementDone.toString() != 'null' - ? element.isPainManagementDone.toString() - : "-"; - painFrequency = element.painFrequency.toString() != 'null' - ? element.painFrequency.toString() - : "-"; + painScore = element.painScoreDesc.toString() != 'null' ? element.painScoreDesc.toString() : "-"; + painLocation = element.painLocation.toString() != 'null' ? element.painLocation.toString() : "-"; + painCharacter = element.painCharacter.toString() != 'null' ? element.painCharacter.toString() : "-"; + painDuration = element.painDuration.toString() != 'null' ? element.painDuration.toString() : "-"; + isPainDone = + element.isPainManagementDone.toString() != 'null' ? element.isPainManagementDone.toString() : "-"; + painFrequency = element.painFrequency.toString() != 'null' ? element.painFrequency.toString() : "-"; } }); setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 902268da..349da950 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -26,11 +26,9 @@ class PrescriptionViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; bool hasError = false; PrescriptionService _prescriptionService = locator(); - List get allMedicationList => - _prescriptionService.allMedicationList; + List get allMedicationList => _prescriptionService.allMedicationList; - List get prescriptionList => - _prescriptionService.prescriptionList; + List get prescriptionList => _prescriptionService.prescriptionList; List get drugsList => _prescriptionService.doctorsList; //List get allMedicationList => _prescriptionService.allMedicationList; List get drugToDrug => _prescriptionService.drugToDrugList; @@ -38,33 +36,25 @@ class PrescriptionViewModel extends BaseViewModel { List get itemMedicineList => _prescriptionService.itemMedicineList; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; - List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; + List get prescriptionReportList => _prescriptionsService.prescriptionReportList; - List get prescriptionsList => - _prescriptionsService.prescriptionsList; + List get prescriptionsList => _prescriptionsService.prescriptionsList; - List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; - List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; + List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; + List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; List get prescriptionsOrderList => - filterType == FilterType.Clinic - ? _prescriptionsOrderListClinic - : _prescriptionsOrderListHospital; + filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; - List get inPatientPrescription => - _prescriptionsService.prescriptionInPatientList; + List get inPatientPrescription => _prescriptionsService.prescriptionInPatientList; getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); error = ""; - await _prescriptionsService.getPrescriptionInPatient( - mrn: patient.patientId, adn: patient.admissionNo); + await _prescriptionsService.getPrescriptionInPatient(mrn: patient.patientId, adn: patient.admissionNo); if (_prescriptionsService.hasError) { error = "No Prescription Found"; setState(ViewState.Error); @@ -76,38 +66,37 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getItem({int itemID}) async { + Future getItem({int? itemID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPrescription({int mrn}) async { + Future getPrescription({int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postPrescription( - PostPrescriptionReqModel postProcedureReqModel, int mrn) async { + Future postPrescription(PostPrescriptionReqModel postProcedureReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.postPrescription(postProcedureReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -115,24 +104,23 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getMedicationList({String drug}) async { + Future getMedicationList({String? drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); + await _prescriptionService.getMedicationList(drug: drug!); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future updatePrescription( - PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { + Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.updatePrescription(updatePrescriptionReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -140,30 +128,25 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getDrugs({String drugName}) async { + Future getDrugs({String? drugName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getDrugs(drugName: drugName); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getDrugToDrug( - VitalSignData vital, - List lstAssessments, - List allergy, - PatiantInformtion patient, - List prescription) async { + Future getDrugToDrug(VitalSignData vital, List lstAssessments, + List allergy, PatiantInformtion patient, List prescription) async { hasError = false; setState(ViewState.Busy); - await _prescriptionService.getDrugToDrug( - vital, lstAssessments, allergy, patient, prescription); + await _prescriptionService.getDrugToDrug(vital, lstAssessments, allergy, patient, prescription); if (_prescriptionService.hasError) { - error = _prescriptionService.error; + error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -174,27 +157,22 @@ class PrescriptionViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( - prescriptions: prescriptions, patient: patient); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( - itemId: itemId, patient: patient); + await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -204,50 +182,41 @@ class PrescriptionViewModel extends BaseViewModel { void _filterList() { _prescriptionsService.prescriptionsList.forEach((element) { /// PrescriptionsList list sort clinic - List prescriptionsByClinic = - _prescriptionsOrderListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List prescriptionsByClinic = _prescriptionsOrderListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (prescriptionsByClinic.length != 0) { - _prescriptionsOrderListClinic[ - _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + _prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListClinic.add(PrescriptionsList( - filterName: element.clinicDescription, prescriptions: element)); + _prescriptionsOrderListClinic + .add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element)); } /// PrescriptionsList list sort via hospital - List prescriptionsByHospital = - _prescriptionsOrderListHospital - .where( - (elementClinic) => elementClinic.filterName == element.name, - ) - .toList(); + List prescriptionsByHospital = _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); if (prescriptionsByHospital.length != 0) { - _prescriptionsOrderListHospital[_prescriptionsOrderListHospital - .indexOf(prescriptionsByHospital[0])] + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListHospital.add(PrescriptionsList( - filterName: element.name, prescriptions: element)); + _prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element)); } }); } - getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( - prescriptionsOrder: prescriptionsOrder, patient: patient); + await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -257,18 +226,18 @@ class PrescriptionViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getPrescriptions(PatiantInformtion patient, {String patientType}) async { + getPrescriptions(PatiantInformtion patient, {String? patientType}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index b5916bac..d0718597 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -16,30 +16,24 @@ class PrescriptionsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List _prescriptionsOrderListClinic = []; + List _prescriptionsOrderListHospital = []; - List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; + List get prescriptionReportList => _prescriptionsService.prescriptionReportList; - List get prescriptionsList => - _prescriptionsService.prescriptionsList; + List get prescriptionsList => _prescriptionsService.prescriptionsList; - List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; - List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; + List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; + List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; List get prescriptionsOrderList => - filterType == FilterType.Clinic - ? _prescriptionsOrderListClinic - : _prescriptionsOrderListHospital; + filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; getPrescriptions(PatiantInformtion patient) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { _filterList(); @@ -52,7 +46,7 @@ class PrescriptionsViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -62,38 +56,32 @@ class PrescriptionsViewModel extends BaseViewModel { void _filterList() { _prescriptionsService.prescriptionsList.forEach((element) { /// PrescriptionsList list sort clinic - List prescriptionsByClinic = - _prescriptionsOrderListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List prescriptionsByClinic = _prescriptionsOrderListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (prescriptionsByClinic.length != 0) { - _prescriptionsOrderListClinic[ - _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + _prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListClinic.add(PrescriptionsList( - filterName: element.clinicDescription, prescriptions: element)); + _prescriptionsOrderListClinic + .add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element)); } /// PrescriptionsList list sort via hospital - List prescriptionsByHospital = - _prescriptionsOrderListHospital - .where( - (elementClinic) => elementClinic.filterName == element.name, - ) - .toList(); + List prescriptionsByHospital = _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); if (prescriptionsByHospital.length != 0) { - _prescriptionsOrderListHospital[_prescriptionsOrderListHospital - .indexOf(prescriptionsByHospital[0])] + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])] .prescriptionsList .add(element); } else { - _prescriptionsOrderListHospital.add(PrescriptionsList( - filterName: element.name, prescriptions: element)); + _prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element)); } }); } @@ -103,41 +91,33 @@ class PrescriptionsViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { + getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( - prescriptions: prescriptions, patient: patient); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { + getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( - itemId: itemId, patient: patient); + await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( - prescriptionsOrder: prescriptionsOrder, patient: patient); + await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index cb3a2a7e..43758e65 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -37,8 +37,8 @@ class ProcedureViewModel extends BaseViewModel { List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); LabsService _labsService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; @@ -50,14 +50,14 @@ class ProcedureViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get procedureTemplate => _procedureService.templateList; - List templateList = List(); + List templateList = []; List get procedureTemplateDetails => _procedureService.templateDetailsList; - List _patientLabOrdersListClinic = List(); - List _patientLabOrdersListHospital = List(); + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; - Future getProcedure({int mrn, String patientType}) async { + Future getProcedure({int? mrn, String? patientType}) async { hasError = false; await getDoctorProfile(); @@ -65,7 +65,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.getProcedure(mrn: mrn); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -74,13 +74,13 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { + Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureCategory( categoryName: categoryName, categoryID: categoryID, patientId: patientId); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -92,18 +92,18 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.getCategory(); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getProcedureTemplate({String categoryID}) async { + Future getProcedureTemplate({String? categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -129,14 +129,14 @@ class ProcedureViewModel extends BaseViewModel { int tempId = 0; - Future getProcedureTemplateDetails({int templateId}) async { - tempId = templateId; + Future getProcedureTemplateDetails({int? templateId}) async { + tempId = templateId!; hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _procedureService.getProcedureTemplateDetails(templateId: templateId); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -148,7 +148,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.postProcedure(postProcedureReqModel); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { await getProcedure(mrn: mrn); @@ -162,31 +162,31 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.valadteProcedure(procedureValadteRequestModel); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn}) async { + Future updateProcedure({UpdateProcedureRequestModel? updateProcedureRequestModel, int? mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.updateProcedure(updateProcedureRequestModel); + await _procedureService.updateProcedure(updateProcedureRequestModel!); if (_procedureService.hasError) { - error = _procedureService.error; + error = _procedureService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -228,12 +228,12 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -248,7 +248,7 @@ class ProcedureViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = List(); + List labResultLists = []; List get labResultListsCoustom { return labResultLists; @@ -258,7 +258,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, isInpatient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -266,30 +266,30 @@ class ProcedureViewModel extends BaseViewModel { } getLaboratoryResult( - {String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { + {String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { + getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) + if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true; }); } @@ -298,10 +298,10 @@ class ProcedureViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; } else DrAppToastMsg.showSuccesToast(mes); } diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index f464df0e..e8e5a4fe 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,7 +17,7 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - Locale _appLocale; + late Locale _appLocale; String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; @@ -30,13 +30,11 @@ class ProjectViewModel with ChangeNotifier { Locale get appLocal => _appLocale; bool get isArabic => _isArabic; - StreamSubscription subscription; + late StreamSubscription subscription; ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity() - .onConnectivityChanged - .listen((ConnectivityResult result) { + subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -94,8 +92,7 @@ class ProjectViewModel with ChangeNotifier { try { dynamic localRes; - await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) { doctorClinicsList = []; response['List_DoctorsClinic'].forEach((v) { doctorClinicsList.add(new ClinicModel.fromJson(v)); @@ -115,7 +112,11 @@ class ProjectViewModel with ChangeNotifier { void getProfile() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,); + ClinicModel clinicModel = ClinicModel( + doctorID: doctorProfile.doctorID, + clinicID: doctorProfile.clinicID, + projectID: doctorProfile.projectID, + ); await Provider.of(AppGlobal.CONTEX, listen: false) .getDoctorProfileBasedOnClinic(clinicModel); diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index d656de6c..8fbbfc7c 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -12,57 +12,46 @@ class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; RadiologyService _radiologyService = locator(); - List _finalRadiologyListClinic = List(); - List _finalRadiologyListHospital = List(); + List _finalRadiologyListClinic = []; + List _finalRadiologyListHospital = []; List get finalRadiologyList => - filterType == FilterType.Clinic - ? _finalRadiologyListClinic - : _finalRadiologyListHospital; + filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, - isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = - _finalRadiologyListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = _finalRadiologyListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[ - finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListClinic.add(FinalRadiologyList( - filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic + .add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = - _finalRadiologyListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = _finalRadiologyListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital - .indexOf(finalRadiologyListHospital[0])] + _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList( - filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); } }); @@ -72,19 +61,12 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, - lineItem: lineItem, - projectId: projectId, - patient: patient); + invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error; + error = _radiologyService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 892284e2..c8993da0 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -6,28 +6,25 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferralPatientViewModel extends BaseViewModel { - ReferralPatientService _referralPatientService = - locator(); + ReferralPatientService _referralPatientService = locator(); - List get listMyReferralPatientModel => - _referralPatientService.listMyReferralPatientModel; + List get listMyReferralPatientModel => _referralPatientService.listMyReferralPatientModel; Future getMyReferralPatient() async { setState(ViewState.Busy); await _referralPatientService.getMyReferralPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future replay( - String referredDoctorRemarks, MyReferralPatientModel model) async { + Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { setState(ViewState.BusyLocal); await _referralPatientService.replay(referredDoctorRemarks, model); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referred_view_model.dart b/lib/core/viewModel/referred_view_model.dart index 173aa60a..da99d26b 100644 --- a/lib/core/viewModel/referred_view_model.dart +++ b/lib/core/viewModel/referred_view_model.dart @@ -6,17 +6,15 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferredPatientViewModel extends BaseViewModel { - ReferredPatientService _referralPatientService = - locator(); + ReferredPatientService _referralPatientService = locator(); - List get listMyReferredPatientModel => - _referralPatientService.listMyReferredPatientModel; + List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; Future getMyReferredPatient() async { setState(ViewState.Busy); await _referralPatientService.getMyReferredPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 3ee64c9b..681d7321 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -8,14 +8,13 @@ import 'base_view_model.dart'; class ScheduleViewModel extends BaseViewModel { ScheduleService _scheduleService = locator(); - List get listDoctorWorkingHoursTable => - _scheduleService.listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable; Future getDoctorSchedule() async { setState(ViewState.Busy); await _scheduleService.getDoctorSchedule(); if (_scheduleService.hasError) { - error = _scheduleService.error; + error = _scheduleService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index b768cc9d..c5a0bc73 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -21,7 +21,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.addSickLeave(addSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -31,7 +31,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.extendSickLeave(extendSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -41,7 +41,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getStatistics(appoNo, patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -51,7 +51,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeave(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -61,7 +61,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeavePatient(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -71,7 +71,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getRescheduleLeave(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -81,7 +81,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getOffTime(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -91,7 +91,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getReasonsByID(id: id); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -101,8 +101,8 @@ class SickLeaveViewModel extends BaseViewModel { //setState(ViewState.Busy); await _sickLeaveService.getCoveringDoctors(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; - // setState(ViewState.Error); + error = _sickLeaveService.error!; +// setState(ViewState.Error); } //else // setState(ViewState.Idle); @@ -113,7 +113,7 @@ class SickLeaveViewModel extends BaseViewModel { await _sickLeaveService.addReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -123,7 +123,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.updateReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/landing_page.dart b/lib/landing_page.dart index cd7a8171..90b8453f 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -5,7 +5,6 @@ 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/bottom_nav_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,7 +15,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State { int currentTab = 0; - PageController pageController; + late PageController pageController; _changeCurrentTab(int tab) { setState(() { @@ -39,14 +38,11 @@ class _LandingPageState extends State { elevation: 0, backgroundColor: Colors.grey[100], //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: currentTab != 0 - ? Text(getText(currentTab).toUpperCase()) - : SizedBox(), + title: currentTab != 0 ? Text(getText(currentTab).toUpperCase()) : SizedBox(), leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), + icon: Image.asset('assets/images/menu.png', height: 50, width: 50), iconSize: 15, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -97,7 +93,7 @@ class MyAppbar extends StatelessWidget with PreferredSizeWidget { @override final Size preferredSize; - MyAppbar({Key key}) + MyAppbar({Key? key}) : preferredSize = Size.fromHeight(0.0), super(key: key); @override diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 94e507c8..fa6f53a6 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -34,7 +34,7 @@ class ListDoctorWorkingHoursTable { } class WorkingHours { - String from; - String to; - WorkingHours({required this.from, required this.to}); + String? from; + String? to; + WorkingHours({this.from, this.to}); } diff --git a/lib/models/doctor/user_model.dart b/lib/models/doctor/user_model.dart index 2500bfd7..66768c8a 100644 --- a/lib/models/doctor/user_model.dart +++ b/lib/models/doctor/user_model.dart @@ -26,7 +26,7 @@ class UserModel { this.isLoginForDoctorApp, this.patientOutSA}); - UserModel.fromJson(Map json) { + UserModel.fromJson(Map json) { userID = json['UserID']; password = json['Password']; projectID = json['ProjectID']; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 9563b29c..e6d024fd 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -16,14 +16,13 @@ import 'package:provider/provider.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; - class LoginScreen extends StatefulWidget { @override _LoginScreenState createState() => _LoginScreenState(); } class _LoginScreenState extends State { - String platformImei; + late String platformImei; bool allowCallApi = true; //TODO change AppTextFormField to AppTextFormFieldCustom @@ -34,7 +33,7 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -47,170 +46,117 @@ class _LoginScreenState extends State { Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, - child: Column( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( + //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: [ - 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'), - ), - - Text( - "Doctor App", - style: TextStyle( - fontSize: - SizeConfig.isMobile - ? 16 - : SizeConfig - .realScreenWidth * - 0.030, - fontWeight: FontWeight - .w600, - color: Color(0xFFD02127)), - ), - ]), - ], - )), - SizedBox( - height: 40, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + ], ), - 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: [ - - 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).selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: (){ - Helpers - .showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, - - - ), - buildSizedBox() - ]), - ), - ], + 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'), ), - ) + 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: [ + 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).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: () { + Helpers.showCupertinoPicker( + context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); + }, + ), + buildSizedBox() + ]), + ), + ], + ), ) - ])) + ], + ) + ])) ]), ), bottomSheet: Container( - height: 90, width: double.infinity, child: Center( @@ -220,26 +166,23 @@ class _LoginScreenState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ AppButton( - title: TranslationBase - .of(context) - .login, + 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: 25, + ) ], ), ), - ),), + ), + ), ); } @@ -249,9 +192,11 @@ class _LoginScreenState extends State { ); } - login(context,) async { - if (loginFormKey.currentState.validate()) { - loginFormKey.currentState.save(); + login( + context, + ) async { + if (loginFormKey.currentState!.validate()) { + loginFormKey.currentState!.save(); GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.login(authenticationViewModel.userInfo); if (authenticationViewModel.state == ViewState.ErrorLocal) { @@ -259,7 +204,7 @@ class _LoginScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - authenticationViewModel.setUnverified(true,isFromLogin: true); + authenticationViewModel.setUnverified(true, isFromLogin: true); // Navigator.of(context).pushReplacement( // MaterialPageRoute( // builder: (BuildContext context) => @@ -276,22 +221,23 @@ class _LoginScreenState extends State { onSelectProject(index) { setState(() { authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName; + projectIdController.text = projectsList[index].facilityName!; }); - primaryFocus.unfocus(); + 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; - projectIdController.text = projectsList[0].facilityName; + projectIdController.text = projectsList[0].facilityName!; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 69d4a47a..94404bc1 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -33,33 +33,29 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); class VerificationMethodsScreen extends StatefulWidget { - - final password; - - VerificationMethodsScreen({this.password, }); + VerificationMethodsScreen({ + this.password, + }); @override _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); } class _VerificationMethodsScreenState extends State { - - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes fingerPrintBefore; - AuthMethodTypes selectedOption; - AuthenticationViewModel authenticationViewModel; + late AuthMethodTypes fingerPrintBefore; + late AuthMethodTypes selectedOption; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); - - return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -78,17 +74,17 @@ class _VerificationMethodsScreenState extends State { 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),) - - ), + if (authenticationViewModel.isFromLogin) + InkWell( + onTap: () { + authenticationViewModel.setUnverified(false, isFromLogin: false); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + child: Icon( + Icons.arrow_back_ios, + color: Color(0xFF2B353E), + )), Container( - child: Column( children: [ SizedBox( @@ -96,290 +92,226 @@ class _VerificationMethodsScreenState extends State { ), authenticationViewModel.user != null && isMoreOption == false ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - AppText( - TranslationBase.of(context).welcomeBack, - fontSize:12, - fontWeight: FontWeight.w700, - color: Color(0xFF2B353E), - ), - AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), - fontSize: 24, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context).accountInfo , - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 20, - ), - Container( - padding: EdgeInsets.all(15), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - children: [ - - Text( - TranslationBase.of(context) - .lastLoginAt, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700,), - + AppText( + TranslationBase.of(context).welcomeBack, + fontSize: 12, + fontWeight: FontWeight.w700, + color: Color(0xFF2B353E), + ), + AppText( + Helpers.capitalize(authenticationViewModel.user?.doctorName), + fontSize: 24, + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 20, + ), + Container( + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all(color: HexColor('#707070'), width: 0.1), ), - 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, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + Text( + TranslationBase.of(context).lastLoginAt!, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + ), + ), + Row( + children: [ + AppText( + TranslationBase.of(context).verifyWith, + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + AppText( + authenticationViewModel.getType( + authenticationViewModel.user?.logInTypeID, context), + fontSize: 14, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ], + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, ), + Column( + children: [ + AppText( + authenticationViewModel.user?.editedOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + authenticationViewModel.user!.editedOn ?? "")) + : authenticationViewModel.user?.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + authenticationViewModel.user!.createdOn ?? "")) + : '--', + textAlign: TextAlign.right, + fontSize: 13, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + ), + AppText( + authenticationViewModel.user?.editedOn != null + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate( + authenticationViewModel!.user!.editedOn ?? "")) + : authenticationViewModel.user!.createdOn != null + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate( + authenticationViewModel.user!.createdOn ?? "")) + : '--', + textAlign: TextAlign.right, + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + ) ], - ) - ], - crossAxisAlignment: CrossAxisAlignment.start,), - Column(children: [ - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 13, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, ), - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, - + ), + SizedBox( + height: 20, + ), + Row( + children: [ + AppText( + "Please Verify", + fontSize: 16, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ], ) ], - ), - ), - 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, - ), - ]), + 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, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, 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), + 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; + }); + }, )) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: - MainAxisAlignment.center, + ]), + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, 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), - )) - ], - ), - ]), + 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), + )) + ], + ), + ]), // ) ], @@ -391,56 +323,59 @@ class _VerificationMethodsScreenState extends State { ), ), ), - bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( - height: 90, - width: double.infinity, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SecondaryButton( - label: TranslationBase - .of(context) - .useAnotherAccount, - color: Color(0xFFD02127), - //fontWeight: FontWeight.w700, - onTap: () { - authenticationViewModel.deleteUser(); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - // Navigator.pushAndRemoveUntil( - // AppGlobal.CONTEX, - // FadePage( - // page: RootPage(), - // ), - // (r) => false); - // Navigator.of(context).pushNamed(LOGIN); - }, + bottomSheet: authenticationViewModel.user == null + ? SizedBox( + height: 0, + ) + : Container( + height: 90, + width: double.infinity, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SecondaryButton( + label: TranslationBase.of(context).useAnotherAccount!, + color: Color(0xFFD02127), + //fontWeight: FontWeight.w700, + onTap: () { + 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: 25,) - ], + ), ), - ), - ),), ); } - sendActivationCodeByOtpNotificationType( - AuthMethodTypes authMethodType) async { - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { + if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); - - await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: authenticationViewModel.userInfo.password ); + await authenticationViewModel.sendActivationCodeForDoctorApp( + authMethodType: authMethodType, password: authenticationViewModel.userInfo.password!); if (authenticationViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); } else { - authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes); - sharedPref.setString(PASSWORD, authenticationViewModel.userInfo.password); + authenticationViewModel + .setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes); + sharedPref.setString(PASSWORD, authenticationViewModel.userInfo.password!); GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); } @@ -454,16 +389,15 @@ class _VerificationMethodsScreenState extends State { sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel - .sendActivationCodeVerificationScreen(authMethodType); + await authenticationViewModel.sendActivationCodeVerificationScreen(authMethodType); if (authenticationViewModel.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { - authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeVerificationScreenRes); - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + authenticationViewModel + .setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeVerificationScreenRes); + if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); } else { @@ -473,12 +407,10 @@ class _VerificationMethodsScreenState extends State { } authenticateUser(AuthMethodTypes authMethodType, isActive) { - if (authMethodType == AuthMethodTypes.Fingerprint || - authMethodType == AuthMethodTypes.FaceID) { + if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = - fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + this.selectedOption = fingerPrintBefore != null ? fingerPrintBefore : authMethodType; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -488,8 +420,7 @@ class _VerificationMethodsScreenState extends State { sendActivationCode(authMethodType); break; case AuthMethodTypes.Fingerprint: - this.loginWithFingerPrintOrFaceID( - AuthMethodTypes.Fingerprint, isActive); + this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive); break; case AuthMethodTypes.FaceID: this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive); @@ -512,7 +443,9 @@ class _VerificationMethodsScreenState extends State { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, + authenticationViewModel.loggedUser != null + ? authenticationViewModel.loggedUser.mobileNumber + : authenticationViewModel.user!.mobile, (value) { showDialog( context: context, @@ -522,23 +455,21 @@ class _VerificationMethodsScreenState extends State { this.checkActivationCode(value: value); }, - () => - { + () => { print('Faild..'), }, ).displayDialog(context); } - loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, - isActive) async { + + loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async { if (isActive) { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && - (SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == - AuthMethodTypes.Fingerprint || - SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { + (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == + AuthMethodTypes.Fingerprint || + SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == + AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -568,7 +499,4 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED); } } - - - } diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index 7a5c93e6..0cf174c7 100644 --- a/lib/screens/base/base_view.dart +++ b/lib/screens/base/base_view.dart @@ -5,11 +5,11 @@ import 'package:provider/provider.dart'; import '../../locator.dart'; class BaseView extends StatefulWidget { - final Widget Function(BuildContext context, T model, Widget child) builder; - final Function(T) onModelReady; + final Widget Function(BuildContext context, T model, Widget? child) builder; + final Function(T)? onModelReady; BaseView({ - this.builder, + required this.builder, this.onModelReady, }); @@ -18,14 +18,14 @@ class BaseView extends StatefulWidget { } class _BaseViewState extends State> { - T model = locator(); + T? model = locator(); bool isLogin = false; @override void initState() { if (widget.onModelReady != null) { - widget.onModelReady(model); + widget.onModelReady!(model!); } super.initState(); @@ -34,7 +34,7 @@ class _BaseViewState extends State> { @override Widget build(BuildContext context) { return ChangeNotifierProvider.value( - value: model, + value: model!, child: Consumer(builder: widget.builder), ); } diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 14e446e8..9b4017a4 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -12,13 +12,14 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:url_launcher/url_launcher.dart'; class DoctorReplayChat extends StatelessWidget { - final ListGtMyPatientsQuestions reply; TextEditingController msgController = TextEditingController(); - final DoctorReplayViewModel previousModel; - DoctorReplayChat( - {Key key, this.reply, this.previousModel, - }); + final DoctorReplayViewModel previousModel; + DoctorReplayChat({ + Key? key, + required this.reply, + required this.previousModel, + }); @override Widget build(BuildContext context) { @@ -37,33 +38,27 @@ class DoctorReplayChat extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), height: 115, child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), + padding: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(top: 40), child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: RichText( text: TextSpan( style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), + fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: reply.patientName - .toString(), + text: reply.patientName.toString(), style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -77,9 +72,7 @@ class DoctorReplayChat extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(FontAwesomeIcons.times, - size: 30, - color: Color(0xFF2B353E))) + child: Icon(FontAwesomeIcons.times, size: 30, color: Color(0xFF2B353E))) ], ), ], @@ -93,8 +86,9 @@ class DoctorReplayChat extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - - SizedBox(height: 30,), + SizedBox( + height: 30, + ), Container( // color: Color(0xFF2B353E), width: MediaQuery.of(context).size.width * 0.9, @@ -104,9 +98,7 @@ class DoctorReplayChat extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: HexColor('#707070') , - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -132,12 +124,13 @@ class DoctorReplayChat extends StatelessWidget { ), ), Divider(), - SizedBox(width: 10,), + SizedBox( + width: 10, + ), Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - reply.patientName - .toString(), + reply.patientName.toString(), fontSize: 14, fontFamily: 'Poppins', color: Colors.white, @@ -149,7 +142,7 @@ class DoctorReplayChat extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" +reply.mobileNumber); + launch("tel://" + reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -161,18 +154,23 @@ class DoctorReplayChat extends StatelessWidget { ), Column( crossAxisAlignment: CrossAxisAlignment.center, - children: [ AppText( - reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .w600, + reply.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDateTimeFromServerFormat( + reply.createdOn ?? "")) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight.w600, color: Colors.white, fontSize: 14, ), AppText( - reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), - fontSize: 14, + reply.createdOn != null + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( + reply.createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontSize: 14, fontFamily: 'Poppins', color: Colors.white, // fontSize: 18 @@ -210,7 +208,9 @@ class DoctorReplayChat extends StatelessWidget { ], ), ), - SizedBox(height: 30,), + SizedBox( + height: 30, + ), ], ), ), @@ -276,8 +276,6 @@ class DoctorReplayChat extends StatelessWidget { // ), // ) ], - - ), ), )); diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index f522561f..38bc801c 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -16,10 +16,9 @@ import 'package:flutter/material.dart'; *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service */ class DoctorReplyScreen extends StatelessWidget { - final Function changeCurrentTab; - const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); @override Widget build(BuildContext context) { @@ -28,16 +27,16 @@ class DoctorReplyScreen extends StatelessWidget { model.getDoctorReply(); }, builder: (_, model, w) => WillPopScope( - onWillPop: ()async{ + onWillPop: () async { changeCurrentTab(); return false; }, child: AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem ?? "") : Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: ListView( @@ -45,19 +44,17 @@ class DoctorReplyScreen extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: - model.listDoctorWorkingHoursTable.map((reply) { + children: model.listDoctorWorkingHoursTable.map((reply) { return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat( - reply: reply, - previousModel: model, - ))); - }, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => DoctorReplayChat( + reply: reply, + previousModel: model, + ))); + }, child: DoctorReplyWidget(reply: reply), ); }).toList(), @@ -68,6 +65,5 @@ class DoctorReplyScreen extends StatelessWidget { ), ), ); - } } diff --git a/lib/screens/doctor/my_referral_patient_screen.dart b/lib/screens/doctor/my_referral_patient_screen.dart index 960bbdd9..7f648b0e 100644 --- a/lib/screens/doctor/my_referral_patient_screen.dart +++ b/lib/screens/doctor/my_referral_patient_screen.dart @@ -21,7 +21,7 @@ class _MyReferralPatientState extends State { onModelReady: (model) => model.getMyReferralPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).myReferralPatient, + appBarTitle: TranslationBase.of(context).myReferralPatient ?? "", body: model.listMyReferralPatientModel.length == 0 ? Center( child: AppText( @@ -45,21 +45,18 @@ class _MyReferralPatientState extends State { ...List.generate( model.listMyReferralPatientModel.length, (index) => MyReferralPatientWidget( - myReferralPatientModel: model - .listMyReferralPatientModel[index], + myReferralPatientModel: model.listMyReferralPatientModel[index], model: model, expandClick: () { setState(() { - if (widget.expandedItemIndex == - index) { + if (widget.expandedItemIndex == index) { widget.expandedItemIndex = -1; } else { widget.expandedItemIndex = index; } }); }, - isExpand: - widget.expandedItemIndex == index, + isExpand: widget.expandedItemIndex == index, ), ) ], diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 5ef8b617..23117bb8 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -14,9 +14,8 @@ class PatientArrivalScreen extends StatefulWidget { _PatientArrivalScreen createState() => _PatientArrivalScreen(); } -class _PatientArrivalScreen extends State - with SingleTickerProviderStateMixin { - TabController _tabController; +class _PatientArrivalScreen extends State with SingleTickerProviderStateMixin { + late TabController _tabController; var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -24,10 +23,8 @@ class _PatientArrivalScreen extends State PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), + From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), + To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", @@ -54,7 +51,7 @@ class _PatientArrivalScreen extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).arrivalpatient, + appBarTitle: TranslationBase.of(context).arrivalpatient ?? "", body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -66,9 +63,7 @@ class _PatientArrivalScreen extends State width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -78,22 +73,19 @@ class _PatientArrivalScreen extends State indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText( - TranslationBase.of(context).arrivalpatient), + child: AppText(TranslationBase.of(context).arrivalpatient), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText( - TranslationBase.of(context).rescheduleLeaves), + child: AppText(TranslationBase.of(context).rescheduleLeaves), ), ), ], diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..92089f4c 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -27,9 +27,8 @@ class DashboardSliderItemWidget extends StatelessWidget { height: 110, child: ListView( scrollDirection: Axis.horizontal, - children: - List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[index]); + children: List.generate(item.summaryoptions!.length, (int index) { + return GetActivityButton(item.summaryoptions![index]); }))) ], ); diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index de5cc05f..2e7815ba 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -45,8 +45,7 @@ class _DashboardSwipeWidgetState extends State { }, itemCount: 3, // itemHeight: 300, - pagination: new SwiperCustomPagination( - builder: (BuildContext context, SwiperPluginConfig config) { + pagination: new SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) { return new Stack( alignment: Alignment.bottomCenter, children: [ @@ -59,15 +58,9 @@ class _DashboardSwipeWidgetState extends State { 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), + config.activeIndex == 0 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), + config.activeIndex == 1 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), + config.activeIndex == 2 ? SwiperRoundedPagination(true) : SwiperRoundedPagination(false), ], ), ), @@ -94,9 +87,7 @@ class _DashboardSwipeWidgetState extends State { 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]))); + child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[1]))); if (index == 0) return RoundedContainer( raduis: 16, @@ -106,9 +97,7 @@ class _DashboardSwipeWidgetState extends State { 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[0]))); + child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) return RoundedContainer( raduis: 16, @@ -118,8 +107,7 @@ class _DashboardSwipeWidgetState extends State { shadowSpreadRadius: 3, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 1, child: Row( @@ -135,21 +123,17 @@ class _DashboardSwipeWidgetState extends State { Padding( padding: EdgeInsets.all(8), child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .patients, + TranslationBase.of(context).patients, fontSize: 12, fontWeight: FontWeight.bold, fontHeight: 0.5, ), AppText( - TranslationBase.of(context) - .referral, + TranslationBase.of(context).referral, fontSize: 22, fontWeight: FontWeight.bold, ), @@ -162,34 +146,16 @@ class _DashboardSwipeWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - child: RowCounts( - dashboardItemList[2] - .summaryoptions[0] - .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black), + 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), + 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), + child: RowCounts(dashboardItemList[2].summaryoptions![2].kPIParameter, + dashboardItemList[2].summaryoptions![2].value!, Colors.red), ), ], ), @@ -200,17 +166,13 @@ class _DashboardSwipeWidgetState extends State { Expanded( flex: 3, child: Stack(children: [ - Container( - child: GaugeChart( - _createReferralData(widget.dashboardItemList))), + Container(child: GaugeChart(_createReferralData(widget.dashboardItemList))), Positioned( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ AppText( - widget.model - .getPatientCount(dashboardItemList[2]) - .toString(), + widget.model.getPatientCount(dashboardItemList[2]).toString(), fontSize: SizeConfig.textMultiplier * 3.0, fontWeight: FontWeight.bold, ) @@ -227,21 +189,14 @@ 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, - 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), + 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 [ diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..383e7a9e 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -5,15 +5,15 @@ class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, this.imageName, - @required this.child, - this.onTap, - Key key, - this.color, + required this.child, + required this.onTap, + Key? key, + required this.color, this.opacity = 0.4, - this.margin}) + required this.margin}) : super(key: key); final bool hasBorder; - final String imageName; + final String? imageName; final Widget child; final Function onTap; final Color color; @@ -22,12 +22,10 @@ class HomePageCard extends StatelessWidget { @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap(), child: Container( width: 120, - height: MediaQuery.of(context).orientation == Orientation.portrait - ? 100 - : 200, + height: MediaQuery.of(context).orientation == Orientation.portrait ? 100 : 200, margin: this.margin, decoration: BoxDecoration( color: !hasBorder @@ -43,8 +41,7 @@ class HomePageCard extends StatelessWidget { ? DecorationImage( image: AssetImage('assets/images/dashboard/$imageName'), fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), + colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), ) : null, ), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index bdaac7a7..63b998bc 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -12,12 +12,12 @@ class HomePatientCard extends StatelessWidget { final Function onTap; HomePatientCard({ - @required this.backgroundColor, - @required this.backgroundIconColor, - @required this.cardIcon, - @required this.text, - @required this.textColor, - @required this.onTap, + required this.backgroundColor, + required this.backgroundIconColor, + required this.cardIcon, + required this.text, + required this.textColor, + required this.onTap, }); @override diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c305b752..e5c08cbc 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -36,9 +36,9 @@ import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../widgets/shared/app_texts_widget.dart'; class HomeScreen extends StatefulWidget { - HomeScreen({Key key, this.title}) : super(key: key); + HomeScreen({Key? key, this.title}) : super(key: key); - final String title; + final String? title; final String iconURL = 'assets/images/dashboard_icon/'; @override @@ -47,14 +47,14 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; var _isInit = true; - DoctorProfileModel profile; + late DoctorProfileModel profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; var clinicId; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; int colorIndex = 0; @override @@ -69,8 +69,7 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { - await model.setFirebaseNotification( - projectsProvider, authenticationViewModel); + await model.setFirebaseNotification(projectsProvider, authenticationViewModel); await model.getDashboard(); await model.getDoctorProfile(isGetProfile: true); await model.checkDoctorHasLiveCare(); @@ -86,8 +85,7 @@ class _HomeScreenState extends State { padding: EdgeInsets.only(top: 10), child: Stack(children: [ IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), + icon: Image.asset('assets/images/menu.png', height: 50, width: 50), iconSize: 18, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -99,8 +97,7 @@ class _HomeScreenState extends State { children: [ Container( width: MediaQuery.of(context).size.width * .6, - child: projectsProvider.doctorClinicsList.length > - 0 + child: projectsProvider.doctorClinicsList.length > 0 ? Stack( children: [ DropdownButtonHideUnderline( @@ -109,61 +106,36 @@ class _HomeScreenState extends State { iconEnabledColor: Colors.black, isExpanded: true, value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID + ? projectsProvider.doctorClinicsList[0].clinicID : clinicId, iconSize: 25, elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider - .doctorClinicsList - .map((item) { + selectedItemBuilder: (BuildContext context) { + return projectsProvider.doctorClinicsList.map((item) { return Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, children: [ Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - padding: - EdgeInsets.all(2), - margin: - EdgeInsets.all(2), - decoration: - new BoxDecoration( - color: - Colors.red[800], - borderRadius: - BorderRadius - .circular( - 20), + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(20), ), - constraints: - BoxConstraints( + constraints: BoxConstraints( minWidth: 20, minHeight: 20, ), child: Center( child: AppText( - projectsProvider - .doctorClinicsList - .length - .toString(), - color: - Colors.white, - fontSize: - projectsProvider - .isArabic - ? 10 - : 11, - textAlign: - TextAlign - .center, + projectsProvider.doctorClinicsList.length.toString(), + color: Colors.white, + fontSize: projectsProvider.isArabic ? 10 : 11, + textAlign: TextAlign.center, ), )), ], @@ -171,8 +143,7 @@ class _HomeScreenState extends State { AppText(item.clinicName, fontSize: 12, color: Colors.black, - fontWeight: - FontWeight.bold, + fontWeight: FontWeight.bold, textAlign: TextAlign.end), ], ); @@ -180,21 +151,14 @@ class _HomeScreenState extends State { }, 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); + GifLoaderDialogUtils.showMyDialog(context); + await model.changeClinic(clinicId, authenticationViewModel); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } }, - items: projectsProvider - .doctorClinicsList - .map((item) { + items: projectsProvider.doctorClinicsList.map((item) { return DropdownMenuItem( child: AppText( item.clinicName, @@ -206,8 +170,7 @@ class _HomeScreenState extends State { )), ], ) - : AppText( - TranslationBase.of(context).noClinic), + : AppText(TranslationBase.of(context).noClinic), ), ], ), @@ -233,21 +196,16 @@ class _HomeScreenState extends State { ? 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]), - ]))) + 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, @@ -289,11 +247,9 @@ class _HomeScreenState extends State { ), Container( height: 120, - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - ...homePatientsCardsWidget(model), - ])), + child: ListView(scrollDirection: Axis.horizontal, children: [ + ...homePatientsCardsWidget(model), + ])), SizedBox( height: 20, ), @@ -313,20 +269,21 @@ class _HomeScreenState extends State { List homePatientsCardsWidget(DashboardViewModel model) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); - backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); - List backgroundIconColors = List(3); - backgroundIconColors[0] = Colors.white12; - backgroundIconColors[1] = Colors.white38; - backgroundIconColors[2] = Colors.white10; - List textColors = List(3); - textColors[0] = Colors.white; - textColors[1] = Colors.black; - textColors[2] = Colors.white; + List backgroundColors = []; + backgroundColors.add(Color(0xffD02127)); + backgroundColors.add(Colors.grey[300]!); + backgroundColors.add(Color(0xff2B353E)); + + List backgroundIconColors = []; + backgroundIconColors.add(Colors.white12); + backgroundIconColors.add(Colors.white38); + backgroundIconColors.add(Colors.white10); - List patientCards = List(); + List textColors = []; + textColors.add(Colors.white); + textColors.add(Colors.black); + textColors.add(Colors.white); + List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( @@ -334,8 +291,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], - text: - "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", + text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", onTap: () { Navigator.push( context, @@ -353,7 +309,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.inpatient, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myInPatient, + text: TranslationBase.of(context).myInPatient!, onTap: () { Navigator.push( context, @@ -370,22 +326,17 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myOutPatient_2lines, + text: TranslationBase.of(context).myOutPatient_2lines!, onTap: () { String date = AppDateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); Navigator.push( context, MaterialPageRoute( builder: (context) => OutPatientsScreen( patientSearchRequestModel: PatientSearchRequestModel( - from: date, - to: date, - doctorID: - authenticationViewModel.doctorProfile.doctorID)), + from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID)), )); }, )); @@ -396,14 +347,12 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.referral_1, textColor: textColors[colorIndex], - text: TranslationBase.of(context) - .myPatientsReferral, + text: TranslationBase.of(context).myPatientsReferral!, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - PatientReferralScreen(), + builder: (context) => PatientReferralScreen(), ), ); }, @@ -415,14 +364,12 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search, textColor: textColors[colorIndex], - text: TranslationBase.of(context) - .searchPatientDashBoard, + text: TranslationBase.of(context).searchPatientDashBoard!, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - PatientSearchScreen(), + builder: (context) => PatientSearchScreen(), )); }, )); @@ -433,23 +380,18 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search_medicines, textColor: textColors[colorIndex], - text: TranslationBase.of(context) - .searchMedicineDashboard, + text: TranslationBase.of(context).searchMedicineDashboard!, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MedicineSearchScreen(), + builder: (context) => MedicineSearchScreen(), )); }, )); changeColorIndex(); - return [ - ...List.generate(patientCards.length, (index) => patientCards[index]) - .toList() - ]; + return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()]; } changeColorIndex() { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index d4e9120e..38d0089a 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -24,7 +24,7 @@ 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, required this.patient}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -35,57 +35,61 @@ class _EndCallScreenState extends State { bool isDischargedPatient = false; bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; + late String patientType; + late String arrivalType; + late String from; + late String to; - LiveCarePatientViewModel liveCareModel; + late LiveCarePatientViewModel liveCareModel; @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).resume, - TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', isInPatient: isInpatient, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel - .startCall(isReCall: false, vCID: widget.patient.vcId) - .then((value) async{ + await liveCareModel.startCall(isReCall: false, vCID: widget.patient.vcId!).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) { @@ -93,17 +97,14 @@ class _EndCallScreenState extends State { } }, isDartIcon: true, dartIcon: DoctorApp.call), PatientProfileCardModel( - TranslationBase.of(context).endLC, - TranslationBase.of(context).consultation, - '', - 'patient/vital_signs.png', + TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', isInPatient: isInpatient, onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.endCallWithCharge(widget.patient.vcId); + await liveCareModel.endCallWithCharge(widget.patient.vcId!); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -113,10 +114,7 @@ class _EndCallScreenState extends State { } }); }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), - PatientProfileCardModel( - TranslationBase.of(context).sendLC, - TranslationBase.of(context).instruction, - "", + PatientProfileCardModel(TranslationBase.of(context).sendLC!, TranslationBase.of(context).instruction!, "", 'patient/health_summary.png', onTap: () {}, isInPatient: isInpatient, @@ -124,19 +122,11 @@ class _EndCallScreenState extends State { isDisable: true, dartIcon: DoctorApp.send_instruction), PatientProfileCardModel( - TranslationBase.of(context).transferTo, - TranslationBase.of(context).admin, - '', - 'patient/health_summary.png', onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - LivaCareTransferToAdmin(patient: widget.patient))); - }, - isInPatient: isInpatient, - isDartIcon: true, - dartIcon: DoctorApp.transfer_to_admin), + TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: widget.patient))); + }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), ]; return BaseView( @@ -145,14 +135,12 @@ class _EndCallScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, + appBarTitle: TranslationBase.of(context).patientProfile!, backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - widget.patient, arrivalType ?? '7', '1', + appBar: PatientProfileHeaderNewDesignAppBar(widget.patient, arrivalType ?? '7', '1', isInpatient: isInpatient, - height: (widget.patient.patientStatusType != null && - widget.patient.patientStatusType == 43) + height: (widget.patient.patientStatusType != null && widget.patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -167,8 +155,7 @@ class _EndCallScreenState extends State { child: ListView( children: [ Padding( - padding: - const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -193,8 +180,7 @@ class _EndCallScreenState extends State { crossAxisCount: 3, itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => - PatientProfileButton( + itemBuilder: (BuildContext context, int index) => PatientProfileButton( patient: widget.patient, patientType: patientType, arrivalType: arrivalType, @@ -205,8 +191,7 @@ class _EndCallScreenState extends State { route: cardsList[index].route, icon: cardsList[index].icon, isInPatient: cardsList[index].isInPatient, - isDischargedPatient: - cardsList[index].isDischargedPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, isDisable: cardsList[index].isDisable, onTap: cardsList[index].onTap, isLoading: cardsList[index].isLoading, @@ -246,7 +231,7 @@ class _EndCallScreenState extends State { fontWeight: FontWeight.w700, color: Colors.red[600], title: "Close", //TranslationBase.of(context).close, - onPressed: () { + onPressed: () { Navigator.of(context).pop(); }, ), 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..89247b10 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -23,21 +23,20 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class LivaCareTransferToAdmin extends StatefulWidget { final PatiantInformtion patient; - const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key); + const LivaCareTransferToAdmin({Key? key, required this.patient}) : super(key: key); @override - _LivaCareTransferToAdminState createState() => - _LivaCareTransferToAdminState(); + _LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState(); } class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController noteController = TextEditingController(); - String noteError; + late String noteError; void initState() { requestPermissions(); @@ -59,8 +58,7 @@ class _LivaCareTransferToAdminState extends State { onModelReady: (model) {}, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: - "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, body: Container( @@ -84,17 +82,13 @@ class _LivaCareTransferToAdminState extends State { ), Positioned( top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -105,31 +99,30 @@ class _LivaCareTransferToAdminState extends State { ), ), ButtonBottomSheet( - title: - "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + title: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", onPressed: () { setState(() { if (noteController.text.isEmpty) { - noteError = TranslationBase.of(context).emptyMessage; + noteError = TranslationBase.of(context).emptyMessage!; } else { - noteError = null; + noteError = null!; } if (noteController.text.isNotEmpty) { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - model.endCallWithCharge(widget.patient.vcId); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + model.endCallWithCharge(widget.patient.vcId!); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + Navigator.of(context).pop(); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); } }); }, @@ -144,8 +137,7 @@ class _LivaCareTransferToAdminState extends State { 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, @@ -189,8 +181,7 @@ class _LivaCareTransferToAdminState extends State { } 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; } diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 43afd4c1..11007718 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -24,13 +24,13 @@ class LiveCarePatientScreen extends StatefulWidget { class _LiveCarePatientScreenState extends State { final _controller = TextEditingController(); - Timer timer; - LiveCarePatientViewModel _liveCareViewModel; + late Timer timer; + late LiveCarePatientViewModel _liveCareViewModel; @override void initState() { super.initState(); timer = Timer.periodic(Duration(seconds: 10), (Timer t) { - if(_liveCareViewModel != null){ + if (_liveCareViewModel != null) { _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); } }); @@ -38,7 +38,7 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { - _liveCareViewModel = null; + _liveCareViewModel = null!; timer?.cancel(); super.dispose(); } @@ -49,7 +49,6 @@ class _LiveCarePatientScreenState extends State { onModelReady: (model) async { _liveCareViewModel = model; await model.getPendingPatientERForDoctorApp(); - }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -82,7 +81,9 @@ class _LiveCarePatientScreenState extends State { ]), ), ), - SizedBox(height: 20,), + SizedBox( + height: 20, + ), Center( child: FractionallySizedBox( widthFactor: .9, @@ -90,44 +91,36 @@ 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( + onPressed: () {}, + 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 +129,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/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index f081479c..a503ae74 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -21,7 +21,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class LiveCarePandingListScreen extends StatefulWidget { // In the constructor, require a item id. - LiveCarePandingListScreen({Key key}) : super(key: key); + LiveCarePandingListScreen({Key? key}) : super(key: key); @override _LiveCarePandingListState createState() => _LiveCarePandingListState(); @@ -31,7 +31,7 @@ class _LiveCarePandingListState extends State { List _data = []; Helpers helpers = new Helpers(); bool _isInit = true; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; @override void didChangeDependencies() { super.didChangeDependencies(); @@ -45,7 +45,7 @@ class _LiveCarePandingListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).livecare, + appBarTitle: TranslationBase.of(context).livecare!, body: Container( child: ListView(scrollDirection: Axis.vertical, @@ -61,13 +61,11 @@ class _LiveCarePandingListState extends State { ? Center( child: Text( _liveCareProvider.errorMsg, - style: TextStyle( - color: Theme.of(context).errorColor), + style: TextStyle(color: Theme.of(context).errorColor), ), ) : Column( - children: _liveCareProvider.liveCarePendingList - .map((item) { + children: _liveCareProvider.liveCarePendingList.map((item) { return Container( decoration: myBoxDecoration(), child: InkWell( @@ -86,47 +84,28 @@ class _LiveCarePandingListState extends State { Column( children: [ Container( - decoration: - BoxDecoration( + decoration: BoxDecoration( gradient: LinearGradient( - begin: Alignment( - -1, - -1), - end: Alignment( - 1, 1), + begin: Alignment(-1, -1), + end: Alignment(1, 1), colors: [ - Colors.grey[ - 100], - Colors.grey[ - 200], + Colors.grey[100]!, + Colors.grey[200]!, ]), boxShadow: [ BoxShadow( - color: Color.fromRGBO( - 0, - 0, - 0, - 0.08), - offset: Offset( - 0.0, - 5.0), - blurRadius: - 16.0) + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) ], - borderRadius: - BorderRadius.all( - Radius.circular( - 50.0)), + borderRadius: BorderRadius.all(Radius.circular(50.0)), ), width: 80, height: 80, child: Icon( - item.gender == - "1" - ? DoctorApp - .male - : DoctorApp - .female_icon, + item.gender == "1" + ? DoctorApp.male + : DoctorApp.female_icon, size: 80, )), ], @@ -135,48 +114,28 @@ class _LiveCarePandingListState extends State { width: 20, ), Column( - crossAxisAlignment: - CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( item.patientName, - fontSize: 2.0 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight - .bold, + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), SizedBox( height: 8, ), AppText( - TranslationBase.of( - context) - .fileNo + - item.patientID - .toString(), - fontSize: 2.0 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight - .bold, + TranslationBase.of(context).fileNo! + + item.patientID.toString(), + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), AppText( - TranslationBase.of( - context) - .age + + TranslationBase.of(context).age! + ' ' + - item.age - .toString(), - fontSize: 2.0 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight - .bold, + item.age.toString(), + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), SizedBox( height: 8, @@ -193,8 +152,7 @@ class _LiveCarePandingListState extends State { Icons.video_call, size: 40, ), - color: Colors - .green, //Colors.black, + color: Colors.green, //Colors.black, onPressed: () => { _isInit = true, // sharedPref.setObj( @@ -255,9 +213,9 @@ class _LiveCarePandingListState extends State { MyGlobals myGlobals = new MyGlobals(); class MyGlobals { - GlobalKey _scaffoldKey; + GlobalKey? _scaffoldKey; MyGlobals() { _scaffoldKey = GlobalKey(); } - GlobalKey get scaffoldKey => _scaffoldKey; + GlobalKey get scaffoldKey => _scaffoldKey!; } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index c6f9a885..aecccac7 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -18,7 +18,7 @@ class VideoCallPage extends StatefulWidget { final PatiantInformtion patientData; final listContext; final LiveCarePatientViewModel model; - VideoCallPage({this.patientData, this.listContext, this.model}); + VideoCallPage({required this.patientData, this.listContext, required this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -27,10 +27,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - Timer _timmerInstance; + late Timer _timmerInstance; int _start = 0; String _timmer = ''; - LiveCareViewModel _liveCareProvider; + late LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -75,13 +75,13 @@ class _VideoCallPageState extends State { }, onCallEnd: () { //TODO handling onCallEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { //TODO handling onCalNotRespondEnd - WidgetsBinding.instance.addPostFrameCallback((_) { + WidgetsBinding.instance!.addPostFrameCallback((_) { changeRoute(context); }); }); @@ -96,8 +96,7 @@ class _VideoCallPageState extends State { }); connectOpenTok(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } @override @@ -125,20 +124,14 @@ class _VideoCallPageState extends State { ), Text( _start == 0 ? 'Dailing' : 'Connected', - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w300, - fontSize: 15), + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.fullName, - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w900, - fontSize: 20), + widget.patientData.fullName!, + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -146,10 +139,7 @@ class _VideoCallPageState extends State { Container( child: Text( _start == 0 ? 'Connecting...' : _timmer.toString(), - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w300, - fontSize: 15), + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), )), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -196,8 +186,8 @@ class _VideoCallPageState extends State { _showAlert(BuildContext context) async { await showDialog( context: context, - builder: (dialogContex) => AlertDialog(content: StatefulBuilder( - builder: (BuildContext context, StateSetter setState) { + builder: (dialogContex) => + AlertDialog(content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { return Container( height: MediaQuery.of(context).size.height * 0.7, width: MediaQuery.of(context).size.width * .9, @@ -210,8 +200,7 @@ class _VideoCallPageState extends State { top: -40.0, child: InkResponse( onTap: () { - Navigator.of(context, rootNavigator: true) - .pop('dialog'); + Navigator.of(context, rootNavigator: true).pop('dialog'); Navigator.of(context).pop(); }, child: CircleAvatar( @@ -229,8 +218,7 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {endCall()}, - child: - Text(TranslationBase.of(context).endcall), + child: Text(TranslationBase.of(context).endcall!), color: Colors.red, textColor: Colors.white, )), @@ -238,8 +226,7 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {resumeCall()}, - child: - Text(TranslationBase.of(context).resumecall), + child: Text(TranslationBase.of(context).resumecall!), color: Colors.green[900], textColor: Colors.white, ), @@ -248,8 +235,7 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {endCallWithCharge()}, - child: Text(TranslationBase.of(context) - .endcallwithcharge), + child: Text(TranslationBase.of(context).endcallwithcharge!), textColor: Colors.white, ), ), @@ -259,8 +245,7 @@ class _VideoCallPageState extends State { onPressed: () => { setState(() => {isTransfer = true}) }, - child: Text( - TranslationBase.of(context).transfertoadmin), + child: Text(TranslationBase.of(context).transfertoadmin!), color: Colors.yellow[900], ), ), @@ -274,14 +259,11 @@ class _VideoCallPageState extends State { child: TextField( maxLines: 3, controller: notes, - decoration: InputDecoration.collapsed( - hintText: - "Enter your notes here"), + decoration: InputDecoration.collapsed(hintText: "Enter your notes here"), )), Center( child: RaisedButton( - onPressed: () => - {this.transferToAdmin(notes)}, + onPressed: () => {this.transferToAdmin(notes)}, child: Text('Transfer'), color: Colors.yellow[900], )) @@ -303,33 +285,24 @@ class _VideoCallPageState extends State { transferToAdmin(notes) { closeRoute(); - _liveCareProvider - .transfterToAdmin(widget.patientData, notes) - .then((result) { + _liveCareProvider.transfterToAdmin(widget.patientData, notes).then((result) { connectOpenTok(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCall() { closeRoute(); - _liveCareProvider - .endCall(widget.patientData, false, doctorprofile['DoctorID']) - .then((result) { + _liveCareProvider.endCall(widget.patientData, false, doctorprofile['DoctorID']).then((result) { print(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCallWithCharge() { - _liveCareProvider - .endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']) - .then((result) { + _liveCareProvider.endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']).then((result) { closeRoute(); print('end callwith charge'); print(result); - }).catchError((error) => - {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } closeRoute() { diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index ad7f13cb..4a0020e1 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -17,19 +17,17 @@ class HealthSummaryPage extends StatefulWidget { } class _HealthSummaryPageState extends State { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType.toString() ?? "0", @@ -37,7 +35,7 @@ class _HealthSummaryPageState extends State { isInpatient: isInpatient, ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -45,8 +43,7 @@ class _HealthSummaryPageState extends State { child: Column( children: [ Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), + padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), child: Container( child: Padding( padding: const EdgeInsets.all(8.0), @@ -76,112 +73,65 @@ class _HealthSummaryPageState extends State { ), ), ), - (model.medicalFileList != null && - model.medicalFileList.length != 0) + (model.medicalFileList != null && model.medicalFileList.length != 0) ? ListView.builder( //physics: , physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0] - .timelines.length, + itemCount: model.medicalFileList[0].entityList![0].timelines!.length, itemBuilder: (BuildContext ctxt, int index) { return InkWell( onTap: () { - if (model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .length != + if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0] + .consulations!.length != 0) Navigator.push( context, MaterialPageRoute( builder: (context) => MedicalFileDetails( - age: patient.age is String - ? patient.age ?? "" - : "${patient.age}", - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, + age: patient.age is String ? patient.age ?? "" : "${patient.age}", + firstName: patient.firstName ?? "", + lastName: patient.lastName ?? "", + gender: patient.genderDescription ?? "", encounterNumber: index, pp: patient.patientId, patient: patient, - doctorName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName + doctorName: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].doctorName : "", - clinicName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .clinicName + clinicName: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].clinicName : "", - doctorImage: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorImage + doctorImage: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index].doctorImage : "", - episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() + episode: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.isNotEmpty + ? model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations![0].episodeID + .toString() : "", - vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), + vistDate: model.medicalFileList[0].entityList![0].timelines![index].date + .toString())), ); }, child: DoctorCard( - doctorName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, - clinic: model.medicalFileList[0].entityList[0] - .timelines[index].clinicName, - branch: model.medicalFileList[0].entityList[0] - .timelines[index].projectName, - profileUrl: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorImage, - appointmentDate: - AppDateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList[0] - .timelines[index].date, + doctorName: + model.medicalFileList[0].entityList![0].timelines![index].doctorName ?? "", + clinic: model.medicalFileList[0].entityList![0].timelines![index].clinicName ?? "", + branch: model.medicalFileList[0].entityList![0].timelines![index].projectName ?? "", + profileUrl: + model.medicalFileList[0].entityList![0].timelines![index].doctorImage ?? "", + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + model.medicalFileList[0].entityList![0].timelines![index].date ?? "", ), isPrescriptions: true, - isShowEye: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .length != + isShowEye: model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0].consulations!.length != 0 ? true : false), @@ -197,8 +147,7 @@ class _HealthSummaryPageState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noMedicalFileFound), + child: AppText(TranslationBase.of(context).noMedicalFileFound), ) ], ), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 9bfde511..a5f5b385 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -21,24 +21,24 @@ class MedicalFileDetails extends StatefulWidget { int encounterNumber; int pp; PatiantInformtion patient; - String clinicName; + String? clinicName; String episode; - String doctorName; + String? doctorName; String vistDate; - String doctorImage; + String? doctorImage; MedicalFileDetails( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, this.doctorName, - this.vistDate, + required this.vistDate, this.clinicName, - this.episode, + required this.episode, this.doctorImage}); @override @@ -50,11 +50,11 @@ class MedicalFileDetails extends StatefulWidget { encounterNumber: encounterNumber, pp: pp, patient: patient, - clinicName: clinicName, - doctorName: doctorName, + clinicName: clinicName!, + doctorName: doctorName!, episode: episode, vistDate: vistDate, - doctorImage: doctorImage, + doctorImage: doctorImage!, ); } @@ -73,18 +73,18 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {required this.age, + required this.firstName, + required this.lastName, + required this.gender, + required this.encounterNumber, + required this.pp, + required this.patient, + required this.doctorName, + required this.vistDate, + required this.clinicName, + required this.episode, + required this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; @@ -99,26 +99,23 @@ class _MedicalFileDetailsState extends State { model.getMedicalFile(mrn: pp); } }, - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, patientType: patient.patientType.toString() ?? "0", - arrivalType: patient.arrivedOn.toString() ?? 0, + arrivalType: patient.arrivedOn.toString()!, doctorName: doctorName, profileUrl: doctorImage, clinic: clinicName, isPrescriptions: true, isMedicalFile: true, episode: episode, - vistDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', + vistDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -127,13 +124,8 @@ class _MedicalFileDetailsState extends State { child: Column( children: [ model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0] + .consulations!.length != 0 ? Padding( padding: EdgeInsets.all(10.0), @@ -142,109 +134,81 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of( - context) - .historyOfPresentIllness + TranslationBase.of(context) + .historyOfPresentIllness! .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : true, + variant: isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isHistoryExpand = - !isHistoryExpand; + isHistoryExpand = !isHistoryExpand; }); }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstCheifComplaint[ - index] - .hOPI + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstCheifComplaint![index] + .hOPI! .trim(), ), ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), ], ), ], @@ -264,86 +228,62 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .assessment - .toUpperCase(), - variant: - isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : true, + AppText(TranslationBase.of(context).assessment!.toUpperCase(), + variant: isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isAssessmentExpand = - !isAssessmentExpand; + isAssessmentExpand = !isAssessmentExpand; }); }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: + Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -353,58 +293,39 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .iCD10 + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .iCD10! .trim(), fontSize: 13.5, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), - SizedBox( - width: 15.0), + SizedBox(width: 15.0), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .condition + - ": ", + TranslationBase.of(context).condition! + ": ", fontSize: 12.5, ), Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .condition + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .condition! .trim(), fontSize: 13.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -414,22 +335,14 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] .description, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, fontSize: 15.0, ), ) @@ -438,32 +351,21 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - TranslationBase.of( - context) - .type + - ": ", + TranslationBase.of(context).type! + ": ", fontSize: 15.5, ), Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] .type, fontSize: 16.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -473,16 +375,13 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .remarks + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstAssessments![index] + .remarks! .trim(), ), Divider( @@ -507,85 +406,62 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : true, + AppText(TranslationBase.of(context).test!.toUpperCase(), + variant: isProcedureExpand ? "bodyText" : '', + bold: isProcedureExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isProcedureExpand = - !isProcedureExpand; + isProcedureExpand = !isProcedureExpand; }); }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: + Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -596,63 +472,39 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procedureId + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .procedureId! .trim(), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), Column( children: [ AppText( - TranslationBase.of( - context) - .orderDate + - ": ", + TranslationBase.of(context).orderDate! + ": ", ), AppText( - AppDateUtils.getDateFormatted( - DateTime - .parse( + AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .orderDate + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] + .orderDate! .trim(), )), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), @@ -666,22 +518,14 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] .procName, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ) ], @@ -693,22 +537,15 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstProcedure![index] .patientID .toString(), - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -737,78 +574,59 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != + model.medicalFileList[0].entityList![0].timelines![encounterNumber] + .timeLineEvents![0].consulations!.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of( - context) - .physicalSystemExamination + TranslationBase.of(context) + .physicalSystemExamination! .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : true, + variant: isPhysicalExam ? "bodyText" : '', + bold: isPhysicalExam ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isPhysicalExam = - !isPhysicalExam; + isPhysicalExam = !isPhysicalExam; }); }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam! .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( @@ -816,27 +634,17 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText(TranslationBase.of( - context) - .examType + - ": "), + AppText(TranslationBase.of(context).examType! + ": "), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .examDesc, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -844,47 +652,30 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .examDesc, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ) ], ), Row( children: [ - AppText(TranslationBase.of( - context) - .abnormal + - ": "), + AppText(TranslationBase.of(context).abnormal! + ": "), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .abnormal, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -893,15 +684,12 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] + .medicalFileList[0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations![0] + .lstPhysicalExam![index] .remarks, ), Divider( diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index eeea51c5..b5027c33 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -31,7 +31,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function changeLoadingState; + final Function? changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -46,17 +46,16 @@ class _MedicineSearchState extends State { bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + late GetMedicationResponseModel _selectedMedication; + GlobalKey key = new GlobalKey>(); // String lastWords; List _localeNames = []; - String lastError; + late String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String reconizedWord; + late String reconizedWord; @override void didChangeDependencies() { @@ -70,15 +69,13 @@ class _MedicineSearchState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); // if (hasSpeech) { // _localeNames = await speech.locales(); // var systemLocale = await speech.systemLocale(); - _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' - ? 'en-GB' - : 'ar-SA'; // systemLocale.localeId; + _currentLocaleId = + TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; // } if (!mounted) return; @@ -88,9 +85,7 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -123,7 +118,7 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchMedicine, + appBarTitle: TranslationBase.of(context).searchMedicine!, body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, @@ -141,13 +136,11 @@ class _MedicineSearchState extends State { child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( borderColor: Colors.white, - hintText: - TranslationBase.of(context).searchMedicineNameHere, + hintText: TranslationBase.of(context).searchMedicineNameHere, controller: myController, onSaved: (value) {}, onFieldSubmitted: (value) { @@ -178,18 +171,15 @@ class _MedicineSearchState extends State { ), ), Container( - margin: - EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), + margin: EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).youCanFind + - (myController.text != '' - ? model.pharmacyItemsList.length.toString() - : '0') + + TranslationBase.of(context).youCanFind! + + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).itemsInSearch, + TranslationBase.of(context).itemsInSearch!, fontWeight: FontWeight.bold, ), ], @@ -206,26 +196,20 @@ class _MedicineSearchState extends State { scrollDirection: Axis.vertical, // shrinkWrap: true, - itemCount: model.pharmacyItemsList == null - ? 0 - : model.pharmacyItemsList.length, + itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length, itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model.pharmacyItemsList[index] - ["ItemDescription"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"], + label: model.pharmacyItemsList[index]["ItemDescription"], + url: model.pharmacyItemsList[index]["ImageSRCUrl"], ), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PharmaciesListScreen( - itemID: model.pharmacyItemsList[index] - ["ItemID"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"]), + itemID: model.pharmacyItemsList[index]["ItemID"], + url: model.pharmacyItemsList[index]["ImageSRCUrl"]), ), ); }, diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 49c39c53..764a19f6 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,8 +23,7 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - PharmaciesListScreen({Key key, @required this.itemID, this.url}) - : super(key: key); + PharmaciesListScreen({Key? key, required this.itemID, required this.url}) : super(key: key); @override _PharmaciesListState createState() => _PharmaciesListState(); @@ -32,8 +31,7 @@ class PharmaciesListScreen extends StatefulWidget { class _PharmaciesListState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; - + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -42,7 +40,7 @@ class _PharmaciesListState extends State { onModelReady: (model) => model.getPharmaciesList(widget.itemID), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList, + appBarTitle: TranslationBase.of(context).pharmaciesList!, body: Container( height: SizeConfig.screenHeight, child: ListView( @@ -52,71 +50,64 @@ class _PharmaciesListState extends State { children: [ model.pharmaciesList.length > 0 ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: widget.url != null - ? Image.network( - widget.url, - height: - SizeConfig.imageSizeMultiplier * - 21, - width: - SizeConfig.imageSizeMultiplier * - 20, - fit: BoxFit.cover, - ): Container(), + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(7)), + child: widget.url != null + ? Image.network( + widget.url, + height: SizeConfig.imageSizeMultiplier * 21, + width: SizeConfig.imageSizeMultiplier * 20, + fit: BoxFit.cover, + ) + : Container(), + ), ), - ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - AppText( - TranslationBase.of(context) - .description, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - TranslationBase.of(context).price, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["SellingPrice"] - .toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - ), - ) - ], - )): Container(), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + AppText( + TranslationBase.of(context).description, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["ItemDescription"], + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + AppText( + TranslationBase.of(context).price, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["SellingPrice"].toString(), + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + ], + ), + ) + ], + )) + : Container(), Container( margin: EdgeInsets.only( top: SizeConfig.widthMultiplier * 2, @@ -131,18 +122,15 @@ class _PharmaciesListState extends State { fontWeight: FontWeight.bold, ), ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, + alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, ), Container( width: SizeConfig.screenWidth * 0.99, - margin: EdgeInsets.only(left: 10,right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model - .pharmaciesList.length, + itemCount: model.pharmaciesList == null ? 0 : model.pharmaciesList.length, itemBuilder: (BuildContext context, int index) { return RoundedContainer( margin: EdgeInsets.only(top: 5), @@ -151,15 +139,11 @@ class _PharmaciesListState extends State { Expanded( flex: 1, child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), + borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.network( - model - .pharmaciesList[index]["ProjectImageURL"], - height: - SizeConfig.imageSizeMultiplier * 15, - width: - SizeConfig.imageSizeMultiplier * 15, + model.pharmaciesList[index]["ProjectImageURL"], + height: SizeConfig.imageSizeMultiplier * 15, + width: SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, ), ), @@ -167,8 +151,7 @@ class _PharmaciesListState extends State { Expanded( flex: 4, child: AppText( - model - .pharmaciesList[index]["LocationDescription"], + model.pharmaciesList[index]["LocationDescription"], margin: 10, ), ), @@ -186,10 +169,7 @@ class _PharmaciesListState extends State { Icons.call, color: Colors.red, ), - onTap: () => - launch("tel://" + - model - .pharmaciesList[index]["PhoneNumber"]), + onTap: () => launch("tel://" + model.pharmaciesList[index]["PhoneNumber"]), ), ), Padding( @@ -201,14 +181,9 @@ class _PharmaciesListState extends State { ), onTap: () { MapsLauncher.launchCoordinates( - double.parse( - model - .pharmaciesList[index]["Latitude"]), - double.parse( - model - .pharmaciesList[index]["Longitude"]), - model.pharmaciesList[index] - ["LocationDescription"]); + double.parse(model.pharmaciesList[index]["Latitude"]), + double.parse(model.pharmaciesList[index]["Longitude"]), + model.pharmaciesList[index]["LocationDescription"]); }, ), ), @@ -221,18 +196,18 @@ class _PharmaciesListState extends State { }), ) ]), - ),),); + ), + ), + ); } - Image imageFromBase64String(String base64String) { return Image.memory(base64Decode(base64String)); } //TODO CHECK THE URL IS NULL OR NOT - Uint8List dataFromBase64String(String base64String) { - if(base64String !=null) - return base64Decode(base64String); + Uint8List? dataFromBase64String(String base64String) { + if (base64String != null) return base64Decode(base64String); } String base64String(Uint8List data) { diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 7f314c0e..b1e3c754 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -24,322 +24,309 @@ class _DischargedPatientState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getDischargedPatient(), - builder: (_, model, w) => AppScaffold( - //appBarTitle: 'Discharged Patient', - //subtitle: "Last Three Months", - backgroundColor: Colors.grey[200], - isShowAppBar: false, - baseViewModel: model, - body: model.myDischargedPatient.isEmpty? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Discharged Patient', - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ):Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - SizedBox(height: 12,), - Container( - width: double.maxFinite, - height: 75, - decoration: BoxDecoration( - 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), + onModelReady: (model) => model.getDischargedPatient(), + builder: (_, model, w) => AppScaffold( + //appBarTitle: 'Discharged Patient', + //subtitle: "Last Three Months", + backgroundColor: Colors.grey[200]!, + isShowAppBar: false, + baseViewModel: model, + body: model.myDischargedPatient.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), 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), + 'No Discharged Patient', + color: Theme.of(context).errorColor, ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox(height: 5,), - Expanded(child: SingleChildScrollView( - child: Column( - children: [ - ...List.generate(model.filterData.length, (index) => InkWell( - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "isSearch": false, - "isInpatient":true, - "isDischargedPatient":true - }); - - }, - child: Container( - width: double.maxFinite, - margin: EdgeInsets.all(8), - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Colors.white, - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row(children: [ - Container( - width: 170, - child: AppText( - (Helpers.capitalize(model - .filterData[index] - .firstName) + - " " + - Helpers.capitalize(model - .filterData[index] - .lastName)), - fontSize: 16, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, - ), - ), - model.filterData[index].gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - Row( - children: [ - AppText( - model.filterData[index].nationalityName != null - ? model.filterData[index].nationalityName.trim() - : model.filterData[index].nationality != null - ? model.filterData[index].nationality.trim() - : model.filterData[index].nationalityId != null - ? model.filterData[index].nationalityId - : "", - fontWeight: FontWeight.bold, - fontSize: 14, - textOverflow: TextOverflow.ellipsis, - ), - model.filterData[index] - .nationality != - null || - model.filterData[index] - .nationalityId != - null - ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), - child: Image.network( - model.filterData[index].nationalityFlagURL != null ? - model.filterData[index].nationalityFlagURL - : '', - height: 25, - width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { - return AppText( - '', - fontSize: 10, - ); - }, - )) - : SizedBox() - ], - ) - ], - )), - Row( - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - model.filterData[index].gender == - 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), + ) + ], + ), + ) + : Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + SizedBox( + height: 12, + ), + Container( + width: double.maxFinite, + height: 75, + decoration: BoxDecoration( + 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( + onPressed: () {}, + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), ), - ], - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .fileNumber, - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: model - .filterData[index] - .patientId - .toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: model.filterData[index].admissionDate == null ? "" : - TranslationBase.of(context).admissionDate + " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: model.filterData[index].admissionDate == null ? "" - : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], - ), - ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 5, + ), + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + model.filterData.length, + (index) => InkWell( + onTap: () { + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "1", + "isSearch": false, + "isInpatient": true, + "isDischargedPatient": true + }); + }, + child: Container( + width: double.maxFinite, + margin: EdgeInsets.all(8), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row(children: [ + Container( + width: 170, + child: AppText( + (Helpers.capitalize(model.filterData[index].firstName) + + " " + + Helpers.capitalize( + model.filterData[index].lastName)), + fontSize: 16, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), + ), + model.filterData[index].gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + Row( + children: [ + AppText( + model.filterData[index].nationalityName != null + ? model.filterData[index].nationalityName!.trim() + : model.filterData[index].nationality != null + ? model.filterData[index].nationality!.trim() + : model.filterData[index].nationalityId != null + ? model.filterData[index].nationalityId + : "", + fontWeight: FontWeight.bold, + fontSize: 14, + textOverflow: TextOverflow.ellipsis, + ), + model.filterData[index].nationality != null || + model.filterData[index].nationalityId != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + model.filterData[index].nationalityFlagURL != + null + ? model + .filterData[index].nationalityFlagURL! + : '', + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, StackTrace? stackTrace) { + return AppText( + '', + fontSize: 10, + ); + }, + )) + : SizedBox() + ], + ) + ], + )), + Row( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + model.filterData[index].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: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: model.filterData[index].patientId + .toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].admissionDate == + null + ? "" + : TranslationBase.of(context) + .admissionDate! + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].admissionDate == + null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 15)), + ], + ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].dischargeDate == + null + ? "" + : "Discharge Date : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].dischargeDate == + null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, fontSize: 15)), + ], + ), + ), + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 14, + fontWeight: FontWeight.w300, + ), + AppText( + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate ?? "")).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ), + ) + ], + ) + ], + ), ), - children: [ - new TextSpan( - text: model.filterData[index].dischargeDate == null ? "" - : "Discharge Date : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: model.filterData[index].dischargeDate == null ? "" - : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], - ), - ), - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 14,fontWeight: FontWeight.w300, - ), - AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700), - ], - ), - ], - ), - ) - ], - ) - ], - ), + )), + ], + ), + ), + ), + ], ), - )), - ], - ), - - - ), - ),], - ), - ),) - ); + ), + )); } - - } diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 33692628..1ea723fc 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -17,21 +17,19 @@ import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getECGPatient( - patientType: patient.patientType, - patientOutSA: 0, - patientID: patient.patientId), + onModelReady: (model) => + model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Color(0xffF8F8F8), - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + appBar: PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), @@ -39,84 +37,105 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox(height: 12,), - AppText('Service',style: "caption2",color: Colors.black,), - AppText('ECG',bold: true,fontSize: 22,), - SizedBox(height: 12,), - ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( - onTap: () async { - await launch( - model.patientMuseResultsModelList[index].imageURL); - }, - child: Container( - width: double.infinity, - height: 120, - margin: EdgeInsets.only(top: 5,bottom: 5), - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all(color: Colors.white,width: 2), - color: Colors.white, - borderRadius: BorderRadius.circular(8) - ), - child: Column( - children: [ - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), - SizedBox(height:3), - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: - TranslationBase.of(context).orderNo, - style: TextStyle( - fontSize: 12, - fontFamily: - 'Poppins')), - new TextSpan( - text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', - style: TextStyle( - fontWeight: FontWeight.w600, - fontFamily: - 'Poppins', - fontSize: 14)), - ], + SizedBox( + height: 12, + ), + AppText( + 'Service', + style: "caption2", + color: Colors.black, + ), + AppText( + 'ECG', + bold: true, + fontSize: 22, + ), + SizedBox( + height: 12, + ), + ...List.generate( + model.patientMuseResultsModelList.length, + (index) => InkWell( + onTap: () async { + await launch(model.patientMuseResultsModelList[index].imageURL ?? ""); + }, + child: Container( + width: double.infinity, + height: 120, + margin: EdgeInsets.only(top: 5, bottom: 5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all(color: Colors.white, width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8)), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'ECG Report', + fontWeight: FontWeight.w700, + fontSize: 17, + ), + SizedBox(height: 3), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).orderNo, + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), + new TextSpan( + text: + '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', + style: TextStyle( + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + fontSize: 14)), + ], + ), + ) + ], + ), ), - ) - ], - ), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), - ], - ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now())}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + SizedBox( + height: 15, + ), + Align( + alignment: Alignment.topRight, + child: Icon(DoctorApp.external_link), + ) + ], ), - ], - ), - SizedBox(height: 15,), - Align( - alignment: Alignment.topRight, - child: Icon(DoctorApp.external_link), - ) - ], - ), - ), - )), - + ), + )), ], ), ), diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index 1b42d305..0942c253 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -68,73 +68,56 @@ class _InPatientPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ...List.generate( - model.filteredInPatientItems.length, (index) { + ...List.generate(model.filteredInPatientItems.length, (index) { if (!widget.isMyInPatient) return PatientCard( - patientInfo: - model.filteredInPatientItems[index], + patientInfo: model.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); + FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model - .filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); }, ); - else if (model.filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID && + else if (model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID && widget.isMyInPatient) return PatientCard( - patientInfo: - model.filteredInPatientItems[index], + patientInfo: model.filteredInPatientItems[index], patientType: "1", arrivalType: "1", isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); + FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model - .filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); }, ); else @@ -150,10 +133,7 @@ class _InPatientPageState extends State { ) : Expanded( child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: - TranslationBase.of(context).noDataAvailable)), + child: Container(child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable ?? "")), ), ), ], diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 60446887..927db334 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -16,9 +16,8 @@ class PatientInPatientScreen extends StatefulWidget { _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); } -class _PatientInPatientScreenState extends State - with SingleTickerProviderStateMixin { - TabController _tabController; +class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin { + late TabController _tabController; int _activeTab = 0; @override @@ -85,15 +84,12 @@ class _PatientInPatientScreenState extends State child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), + 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 + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 ), color: Colors.white), child: Center( @@ -104,18 +100,14 @@ class _PatientInPatientScreenState extends State indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ - tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll, + tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll ?? "", counter: model.inPatientList.length), - tabWidget( - screenSize, _activeTab == 1, "My InPatients", + tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), - tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged), + tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged ?? ""), ], ), ), @@ -144,8 +136,7 @@ class _PatientInPatientScreenState extends State ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index f78752ec..68d8c319 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -49,8 +49,7 @@ class ReferralDischargedPatientDetails 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', @@ -67,20 +66,15 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromDischargeReferralPatient( - referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromDischargeReferralPatient(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", "isDischargedPatient": true, - "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( @@ -111,11 +105,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -127,7 +120,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -150,12 +143,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.admissionDate, - "dd MMM,yyyy"), + referredPatient.admissionDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -175,12 +166,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.dischargeDate, - "dd MMM,yyyy"), + referredPatient.dischargeDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -199,11 +188,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate ?? "").difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate ?? "")).inDays + 1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -225,36 +213,30 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.referringDoctorName, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), 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), ), ], @@ -262,60 +244,48 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.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), ), AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), 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), ), ), @@ -331,8 +301,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -343,8 +312,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -363,12 +331,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), 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), ), ), @@ -390,8 +356,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -413,8 +378,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -425,9 +389,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -436,12 +398,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + referredPatient.mAXResponseTime ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -451,8 +411,7 @@ class ReferralDischargedPatientDetails 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_left.png', height: 50, @@ -496,30 +455,22 @@ class ReferralDischargedPatientDetails 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), ), ], diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 92f92f87..1e001799 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -17,81 +17,88 @@ class ReferralDischargedPatientPage extends StatefulWidget { } class _ReferralDischargedPatientPageState extends State { - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.gtMyDischargeReferralPatient(), builder: (_, model, w) => AppScaffold( appBarTitle: 'Referral Discharged ', - backgroundColor: Colors.grey[200], + backgroundColor: Colors.grey[200]!, isShowAppBar: false, baseViewModel: model, - body: model.myDischargeReferralPatient.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( - 'No Discharged Patient', - color: Theme.of(context).errorColor, + body: model.myDischargeReferralPatient.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( + 'No Discharged Patient', + color: Theme.of(context).errorColor, + ), + ) + ], ), ) - ], - ), - ):Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 5,), - Expanded( - child: ListView.builder( - itemCount: model.myDischargeReferralPatient.length, - itemBuilder: (context,index)=>InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), - ), - ); - }, - child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context), - referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, - patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName, - patientGender: model.myDischargeReferralPatient[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate), - referredTime: AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate), - patientID: "${model.myDischargeReferralPatient[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}", - remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, - nationality: model.myDischargeReferralPatient[index].nationalityName, - nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend - doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend - referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, - clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), - ), - )), + : Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 5, + ), + Expanded( + child: ListView.builder( + itemCount: model.myDischargeReferralPatient.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode( + model.myDischargeReferralPatient[index].referralStatus!, context), + referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, + patientName: model.myDischargeReferralPatient[index].firstName! + + " " + + model.myDischargeReferralPatient[index].lastName!, + patientGender: model.myDischargeReferralPatient[index].gender, + referredDate: AppDateUtils.getDayMonthYearDateFormatted( + model.myDischargeReferralPatient[index].referralDate!), + referredTime: + AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate!), + patientID: "${model.myDischargeReferralPatient[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic: + "${model.myDischargeReferralPatient[index].referringClinicDescription}", + remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, + nationality: model.myDischargeReferralPatient[index].nationalityName, + nationalityFlag: + '', //model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend + doctorAvatar: + '', //model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend + referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, + clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), + ), + )), + ), + ], + ), ), - - ], - ), - ), ), ); } - - } diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 2bffdda5..172cf355 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -15,21 +15,19 @@ import 'package:provider/provider.dart'; import '../base/base_view.dart'; class InsuranceApprovalScreenNew extends StatefulWidget { - final int appointmentNo; + final int? appointmentNo; InsuranceApprovalScreenNew({this.appointmentNo}); @override - _InsuranceApprovalScreenNewState createState() => - _InsuranceApprovalScreenNewState(); + _InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState(); } -class _InsuranceApprovalScreenNewState - extends State { +class _InsuranceApprovalScreenNewState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; @@ -39,11 +37,9 @@ class _InsuranceApprovalScreenNewState ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient?.appointmentNo, - projectId: patient.projectId) + appointmentNo: patient?.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType.toString() ?? "0", @@ -52,7 +48,7 @@ class _InsuranceApprovalScreenNewState ), isShowAppBar: true, baseViewModel: model, - appBarTitle: TranslationBase.of(context).approvals, + appBarTitle: TranslationBase.of(context).approvals ?? "", body: patient.admissionNo != null ? SingleChildScrollView( child: Container( @@ -98,8 +94,7 @@ class _InsuranceApprovalScreenNewState Navigator.push( context, MaterialPageRoute( - builder: (context) => - InsuranceApprovalsDetails( + builder: (context) => InsuranceApprovalsDetails( patient: patient, indexInsurance: index, patientType: patientType, @@ -108,27 +103,14 @@ class _InsuranceApprovalScreenNewState }, child: DoctorCardInsurance( patientOut: "In Patient", - profileUrl: model - .insuranceApprovalInPatient[index] - .doctorImage, - clinic: model - .insuranceApprovalInPatient[index] - .clinicName, - doctorName: model - .insuranceApprovalInPatient[index] - .doctorName, - branch: model - .insuranceApprovalInPatient[index] - .approvalNo - .toString(), + profileUrl: model.insuranceApprovalInPatient[index].doctorImage, + clinic: model.insuranceApprovalInPatient[index].clinicName, + doctorName: model.insuranceApprovalInPatient[index].doctorName, + branch: model.insuranceApprovalInPatient[index].approvalNo.toString(), isPrescriptions: true, - approvalStatus: model - .insuranceApprovalInPatient[index] - .approvalStatusDescption ?? - '', - branch2: model - .insuranceApprovalInPatient[index] - .projectName, + approvalStatus: + model.insuranceApprovalInPatient[index].approvalStatusDescption ?? '', + branch2: model.insuranceApprovalInPatient[index].projectName, ), ), ), @@ -145,8 +127,7 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noInsuranceApprovalFound), + child: AppText(TranslationBase.of(context).noInsuranceApprovalFound), ), SizedBox( height: 150.0, @@ -173,8 +154,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context) - .insurance22, + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -184,8 +164,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - TranslationBase.of(context) - .approvals22, + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -202,8 +181,7 @@ class _InsuranceApprovalScreenNewState Navigator.push( context, MaterialPageRoute( - builder: (context) => - InsuranceApprovalsDetails( + builder: (context) => InsuranceApprovalsDetails( patient: patient, indexInsurance: index, patientType: patientType, @@ -211,24 +189,14 @@ class _InsuranceApprovalScreenNewState ); }, child: DoctorCardInsurance( - patientOut: model.insuranceApproval[index] - .patientDescription, - profileUrl: model - .insuranceApproval[index].doctorImage, - clinic: model - .insuranceApproval[index].clinicName, - doctorName: model - .insuranceApproval[index].doctorName, - branch: model - .insuranceApproval[index].approvalNo - .toString(), + patientOut: model.insuranceApproval[index].patientDescription, + profileUrl: model.insuranceApproval[index].doctorImage, + clinic: model.insuranceApproval[index].clinicName, + doctorName: model.insuranceApproval[index].doctorName, + branch: model.insuranceApproval[index].approvalNo.toString(), isPrescriptions: true, - approvalStatus: model - .insuranceApproval[index] - .approvalStatusDescption ?? - '', - branch2: model - .insuranceApproval[index].projectName, + approvalStatus: model.insuranceApproval[index].approvalStatusDescption ?? '', + branch2: model.insuranceApproval[index].projectName, ), ), ), @@ -245,8 +213,7 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noInsuranceApprovalFound), + child: AppText(TranslationBase.of(context).noInsuranceApprovalFound), ) ], ), diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 92910394..c47ca5dc 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -17,14 +17,10 @@ class InsuranceApprovalsDetails extends StatefulWidget { int indexInsurance; String patientType; - InsuranceApprovalsDetails( - {this.patient, this.indexInsurance, this.patientType}); + InsuranceApprovalsDetails({required this.patient, required this.indexInsurance, required this.patientType}); @override _InsuranceApprovalsDetailsState createState() => - _InsuranceApprovalsDetailsState( - patient: patient, - indexInsurance: indexInsurance, - patientType: patientType); + _InsuranceApprovalsDetailsState(patient: patient, indexInsurance: indexInsurance, patientType: patientType); } class _InsuranceApprovalsDetailsState extends State { @@ -32,13 +28,12 @@ class _InsuranceApprovalsDetailsState extends State { int indexInsurance; String patientType; - _InsuranceApprovalsDetailsState( - {this.patient, this.indexInsurance, this.patientType}); + _InsuranceApprovalsDetailsState({required this.patient, required this.indexInsurance, required this.patientType}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -46,776 +41,602 @@ class _InsuranceApprovalsDetailsState extends State { ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, - projectId: patient.projectId) + appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), - body: patient.admissionNo != null - ? SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString(), patient.arrivedOn ?? ""), + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ], ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" || - "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "تمت الموافقة" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), - ), - ], - ), - Row( - children: [ - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .doctorName - .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != null + ? model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption ?? + "" + : "", + color: model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != + null + ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( + ], + ), + Row( + children: [ + AppText( + model.insuranceApprovalInPatient[indexInsurance].doctorName!.toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( children: [ - Column( - children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig - .imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular( - 50), - child: Image.network( - model - .insuranceApprovalInPatient[ - indexInsurance] - .doctorImage, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: - Colors.transparent, + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + model.insuranceApprovalInPatient[indexInsurance].doctorImage ?? "", + fit: BoxFit.fill, + width: 700, ), ), - ], + backgroundColor: Colors.transparent, + ), ), - Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( children: [ - SizedBox( - height: 25.0, + AppText( + TranslationBase.of(context).clinic! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .clinicName, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance].clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .approvalNo + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].approvalNo + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - 'Unused Count:', - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].unUsedCount + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).companyName! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .companyName + - ": ", - color: Colors.grey[500], - ), - AppText('Sample') - ], + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).receiptOn! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn + - ": ", - color: Colors.grey[500], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ), - ], + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate + - ": ", - color: Colors.grey[500], - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ], + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).expiryDate! + ": ", + color: Colors.grey[500], + ), + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, ), ], ), - ), + ], ), - ], + ), ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context) - .procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .status, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context).procedure, + fontWeight: FontWeight.w700, + ), ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model - .insuranceApprovalInPatient[ - indexInsurance] - .apporvalDetails - .length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Column( + Expanded( + child: AppText( + TranslationBase.of(context).status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context).usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApprovalInPatient[indexInsurance].apporvalDetails!.length, + itemBuilder: (BuildContext context, int index) { + return Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Container( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.procedureName ?? - "", - textAlign: - TextAlign - .start, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.status ?? - "", - textAlign: - TextAlign - .center, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.isInvoicedDesc ?? - "", - textAlign: - TextAlign - .center, - ), - ), + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + ?.apporvalDetails![index]?.procedureName ?? + "", + textAlign: TextAlign.start, ), - ], + ), ), - SizedBox( - width: 5, + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + ?.apporvalDetails![index]?.status ?? + "", + textAlign: TextAlign.center, + ), + ), ), - Divider( - color: Colors.black38, + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + ?.apporvalDetails![index]?.isInvoicedDesc ?? + "", + textAlign: TextAlign.center, + ), + ), ), ], ), - ); - }), - ), - ], + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), ), - ), - ], + ], + ), ), - ), + ], ), - ], + ), ), - ), - ) - : SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ], ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption != - null - ? model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == - "Approved" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), - ), - ], + AppText( + model.insuranceApproval[indexInsurance].approvalStatusDescption != null + ? model.insuranceApproval[indexInsurance].approvalStatusDescption ?? "" + : "", + color: model.insuranceApproval[indexInsurance].approvalStatusDescption != null + ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), - Row( - children: [ - AppText( - model - .insuranceApproval[indexInsurance] - .doctorName - .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( + ], + ), + Row( + children: [ + AppText( + model.insuranceApproval[indexInsurance].doctorName!.toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( children: [ - Column( - children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig - .imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular( - 50), - child: Image.network( - model - .insuranceApproval[ - indexInsurance] - .doctorImage, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: - Colors.transparent, + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + model.insuranceApproval[indexInsurance].doctorImage ?? "", + fit: BoxFit.fill, + width: 700, ), ), - ], + backgroundColor: Colors.transparent, + ), ), - Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( children: [ - SizedBox( - height: 25.0, + AppText( + TranslationBase.of(context).clinic! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - .clinicName, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + model.insuranceApproval[indexInsurance].clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .approvalNo + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApproval[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApproval[indexInsurance].approvalNo.toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).unusedCount! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .unusedCount + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApproval[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApproval[indexInsurance].unUsedCount.toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).companyName! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .companyName + - ": ", - color: Colors.grey[500], - ), - AppText('Sample') - ], + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).receiptOn! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn + - ": ", - color: Colors.grey[500], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ), - ], + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate + - ": ", - color: Colors.grey[500], - ), - if (model - .insuranceApproval[ - indexInsurance] - .expiryDate != - null) - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ], + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).expiryDate! + ": ", + color: Colors.grey[500], ), + if (model.insuranceApproval[indexInsurance].expiryDate != null) + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ], ), - ), + ], ), - ], + ), ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context) - .procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .status, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context) - .usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context).procedure, + fontWeight: FontWeight.w700, + ), ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model - .insuranceApproval[ - indexInsurance] - .apporvalDetails - .length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Column( + Expanded( + child: AppText( + TranslationBase.of(context).status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context).usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model.insuranceApproval[indexInsurance].apporvalDetails!.length, + itemBuilder: (BuildContext context, int index) { + return Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Container( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.procedureName ?? - "", - textAlign: - TextAlign - .start, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.status ?? - "", - textAlign: - TextAlign - .center, - ), - ), + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + ?.apporvalDetails![index]?.procedureName ?? + "", + textAlign: TextAlign.start, ), - Expanded( - child: Container( - child: AppText( - model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.isInvoicedDesc ?? - "", - textAlign: - TextAlign - .center, - ), - ), - ), - ], + ), ), - SizedBox( - width: 5, + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + ?.apporvalDetails![index]?.status ?? + "", + textAlign: TextAlign.center, + ), + ), ), - Divider( - color: Colors.black38, + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + ?.apporvalDetails![index]?.isInvoicedDesc ?? + "", + textAlign: TextAlign.center, + ), + ), ), ], ), - ); - }), - ), - ], + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), ), - ), - ], + ], + ), ), - ), + ], ), - ], + ), ), - ), - )), + ], + ), + ), + )), ); } } diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 14ae707b..3636e698 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -16,8 +16,7 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; - const FilterDatePage( - {Key key, this.outPatientFilterType, this.patientSearchViewModel}) + const FilterDatePage({Key? key, required this.outPatientFilterType, required this.patientSearchViewModel}) : super(key: key); @override @@ -46,8 +45,7 @@ class _FilterDatePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle( - title: (OutPatientFilterType.Previous == - widget.outPatientFilterType) + title: (OutPatientFilterType.Previous == widget.outPatientFilterType) ? " Filter Previous Out Patient" : "Filter Nextweek Out Patient", ), @@ -63,16 +61,12 @@ class _FilterDatePageState extends State { color: Colors.white, child: InkWell( onTap: () => selectDate(context, - firstDate: - getFirstDate(widget.outPatientFilterType), - lastDate: - getLastDate(widget.outPatientFilterType)), + firstDate: getFirstDate(widget.outPatientFilterType), + lastDate: getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).fromDate, - widget.patientSearchViewModel - .selectedFromDate != - null + TranslationBase.of(context).fromDate!, + widget.patientSearchViewModel.selectedFromDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -92,16 +86,12 @@ class _FilterDatePageState extends State { child: InkWell( onTap: () => selectDate(context, isFromDate: false, - firstDate: - getFirstDate(widget.outPatientFilterType), - lastDate: - getLastDate(widget.outPatientFilterType)), + firstDate: getFirstDate(widget.outPatientFilterType), + lastDate: getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).toDate, - widget.patientSearchViewModel - .selectedToDate != - null + TranslationBase.of(context).toDate!, + widget.patientSearchViewModel.selectedToDate != null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -146,41 +136,30 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (widget.patientSearchViewModel.selectedFromDate == - null || - widget.patientSearchViewModel.selectedToDate == - null) { - Helpers.showErrorToast( - "Please Select All The date Fields "); + if (widget.patientSearchViewModel.selectedFromDate == null || + widget.patientSearchViewModel.selectedToDate == null) { + Helpers.showErrorToast("Please Select All The date Fields "); } else { - Duration difference = widget - .patientSearchViewModel.selectedToDate - .difference(widget - .patientSearchViewModel.selectedFromDate); + Duration difference = widget.patientSearchViewModel.selectedToDate! + .difference(widget.patientSearchViewModel.selectedFromDate!); if (difference.inDays > 90) { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { String dateTo = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate, - 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedToDate!, 'yyyy-MM-dd'); String dateFrom = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate, - 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedFromDate!, 'yyyy-MM-dd'); - PatientSearchRequestModel currentModel = - PatientSearchRequestModel(); + PatientSearchRequestModel currentModel = PatientSearchRequestModel(); currentModel.to = dateTo; currentModel.from = dateFrom; GifLoaderDialogUtils.showMyDialog(context); - await widget.patientSearchViewModel - .getOutPatient(currentModel, isLocalBusy: true); + await widget.patientSearchViewModel.getOutPatient(currentModel, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); - if (widget.patientSearchViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.patientSearchViewModel.error); + if (widget.patientSearchViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientSearchViewModel.error); } else { Navigator.of(context).pop(); } @@ -199,16 +178,15 @@ class _FilterDatePageState extends State { )); } - selectDate(BuildContext context, - {bool isFromDate = true, DateTime firstDate, lastDate}) async { + selectDate(BuildContext context, {bool isFromDate = true, DateTime? firstDate, lastDate}) async { Helpers.hideKeyboard(context); DateTime selectedDate = isFromDate ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate : this.widget.patientSearchViewModel.selectedToDate ?? lastDate; - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, - firstDate: firstDate, + firstDate: firstDate!, lastDate: lastDate, initialEntryMode: DatePickerEntryMode.calendar, ); @@ -232,27 +210,22 @@ class _FilterDatePageState extends State { getFirstDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime( - DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); + return DateTime(DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); } else { - return DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); + return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); } } getLastDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); } else { - return DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); + return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 30400c65..bb211329 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -35,13 +35,13 @@ class OutPatientsScreen extends StatefulWidget { final isAppbar; final arrivalType; final isView; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; + final PatientType? selectedPatientType; + final PatientSearchRequestModel? patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String searchKey; + final String? searchKey; OutPatientsScreen( {this.patientSearchForm, @@ -62,21 +62,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; + late int clinicId; + late AuthenticationViewModel authenticationViewModel; List _times = []; int _activeLocation = 1; - String patientType; - String patientTypeTitle; + late String patientType; + late String patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + late String arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; @@ -84,15 +84,15 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); _times = [ - TranslationBase.of(context).previous, - TranslationBase.of(context).today, - TranslationBase.of(context).nextWeek, + TranslationBase.of(context).previous!, + TranslationBase.of(context).today!, + TranslationBase.of(context).nextWeek!, ]; final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel!); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -106,15 +106,13 @@ class _OutPatientsScreenState extends State { Container( // color: Colors.red, height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: _times.map((item) { - bool _isActive = - _times[_activeLocation] == item ? true : false; + bool _isActive = _times[_activeLocation] == item ? true : false; return Expanded( child: InkWell( @@ -134,8 +132,7 @@ class _OutPatientsScreenState extends State { await model.getPatientBasedOnDate( item: item, selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: - widget.patientSearchRequestModel, + patientSearchRequestModel: widget.patientSearchRequestModel, isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); @@ -143,16 +140,11 @@ class _OutPatientsScreenState extends State { child: 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), + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -160,22 +152,16 @@ class _OutPatientsScreenState extends State { AppText( item, fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive - ? Colors.white - : Color(0xFF2B353E), + color: _isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), - _isActive && - _activeLocation != 0 && - model.state == ViewState.Idle + _isActive && _activeLocation != 0 && model.state == ViewState.Idle ? Container( padding: EdgeInsets.all(2), - margin: EdgeInsets.symmetric( - horizontal: 5), + margin: EdgeInsets.symmetric(horizontal: 5), decoration: new BoxDecoration( color: Colors.white, - borderRadius: - BorderRadius.circular(50), + borderRadius: BorderRadius.circular(50), ), constraints: BoxConstraints( minWidth: 20, @@ -183,9 +169,7 @@ class _OutPatientsScreenState extends State { ), child: new Text( model.filterData.length.toString(), - style: new TextStyle( - color: Colors.red, - fontSize: 10), + style: new TextStyle(color: Colors.red, fontSize: 10), textAlign: TextAlign.center, ), ) @@ -211,47 +195,40 @@ class _OutPatientsScreenState extends State { color: HexColor("#CCCCCC"), ), 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( - _activeLocation != 0 - ? DoctorApp.filter_1 - : FontAwesomeIcons.slidersH, - color: Colors.black, - ), - iconSize: 20, - padding: EdgeInsets.only(bottom: 30), - onPressed: _activeLocation != 0 - ? null - : () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - FilterDatePage( - outPatientFilterType: - outPatientFilterType, - patientSearchViewModel: - model, - ))); - }, - ), - 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( + _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => FilterDatePage( + outPatientFilterType: outPatientFilterType, + patientSearchViewModel: model, + ))); + }, + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), SizedBox( height: 10.0, ), @@ -260,8 +237,7 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -270,11 +246,8 @@ class _OutPatientsScreenState extends State { itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { if (_activeLocation != 0 || - (model.filterData[index].patientStatusType != - null && - model.filterData[index] - .patientStatusType == - 43)) + (model.filterData[index].patientStatusType != null && + model.filterData[index].patientStatusType == 43)) return Padding( padding: EdgeInsets.all(8.0), child: PatientCard( @@ -285,20 +258,16 @@ class _OutPatientsScreenState extends State { isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget.patientSearchRequestModel!.from, + "to": widget.patientSearchRequestModel!.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index c7056ce3..cee49c6c 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -12,42 +12,38 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsScreen extends StatefulWidget { final PrescriptionResModel prescriptionResModel; - OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel}); + OutPatientPrescriptionDetailsScreen({Key? key, required this.prescriptionResModel}); @override - _OutPatientPrescriptionDetailsScreenState createState() => - _OutPatientPrescriptionDetailsScreenState(); + _OutPatientPrescriptionDetailsScreenState createState() => _OutPatientPrescriptionDetailsScreenState(); } -class _OutPatientPrescriptionDetailsScreenState - extends State { - - - getPrescriptionReport(BuildContext context,PatientViewModel model ){ - RequestPrescriptionReport prescriptionReqModel = - RequestPrescriptionReport( +class _OutPatientPrescriptionDetailsScreenState extends State { + getPrescriptionReport(BuildContext context, PatientViewModel model) { + RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport( appointmentNo: widget.prescriptionResModel.appointmentNo, episodeID: widget.prescriptionResModel.episodeID, setupID: widget.prescriptionResModel.setupID, patientTypeID: widget.prescriptionResModel.patientID); model.getPrescriptionReport(prescriptionReqModel.toJson()); } + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => getPrescriptionReport(context, model), builder: (_, model, w) => AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionDetails, - body: CardWithBgWidgetNew( - widget: ListView.builder( - itemCount: model.prescriptionReport.length, - itemBuilder: (BuildContext context, int index) { - return OutPatientPrescriptionDetailsItem( - prescriptionReport: - model.prescriptionReport[index], - ); - }), - ), - ),); + appBarTitle: TranslationBase.of(context).prescriptionDetails ?? "", + body: CardWithBgWidgetNew( + widget: ListView.builder( + itemCount: model.prescriptionReport.length, + itemBuilder: (BuildContext context, int index) { + return OutPatientPrescriptionDetailsItem( + prescriptionReport: model.prescriptionReport[index], + ); + }), + ), + ), + ); } } diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index b9afab7d..587550e3 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -5,11 +5,11 @@ import 'package:flutter/material.dart'; class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const PatientSearchHeader({Key key, this.title}) : super(key: key); + const PatientSearchHeader({Key? key, required this.title}) : super(key: key); @override Widget build(BuildContext context) { - return Container( + return Container( padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, @@ -38,6 +38,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { } @override - - Size get preferredSize => Size(double.maxFinite,65); + Size get preferredSize => Size(double.maxFinite, 65); } 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..ac28e26b 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -32,45 +32,41 @@ class PatientsSearchResultScreen extends StatefulWidget { final String searchKey; PatientsSearchResultScreen( - {this.selectedPatientType, - this.patientSearchRequestModel, + {required this.selectedPatientType, + required this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, - this.searchKey, + required this.searchKey, this.isSearchAndOut = false}); @override - _PatientsSearchResultScreenState createState() => - _PatientsSearchResultScreenState(); + _PatientsSearchResultScreenState createState() => _PatientsSearchResultScreenState(); } -class _PatientsSearchResultScreenState - extends State { - int clinicId; - AuthenticationViewModel authenticationViewModel; +class _PatientsSearchResultScreenState extends State { + late int clinicId; + late AuthenticationViewModel authenticationViewModel; - String patientType; - String patientTypeTitle; + late String patientType; + late String patientTypeTitle; var selectedFilter = 1; - String arrivalType; - ProjectViewModel projectsProvider; + late String arrivalType; + late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - PatientModel patient; + late PatientModel patient; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - if (!widget.isSearchWithKeyInfo && - widget.selectedPatientType == PatientType.OutPatient) { + if (!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { await model.getOutPatient(widget.patientSearchRequestModel); } else { - await model - .getPatientFileInformation(widget.patientSearchRequestModel); + await model.getPatientFileInformation(widget.patientSearchRequestModel); } }, builder: (_, model, w) => AppScaffold( @@ -93,31 +89,30 @@ class _PatientsSearchResultScreenState color: HexColor("#CCCCCC"), ), 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), + onPressed: () {}, + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), SizedBox( height: 10.0, ), @@ -126,8 +121,7 @@ class _PatientsSearchResultScreenState child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", ), ) : ListView.builder( @@ -145,21 +139,16 @@ class _PatientsSearchResultScreenState isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": widget.isSearch, - "isInpatient": widget.isInpatient, - "arrivalType": "7", - "isSearchAndOut": - widget.isSearchAndOut, - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, + "isSearch": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + "isSearchAndOut": widget.isSearchAndOut, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index 2275cc09..b1be78ed 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -29,7 +29,7 @@ class _PatientSearchScreenState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -44,58 +44,46 @@ class _PatientSearchScreenState extends State { child: Center( child: Column( children: [ - BottomSheetTitle( - title: TranslationBase.of(context).searchPatient), + BottomSheetTitle(title: TranslationBase.of(context).searchPatient!!), FractionallySizedBox( widthFactor: 0.9, child: Container( color: Theme.of(context).scaffoldBackgroundColor, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 10, - ), - Container( - margin: - EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .patpatientIDMobilenationalientID, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - inputType: TextInputType.number, - hasBorder: true, - controller: patientFileInfoController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - onChanged: (_) {}, - validationError: (isFormSubmitted && - (patientFileInfoController - .text.isEmpty && - firstNameInfoController - .text.isEmpty && - middleNameInfoController - .text.isEmpty && - lastNameFileInfoController - .text.isEmpty)) - ? TranslationBase.of(context).emptyMessage - : null, - ), - ), - SizedBox( - height: 5, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ), - ])), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).patpatientIDMobilenationalientID, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + inputType: TextInputType.number, + hasBorder: true, + controller: patientFileInfoController, + inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], + onChanged: (_) {}, + validationError: (isFormSubmitted && + (patientFileInfoController.text.isEmpty && + firstNameInfoController.text.isEmpty && + middleNameInfoController.text.isEmpty && + lastNameFileInfoController.text.isEmpty)) + ? TranslationBase.of(context).emptyMessage + : null, + ), + ), + SizedBox( + height: 5, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + ])), ), ], ), @@ -147,41 +135,29 @@ class _PatientSearchScreenState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel( - doctorID: authenticationViewModel.doctorProfile.doctorID); + PatientSearchRequestModel(doctorID: authenticationViewModel.doctorProfile!.doctorID); if (showOther) { patientSearchRequestModel.firstName = - firstNameInfoController.text.trim().isEmpty - ? "0" - : firstNameInfoController.text.trim(); + firstNameInfoController.text.trim().isEmpty ? "0" : firstNameInfoController.text.trim(); patientSearchRequestModel.middleName = - middleNameInfoController.text.trim().isEmpty - ? "0" - : middleNameInfoController.text.trim(); + middleNameInfoController.text.trim().isEmpty ? "0" : middleNameInfoController.text.trim(); patientSearchRequestModel.lastName = - lastNameFileInfoController.text.isEmpty - ? "0" - : lastNameFileInfoController.text.trim(); + lastNameFileInfoController.text.isEmpty ? "0" : lastNameFileInfoController.text.trim(); } if (patientFileInfoController.text.isNotEmpty) { if (patientFileInfoController.text.length == 10 && - (patientFileInfoController.text[0] == '2' || - patientFileInfoController.text[0] == '1')) { - patientSearchRequestModel.identificationNo = - patientFileInfoController.text; + (patientFileInfoController.text[0] == '2' || patientFileInfoController.text[0] == '1')) { + patientSearchRequestModel.identificationNo = patientFileInfoController.text; patientSearchRequestModel.searchType = 2; patientSearchRequestModel.patientID = 0; - } else if ((patientFileInfoController.text.length == 10 || - patientFileInfoController.text.length == 9) && - ((patientFileInfoController.text[0] == '0' && - patientFileInfoController.text[1] == '5') || + } else if ((patientFileInfoController.text.length == 10 || patientFileInfoController.text.length == 9) && + ((patientFileInfoController.text[0] == '0' && patientFileInfoController.text[1] == '5') || patientFileInfoController.text[0] == '5')) { patientSearchRequestModel.mobileNo = patientFileInfoController.text; patientSearchRequestModel.searchType = 0; } else { - patientSearchRequestModel.patientID = - int.parse(patientFileInfoController.text); + patientSearchRequestModel.patientID = int.parse(patientFileInfoController.text); patientSearchRequestModel.searchType = 1; } } @@ -201,8 +177,7 @@ class _PatientSearchScreenState extends State { builder: (BuildContext context) => PatientsSearchResultScreen( selectedPatientType: selectedPatientType, patientSearchRequestModel: patientSearchRequestModel, - isSearchWithKeyInfo: - patientFileInfoController.text.isNotEmpty ? true : false, + isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, isSearchAndOut: true, searchKey: patientFileInfoController.text, diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart deleted file mode 100644 index a1ee2cab..00000000 --- a/lib/screens/patients/patient_search/time_bar.dart +++ /dev/null @@ -1,110 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/patient_type.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/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:hexcolor/hexcolor.dart'; - -class TimeBar extends StatefulWidget { - final PatientSearchViewModel model; - final PatientType selectedPatientType; - final PatientSearchRequestModel patientSearchRequestModel; - final bool isSearchWithKeyInfo; - - const TimeBar( - {Key key, - this.model, - this.selectedPatientType, - this.patientSearchRequestModel, - this.isSearchWithKeyInfo}) - : super(key: key); - @override - _TimeBarState createState() => _TimeBarState(); -} - -class _TimeBarState extends State { - @override - Widget build(BuildContext context) { - List _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, - ]; - int _activeLocation = 0; - return Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - // border: Border.all( - // width: 0.5, - // ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await widget.model.getPatientBasedOnDate( - item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: - widget.patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10), - topRight: Radius.circular(10)), - color: Colors.white), - alignment: Alignment.center, - height: 1, - width: SizeConfig.screenWidth * 0.23, - ) - : Container() - ]); - }).toList(), - ), - ); - } -} diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 6890d74f..be718c56 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -31,7 +31,7 @@ class _UcafDetailScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -47,9 +47,8 @@ class _UcafDetailScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).ucaf, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).ucaf ?? "", body: Column( children: [ Expanded( @@ -88,17 +87,14 @@ class _UcafDetailScreenState extends State { height: 10, ), Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( children: [ - treatmentStepsBar( - context, model, screenSize, patient), + treatmentStepsBar(context, model, screenSize, patient), SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem( - context, model), + ...getSelectedTreatmentStepItem(context, model), ], ), ), @@ -124,8 +120,7 @@ class _UcafDetailScreenState extends State { fontSize: 2.2, onPressed: () { Navigator.of(context).popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; + return route.settings.name == PATIENTS_PROFILE; }); }, ), @@ -148,12 +143,9 @@ class _UcafDetailScreenState extends State { onPressed: () async { await model.postUCAF(patient); if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .postUcafSuccessMsg); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg); Navigator.of(context).popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; + return route.settings.name == PATIENTS_PROFILE; }); } else { DrAppToastMsg.showErrorToast(model.error); @@ -170,17 +162,15 @@ class _UcafDetailScreenState extends State { )); } - Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, - Size screenSize, PatiantInformtion patient) { + Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) { List __treatmentSteps = [ - TranslationBase.of(context).diagnosis.toUpperCase(), - TranslationBase.of(context).medications.toUpperCase(), - TranslationBase.of(context).procedures.toUpperCase(), + TranslationBase.of(context).diagnosis ?? "".toUpperCase(), + TranslationBase.of(context).medications ?? "".toUpperCase(), + TranslationBase.of(context).procedures ?? "".toUpperCase(), ]; return Container( height: screenSize.height * 0.070, - decoration: Helpers.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC)), + decoration: Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -192,16 +182,13 @@ class _UcafDetailScreenState extends State { child: Container( height: screenSize.height * 0.070, decoration: Helpers.containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, - _isActive ? HexColor("#B8382B") : Colors.white), + _isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : 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, ), ), @@ -228,16 +215,13 @@ class _UcafDetailScreenState extends State { ); } - List getSelectedTreatmentStepItem( - BuildContext _context, UcafViewModel model) { + List getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) { switch (_activeTap) { case 0: if (model.patientAssessmentList != null) { return [ - ...List.generate( - model.patientAssessmentList.length, - (index) => DiagnosisWidget( - model, model.patientAssessmentList[index])).toList() + ...List.generate(model.patientAssessmentList.length, + (index) => DiagnosisWidget(model, model.patientAssessmentList[index])).toList() ]; } else { return [ @@ -247,22 +231,15 @@ class _UcafDetailScreenState extends State { break; case 1: return [ - ...List.generate( - model.prescriptionList != null - ? model.prescriptionList.entityList.length - : 0, - (index) => MedicationWidget( - model, model.prescriptionList.entityList[index])).toList() + ...List.generate(model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, + (index) => MedicationWidget(model, model.prescriptionList!.entityList![index])).toList() ]; break; case 2: if (model.orderProcedures != null) { return [ ...List.generate( - model.orderProcedures.length, - (index) => - ProceduresWidget(model, model.orderProcedures[index])) - .toList() + model.orderProcedures.length, (index) => ProceduresWidget(model, model.orderProcedures[index])).toList() ]; } else { return [ @@ -286,12 +263,10 @@ class DiagnosisWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MasterKeyModel diagnosisType = model.findMasterDataById( - masterKeys: MasterKeysService.DiagnosisType, - id: diagnosis.diagnosisTypeID); - MasterKeyModel diagnosisCondition = model.findMasterDataById( - masterKeys: MasterKeysService.DiagnosisCondition, - id: diagnosis.conditionID); + MasterKeyModel? diagnosisType = + model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID); + MasterKeyModel? diagnosisCondition = + model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -562,7 +537,7 @@ class ProceduresWidget extends StatelessWidget { AppText( "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: procedure.isCovered ? Colors.green : Colors.red, + color: procedure.isCovered! ? Colors.green : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 5f7b91f3..40024b6d 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -53,7 +53,7 @@ class _UCAFInputScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -65,9 +65,8 @@ class _UCAFInputScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).ucaf, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).ucaf ?? "", body: model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 @@ -105,8 +104,7 @@ class _UCAFInputScreenState extends State { screenSize: screenSize, ), Container( - margin: EdgeInsets.symmetric( - vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -160,8 +158,7 @@ class _UCAFInputScreenState extends State { height: 16, ),*/ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -175,8 +172,7 @@ class _UCAFInputScreenState extends State { ), AppText( "BP (H/L)", - fontSize: - SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -185,8 +181,7 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.bloodPressure}", - fontSize: - SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -200,8 +195,7 @@ class _UCAFInputScreenState extends State { children: [ AppText( "${TranslationBase.of(context).temperature}", - fontSize: - SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -211,8 +205,7 @@ class _UCAFInputScreenState extends State { Expanded( child: AppText( "${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)", - fontSize: - SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -226,15 +219,13 @@ class _UCAFInputScreenState extends State { height: 2, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( "${TranslationBase.of(context).pulseBeats}:", - fontSize: - SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -243,8 +234,7 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.hartRat}", - fontSize: - SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -256,14 +246,13 @@ class _UCAFInputScreenState extends State { height: 16, ), AppText( - TranslationBase.of(context) - .chiefComplaintsAndSymptoms, + TranslationBase.of(context).chiefComplaintsAndSymptoms, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), - /* SizedBox( + /* SizedBox( height: 4, ), AppText( @@ -278,11 +267,9 @@ class _UCAFInputScreenState extends State { height: 8, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).instruction, - dropDownText: Helpers.parseHtmlString(model - .patientChiefComplaintList[0] - .chiefComplaint), + hintText: TranslationBase.of(context).instruction, + dropDownText: + Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint ?? ""), controller: _additionalComplaintsController, inputType: TextInputType.multiline, enabled: false, @@ -323,7 +310,7 @@ class _UCAFInputScreenState extends State { SizedBox( height: 8, ), - /* AppTextFieldCustom( + /* AppTextFieldCustom( hintText: TranslationBase.of(context).other, dropDownText: TranslationBase.of(context).none, enabled: false, @@ -407,11 +394,7 @@ class _UCAFInputScreenState extends State { color: HexColor("#D02127"), onPressed: () { Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType - }); + arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType}); }, ), ), @@ -428,9 +411,9 @@ class _UCAFInputScreenState extends State { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - model.patientVitalSignsHistory.length == 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context).chiefComplaintEmptyMsg, + model.patientVitalSignsHistory.length == 0 + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context).chiefComplaintEmptyMsg, fontWeight: FontWeight.normal, textAlign: TextAlign.center, color: HexColor("#B8382B"), diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index da0381ed..7e25e300 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -17,7 +17,7 @@ class PageStepperWidget extends StatelessWidget { final int currentStepIndex; final Size screenSize; - PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize}); + PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize}); @override Widget build(BuildContext context) { @@ -32,11 +32,9 @@ class PageStepperWidget extends StatelessWidget { children: [ for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, - dividerWidth) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, - dividerWidth) + StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth) ], ) ], @@ -46,15 +44,13 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { - final int index; final bool isInProgress; final bool isFinalStep; final bool isStepFinish; final double dividerWidth; - StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, - this.dividerWidth); + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth); @override Widget build(BuildContext context) { @@ -62,9 +58,9 @@ class StepWidget extends StatelessWidget { if (isInProgress) { status = StepStatus.InProgress; } else { - if(isStepFinish){ + if (isStepFinish) { status = StepStatus.Completed; - }else { + } else { status = StepStatus.Locked; } } @@ -80,10 +76,18 @@ class StepWidget extends StatelessWidget { width: 30, height: 30, decoration: BoxDecoration( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : Color(0xFF359846), shape: BoxShape.circle, border: Border.all( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : Color(0xFF359846), width: 1), ), child: Center( @@ -124,11 +128,13 @@ class StepWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(4.0), ), - border: Border.all(color: status == StepStatus.InProgress - ? Color(0xFFF1E9D3) - : status == StepStatus.Locked - ? Color(0x29797979) - : Color(0xFFD8E8D8), width: 0.30), + border: Border.all( + color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0x29797979) + : Color(0xFFD8E8D8), + width: 0.30), ), child: AppText( status == StepStatus.InProgress @@ -143,8 +149,8 @@ class StepWidget extends StatelessWidget { color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked - ? Color(0xFF969696) - : Color(0xFF359846), + ? Color(0xFF969696) + : Color(0xFF359846), ), ) ], @@ -156,4 +162,4 @@ enum StepStatus { InProgress, Locked, Completed, -} \ No newline at end of file +} 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 08a69907..ab22cb6b 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 @@ -23,12 +23,10 @@ import '../../../../routes.dart'; class AdmissionRequestFirstScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => - _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState - extends State { +class _AdmissionRequestThirdScreenState extends State { final _dietTypeRemarksController = TextEditingController(); final _sickLeaveCommentsController = TextEditingController(); final _postMedicalHistoryController = TextEditingController(); @@ -41,16 +39,16 @@ class _AdmissionRequestThirdScreenState bool _isSickLeaveRequired = false; bool _patientPregnant = false; - String clinicError; - String doctorError; - String sickLeaveCommentError; - String dietTypeError; - String medicalHistoryError; - String surgicalHistoryError; + String? clinicError; + String? doctorError; + String? sickLeaveCommentError; + String? dietTypeError; + String? medicalHistoryError; + String? surgicalHistoryError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -61,9 +59,8 @@ class _AdmissionRequestThirdScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -100,14 +97,12 @@ class _AdmissionRequestThirdScreenState ), ), Container( - margin: - EdgeInsets.symmetric(vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .specialityAndDoctorDetail, + TranslationBase.of(context).specialityAndDoctorDetail, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, @@ -121,14 +116,15 @@ class _AdmissionRequestThirdScreenState isTextFieldHasSuffix: true, validationError: clinicError, dropDownText: _selectedClinic != null - ? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish'] + ? projectViewModel.isArabic + ? _selectedClinic['clinicNameArabic'] + : _selectedClinic['clinicNameEnglish'] : null, enabled: false, - onClick: model.clinicList != null && - model.clinicList.length > 0 + onClick: model.clinicList != null && model.clinicList.length > 0 ? () { openListDialogField( - projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', + projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { @@ -137,28 +133,21 @@ class _AdmissionRequestThirdScreenState }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getClinics().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.clinicList.length > 0) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getClinics().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.clinicList.length > 0) { openListDialogField( - projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish', + projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { _selectedClinic = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -169,17 +158,13 @@ class _AdmissionRequestThirdScreenState height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, isTextFieldHasSuffix: true, - dropDownText: _selectedDoctor != null - ? _selectedDoctor['DoctorName'] - : null, + dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null, enabled: false, validationError: doctorError, onClick: _selectedClinic != null - ? model.doctorsList != null && - model.doctorsList.length > 0 + ? model.doctorsList != null && model.doctorsList.length > 0 ? () { - openListDialogField('DoctorName', - 'DoctorID', model.doctorsList, + openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; @@ -187,29 +172,21 @@ class _AdmissionRequestThirdScreenState }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getClinicDoctors( - _selectedClinic['clinicID']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.doctorsList.length > 0) { - openListDialogField('DoctorName', - 'DoctorID', model.doctorsList, + .getClinicDoctors(_selectedClinic['clinicID']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.doctorsList.length > 0) { + openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } } : null, @@ -226,7 +203,7 @@ class _AdmissionRequestThirdScreenState SizedBox( height: 10, ), - if(patient.gender != 1) + if (patient.gender != 1) CheckboxListTile( title: AppText( TranslationBase.of(context).patientPregnant, @@ -238,7 +215,7 @@ class _AdmissionRequestThirdScreenState activeColor: HexColor("#D02127"), onChanged: (newValue) { setState(() { - _patientPregnant = newValue; + _patientPregnant = newValue!; }); }, controlAffinity: ListTileControlAffinity.leading, @@ -255,15 +232,14 @@ class _AdmissionRequestThirdScreenState activeColor: HexColor("#D02127"), onChanged: (newValue) { setState(() { - _isSickLeaveRequired = newValue; + _isSickLeaveRequired = newValue!; }); }, controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).sickLeaveComments, + hintText: TranslationBase.of(context).sickLeaveComments, controller: _sickLeaveCommentsController, minLines: 2, maxLines: 4, @@ -278,43 +254,31 @@ class _AdmissionRequestThirdScreenState hintText: TranslationBase.of(context).dietType, isTextFieldHasSuffix: true, validationError: dietTypeError, - dropDownText: _selectedDietType != null - ? _selectedDietType['nameEn'] - : null, + dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null, enabled: false, - onClick: model.dietTypesList != null && - model.dietTypesList.length > 0 + onClick: model.dietTypesList != null && model.dietTypesList.length > 0 ? () { - openListDialogField( - 'nameEn', 'id', model.dietTypesList, - (selectedValue) { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getDietTypes(patient.patientId).then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.dietTypesList.length > 0) { - openListDialogField( - 'nameEn', 'id', model.dietTypesList, - (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model + .getDietTypes(patient.patientId) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.dietTypesList.length > 0) { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -322,8 +286,7 @@ class _AdmissionRequestThirdScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).dietTypeRemarks, + hintText: TranslationBase.of(context).dietTypeRemarks, controller: _dietTypeRemarksController, minLines: 4, maxLines: 6, @@ -370,75 +333,60 @@ class _AdmissionRequestThirdScreenState _sickLeaveCommentsController.text != "" && _postMedicalHistoryController.text != "" && _postSurgicalHistoryController.text != "") { - model.admissionRequestData.patientMRN = - patient.patientMRN; - model.admissionRequestData.appointmentNo = - patient.appointmentNo; + model.admissionRequestData.patientMRN = patient.patientMRN!; + model.admissionRequestData.appointmentNo = patient.appointmentNo; model.admissionRequestData.episodeID = patient.episodeNo; model.admissionRequestData.admissionRequestNo = 0; - model.admissionRequestData.admitToClinic = - _selectedClinic['clinicID']; - model.admissionRequestData.mrpDoctorID = - _selectedDoctor['DoctorID']; + model.admissionRequestData.admitToClinic = _selectedClinic['clinicID']; + model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID']; model.admissionRequestData.isPregnant = _patientPregnant; - model.admissionRequestData.isSickLeaveRequired = - _isSickLeaveRequired; - model.admissionRequestData.sickLeaveComments = - _sickLeaveCommentsController.text; - model.admissionRequestData.isDietType = - _selectedDietType != null ? true : false; - model.admissionRequestData.dietType = - _selectedDietType != null - ? _selectedDietType['id'] - : 0; - model.admissionRequestData.dietRemarks = - _dietTypeRemarksController.text; - model.admissionRequestData.pastMedicalHistory = - _postMedicalHistoryController.text; - model.admissionRequestData.pastSurgicalHistory = - _postSurgicalHistoryController.text; - Navigator.of(context) - .pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: { + model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired; + model.admissionRequestData.sickLeaveComments = _sickLeaveCommentsController.text; + model.admissionRequestData.isDietType = _selectedDietType != null ? true : false; + model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; + model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text; + model.admissionRequestData.pastMedicalHistory = _postMedicalHistoryController.text; + model.admissionRequestData.pastSurgicalHistory = _postSurgicalHistoryController.text; + Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: { 'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'admission-data': model.admissionRequestData }); } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill); setState(() { - if(_selectedClinic == null){ + if (_selectedClinic == null) { clinicError = TranslationBase.of(context).fieldRequired; - }else { + } else { clinicError = null; } - if(_selectedDoctor == null){ + if (_selectedDoctor == null) { doctorError = TranslationBase.of(context).fieldRequired; - }else { + } else { doctorError = null; } - if(_sickLeaveCommentsController.text == ""){ + if (_sickLeaveCommentsController.text == "") { sickLeaveCommentError = TranslationBase.of(context).fieldRequired; - }else { + } else { sickLeaveCommentError = null; } - if(_selectedDietType == null){ + if (_selectedDietType == null) { dietTypeError = TranslationBase.of(context).fieldRequired; - }else { - dietTypeError = null; + } else { + dietTypeError = ""; } - if(_postMedicalHistoryController.text == ""){ + if (_postMedicalHistoryController.text == "") { medicalHistoryError = TranslationBase.of(context).fieldRequired; - }else { + } else { medicalHistoryError = null; } - if(_postSurgicalHistoryController.text == ""){ + if (_postSurgicalHistoryController.text == "") { surgicalHistoryError = TranslationBase.of(context).fieldRequired; - }else { + } else { surgicalHistoryError = null; } }); @@ -453,8 +401,8 @@ class _AdmissionRequestThirdScreenState ); } - void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + void openListDialogField( + String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, 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 120b6adf..547fa5cb 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 @@ -23,23 +23,21 @@ import '../../../../routes.dart'; class AdmissionRequestThirdScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => - _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState - extends State { +class _AdmissionRequestThirdScreenState extends State { dynamic _selectedDiagnosis; dynamic _selectedIcd; dynamic _selectedDiagnosisType; - String diagnosisError; - String icdError; - String diagnosisTypeError; + String? diagnosisError; + String? icdError; + String? diagnosisTypeError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -52,9 +50,8 @@ class _AdmissionRequestThirdScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -106,18 +103,13 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).diagnosis, - dropDownText: _selectedDiagnosis != null - ? _selectedDiagnosis['nameEn'] - : null, + dropDownText: _selectedDiagnosis != null ? _selectedDiagnosis['nameEn'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: diagnosisError, - onClick: model.diagnosisTypesList != null && - model.diagnosisTypesList.length > 0 + onClick: model.diagnosisTypesList != null && model.diagnosisTypesList.length > 0 ? () { - openListDialogField('nameEn', 'id', - model.diagnosisTypesList, - (selectedValue) { + openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) { setState(() { _selectedDiagnosis = selectedValue; }); @@ -125,24 +117,17 @@ class _AdmissionRequestThirdScreenState } : () async { GifLoaderDialogUtils.showMyDialog(context); - await model.getDiagnosis().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.diagnosisTypesList.length > 0) { - openListDialogField('nameEn', 'id', - model.diagnosisTypesList, - (selectedValue) { + await model.getDiagnosis().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.diagnosisTypesList.length > 0) { + openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) { setState(() { _selectedDiagnosis = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { + } else if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -152,18 +137,13 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).icd, - dropDownText: _selectedIcd != null - ? _selectedIcd['description'] - : null, + dropDownText: _selectedIcd != null ? _selectedIcd['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: icdError, - onClick: model.icdCodes != null && - model.icdCodes.length > 0 + onClick: model.icdCodes != null && model.icdCodes.length > 0 ? () { - openListDialogField( - 'description', 'code', model.icdCodes, - (selectedValue) { + openListDialogField('description', 'code', model.icdCodes, (selectedValue) { setState(() { _selectedIcd = selectedValue; }); @@ -172,25 +152,18 @@ class _AdmissionRequestThirdScreenState : () async { GifLoaderDialogUtils.showMyDialog(context); await model - .getICDCodes(patient.patientMRN) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.icdCodes.length > 0) { - openListDialogField( - 'description', 'code', model.icdCodes, - (selectedValue) { + .getICDCodes(patient.patientMRN!) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.icdCodes.length > 0) { + openListDialogField('description', 'code', model.icdCodes, (selectedValue) { setState(() { _selectedIcd = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { + } else if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -200,19 +173,14 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).diagnoseType, - dropDownText: _selectedDiagnosisType != null - ? _selectedDiagnosisType['description'] - : null, + dropDownText: _selectedDiagnosisType != null ? _selectedDiagnosisType['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: diagnosisTypeError, - onClick: model.listOfDiagnosisSelectionTypes != - null && - model.listOfDiagnosisSelectionTypes.length > - 0 + onClick: model.listOfDiagnosisSelectionTypes != null && + model.listOfDiagnosisSelectionTypes.length > 0 ? () { - openListDialogField('description', 'code', - model.listOfDiagnosisSelectionTypes, + openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes, (selectedValue) { setState(() { _selectedDiagnosisType = selectedValue; @@ -222,29 +190,20 @@ class _AdmissionRequestThirdScreenState : () async { GifLoaderDialogUtils.showMyDialog(context); await model - .getMasterLookup(MasterKeysService - .DiagnosisSelectionType) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); + .getMasterLookup(MasterKeysService.DiagnosisSelectionType) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.Idle && - model.listOfDiagnosisSelectionTypes - .length > - 0) { - openListDialogField('description', 'code', - model.listOfDiagnosisSelectionTypes, + model.listOfDiagnosisSelectionTypes.length > 0) { + openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes, (selectedValue) { setState(() { - _selectedDiagnosisType = - selectedValue; + _selectedDiagnosisType = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { + } else if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -279,58 +238,48 @@ class _AdmissionRequestThirdScreenState title: TranslationBase.of(context).submit, color: HexColor("#359846"), onPressed: () async { - if (_selectedDiagnosis != null && - _selectedIcd != null && - _selectedDiagnosisType != null) { + if (_selectedDiagnosis != null && _selectedIcd != null && _selectedDiagnosisType != null) { model.admissionRequestData = admissionRequest; dynamic admissionRequestDiagnoses = [ { - 'diagnosisDescription': - _selectedDiagnosis['nameEn'], + 'diagnosisDescription': _selectedDiagnosis['nameEn'], 'diagnosisType': _selectedDiagnosis['id'], 'icdCode': _selectedIcd['code'], - 'icdCodeDescription': - _selectedIcd['description'], + 'icdCodeDescription': _selectedIcd['description'], 'type': _selectedDiagnosisType['code'], 'remarks': "", 'isActive': true, } ]; - model.admissionRequestData - .admissionRequestDiagnoses = - admissionRequestDiagnoses; + model.admissionRequestData.admissionRequestDiagnoses = admissionRequestDiagnoses; await model.makeAdmissionRequest(); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .admissionRequestSuccessMsg); - Navigator.popUntil(context, - ModalRoute.withName(PATIENTS_PROFILE)); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).admissionRequestSuccessMsg); + Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE)); } } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill); setState(() { - if(_selectedDiagnosis == null){ + if (_selectedDiagnosis == null) { diagnosisError = TranslationBase.of(context).fieldRequired; - }else { + } else { diagnosisError = null; } - if(_selectedIcd == null){ + if (_selectedIcd == null) { icdError = TranslationBase.of(context).fieldRequired; - }else { + } else { icdError = null; } - if(_selectedDiagnosisType == null){ + if (_selectedDiagnosisType == null) { diagnosisTypeError = TranslationBase.of(context).fieldRequired; - }else { + } else { diagnosisTypeError = null; } }); @@ -348,8 +297,8 @@ class _AdmissionRequestThirdScreenState ); } - void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + void openListDialogField( + String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, 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 bea487f7..42fafd8e 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 @@ -26,12 +26,10 @@ import '../../../../routes.dart'; class AdmissionRequestSecondScreen extends StatefulWidget { @override - _AdmissionRequestSecondScreenState createState() => - _AdmissionRequestSecondScreenState(); + _AdmissionRequestSecondScreenState createState() => _AdmissionRequestSecondScreenState(); } -class _AdmissionRequestSecondScreenState - extends State { +class _AdmissionRequestSecondScreenState extends State { final _postPlansEstimatedCostController = TextEditingController(); final _estimatedCostController = TextEditingController(); final _expectedDaysController = TextEditingController(); @@ -40,28 +38,28 @@ class _AdmissionRequestSecondScreenState final _complicationsController = TextEditingController(); final _otherProceduresController = TextEditingController(); - DateTime _expectedAdmissionDate; + late DateTime _expectedAdmissionDate; dynamic _selectedFloor; dynamic _selectedWard; dynamic _selectedRoomCategory; dynamic _selectedAdmissionType; - String costError; - String plansError; - String otherInterventionsError; - String expectedDaysError; - String expectedDatesError; - String floorError; - String roomError; - String treatmentsError; - String complicationsError; - String proceduresError; - String admissionTypeError; + String? costError; + String? plansError; + String? otherInterventionsError; + String? expectedDaysError; + String? expectedDatesError; + String? floorError; + String? roomError; + String? treatmentsError; + String? complicationsError; + String? proceduresError; + String? admissionTypeError; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -74,9 +72,8 @@ class _AdmissionRequestSecondScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).admissionRequest, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).admissionRequest!, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -112,14 +109,12 @@ class _AdmissionRequestSecondScreenState ), ), Container( - margin: - EdgeInsets.symmetric(vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .postPlansEstimatedCost, + TranslationBase.of(context).postPlansEstimatedCost, color: Color(0xFF2E303A), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w700, @@ -129,15 +124,11 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).estimatedCost, + hintText: TranslationBase.of(context).estimatedCost, controller: _estimatedCostController, validationError: costError, inputType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], + inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], ), SizedBox( height: 10, @@ -154,10 +145,8 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .otherDepartmentsInterventions, - controller: - _otherDepartmentsInterventionsController, + hintText: TranslationBase.of(context).otherDepartmentsInterventions, + controller: _otherDepartmentsInterventionsController, inputType: TextInputType.multiline, validationError: otherInterventionsError, minLines: 2, @@ -177,23 +166,18 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).expectedDays, + hintText: TranslationBase.of(context).expectedDays, controller: _expectedDaysController, validationError: expectedDaysError, inputType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], + inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], ), SizedBox( height: 10, ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context) - .expectedAdmissionDate, + hintText: TranslationBase.of(context).expectedAdmissionDate, dropDownText: _expectedAdmissionDate != null ? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" : null, @@ -201,16 +185,16 @@ class _AdmissionRequestSecondScreenState isTextFieldHasSuffix: true, validationError: expectedDatesError, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + Icons.calendar_today, + color: Colors.black, + )), onClick: () { if (_expectedAdmissionDate == null) { _expectedAdmissionDate = DateTime.now(); } - _selectDate(context, _expectedAdmissionDate, - (picked) { + _selectDate(context, _expectedAdmissionDate, (picked) { setState(() { _expectedAdmissionDate = picked; }); @@ -223,47 +207,32 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).floor, - dropDownText: _selectedFloor != null - ? _selectedFloor['description'] - : null, + dropDownText: _selectedFloor != null ? _selectedFloor['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: floorError, - onClick: model.floorList != null && - model.floorList.length > 0 + onClick: model.floorList != null && model.floorList.length > 0 ? () { - openListDialogField( - 'description', - 'floorID', - model.floorList, (selectedValue) { + openListDialogField('description', 'floorID', model.floorList, (selectedValue) { setState(() { _selectedFloor = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getFloors().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.floorList.length > 0) { - openListDialogField( - 'description', - 'floorID', - model.floorList, (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getFloors().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.floorList.length > 0) { + openListDialogField('description', 'floorID', model.floorList, + (selectedValue) { setState(() { _selectedFloor = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -273,46 +242,32 @@ class _AdmissionRequestSecondScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).ward, - dropDownText: _selectedWard != null - ? _selectedWard['description'] - : null, + dropDownText: _selectedWard != null ? _selectedWard['description'] : null, enabled: false, isTextFieldHasSuffix: true, - onClick: model.wardList != null && - model.wardList.length > 0 + onClick: model.wardList != null && model.wardList.length > 0 ? () { - openListDialogField( - 'description', - 'nursingStationID', - model.wardList, (selectedValue) { + openListDialogField('description', 'nursingStationID', model.wardList, + (selectedValue) { setState(() { _selectedWard = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getWards().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.wardList.length > 0) { - openListDialogField( - 'description', - 'nursingStationID', - model.wardList, (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getWards().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.wardList.length > 0) { + openListDialogField('description', 'nursingStationID', model.wardList, + (selectedValue) { setState(() { _selectedWard = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -321,54 +276,37 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).roomCategory, - dropDownText: _selectedRoomCategory != null - ? _selectedRoomCategory['description'] - : null, + hintText: TranslationBase.of(context).roomCategory, + dropDownText: + _selectedRoomCategory != null ? _selectedRoomCategory['description'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: roomError, - onClick: model.roomCategoryList != null && - model.roomCategoryList.length > 0 + onClick: model.roomCategoryList != null && model.roomCategoryList.length > 0 ? () { - openListDialogField( - 'description', - 'categoryID', - model.roomCategoryList, + openListDialogField('description', 'categoryID', model.roomCategoryList, (selectedValue) { setState(() { - _selectedRoomCategory = - selectedValue; + _selectedRoomCategory = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getRoomCategories().then( - (_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.roomCategoryList.length > 0) { - openListDialogField( - 'description', - 'categoryID', - model.roomCategoryList, + GifLoaderDialogUtils.showMyDialog(context); + await model + .getRoomCategories() + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.roomCategoryList.length > 0) { + openListDialogField('description', 'categoryID', model.roomCategoryList, (selectedValue) { setState(() { - _selectedRoomCategory = - selectedValue; + _selectedRoomCategory = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -376,8 +314,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).treatmentLine, + hintText: TranslationBase.of(context).treatmentLine, controller: _treatmentLineController, inputType: TextInputType.multiline, validationError: treatmentsError, @@ -388,8 +325,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).complications, + hintText: TranslationBase.of(context).complications, controller: _complicationsController, inputType: TextInputType.multiline, validationError: complicationsError, @@ -400,8 +336,7 @@ class _AdmissionRequestSecondScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).otherProcedure, + hintText: TranslationBase.of(context).otherProcedure, controller: _otherProceduresController, inputType: TextInputType.multiline, validationError: proceduresError, @@ -413,53 +348,34 @@ class _AdmissionRequestSecondScreenState ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: - TranslationBase.of(context).admissionType, - dropDownText: _selectedAdmissionType != null - ? _selectedAdmissionType['nameEn'] - : null, + hintText: TranslationBase.of(context).admissionType, + dropDownText: _selectedAdmissionType != null ? _selectedAdmissionType['nameEn'] : null, enabled: false, isTextFieldHasSuffix: true, validationError: admissionTypeError, - onClick: model.admissionTypeList != null && - model.admissionTypeList.length > 0 + onClick: model.admissionTypeList != null && model.admissionTypeList.length > 0 ? () { - openListDialogField('nameEn', 'id', - model.admissionTypeList, - (selectedValue) { + openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) { setState(() { - _selectedAdmissionType = - selectedValue; + _selectedAdmissionType = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); await model - .getMasterLookup(MasterKeysService - .AdmissionRequestType) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.admissionTypeList.length > - 0) { - openListDialogField('nameEn', 'id', - model.admissionTypeList, - (selectedValue) { + .getMasterLookup(MasterKeysService.AdmissionRequestType) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.admissionTypeList.length > 0) { + openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) { setState(() { - _selectedAdmissionType = - selectedValue; + _selectedAdmissionType = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -496,140 +412,107 @@ class _AdmissionRequestSecondScreenState _postPlansEstimatedCostController.text != "" && _expectedDaysController.text != "" && _expectedAdmissionDate != null && - _otherDepartmentsInterventionsController.text != - "" && + _otherDepartmentsInterventionsController.text != "" && _selectedFloor != null && - _selectedRoomCategory != - null /*_selectedWard is not required*/ && + _selectedRoomCategory != null /*_selectedWard is not required*/ && _treatmentLineController.text != "" && _complicationsController.text != "" && _otherProceduresController.text != "" && _selectedAdmissionType != null) { model.admissionRequestData = admissionRequest; - model.admissionRequestData.estimatedCost = - int.parse(_estimatedCostController.text); - model.admissionRequestData - .elementsForImprovement = + model.admissionRequestData.estimatedCost = int.parse(_estimatedCostController.text); + model.admissionRequestData.elementsForImprovement = _postPlansEstimatedCostController.text; - model.admissionRequestData.expectedDays = - int.parse(_expectedDaysController.text); - model.admissionRequestData.admissionDate = - _expectedAdmissionDate.toIso8601String(); - model.admissionRequestData - .otherDepartmentInterventions = + model.admissionRequestData.expectedDays = int.parse(_expectedDaysController.text); + model.admissionRequestData.admissionDate = _expectedAdmissionDate.toIso8601String(); + model.admissionRequestData.otherDepartmentInterventions = _otherDepartmentsInterventionsController.text; - model.admissionRequestData.admissionLocationID = - _selectedFloor['floorID']; + model.admissionRequestData.admissionLocationID = _selectedFloor['floorID']; model.admissionRequestData.wardID = - _selectedWard != null - ? _selectedWard['nursingStationID'] - : 0; - model.admissionRequestData.roomCategoryID = - _selectedRoomCategory['categoryID']; + _selectedWard != null ? _selectedWard['nursingStationID'] : 0; + model.admissionRequestData.roomCategoryID = _selectedRoomCategory['categoryID']; - model.admissionRequestData - .admissionRequestProcedures = []; + model.admissionRequestData.admissionRequestProcedures = []; - model.admissionRequestData.mainLineOfTreatment = - _treatmentLineController.text; - model.admissionRequestData.complications = - _complicationsController.text; - model.admissionRequestData.otherProcedures = - _otherProceduresController.text; - model.admissionRequestData.admissionType = - _selectedAdmissionType['id']; + model.admissionRequestData.mainLineOfTreatment = _treatmentLineController.text; + model.admissionRequestData.complications = _complicationsController.text; + model.admissionRequestData.otherProcedures = _otherProceduresController.text; + model.admissionRequestData.admissionType = _selectedAdmissionType['id']; - Navigator.of(context).pushNamed( - PATIENT_ADMISSION_REQUEST_3, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'admission-data': model.admissionRequestData - }); + Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'admission-data': model.admissionRequestData + }); } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill); setState(() { if (_estimatedCostController.text == "") { - costError = - TranslationBase.of(context).fieldRequired; + costError = TranslationBase.of(context).fieldRequired; } else { costError = null; } - if (_postPlansEstimatedCostController.text == - "") { - plansError = - TranslationBase.of(context).fieldRequired; + if (_postPlansEstimatedCostController.text == "") { + plansError = TranslationBase.of(context).fieldRequired; } else { plansError = null; } if (_expectedDaysController.text == "") { - expectedDaysError = - TranslationBase.of(context).fieldRequired; + expectedDaysError = TranslationBase.of(context).fieldRequired; } else { - expectedDaysError = null; + expectedDaysError = ""; } if (_expectedAdmissionDate == null) { - expectedDatesError = - TranslationBase.of(context).fieldRequired; + expectedDatesError = TranslationBase.of(context).fieldRequired; } else { expectedDatesError = null; } - if (_otherDepartmentsInterventionsController - .text == - "") { - otherInterventionsError = - TranslationBase.of(context).fieldRequired; + if (_otherDepartmentsInterventionsController.text == "") { + otherInterventionsError = TranslationBase.of(context).fieldRequired; } else { otherInterventionsError = null; } if (_selectedFloor == null) { - floorError = - TranslationBase.of(context).fieldRequired; + floorError = TranslationBase.of(context).fieldRequired; } else { floorError = null; } if (_selectedRoomCategory == null) { - roomError = - TranslationBase.of(context).fieldRequired; + roomError = TranslationBase.of(context).fieldRequired; } else { roomError = null; } if (_treatmentLineController.text == "") { - treatmentsError = - TranslationBase.of(context).fieldRequired; + treatmentsError = TranslationBase.of(context).fieldRequired; } else { treatmentsError = null; } if (_complicationsController.text == "") { - complicationsError = - TranslationBase.of(context).fieldRequired; + complicationsError = TranslationBase.of(context).fieldRequired; } else { complicationsError = null; } if (_otherProceduresController.text == "") { - proceduresError = - TranslationBase.of(context).fieldRequired; + proceduresError = TranslationBase.of(context).fieldRequired; } else { proceduresError = null; } if (_selectedAdmissionType == null) { - admissionTypeError = - TranslationBase.of(context).fieldRequired; + admissionTypeError = TranslationBase.of(context).fieldRequired; } else { admissionTypeError = null; } @@ -647,9 +530,8 @@ class _AdmissionRequestSecondScreenState ); } - Future _selectDate(BuildContext context, DateTime dateTime, - Function(DateTime picked) updateDate) async { - final DateTime picked = await showDatePicker( + Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async { + final DateTime? picked = await showDatePicker( context: context, initialDate: dateTime, firstDate: DateTime.now(), @@ -661,8 +543,8 @@ class _AdmissionRequestSecondScreenState } } - void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + void openListDialogField( + String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index fcc9746a..d125336a 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -18,15 +18,14 @@ class FlowChartPage extends StatelessWidget { final PatiantInformtion patient; final bool isInpatient; - FlowChartPage({this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); + FlowChartPage( + {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, - procedure: filterName, - patient: patient), + onModelReady: (model) => + model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, patient: patient), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, @@ -41,25 +40,25 @@ class FlowChartPage extends StatelessWidget { ), ) : Container( - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noDataAvailable, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], + ), ), ), - ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 0d059000..fd07bc07 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -18,14 +18,14 @@ class LabResultWidget extends StatelessWidget { final bool isInpatient; LabResultWidget( - {Key key, - this.filterName, - this.patientLabResultList, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.filterName, + required this.patientLabResultList, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -37,32 +37,32 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // if (!isInpatient) - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - isInpatient: isInpatient, - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(filterName), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient, ), - ); - }, - child: AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, - ), + ), + ); + }, + child: AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, ), - ], - ), + ), + ], + ), Row( children: [ Expanded( @@ -123,7 +123,7 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( '${patientLabResultList[index].testCode}\n' + - patientLabResultList[index].description, + patientLabResultList[index].description!, textAlign: TextAlign.center, ), ), @@ -135,9 +135,8 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - patientLabResultList[index].resultValue ??""+ - " " + - "${patientLabResultList[index].uOM ?? ""}", + patientLabResultList[index].resultValue ?? + "" + " " + "${patientLabResultList[index].uOM ?? ""}", textAlign: TextAlign.center, ), ), @@ -228,7 +227,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - lab.resultValue + " " + lab.uOM, + lab.resultValue! + " " + lab.uOM!, textAlign: TextAlign.center, ), ), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 697d16d2..c08d1514 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultDetailsWidget extends StatefulWidget { final List labResult; LabResultDetailsWidget({ - this.labResult, + required this.labResult, }); @override @@ -24,7 +24,7 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - /* decoration: BoxDecoration( + /* decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), @@ -74,7 +74,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -87,17 +87,16 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResult.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); tableRow.add(TableRow(children: [ Container( child: Container( padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic? AppDateUtils.getWeekDayArabic(date.weekday): AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - fontFamily: 'Poppins', ), ), @@ -110,7 +109,6 @@ class _VitalSignDetailsWidgetState extends State { '${vital.resultValue}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index 89860f44..4c27861e 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -10,15 +10,15 @@ class LineChartCurved extends StatefulWidget { final String title; final List labResult; - LineChartCurved({this.title, this.labResult}); + LineChartCurved({required this.title, required this.labResult}); @override State createState() => LineChartCurvedState(); } class LineChartCurvedState extends State { - bool isShowingMainData; - List xAxixs = List(); + bool? isShowingMainData; + List xAxixs = []; int indexes = 0; @override @@ -59,7 +59,6 @@ class LineChartCurvedState extends State { widget.title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -92,8 +91,7 @@ class LineChartCurvedState extends State { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -102,27 +100,23 @@ class LineChartCurvedState extends State { fontSize: 11, ), margin: 28, - rotateAngle:-65, + rotateAngle: -65, getTitles: (value) { print(value); - DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime!); if (widget.labResult.length < 8) { if (widget.labResult.length > value.toInt()) { return '${date.day}/ ${date.year}'; } else return ''; } else { - if (value.toInt() == 0) - return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResult.length - 1) - return '${date.day}/ ${date.year}'; + if (value.toInt() == 0) return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { return '${date.day}/ ${date.year}'; } } - - return ''; }, ), @@ -160,7 +154,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY()+2, + maxY: getMaxY() + 2, minY: getMinY(), lineBarsData: getData(), ); @@ -169,10 +163,10 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; widget.labResult.forEach((element) { - try{ - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble > max) max = resultValueDouble;} - catch(e){ + try { + double resultValueDouble = double.parse(element.resultValue!); + if (resultValueDouble > max) max = resultValueDouble; + } catch (e) { print(e); } }); @@ -182,13 +176,14 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; - try{ - min = double.parse(widget.labResult[0].resultValue); - - widget.labResult.forEach((element) { - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble < min) min = resultValueDouble; - });}catch(e){ + try { + min = double.parse(widget.labResult[0].resultValue ?? ""); + + widget.labResult.forEach((element) { + double resultValueDouble = double.parse(element.resultValue ?? ""); + if (resultValueDouble < min) min = resultValueDouble; + }); + } catch (e) { print(e); } int value = min.toInt(); @@ -197,15 +192,14 @@ class LineChartCurvedState extends State { } List getData() { - List spots = List(); + List spots = []; for (int index = 0; index < widget.labResult.length; index++) { - try{ - var resultValueDouble = double.parse(widget.labResult[index].resultValue); - spots.add(FlSpot(index.toDouble(), resultValueDouble)); - }catch(e){ + try { + var resultValueDouble = double.parse(widget.labResult[index].resultValue ?? ""); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + } catch (e) { print(e); spots.add(FlSpot(index.toDouble(), 0.0)); - } } diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 6026c9e9..26018768 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,4 +1,3 @@ - import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -8,18 +7,16 @@ import 'package:flutter/material.dart'; import 'Lab_Result_details_wideget.dart'; import 'LineChartCurved.dart'; - class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ - Key key, - @required this.labResult, - @required this.name, + Key? key, + required this.labResult, + required this.name, }) : super(key: key); final List labResult; final String name; - @override Widget build(BuildContext context) { return Padding( @@ -29,19 +26,16 @@ class LabResultChartAndDetails extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: LineChartCurved( + title: name, + labResult: labResult, ), - child: LineChartCurved(title: name,labResult:labResult,), ), Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -51,7 +45,9 @@ class LabResultChartAndDetails extends StatelessWidget { fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), LabResultDetailsWidget( labResult: labResult.reversed.toList(), ), @@ -62,5 +58,4 @@ class LabResultChartAndDetails extends StatelessWidget { ), ); } - } diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index dd8ace01..a8b98be9 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; class LabResult extends StatefulWidget { final LabOrdersResModel labOrders; - LabResult({Key key, this.labOrders}); + LabResult({Key? key, required this.labOrders}); @override _LabResultState createState() => _LabResultState(); @@ -27,13 +27,11 @@ class _LabResultState extends State { onModelReady: (model) => model.getLabResult(widget.labOrders), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).labOrders, + appBarTitle: TranslationBase.of(context).labOrders ?? "", body: model.labResultList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoLabOrders) + ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoLabOrders ?? "") : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, - 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView( children: [ CardWithBgWidgetNew( @@ -69,7 +67,6 @@ class _LabResultState extends State { ), ], ), - ], ), ), 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..7f581945 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -17,12 +17,12 @@ class LaboratoryResultPage extends StatefulWidget { final bool isInpatient; LaboratoryResultPage( - {Key key, - this.patientLabOrders, - this.patient, - this.patientType, - this.arrivalType, - this.isInpatient}); + {Key? key, + required this.patientLabOrders, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -40,9 +40,7 @@ class _LaboratoryResultPageState extends State { // patient: widget.patient, // isInpatient: widget.patientType == "1"), onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: true), + patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileHeaderWhitAppointmentAppBar( @@ -65,11 +63,11 @@ class _LaboratoryResultPageState extends State { children: [ LaboratoryResultWidget( onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo, + billNo: widget.patientLabOrders.invoiceNo!, details: model.patientLabSpecialResult.length > 0 - ? model.patientLabSpecialResult[0].resultDataHTML + ? model.patientLabSpecialResult[0]!.resultDataHTML : null, - orderNo: widget.patientLabOrders.orderNo, + orderNo: widget.patientLabOrders.orderNo!, patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 08c247ee..67d0c63b 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -16,21 +16,21 @@ import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; - final String details; + final String? details; final String orderNo; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; final bool isInpatient; const LaboratoryResultWidget( - {Key key, - this.onTap, - this.billNo, - this.details, - this.orderNo, - this.patientLabOrder, - this.patient, - this.isInpatient}) + {Key? key, + required this.onTap, + required this.billNo, + required this.details, + required this.orderNo, + required this.patientLabOrder, + required this.patient, + required this.isInpatient}) : super(key: key); @override @@ -40,7 +40,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -88,20 +88,16 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 10, right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .generalResult, + TranslationBase.of(context).generalResult, bold: true, ))), Container( width: 25, height: 25, child: Icon( - _isShowMoreGeneral - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -132,11 +128,8 @@ class _LaboratoryResultWidgetState extends State { model.labResultLists.length, (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, + filterName: model.labResultLists[index].filterName, + patientLabResultList: model.labResultLists[index].patientLabResultList, patient: widget.patient, isInpatient: widget.isInpatient, ), @@ -151,7 +144,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 15, ), - if (widget.details != null && widget.details.isNotEmpty) + if (widget.details != null && widget.details!.isNotEmpty) Column( children: [ InkWell( @@ -173,20 +166,16 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 10, right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .specialResult, + TranslationBase.of(context).specialResult, bold: true, ))), Container( width: 25, height: 25, child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -209,16 +198,12 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: !Helpers.isTextHtml(widget.details) + child: !Helpers.isTextHtml(widget.details!) ? AppText( - widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + widget.details ?? TranslationBase.of(context).noDataAvailable, ) : Html( - data: widget.details ?? - TranslationBase.of(context) - .noDataAvailable, + data: widget.details ?? TranslationBase.of(context).noDataAvailable, ), ), ), 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 d6f6fde2..a43ed52e 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -22,18 +22,17 @@ class LabsHomePage extends StatefulWidget { } class _LabsHomePageState extends State { - String patientType; - - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String patientType; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -50,7 +49,7 @@ class _LabsHomePageState extends State { onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, @@ -68,8 +67,7 @@ class _LabsHomePageState extends State { SizedBox( height: 12, ), - if (model.patientLabOrdersList.isNotEmpty && - patient.patientStatusType != 43) + if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -89,8 +87,7 @@ class _LabsHomePageState extends State { ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -110,8 +107,7 @@ class _LabsHomePageState extends State { ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { @@ -124,7 +120,7 @@ class _LabsHomePageState extends State { )), ); }, - label: TranslationBase.of(context).applyForNewLabOrder, + label: TranslationBase.of(context).applyForNewLabOrder ?? "", ), ...List.generate( model.patientLabOrdersList.length, @@ -145,37 +141,26 @@ class _LabsHomePageState extends State { width: 20, height: 160, decoration: BoxDecoration( - color: model.patientLabOrdersList[index] - .isLiveCareAppointment + color: model.patientLabOrdersList[index].isLiveCareAppointment! ? Colors.red[900] - : !model.patientLabOrdersList[index] - .isInOutPatient + : !model.patientLabOrdersList[index].isInOutPatient! ? 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, child: Center( child: Text( - model.patientLabOrdersList[index] - .isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.patientLabOrdersList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.patientLabOrdersList[index].isLiveCareAppointment! + ? TranslationBase.of(context).liveCare!.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient! + ? TranslationBase.of(context).inPatientLabel!.toUpperCase() + : TranslationBase.of(context).outpatient!.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -189,24 +174,18 @@ class _LabsHomePageState extends State { page: LaboratoryResultPage( patientLabOrders: model.patientLabOrdersList[index], patient: patient, - isInpatient:isInpatient, + isInpatient: isInpatient, arrivalType: arrivalType, patientType: patientType, ), ), ), - doctorName: - model.patientLabOrdersList[index].doctorName, - invoiceNO: - ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model - .patientLabOrdersList[index].doctorImageURL, - branch: - model.patientLabOrdersList[index].projectName, - clinic: model - .patientLabOrdersList[index].clinicDescription, - appointmentDate: - model.patientLabOrdersList[index].orderDate.add(Duration(days: 1)), + doctorName: model.patientLabOrdersList[index].doctorName ?? "", + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL ?? "", + branch: model.patientLabOrdersList[index].projectName ?? "", + clinic: model.patientLabOrdersList[index].clinicDescription ?? "", + appointmentDate: model.patientLabOrdersList[index].orderDate!.add(Duration(days: 1)), orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), @@ -215,8 +194,7 @@ class _LabsHomePageState extends State { ), ), ), - if (model.patientLabOrdersList.isEmpty && - patient.patientStatusType != 43) + if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 3eb3660d..3d9411a0 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -21,16 +21,14 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { - HtmlEditorController _controller = HtmlEditorController(); + HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; MedicalReportStatus status = routeArgs['status']; - MedicalReportModel medicalReport = routeArgs.containsKey("medicalReport") - ? routeArgs['medicalReport'] - : null; + MedicalReportModel medicalReport = routeArgs.containsKey("medicalReport") ? routeArgs['medicalReport'] : null; return BaseView( onModelReady: (model) => model.getMedicalReportTemplate(), @@ -38,8 +36,8 @@ class _AddVerifyMedicalReportState extends State { baseViewModel: model, isShowAppBar: true, appBarTitle: status == MedicalReportStatus.ADD - ? TranslationBase.of(context).medicalReportAdd - : TranslationBase.of(context).medicalReportVerify, + ? TranslationBase.of(context).medicalReportAdd! + : TranslationBase.of(context).medicalReportVerify!, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: Column( children: [ @@ -56,7 +54,7 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: model.medicalReportTemplate[0].templateTextHtml, + initialText: model.medicalReportTemplate[0].templateTextHtml!, height: MediaQuery.of(context).size.height * 0.75, controller: _controller, ), @@ -84,13 +82,11 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - String txtOfMedicalReport = - await _controller.getText(); + String txtOfMedicalReport = await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - model.insertMedicalReport( - patient, txtOfMedicalReport); + model.insertMedicalReport(patient, txtOfMedicalReport); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); @@ -112,8 +108,7 @@ class _AddVerifyMedicalReportState extends State { fontWeight: FontWeight.w700, onPressed: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.verifyMedicalReport( - patient, medicalReport); + await model.verifyMedicalReport(patient, medicalReport); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index 7bf6f1d9..1225eba4 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -20,7 +20,7 @@ class MedicalReportDetailPage extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -61,27 +61,29 @@ class MedicalReportDetailPage extends StatelessWidget { ], ), ), - medicalReport.reportDataHtml != null ? 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, + medicalReport.reportDataHtml != null + ? 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: Html(data: medicalReport.reportDataHtml ?? ""), + ) + : Container( + child: ErrorMessage( + error: "No Data", + ), ), - ), - ), - child: Html( - data: medicalReport.reportDataHtml ?? "" - ), - ) : Container( - child: ErrorMessage(error: "No Data",), - ), ], ), ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index e2da651b..1babfab2 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -26,7 +26,7 @@ import 'AddVerifyMedicalReport.dart'; class MedicalReportPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -75,15 +75,14 @@ class MedicalReportPage extends StatelessWidget { ), AddNewOrder( onTap: () { - Navigator.of(context) - .pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { 'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'type': MedicalReportStatus.ADD }); }, - label: TranslationBase.of(context).createNewMedicalReport, + label: TranslationBase.of(context).createNewMedicalReport!, ), if (model.state != ViewState.ErrorLocal) ...List.generate( @@ -91,33 +90,27 @@ class MedicalReportPage extends StatelessWidget { (index) => InkWell( onTap: () { if (model.medicalReportList[index].status == 1) { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_DETAIL, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'medicalReport': model.medicalReportList[index] - }); + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'medicalReport': model.medicalReportList[index] + }); } else { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_INSERT, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD, - 'medicalReport': model.medicalReportList[index] - }); + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'type': MedicalReportStatus.ADD, + 'medicalReport': model.medicalReportList[index] + }); } }, child: Container( margin: EdgeInsets.symmetric(horizontal: 8), child: CardWithBgWidget( hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 - ? Colors.red[700] - : Colors.green[700], + bgColor: model.medicalReportList[index].status == 1 ? Colors.red[700]! : Colors.green[700]!, widget: Column( children: [ Row( @@ -129,11 +122,8 @@ class MedicalReportPage extends StatelessWidget { AppText( model.medicalReportList[index].status == 1 ? TranslationBase.of(context).onHold - : TranslationBase.of(context) - .verified, - color: model.medicalReportList[index] - .status == - 1 + : TranslationBase.of(context).verified, + color: model.medicalReportList[index].status == 1 ? Colors.red[700] : Colors.green[700], fontSize: 1.4 * SizeConfig.textMultiplier, @@ -141,10 +131,8 @@ class MedicalReportPage extends StatelessWidget { ), AppText( projectViewModel.isArabic - ? model.medicalReportList[index] - .doctorNameN - : model.medicalReportList[index] - .doctorName, + ? model.medicalReportList[index].doctorNameN + : model.medicalReportList[index].doctorName, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -155,13 +143,13 @@ class MedicalReportPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn ?? "", "dd MMM yyyy")}', color: Color(0xFF2E303A), fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, ), AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn ?? "", "hh:mm a")}', color: Color(0xFF2E303A), fontWeight: FontWeight.w600, fontSize: 1.5 * SizeConfig.textMultiplier, @@ -174,16 +162,12 @@ class MedicalReportPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.only( - left: 0, top: 4, right: 8, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), child: LargeAvatar( name: projectViewModel.isArabic - ? model.medicalReportList[index] - .doctorNameN - : model.medicalReportList[index] - .doctorName, - url: model.medicalReportList[index] - .doctorImageURL, + ? model.medicalReportList[index].doctorNameN ?? "" + : model.medicalReportList[index].doctorName ?? "", + url: model.medicalReportList[index].doctorImageURL, ), width: 50, height: 50, @@ -191,27 +175,20 @@ class MedicalReportPage extends StatelessWidget { Expanded( child: Container( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( projectViewModel.isArabic - ? model.medicalReportList[index] - .projectNameN - : model.medicalReportList[index] - .projectName, - fontSize: - 1.6 * SizeConfig.textMultiplier, + ? model.medicalReportList[index].projectNameN + : model.medicalReportList[index].projectName, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0xFF2E303A), ), AppText( projectViewModel.isArabic - ? model.medicalReportList[index] - .clinicNameN - : model.medicalReportList[index] - .clinicName, - fontSize: - 1.6 * SizeConfig.textMultiplier, + ? model.medicalReportList[index].clinicNameN + : model.medicalReportList[index].clinicName, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0xFF2E303A), ), ], @@ -224,10 +201,7 @@ class MedicalReportPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ Icon( - model.medicalReportList[index].status == - 1 - ? EvaIcons.eye - : DoctorApp.edit_1, + model.medicalReportList[index].status == 1 ? EvaIcons.eye : DoctorApp.edit_1, ), ], ), diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index be912a60..cb454172 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -30,22 +30,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); + const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -54,15 +53,12 @@ class _ProgressNoteState extends State { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo ?? ""), projectID: patient.projectId, tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model - .getPatientProgressNote(progressNoteRequest.toJson(), - isLocalBusy: isLocalBusy) - .then((c) { + model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { notesList = model.patientProgressNoteList; }); } @@ -71,172 +67,109 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute - .of(context) - .settings - .arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if (routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, - // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, - patient.patientType.toString() ?? '0', - arrivalType, - isInpatient: true, - ), - body: model.patientProgressNoteList == null || - model.patientProgressNoteList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .errorNoProgressNote) - : Container( - color: Colors.grey[200], - child: Column( - children: [ - if (!isDischargedPatient) - AddNewOrder( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - )), - ); - }, - label: widget.visitType == 3 - ? TranslationBase - .of(context) - .addNewOrderSheet - : TranslationBase - .of(context) - .addProgressNote, - ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index] - .status == - 1 && - authenticationViewModel.doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index] - .status == - 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index] - .status == - 2 - ? Colors.green[600] - : Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .patientProgressNoteList[ - index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy) - AppText( - TranslationBase - .of(context) - .notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 4) + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + patient.patientType.toString() ?? '0', + arrivalType, + isInpatient: true, + ), + body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoProgressNote ?? "") + : Container( + color: Colors.grey[200], + child: Column( + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + )), + ); + }, + label: widget.visitType == 3 + ? TranslationBase.of(context).addNewOrderSheet! + : TranslationBase.of(context).addProgressNote!, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index].status == 1 && + authenticationViewModel.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index].status == 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index].status == 2 + ? Colors.green[600]! + : Color(0xFFCC9B14)!, + widget: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.patientProgressNoteList[index].status == 1 && + authenticationViewModel.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy) + AppText( + TranslationBase.of(context).notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 4) AppText( - TranslationBase - .of(context) - .noteCanceled, + TranslationBase.of(context).noteCanceled, fontWeight: FontWeight.bold, color: Colors.red.shade700, fontSize: 12, ), - if (model - .patientProgressNoteList[ - index] - .status == - 2) + if (model.patientProgressNoteList[index].status == 2) AppText( - TranslationBase - .of(context) - .noteVerified, + TranslationBase.of(context).noteVerified, fontWeight: FontWeight.bold, color: Colors.green[600], fontSize: 12, ), if (model.patientProgressNoteList[index].status != 2 && - model - .patientProgressNoteList[ - index] - .status != - 4 && - authenticationViewModel - .doctorProfile.doctorID == - model - .patientProgressNoteList[ - index] - .createdBy) + model.patientProgressNoteList[index].status != 4 && + authenticationViewModel.doctorProfile!.doctorID == + model.patientProgressNoteList[index].createdBy) Row( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model - .patientProgressNoteList[ - index], - patientModel: - model, - patient: - patient, - visitType: widget - .visitType, + builder: (context) => UpdateNoteOrder( + note: model.patientProgressNoteList[index], + patientModel: model, + patient: patient, + visitType: widget.visitType, isUpdate: true, )), ); @@ -244,9 +177,7 @@ class _ProgressNoteState extends State { child: Container( decoration: BoxDecoration( color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), + borderRadius: BorderRadius.circular(10), ), // color:Colors.red[600], @@ -261,10 +192,7 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - TranslationBase - .of( - context) - .update, + TranslationBase.of(context).update, fontSize: 10, color: Colors.white, ), @@ -282,61 +210,33 @@ class _ProgressNoteState extends State { context: context, actionName: "verify", confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: - false, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: false, + lineItemNo: model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, verifiedNote: true, - patientTypeID: - patient - .patientType, + patientTypeID: patient.patientType, patientOutSA: false, ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); }); }, child: Container( decoration: BoxDecoration( color: Colors.green[600], - borderRadius: - BorderRadius.circular( - 10), + borderRadius: BorderRadius.circular(10), ), // color:Colors.red[600], child: Row( children: [ Icon( - FontAwesomeIcons - .check, + FontAwesomeIcons.check, size: 12, color: Colors.white, ), @@ -344,10 +244,7 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - TranslationBase - .of( - context) - .noteVerify, + TranslationBase.of(context).noteVerify, fontSize: 10, color: Colors.white, ), @@ -363,67 +260,37 @@ class _ProgressNoteState extends State { onTap: () async { showMyDialog( context: context, - actionName: - TranslationBase - .of( - context) - .cancel, + actionName: TranslationBase.of(context).cancel!, confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( + GifLoaderDialogUtils.showMyDialog( context, ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), cancelledNote: true, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, + lineItemNo: model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, verifiedNote: false, - patientTypeID: - patient - .patientType, + patientTypeID: patient.patientType, patientOutSA: false, ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); }); }, child: Container( decoration: BoxDecoration( color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), + borderRadius: BorderRadius.circular(10), ), // color:Colors.red[600], child: Row( children: [ Icon( - FontAwesomeIcons - .trash, + FontAwesomeIcons.trash, size: 12, color: Colors.white, ), @@ -449,41 +316,25 @@ class _ProgressNoteState extends State { height: 10, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, + width: MediaQuery.of(context).size.width * 0.60, child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - crossAxisAlignment: - CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase - .of( - context) - .createdBy, + TranslationBase.of(context).createdBy, fontSize: 10, ), Expanded( child: AppText( - model - .patientProgressNoteList[ - index] - .doctorName ?? - '', - fontWeight: - FontWeight.w600, + model.patientProgressNoteList[index].doctorName ?? '', + fontWeight: FontWeight.w600, fontSize: 12, ), ), @@ -495,187 +346,149 @@ class _ProgressNoteState extends State { Column( children: [ AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null + model.patientProgressNoteList[index].createdOn != null ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat( - model - .patientProgressNoteList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? ""), + isArabic: projectViewModel.isArabic) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), + isArabic: projectViewModel.isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getHour(AppDateUtils - .getDateTimeFromServerFormat( - model - .patientProgressNoteList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, ), ], - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, ) ], ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .notes, - fontSize: 10, - ), - ), - ]) - ], - ), - SizedBox( - height: 20, - ), - ], + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientProgressNoteList[index].notes, + fontSize: 10, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), ), - ), - ); - }), + ); + }), + ), ), - ), - ], + ], + ), ), - ), ), ); } - showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { showDialog( context: context, builder: (ctx) => Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.8, - height: 200, - child: AppScaffold( - isShowAppBar: false, - body: Container( - color: Colors.white, - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // SizedBox(height: 20,), - SizedBox( - height: 10, - ), - Row( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 200, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + child: Center( + child: Column( mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - AppText( - TranslationBase - .of(context) - .noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, + // SizedBox(height: 20,), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), + ], + ), + SizedBox( + height: 10, + ), + DividerWithSpacesAround(), + SizedBox( + height: 12, ), - ], - ), - SizedBox( - height: 10, - ), - DividerWithSpacesAround(), - SizedBox( - height: 12, - ), - Container( - padding: EdgeInsets.all(20), - color: Colors.white, - child: AppText( - projectViewModel.isArabic?"هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟":'Are you sure you want $actionName this order?', - fontSize: 15, - textAlign: TextAlign.center, - ), - ), + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: AppText( + projectViewModel.isArabic + ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" + : 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), - SizedBox( - height: 8, + SizedBox( + height: 8, + ), + DividerWithSpacesAround(), + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + TranslationBase.of(context).cancel, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), //Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16, + ), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) + ], + ), + ) + ], ), - DividerWithSpacesAround(), - FractionallySizedBox( - widthFactor: 0.75, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - FlatButton( - child: AppText( - TranslationBase - .of(context) - .cancel, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), //Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }), - FlatButton( - child: AppText( - TranslationBase - .of(context) - .noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.red.shade700, - fontSize: 16, - ), //Text("Confirm", ), - onPressed: () async { - await confirmFun(); - Navigator.of(context).pop(); - }) - ], - ), - ) - ], + ), ), ), ), - ), - ), - ) - ); + )); } } diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 3fde4262..b2873fde 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -28,19 +28,19 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateNoteOrder extends StatefulWidget { - final NoteModel note; + final NoteModel? note; final PatientViewModel patientModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; const UpdateNoteOrder( - {Key key, + {Key? key, this.note, - this.patientModel, - this.patient, - this.visitType, - this.isUpdate}) + required this.patientModel, + required this.patient, + required this.visitType, + required this.isUpdate}) : super(key: key); @override @@ -48,12 +48,12 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { - int selectedType; + int? selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + ProjectViewModel? projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -81,7 +81,7 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note.notes; + progressNoteController.text = widget.note!.notes!; } return AppScaffold( @@ -99,12 +99,12 @@ class _UpdateNoteOrderState extends State { title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, ), SizedBox( height: 10.0, @@ -119,17 +119,13 @@ class _UpdateNoteOrderState extends State { AppTextFieldCustom( hintText: widget.visitType == 3 ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).progressNote!, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -137,26 +133,19 @@ class _UpdateNoteOrderState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: - progressNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: progressNoteController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), Positioned( - top: - -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + top: -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel!.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -173,34 +162,34 @@ class _UpdateNoteOrderState extends State { ), ), bottomSheet: Container( - height: progressNoteController.text.isNotEmpty? 130:70, + height: progressNoteController.text.isNotEmpty ? 130 : 70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ - if(progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), + if (progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + ), + ), Container( margin: EdgeInsets.all(5), child: AppButton( title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).orderSheet! : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? TranslationBase.of(context).noteUpdate! + : TranslationBase.of(context).noteAdd!) + + TranslationBase.of(context).progressNote!, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -212,26 +201,23 @@ class _UpdateNoteOrderState extends State { GifLoaderDialogUtils.showMyDialog(context); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); if (widget.isUpdate) { UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, + lineItemNo: widget.note!.lineItemNo, + createdBy: widget.note?.createdBy, notes: progressNoteController.text, verifiedNote: false, patientTypeID: widget.patient.patientType, patientOutSA: false, ); - await widget.patientModel - .updatePatientProgressNote(reqModel); + await widget.patientModel.updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( - admissionNo: - int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), createdBy: doctorProfile.doctorID, visitType: widget.visitType, patientID: widget.patient.patientId, @@ -240,28 +226,23 @@ class _UpdateNoteOrderState extends State { patientOutSA: false, notes: progressNoteController.text); - await widget.patientModel - .createPatientProgressNote(reqModel); + await widget.patientModel.createPatientProgressNote(reqModel); } if (widget.patientModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.patientModel.error); } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: - int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, - patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel.getPatientProgressNote( - progressNoteRequest.toJson()); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: int.parse(widget.patient.admissionNo!), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); + DrAppToastMsg.showSuccesToast("Your Order added Successfully"); Navigator.of(context).pop(); } else { Helpers.showErrorToast("You cant add only spaces"); @@ -276,8 +257,7 @@ class _UpdateNoteOrderState extends State { 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, @@ -321,8 +301,7 @@ class _UpdateNoteOrderState extends State { } 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; } diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index ca8be2c0..51d9fae0 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -10,17 +10,15 @@ import 'package:flutter/material.dart'; class InpatientPrescriptionDetailsScreen extends StatefulWidget { @override - _InpatientPrescriptionDetailsScreenState createState() => - _InpatientPrescriptionDetailsScreenState(); + _InpatientPrescriptionDetailsScreenState createState() => _InpatientPrescriptionDetailsScreenState(); } -class _InpatientPrescriptionDetailsScreenState - extends State { +class _InpatientPrescriptionDetailsScreenState extends State { bool _showDetails = false; - String error; - TextEditingController answerController; + String? error; + TextEditingController? answerController; bool _isInit = true; - PrescriptionReportForInPatient prescription; + late PrescriptionReportForInPatient prescription; @override void initState() { @@ -31,7 +29,7 @@ class _InpatientPrescriptionDetailsScreenState void didChangeDependencies() { super.didChangeDependencies(); if (_isInit) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; prescription = routeArgs['prescription']; } _isInit = false; @@ -40,7 +38,7 @@ class _InpatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionInfo, + appBarTitle: TranslationBase.of(context).prescriptionInfo ?? "", body: CardWithBgWidgetNew( widget: Container( child: ListView( @@ -59,9 +57,7 @@ class _InpatientPrescriptionDetailsScreenState _showDetails = !_showDetails; }); }, - child: Icon(_showDetails - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), + child: Icon(_showDetails ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ], ), !_showDetails @@ -83,52 +79,25 @@ class _InpatientPrescriptionDetailsScreenState inside: BorderSide(width: 0.5), ), children: [ + buildTableRow(des: '${prescription.direction}', key: 'Direction'), + buildTableRow(des: '${prescription.refillID}', key: 'Refill'), + buildTableRow(des: '${prescription.dose}', key: 'Dose'), + buildTableRow(des: '${prescription.unitofMeasurement}', key: 'UOM'), buildTableRow( - des: '${prescription.direction}', - key: 'Direction'), + des: '${AppDateUtils.getDate(prescription.startDatetime!)}', key: 'Start Date'), buildTableRow( - des: '${prescription.refillID}', - key: 'Refill'), + des: '${AppDateUtils.getDate(prescription.stopDatetime!)}', key: 'Stop Date'), + buildTableRow(des: '${prescription.noOfDoses}', key: 'No of Doses'), + buildTableRow(des: '${prescription.route}', key: 'Route'), + buildTableRow(des: '${prescription.comments}', key: 'Comments'), + buildTableRow(des: '${prescription.pharmacyRemarks}', key: 'Pharmacy Remarks'), buildTableRow( - des: '${prescription.dose}', key: 'Dose'), - buildTableRow( - des: '${prescription.unitofMeasurement}', - key: 'UOM'), - buildTableRow( - des: - '${AppDateUtils.getDate(prescription.startDatetime)}', - key: 'Start Date'), - buildTableRow( - des: - '${AppDateUtils.getDate(prescription.stopDatetime)}', - key: 'Stop Date'), - buildTableRow( - des: '${prescription.noOfDoses}', - key: 'No of Doses'), - buildTableRow( - des: '${prescription.route}', key: 'Route'), - buildTableRow( - des: '${prescription.comments}', - key: 'Comments'), - buildTableRow( - des: '${prescription.pharmacyRemarks}', - key: 'Pharmacy Remarks'), - buildTableRow( - des: - '${AppDateUtils.getDate(prescription.prescriptionDatetime)}', + des: '${AppDateUtils.getDate(prescription.prescriptionDatetime!)}', key: 'Prescription Date'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Status'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Created By'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Processed By'), - buildTableRow( - des: '${prescription.refillID}', - key: 'Authorized By'), + buildTableRow(des: '${prescription.refillID}', key: 'Status'), + buildTableRow(des: '${prescription.refillID}', key: 'Created By'), + buildTableRow(des: '${prescription.refillID}', key: 'Processed By'), + buildTableRow(des: '${prescription.refillID}', key: 'Authorized By'), ], ), Divider( @@ -168,8 +137,7 @@ class _InpatientPrescriptionDetailsScreenState ), Expanded( child: Container( - margin: - EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5), + margin: EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart index 50585143..75300769 100644 --- a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsItem extends StatefulWidget { final PrescriptionReport prescriptionReport; - OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport}); + OutPatientPrescriptionDetailsItem({Key? key, required this.prescriptionReport}); @override _OutPatientPrescriptionDetailsItemState createState() => diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index eb9a3eaa..c11f9ffc 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -8,23 +8,19 @@ class PatientProfileCardModel { final bool isInPatient; final bool isDisable; final bool isLoading; - final Function onTap; + final GestureTapCallback? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; + final IconData? dartIcon; - PatientProfileCardModel( - this.nameLine1, - this.nameLine2, - this.route, - this.icon, { - this.isInPatient = false, - this.isDisable = false, - this.isLoading = false, - this.onTap, - this.isDischargedPatient = false, - this.isSelectInpatient = false, - this.isDartIcon = false,this.dartIcon - }); + PatientProfileCardModel(this.nameLine1, this.nameLine2, this.route, this.icon, + {this.isInPatient = false, + this.isDisable = false, + this.isLoading = false, + this.onTap, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + this.isDartIcon = false, + this.dartIcon}); } 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..ef65c1b0 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -28,9 +28,8 @@ class PatientProfileScreen extends StatefulWidget { _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { - PatiantInformtion patient; +class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { + late PatiantInformtion patient; bool isFromSearch = false; bool isFromLiveCare = false; @@ -39,11 +38,11 @@ class _PatientProfileScreenState extends State bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; - String patientType; - String arrivalType; - String from; - String to; - TabController _tabController; + late String patientType; + late String arrivalType; + late String from; + late String to; + late TabController _tabController; int index = 0; int _activeTab = 0; @override @@ -61,7 +60,7 @@ class _PatientProfileScreenState extends State @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -79,7 +78,7 @@ class _PatientProfileScreenState extends State if (routeArgs.containsKey("isSearchAndOut")) { isSearchAndOut = routeArgs['isSearchAndOut']; } - if(routeArgs.containsKey("isFromLiveCare")) { + if (routeArgs.containsKey("isFromLiveCare")) { isFromLiveCare = routeArgs['isFromLiveCare']; } if (isInpatient) @@ -92,39 +91,37 @@ class _PatientProfileScreenState extends State Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false, - body: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).patientProfile ?? "", + isShowAppBar: false, + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) + height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 210 : 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, @@ -139,8 +136,7 @@ class _PatientProfileScreenState extends State isInpatient: isInpatient, from: from, to: to, - isDischargedPatient: - isDischargedPatient, + isDischargedPatient: isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( @@ -156,207 +152,190 @@ 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, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == - 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = - model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\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/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], + ), + ], + ), + 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, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); + GifLoaderDialogUtils.showMyDialog(context); + await model.postEpisode(postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog(context); + patient.episodeNo = model.episodeID; + Navigator.of(context) + .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + } + }, ), - )), - ], - ), - ], - ), - bottomSheet: isFromLiveCare ? Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase.of(context).update}\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/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == 43) { + Navigator.of(context) + .pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); + } + }), + ], + ), + )), + ], ), - height: MediaQuery - .of(context) - .size - .height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + ], + ), + bottomSheet: isFromLiveCare + ? Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - color: isCallFinished?Colors.red[600]:Colors.green[600], - title: isCallFinished? - TranslationBase.of(context).endCall: - 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); + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: isCallFinished ? Colors.red[600] : Colors.green[600], + title: isCallFinished + ? TranslationBase.of(context).endCall + : 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; + 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; + 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; - }); - }); - - }); - }); - } - } - - }, + }, + 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; + }); + }); + }); + }); + } + } + }, + ), + ), ), ), - ), - ), - SizedBox( - height: 5, + SizedBox( + height: 5, + ), + ], ), - ], - ), - ) : null, - ), - - + ) + : null, + ), ); } } @@ -370,12 +349,7 @@ class AvatarWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], + boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 49fa8012..a95f1c4a 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -12,7 +12,7 @@ class ProfileGridForInPatient extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double height; + final double? height; final bool isInpatient; final bool isDischargedPatient; final bool isFromSearch; @@ -20,102 +20,65 @@ class ProfileGridForInPatient extends StatelessWidget { String to; ProfileGridForInPatient( - {Key key, - this.patient, - this.patientType, - this.arrivalType, + {Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, this.height, - this.isInpatient, - this.from, - this.to, - this.isDischargedPatient, - this.isFromSearch}) + required this.isInpatient, + required this.from, + required this.to, + required this.isDischargedPatient, + required this.isFromSearch}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital ?? "", TranslationBase.of(context).signs ?? "", + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'patient/lab_results.png', + PatientProfileCardModel(TranslationBase.of(context).lab ?? "", TranslationBase.of(context).result ?? "", + LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).result, - RADIOLOGY_PATIENT, - 'patient/health_summary.png', + PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).result!, + RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).prescription!, + ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).progress, - TranslationBase.of(context).note, - PROGRESS_NOTE, + PatientProfileCardModel(TranslationBase.of(context).progress!, TranslationBase.of(context).note!, PROGRESS_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient), - PatientProfileCardModel( - TranslationBase.of(context).order, - TranslationBase.of(context).sheet, - ORDER_NOTE, + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), + PatientProfileCardModel(TranslationBase.of(context).order!, TranslationBase.of(context).sheet!, ORDER_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).medical!, TranslationBase.of(context).report!, + PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', + isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( - TranslationBase.of(context).medical, - TranslationBase.of(context).report, - PATIENT_MEDICAL_REPORT, - 'patient/health_summary.png', - isInPatient: isInpatient, - isDisable: false), - PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, REFER_IN_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).approvals, - PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).approvals!, + PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).discharge, - TranslationBase.of(context).report, - null, + PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, null, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, - isDisable: true), + isInPatient: isInpatient, isDisable: true), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase.of(context).patientSick!, + TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index c01757c5..8e1e906d 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -12,133 +12,79 @@ class ProfileGridForOther extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double height; + final double? height; final bool isInpatient; final bool isFromLiveCare; String from; String to; ProfileGridForOther( - {Key key, - this.patient, - this.patientType, - this.arrivalType, + {Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, this.height, - this.isInpatient, - this.from, - this.to, - this.isFromLiveCare}) + required this.isInpatient, + required this.from, + required this.to, + required this.isFromLiveCare}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'patient/lab_results.png', + TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, - RADIOLOGY_PATIENT, - 'patient/health_summary.png', + PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!, + RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!, + ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, - "ECG", - PATIENT_ECG, - 'patient/patient_sick_leave.png', + TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase - .of(context) - .insurance, - TranslationBase - .of(context) - .service, - PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase - .of(context) - .patientSick, - TranslationBase - .of(context) - .leave, - ADD_SICKLEAVE, - 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, + ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase - .of(context) - .patient, - TranslationBase - .of(context) - .ucaf, - PATIENT_UCAF_REQUEST, - 'patient/ucaf.png', + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, - isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 || - patient.appointmentNo == null ), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) + isDisable: isFromLiveCare + ? patient.appointmentNo == null + : patient.patientStatusType != 43 || patient.appointmentNo == null), + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( - TranslationBase - .of(context) - .referral, - TranslationBase - .of(context) - .patient, - REFER_PATIENT_TO_DOCTOR, - 'patient/refer_patient.png', - isInPatient: isInpatient, - isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 || - patient.appointmentNo == null , + TranslationBase.of(context).referral!, + TranslationBase.of(context).patient!, + REFER_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: isFromLiveCare + ? patient.appointmentNo == null + : patient.patientStatusType != 43 || patient.appointmentNo == null, ), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase - .of(context) - .admission, - TranslationBase - .of(context) - .request, - PATIENT_ADMISSION_REQUEST, - 'patient/admission_req.png', + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, - isDisable: isFromLiveCare?patient.appointmentNo == null:patient.patientStatusType != 43 || - patient.appointmentNo == null - ), + isDisable: isFromLiveCare + ? patient.appointmentNo == null + : patient.patientStatusType != 43 || patient.appointmentNo == null), ]; return Column( @@ -168,9 +114,7 @@ class ProfileGridForOther extends StatelessWidget { isDisable: cardsList[index].isDisable, onTap: cardsList[index].onTap, isLoading: cardsList[index].isLoading, - isFromLiveCare: isFromLiveCare - - ), + isFromLiveCare: isFromLiveCare), ), ), ], diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 9c9f7d36..a4e65543 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -11,101 +11,64 @@ class ProfileGridForSearch extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double height; + final double? height; final bool isInpatient; String from; String to; - ProfileGridForSearch( - {Key key, - this.patient, - this.patientType, - this.arrivalType, + ProfileGridForSearch( + {Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, this.height, - this.isInpatient, this.from,this.to}) + required this.isInpatient, + required this.from, + required this.to}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'patient/lab_results.png', + TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, - RADIOLOGY_PATIENT, - 'patient/health_summary.png', + PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!, + RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!, + ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patient, - "ECG", - PATIENT_ECG, - 'patient/patient_sick_leave.png', + TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, - PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, - ADD_SICKLEAVE, - 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, + ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, - 'patient/ucaf.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PATIENT_UCAF_REQUEST, 'patient/ucaf.png', + isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, - REFER_PATIENT_TO_DOCTOR, - 'patient/refer_patient.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel(TranslationBase.of(context).referral!, TranslationBase.of(context).patient!, + REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', + isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, - PATIENT_ADMISSION_REQUEST, - 'patient/admission_req.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', + isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), ]; return Column( diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index acc79d19..9bc0e8aa 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -14,15 +14,11 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - final String patientType; - final String arrivalType; + final String? patientType; + final String? arrivalType; RadiologyDetailsPage( - {Key key, - this.finalRadiology, - this.patient, - this.patientType, - this.arrivalType}); + {Key? key, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { @@ -66,9 +62,11 @@ class RadiologyDetailsPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), + child: AppText( + TranslationBase.of(context).generalResult, + color: Color(0xff2E303A), + ), ), - Padding( padding: const EdgeInsets.all(8.0), child: AppText( @@ -92,8 +90,7 @@ class RadiologyDetailsPage extends StatelessWidget { height: 80, width: double.maxFinite, child: Container( - margin: - EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), + margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: SecondaryButton( color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", @@ -101,7 +98,7 @@ class RadiologyDetailsPage extends StatelessWidget { onTap: () { launch(model.radImageURL); }, - label: TranslationBase.of(context).openRad, + label: TranslationBase.of(context).openRad ?? "", ), ), ) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 4e969793..a35721b8 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -22,16 +22,16 @@ class RadiologyHomePage extends StatefulWidget { } class _RadiologyHomePageState extends State { - String patientType; - PatiantInformtion patient; - String arrivalType; - bool isInpatient; - bool isFromLiveCare; + String? patientType; + late PatiantInformtion patient; + late String arrivalType; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -44,8 +44,7 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient, - patientType: patientType, isInPatient: false), + onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -65,8 +64,7 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -86,8 +84,7 @@ class _RadiologyHomePageState extends State { ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -100,31 +97,27 @@ class _RadiologyHomePageState extends State { fontSize: 13, ), AppText( - TranslationBase - .of(context) - .result, + TranslationBase.of(context).result, bold: true, fontSize: 22, ), ], ), ), - 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) => - AddRadiologyScreen( + builder: (context) => AddRadiologyScreen( patient: patient, model: model, )), ); }, - label: TranslationBase.of(context).applyForRadiologyOrder, + label: TranslationBase.of(context).applyForRadiologyOrder ?? "", ), ...List.generate( model.radiologyList.length, @@ -146,36 +139,26 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index] - .isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment! ? Colors.red[900] - : !model.radiologyList[index].isInOutPatient + : !model.radiologyList[index].isInOutPatient! ? 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, child: Center( child: Text( - model.radiologyList[index] - .isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment! + ? TranslationBase.of(context).liveCare!.toUpperCase() + : !model.radiologyList[index].isInOutPatient! + ? TranslationBase.of(context).inPatientLabel!.toUpperCase() + : TranslationBase.of(context).outpatient!.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -183,26 +166,19 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: - model.radiologyList[index].doctorName, - profileUrl: - model.radiologyList[index].doctorImageURL, - invoiceNO: - '${model.radiologyList[index].invoiceNo}', - branch: - '${model.radiologyList[index].projectName}', - clinic: model - .radiologyList[index].clinicDescription, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportDate, + model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate!, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: - model.radiologyList[index], + finalRadiology: model.radiologyList[index], patient: patient, ), ), @@ -213,8 +189,7 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index e7714074..bf883517 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -11,12 +11,12 @@ class RadiologyReportScreen extends StatelessWidget { final String reportData; final String url; - RadiologyReportScreen({Key key, this.reportData, this.url}); + RadiologyReportScreen({Key? key, required this.reportData, required this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, + appBarTitle: TranslationBase.of(context).radiologyReport ?? "", body: SingleChildScrollView( child: Column( children: [ @@ -38,7 +38,9 @@ class RadiologyReportScreen extends StatelessWidget { fontSize: 2.5 * SizeConfig.textMultiplier, ), ), - SizedBox(height:MediaQuery.of(context).size.height * 0.13 ,) + SizedBox( + height: MediaQuery.of(context).size.height * 0.13, + ) ], ), ), diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index f54a18ac..e663dc64 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -24,16 +24,14 @@ class AddReplayOnReferralPatient extends StatefulWidget { final MyReferralPatientModel myReferralInPatientModel; const AddReplayOnReferralPatient( - {Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) + {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel}) : super(key: key); @override - _AddReplayOnReferralPatientState createState() => - _AddReplayOnReferralPatientState(); + _AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState - extends State { +class _AddReplayOnReferralPatientState extends State { bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; @@ -75,11 +73,9 @@ class _AddReplayOnReferralPatientState maxLines: 35, minLines: 25, hasBorder: true, - validationError: - replayOnReferralController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: replayOnReferralController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), Positioned( top: 0, //MediaQuery.of(context).size.height * 0, @@ -137,17 +133,13 @@ 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 + .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"); + DrAppToastMsg.showSuccesToast("Your Replay Added Successfully"); Navigator.of(context).pop(); Navigator.of(context).pop(); } @@ -167,8 +159,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-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 447a3739..5a33c00d 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -17,33 +17,29 @@ import 'package:hexcolor/hexcolor.dart'; // ignore: must_be_immutable class MyReferralDetailScreen extends StatelessWidget { - PendingReferral pendingReferral; + late PendingReferral pendingReferral; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; pendingReferral = routeArgs['referral']; return BaseView( onModelReady: (model) => model.getPatientDetails( AppDateUtils.convertStringToDateFormat( - DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(), - "yyyy-MM-dd"), - AppDateUtils.convertStringToDateFormat( - DateTime.now().toString(), "yyyy-MM-dd"), - pendingReferral.patientID, - pendingReferral.sourceAppointmentNo), + DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(), "yyyy-MM-dd"), + AppDateUtils.convertStringToDateFormat(DateTime.now().toString(), "yyyy-MM-dd"), + pendingReferral.patientID!, + pendingReferral.sourceAppointmentNo!), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: false, - body: model.patientArrivalList != null && - model.patientArrivalList.length > 0 + body: model.patientArrivalList != null && model.patientArrivalList.length > 0 ? Column( children: [ Container( - padding: - EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), @@ -62,18 +58,13 @@ class MyReferralDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize(model - .patientArrivalList[0] - .patientDetails - .fullName)), + (Helpers.capitalize(model.patientArrivalList[0].patientDetails!.fullName)), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), ), - model.patientArrivalList[0].patientDetails - .gender == - 1 + model.patientArrivalList[0].patientDetails!.gender == 1 ? Icon( DoctorApp.male_2, color: Colors.blue, @@ -93,7 +84,7 @@ class MyReferralDetailScreen extends StatelessWidget { width: 60, height: 60, child: Image.asset( - pendingReferral.patientDetails.gender == 1 + pendingReferral.patientDetails?.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -107,148 +98,106 @@ class MyReferralDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - pendingReferral.referralStatus != null - ? pendingReferral.referralStatus - : "", + pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "", fontFamily: 'Poppins', - fontSize: - 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: pendingReferral - .referralStatus != - null - ? pendingReferral - .referralStatus == - 'Pending' + color: pendingReferral.referralStatus != null + ? pendingReferral.referralStatus == 'Pending' ? Color(0xffc4aa54) - : pendingReferral - .referralStatus == - 'Accepted' + : pendingReferral.referralStatus == 'Accepted' ? Colors.green[700] : Colors.red[700] : Colors.grey[500], ), AppText( - pendingReferral.referredOn - .split(" ")[0], + pendingReferral.referredOn!.split(" ")[0], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], ), 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( "${pendingReferral.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), AppText( - pendingReferral.referredOn - .split(" ")[1], + pendingReferral.referredOn!.split(" ")[1], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .referredFrom, + TranslationBase.of(context).referredFrom, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig - .textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( - pendingReferral - .isReferralDoctorSameBranch - ? TranslationBase.of( - context) - .sameBranch - : TranslationBase.of( - context) - .otherBranch, + pendingReferral.isReferralDoctorSameBranch! + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig - .textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .remarks + - " : ", + TranslationBase.of(context).remarks ?? "" + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig - .textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - pendingReferral - .remarksFromSource, + pendingReferral.remarksFromSource, fontFamily: 'Poppins', - fontWeight: - FontWeight.w700, - fontSize: 1.8 * - SizeConfig - .textMultiplier, + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -260,35 +209,22 @@ class MyReferralDetailScreen extends StatelessWidget { Row( children: [ AppText( - pendingReferral.patientDetails - .nationalityName != - null - ? pendingReferral - .patientDetails - .nationalityName + pendingReferral.patientDetails!.nationalityName != null + ? pendingReferral.patientDetails!.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * - SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - pendingReferral - .nationalityFlagUrl != - null + pendingReferral.nationalityFlagUrl != null ? ClipRRect( - borderRadius: - BorderRadius.circular( - 20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - pendingReferral - .nationalityFlagUrl, + pendingReferral.nationalityFlagUrl ?? "", height: 25, width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace - stackTrace) { + errorBuilder: (BuildContext context, Object exception, + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -298,12 +234,10 @@ class MyReferralDetailScreen extends StatelessWidget { ], ), Row( - crossAxisAlignment: - CrossAxisAlignment.start, + 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, @@ -311,43 +245,29 @@ class MyReferralDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, height: 40, child: CircleAvatar( radius: 25.0, - backgroundImage: NetworkImage( - pendingReferral - .doctorImageUrl), - backgroundColor: - Colors.transparent, + backgroundImage: NetworkImage(pendingReferral.doctorImageUrl ?? ""), + backgroundColor: Colors.transparent, ), ), ), Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 25, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), child: Column( children: [ AppText( - pendingReferral - .referredByDoctorInfo, + pendingReferral.referredByDoctorInfo, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -375,14 +295,13 @@ class MyReferralDetailScreen extends StatelessWidget { height: 16, ), Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16), + padding: const EdgeInsets.symmetric(horizontal: 16), child: SizedBox( child: ProfileMedicalInfoWidgetSearch( patient: model.patientArrivalList[0], patientType: "7", - from: null, - to: null, + from: "", + to: "", ), ), ), @@ -404,14 +323,11 @@ class MyReferralDetailScreen extends StatelessWidget { hPadding: 8, vPadding: 12, onPressed: () async { - await model.responseReferral( - pendingReferral, true); + await model.responseReferral(pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .referralSuccessMsgAccept); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); Navigator.pop(context); Navigator.pop(context); } @@ -430,14 +346,11 @@ class MyReferralDetailScreen extends StatelessWidget { hPadding: 8, vPadding: 12, onPressed: () async { - await model.responseReferral( - pendingReferral, true); + await model.responseReferral(pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .referralSuccessMsgReject); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); Navigator.pop(context); Navigator.pop(context); } @@ -464,7 +377,6 @@ class MyReferralDetailScreen extends StatelessWidget { "", fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), ), 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..40e263f3 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -11,7 +11,6 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyReferralInPatientScreen extends StatelessWidget { - @override Widget build(BuildContext context) { return BaseView( @@ -19,7 +18,7 @@ class MyReferralInPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient ?? "", body: model.myReferralPatients.isEmpty ? Center( child: Column( @@ -55,30 +54,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), - referredTime: AppDateUtils.getTimeHHMMA(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), ), ), ), diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index fe6fd2db..03488886 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -12,13 +12,12 @@ import '../../../../routes.dart'; class MyReferralPatientScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return BaseView( onModelReady: (model) => model.getPendingReferralPatients(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient ?? "", body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( child: Column( @@ -51,49 +50,30 @@ class MyReferralPatientScreen extends StatelessWidget { model.pendingReferral.length, (index) => InkWell( onTap: () { - Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, - arguments: { - 'referral': model.pendingReferral[index] - }); + Navigator.of(context) + .pushNamed(MY_REFERRAL_DETAIL, arguments: {'referral': model.pendingReferral[index]}); }, child: PatientReferralItemWidget( - referralStatus: - model.pendingReferral[index].referralStatus, - patientName: - model.pendingReferral[index].patientName, - patientGender: model - .pendingReferral[index].patientDetails.gender, - referredDate: model - .pendingReferral[index].referredOn - .split(" ")[0], - referredTime: model - .pendingReferral[index].referredOn - .split(" ")[1], - patientID: - "${model.pendingReferral[index].patientID}", - isSameBranch: model.pendingReferral[index] - .isReferralDoctorSameBranch, + referralStatus: model.pendingReferral[index].referralStatus, + patientName: model.pendingReferral[index].patientName, + patientGender: model.pendingReferral[index].patientDetails?.gender, + referredDate: model.pendingReferral[index].referredOn!.split(" ")[0], + referredTime: model.pendingReferral[index].referredOn!.split(" ")[1], + patientID: "${model.pendingReferral[index].patientID}", + isSameBranch: model.pendingReferral[index].isReferralDoctorSameBranch, isReferral: true, - remark: - model.pendingReferral[index].remarksFromSource, - nationality: model.pendingReferral[index] - .patientDetails.nationalityName, - nationalityFlag: - model.pendingReferral[index].nationalityFlagUrl, - doctorAvatar: - model.pendingReferral[index].doctorImageUrl, - referralDoctorName: model - .pendingReferral[index].referredByDoctorInfo, + remark: model.pendingReferral[index].remarksFromSource, + nationality: model.pendingReferral[index].patientDetails!.nationalityName, + nationalityFlag: model.pendingReferral[index].nationalityFlagUrl, + doctorAvatar: model.pendingReferral[index].doctorImageUrl, + referralDoctorName: model.pendingReferral[index].referredByDoctorInfo, clinicDescription: null, infoIcon: InkWell( onTap: () { - Navigator.of(context) - .pushNamed(MY_REFERRAL_DETAIL, arguments: { - 'referral': model.pendingReferral[index] - }); + Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, + arguments: {'referral': model.pendingReferral[index]}); }, - child: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), + child: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), ), ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de1d5958..d87fdc39 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -18,9 +18,8 @@ class PatientReferralScreen extends StatefulWidget { } class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - - TabController _tabController; - int index=0; + late TabController _tabController; + int index = 0; @override void initState() { @@ -41,12 +40,11 @@ class _PatientReferralScreen extends State with SingleTic _tabController.dispose(); } - @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).patientsreferral, + appBarTitle: TranslationBase.of(context).patientsreferral!, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, @@ -57,9 +55,7 @@ class _PatientReferralScreen extends State with SingleTic height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 1), //width: 0.7 + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 1), //width: 0.7 ), color: Colors.white), child: Center( @@ -69,24 +65,20 @@ class _PatientReferralScreen extends State with SingleTic 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), + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 0 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), + index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -103,17 +95,14 @@ class _PatientReferralScreen extends State with SingleTic ), Container( width: MediaQuery.of(context).size.width * 0.34, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 1 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), + index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -131,16 +120,13 @@ class _PatientReferralScreen extends State with SingleTic Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 2 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), + index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -155,7 +141,6 @@ class _PatientReferralScreen extends State with SingleTic ), ), ), - ], ), ), 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..dc7da44d 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,14 +25,12 @@ 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 { - PatiantInformtion patient; - List referToList; +class _PatientMakeInPatientReferralScreenState extends State { + late PatiantInformtion patient; + late List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; @@ -41,13 +39,13 @@ class _PatientMakeInPatientReferralScreenState final _remarksController = TextEditingController(); final _extController = TextEditingController(); int _activePriority = 1; - String appointmentDate; + late String appointmentDate; - String branchError; - String hospitalError; - String clinicError; - String doctorError; - String frequencyError; + late String branchError; + late String hospitalError; + late String clinicError; + late String doctorError; + late String frequencyError; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); @@ -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,28 +110,21 @@ 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; } @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; 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 - }; + referToList = []; + dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; + dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; referToList.add(sameBranch); referToList.add(otherBranch); @@ -144,7 +134,7 @@ class _PatientMakeInPatientReferralScreenState onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, @@ -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,34 +474,29 @@ class _PatientMakeInPatientReferralScreenState onPressed: () async { setState(() { if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; + branchError = TranslationBase.of(context).fieldRequired!; } else { - branchError = null; + branchError = null!; } if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; + hospitalError = TranslationBase.of(context).fieldRequired!; } else { - hospitalError = null; + hospitalError = null!; } if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context).fieldRequired!; } else { - clinicError = null; + clinicError = null!; } if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context).fieldRequired!; } else { - doctorError = null; + doctorError = null!; } if (_selectedFrequency == null) { - frequencyError = - TranslationBase.of(context).fieldRequired; + frequencyError = TranslationBase.of(context).fieldRequired!; } else { - frequencyError = null; + frequencyError = null!; } }); if (_selectedFrequency == 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); } } @@ -596,14 +538,13 @@ class _PatientMakeInPatientReferralScreenState Widget priorityBar(BuildContext _context, Size screenSize) { List _priorities = [ - TranslationBase.of(context).veryUrgent.toUpperCase(), - TranslationBase.of(context).urgent.toUpperCase(), - TranslationBase.of(context).routine.toUpperCase(), + TranslationBase.of(context).veryUrgent!.toUpperCase(), + TranslationBase.of(context).urgent!.toUpperCase(), + TranslationBase.of(context).routine!.toUpperCase(), ]; 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/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 6a25b9a1..772f2f90 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -21,24 +21,23 @@ import 'package:hexcolor/hexcolor.dart'; class PatientMakeReferralScreen extends StatefulWidget { // previous design page is: ReferPatientScreen @override - _PatientMakeReferralScreenState createState() => - _PatientMakeReferralScreenState(); + _PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState(); } class _PatientMakeReferralScreenState extends State { - PatiantInformtion patient; - List referToList; + late PatiantInformtion patient; + late List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; dynamic _selectedDoctor; - DateTime appointmentDate; + late DateTime appointmentDate; final _remarksController = TextEditingController(); - String branchError = null; - String hospitalError = null; - String clinicError = null; - String doctorError = null; + String? branchError = null; + String? hospitalError = null; + String? clinicError = null; + String? doctorError = null; @override void initState() { @@ -49,20 +48,14 @@ class _PatientMakeReferralScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - referToList = List(); - dynamic sameBranch = { - "id": 1, - "name": TranslationBase.of(context).sameBranch - }; - dynamic otherBranch = { - "id": 2, - "name": TranslationBase.of(context).otherBranch - }; + referToList = []; + dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; + dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; referToList.add(sameBranch); referToList.add(otherBranch); @@ -72,10 +65,9 @@ class _PatientMakeReferralScreenState extends State { onModelReady: (model) => model.getPatientReferral(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referPatient!, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), body: SingleChildScrollView( child: Container( child: Column( @@ -109,57 +101,25 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? referralForm(model, screenSize) : PatientReferralItemWidget( - referralStatus: model - .patientReferral[ - model.patientReferral.length - 1] - .referralStatus, - patientName: model - .patientReferral[ - model.patientReferral.length - 1] - .patientName, - patientGender: model - .patientReferral[ - model.patientReferral.length - 1] - .patientDetails - .gender, - referredDate: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[0], - referredTime: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[1], - patientID: - "${model.patientReferral[model.patientReferral.length - 1].patientID}", - isSameBranch: model - .patientReferral[ - model.patientReferral.length - 1] - .isReferralDoctorSameBranch, + referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus, + patientName: model.patientReferral[model.patientReferral.length - 1].patientName, + patientGender: + model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender, + referredDate: + model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[0], + referredTime: + model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[1], + patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", + isSameBranch: + model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, isReferral: true, - remark: model - .patientReferral[ - model.patientReferral.length - 1] - .remarksFromSource, - nationality: model - .patientReferral[ - model.patientReferral.length - 1] - .patientDetails - .nationalityName, - nationalityFlag: model - .patientReferral[ - model.patientReferral.length - 1] - .nationalityFlagUrl, - doctorAvatar: model - .patientReferral[ - model.patientReferral.length - 1] - .doctorImageUrl, - referralDoctorName: model - .patientReferral[ - model.patientReferral.length - 1] - .referredByDoctorInfo, + remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource, + nationality: + model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName, + nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl, + doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl, + referralDoctorName: + model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo, clinicDescription: null, ), ], @@ -174,28 +134,24 @@ class _PatientMakeReferralScreenState extends State { onPressed: () { setState(() { if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; + branchError = TranslationBase.of(context).fieldRequired!; } else { - branchError = null; + branchError = null!; } if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; + hospitalError = TranslationBase.of(context).fieldRequired!; } else { - hospitalError = null; + hospitalError = null!; } if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context).fieldRequired!; } else { - clinicError = null; + clinicError = null!; } if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context).fieldRequired!; } else { - doctorError = null; + doctorError = null!; } }); if (appointmentDate == null || @@ -204,16 +160,10 @@ class _PatientMakeReferralScreenState extends State { _selectedDoctor == null || _remarksController.text == null) return; model - .makeReferral( - patient, - appointmentDate.toIso8601String(), - _selectedBranch['facilityId'], - _selectedClinic['ClinicID'], - _selectedDoctor['DoctorID'], - _remarksController.text) + .makeReferral(patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'], + _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) .then((_) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).referralSuccessMsg); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); }); }, @@ -259,8 +209,7 @@ class _PatientMakeReferralScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); await model .getClinics(_selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); + .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } @@ -287,47 +236,42 @@ class _PatientMakeReferralScreenState extends State { 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, - onClick: model.branchesList != null && - model.branchesList.length > 0 && - _referTo != null && - _referTo['id'] == 2 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.branchesList, - attributeName: 'facilityName', - attributeValueId: 'facilityId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedBranch = selectedValue; - _selectedClinic = null; - _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinics(_selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, + onClick: + model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.branchesList, + attributeName: 'facilityName', + attributeValueId: 'facilityId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() async { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinics(_selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, ), SizedBox( height: 10, @@ -335,15 +279,11 @@ class _PatientMakeReferralScreenState extends State { 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, - onClick: _selectedBranch != null && - model.clinicsList != null && - model.clinicsList.length > 0 + onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.clinicsList, @@ -358,12 +298,8 @@ class _PatientMakeReferralScreenState extends State { _selectedClinic = selectedValue; GifLoaderDialogUtils.showMyDialog(context); await model - .getClinicDoctors( - patient, - _selectedClinic['ClinicID'], - _selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); + .getClinicDoctors(patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } @@ -386,14 +322,11 @@ class _PatientMakeReferralScreenState extends State { 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 + onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.doctorsList, @@ -418,12 +351,9 @@ class _PatientMakeReferralScreenState extends State { } : () { 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"); + 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"); } }, ), @@ -433,16 +363,16 @@ class _PatientMakeReferralScreenState extends State { AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).date, - dropDownText: appointmentDate != null - ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" - : null, + dropDownText: + appointmentDate != null ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null, enabled: false, isTextFieldHasSuffix: true, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + Icons.calendar_today, + color: Colors.black, + )), onClick: () { _selectDate(context, model); }, @@ -465,7 +395,7 @@ class _PatientMakeReferralScreenState extends State { _selectDate(BuildContext context, PatientReferralViewModel model) async { // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://stackoverflow.com/a/63147062/6246772 to customize a date picker - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: appointmentDate, firstDate: DateTime.now().add(Duration(hours: 2)), 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..1e48aafd 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,8 +19,7 @@ import 'AddReplayOnReferralPatient.dart'; 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) { @@ -51,8 +50,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', @@ -69,18 +67,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( @@ -97,18 +91,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( @@ -143,11 +133,10 @@ class ReferralPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -159,7 +148,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -169,35 +158,30 @@ 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), ), ], ), AppText( AppDateUtils.getTimeHHMMA( - referredPatient.referralDate, + referredPatient.referralDate!, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -207,60 +191,48 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.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), ), AppText( - referredPatient - .referringClinicDescription, + referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * - SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), 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), ), ), @@ -272,29 +244,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'); }, )) @@ -308,8 +273,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -320,8 +284,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -332,9 +295,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -343,12 +304,10 @@ class ReferralPatientDetailScreen extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + referredPatient.mAXResponseTime!, "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -358,8 +317,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, @@ -367,26 +325,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, + referredPatient.doctorImageURL!, height: 25, width: 30, errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -402,30 +351,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), ), ], diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index dc2bf798..4f9e0dcb 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -19,9 +19,8 @@ class ReferredPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referredPatient, - body: model.listMyReferredPatientModel == null || - model.listMyReferredPatientModel.length == 0 + appBarTitle: TranslationBase.of(context).referredPatient!, + body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 ? Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -60,55 +59,31 @@ class ReferredPatientScreen extends StatelessWidget { Navigator.push( context, FadePage( - page: ReferredPatientDetailScreen( - model.getReferredPatientItem(index)), + page: ReferredPatientDetailScreen(model.getReferredPatientItem(index)), ), ); }, child: PatientReferralItemWidget( - referralStatus:model.getReferredPatientItem(index).referralStatusDesc, - referralStatusCode: model - .getReferredPatientItem(index) - .referralStatus, + 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, + patientGender: model.getReferredPatientItem(index).gender, referredDate: AppDateUtils.convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "dd/MM/yyyy"), + 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, + 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, + 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), + clinicDescription: model.getReferredPatientItem(index).referralClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), ), ), 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..bd722b59 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 @@ -50,8 +50,7 @@ class ReferredPatientDetailScreen 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', @@ -68,18 +67,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(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( @@ -93,19 +88,15 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( - onTap: (){ - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + onTap: () { + PatiantInformtion patient = model.getPatientFromReferral(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: Column( @@ -142,8 +133,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( referredPatient.referralStatusDesc, @@ -158,8 +148,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "dd MMM,yyyy"), + referredPatient.referralDate ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -168,20 +157,16 @@ class ReferredPatientDetailScreen 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( @@ -195,8 +180,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "hh:mm a"), + referredPatient.referralDate ?? "", "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -205,29 +189,25 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.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 - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -237,25 +217,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), 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: 14, @@ -270,29 +244,22 @@ class ReferredPatientDetailScreen 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'); }, )) @@ -306,8 +273,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority ?? "" + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -327,9 +293,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime ?? "" + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -338,12 +302,10 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + referredPatient.mAXResponseTime ?? "", "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -353,8 +315,7 @@ class ReferredPatientDetailScreen 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_left.png', height: 50, @@ -362,26 +323,17 @@ class ReferredPatientDetailScreen 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, + referredPatient.doctorImageURL ?? "", height: 25, width: 30, errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -397,30 +349,22 @@ class ReferredPatientDetailScreen 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.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -477,19 +421,16 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only( - left: 0, top: 0, right: 4, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: referredPatient.doctorImageURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL, + referredPatient.doctorImageURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -514,8 +455,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient - .referredDoctorRemarks.isNotEmpty + referredPatient.referredDoctorRemarks!.isNotEmpty ? referredPatient.referredDoctorRemarks : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', @@ -533,31 +473,28 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: AppButton( - title: TranslationBase.of(context).acknowledged, - color: Colors.red[700], - fontColor: Colors.white, - fontWeight: FontWeight.w700, - fontSize: 1.8, - hPadding: 8, - vPadding: 12, - disabled: referredPatient.referredDoctorRemarks.isNotEmpty - ? false - : true, - onPressed: () async { - await model.verifyReferralDoctorRemarks(referredPatient); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast( - "Referral is acknowledged"); - Navigator.pop(context); - } - }, - ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: AppButton( + title: TranslationBase.of(context).acknowledged, + color: Colors.red[700], + fontColor: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 1.8, + hPadding: 8, + vPadding: 12, + disabled: referredPatient.referredDoctorRemarks!.isNotEmpty ? false : true, + onPressed: () async { + await model.verifyReferralDoctorRemarks(referredPatient); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast("Referral is acknowledged"); + Navigator.pop(context); + } + }, ), + ), ], ), ), diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a30842f8..14702f81 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -28,17 +28,16 @@ import 'package:provider/provider.dart'; class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final List mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) - addSelectedAssessment; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; AddAssessmentDetails( - {Key key, - this.mySelectedAssessment, - this.addSelectedAssessment, - this.patientInfo, + {Key? key, + required this.mySelectedAssessment, + required this.addSelectedAssessment, + required this.patientInfo, this.isUpdate = false, - this.mySelectedAssessmentList}); + required this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -59,48 +58,37 @@ class _AddAssessmentDetailsState extends State { ProjectViewModel projectViewModel = Provider.of(context); remarkController.text = widget.mySelectedAssessment.remark ?? ""; - appointmentIdController.text = - widget.mySelectedAssessment.appointmentId.toString(); + appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); if (widget.isUpdate) { if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr - : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; if (widget.mySelectedAssessment.selectedDiagnosisType != null) typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr - : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; + ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn ?? ""; if (widget.mySelectedAssessment.selectedICD != null) - icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + icdNameController.text = widget.mySelectedAssessment.selectedICD!.code; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon, String validationError}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {IconData? icon, String? validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: + BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -135,233 +123,178 @@ class _AddAssessmentDetailsState extends State { child: Center( child: Column( children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addAssessmentDetails), + BottomSheetTitle(title: TranslationBase.of(context).addAssessmentDetails!), FractionallySizedBox( widthFactor: 0.9, child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - // height: 55.0, - hintText: - TranslationBase.of(context).appointmentNumber, - isTextFieldHasSuffix: false, - enabled: false, - controller: appointmentIdController, - ), - ), - SizedBox( - height: 10, - ), - Container( - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - child: widget - .mySelectedAssessment.selectedICD == - null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - widget.mySelectedAssessment - .selectedICD == - null, - child: AutoCompleteTextField< - MasterKeyModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = - '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: AppText( - suggestion.description + - " / " + - suggestion.code - .toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - hintText: TranslationBase.of(context) - .nameOrICD, - maxLines: 2, - minLines: 1, - controller: icdNameController, - enabled: true, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), - )), - ), - SizedBox( - height: 7, - ), - AppTextFieldCustom( - onClick: model.listOfDiagnosisCondition != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - conditionController - .text = projectViewModel - .isArabic - ? widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameAr - : widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).condition, - maxLines: 2, - minLines: 1, - controller: conditionController, - isTextFieldHasSuffix: true, - enabled: false, - hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - onClick: model.listOfDiagnosisType != null + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + // height: 55.0, + hintText: TranslationBase.of(context).appointmentNumber, + isTextFieldHasSuffix: false, + enabled: false, + controller: appointmentIdController, + ), + ), + SizedBox( + height: 10, + ), + Container( + child: InkWell( + onTap: model.listOfICD10 != null ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisType = - selectedValue; - typeController.text = - projectViewModel.isArabic - ? selectedValue.nameAr - : selectedValue.nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null!; + }); } : null, - hintText: TranslationBase.of(context).dType, - maxLines: 2, - minLines: 1, - enabled: false, - isTextFieldHasSuffix: true, - controller: typeController, - hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null + child: widget.mySelectedAssessment.selectedICD == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, + child: AutoCompleteTextField( + decoration: TextFieldsUtils.textFieldSelectorDecoration( + TranslationBase.of(context).nameOrICD!, "", true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment.selectedICD = item; + icdNameController.text = '${item.code.trim()}/${item.description}'; + }), + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => new Padding( + child: AppText(suggestion.description + " / " + suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.code.toLowerCase().startsWith(input.toLowerCase()), + ), + ) + : AppTextFieldCustom( + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null!; + }); + } + : null, + hintText: TranslationBase.of(context).nameOrICD, + maxLines: 2, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () {}, + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + )), + ), + SizedBox( + height: 7, + ), + AppTextFieldCustom( + onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; + conditionController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" + : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).condition, + maxLines: 2, + minLines: 1, + controller: conditionController, + isTextFieldHasSuffix: true, + enabled: false, + hasBorder: true, + validationError: + isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).remarks, - maxLines: 18, - minLines: 5, - inputType: TextInputType.multiline, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = - remarkController.text; - }, - ), - ), - SizedBox( - height: 10, - ), - ])), + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; + typeController.text = + (projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn)!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).dType, + maxLines: 2, + minLines: 1, + enabled: false, + isTextFieldHasSuffix: true, + controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + maxLines: 18, + minLines: 5, + inputType: TextInputType.multiline, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = remarkController.text; + }, + ), + ), + SizedBox( + height: 10, + ), + ])), ), ], ), @@ -389,30 +322,21 @@ class _AddAssessmentDetailsState extends State { child: AppButton( fontWeight: FontWeight.w700, color: Colors.green, - title: (widget.isUpdate - ? 'Update Assessment Details' - : 'Add Assessment Details'), + title: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), loading: model.state == ViewState.BusyLocal, onPressed: () async { setState(() { isFormSubmitted = true; }); - widget.mySelectedAssessment.remark = - remarkController.text; - widget.mySelectedAssessment.appointmentId = - int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment - .selectedDiagnosisCondition != - null && - widget.mySelectedAssessment - .selectedDiagnosisType != - null && + widget.mySelectedAssessment.remark = remarkController.text; + widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD != null) { await submitAssessment( isUpdate: widget.isUpdate, model: model, - mySelectedAssessment: - widget.mySelectedAssessment); + mySelectedAssessment: widget.mySelectedAssessment); } }, ), @@ -431,9 +355,7 @@ class _AddAssessmentDetailsState extends State { } submitAssessment( - {SOAPViewModel model, - MySelectedAssessment mySelectedAssessment, - bool isUpdate = false}) async { + {required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -441,25 +363,24 @@ class _AddAssessmentDetailsState extends State { appointmentNo: widget.patientInfo.appointmentNo, remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code, + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code, prevIcdCode10ID: mySelectedAssessment.icdCode10ID); await model.patchAssessment(patchAssessmentReqModel); } else { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ + PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code) + conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, + icdcode10Id: mySelectedAssessment.selectedICD!.code) ]); await model.postAssessment(postAssessmentRequestModel); @@ -471,7 +392,7 @@ class _AddAssessmentDetailsState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; if (!isUpdate) { diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 4f48ff27..91d42e96 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -29,13 +29,14 @@ class UpdateAssessmentPage extends StatefulWidget { List mySelectedAssessmentList; final PatiantInformtion patientInfo; final Function changeLoadingState; - final int currentIndex; + final int currentIndex; UpdateAssessmentPage( - {Key key, - this.changePageViewIndex, - this.mySelectedAssessmentList, - this.patientInfo, - this.changeLoadingState, this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.mySelectedAssessmentList, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -68,33 +69,30 @@ class _UpdateAssessmentPageState extends State { await model.getMasterLookup(MasterKeysService.ICD10); } model.patientAssessmentList.forEach((element) { - MasterKeyModel diagnosisType = model.getOneMasterKey( + MasterKeyModel? diagnosisType = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisType, id: element.diagnosisTypeID, ); - MasterKeyModel selectedICD = model.getOneMasterKey( + MasterKeyModel? selectedICD = model.getOneMasterKey( masterKeys: MasterKeysService.ICD10, id: element.icdCode10ID, ); - MasterKeyModel diagnosisCondition = model.getOneMasterKey( + MasterKeyModel? diagnosisCondition = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - if (diagnosisCondition != null && - diagnosisType != null && - diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = - MySelectedAssessment( - appointmentId: element.appointmentNo, - remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID); + if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); widget.mySelectedAssessmentList.add(temMySelectedAssessment); } @@ -104,229 +102,155 @@ class _UpdateAssessmentPageState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - - color: Theme - .of(context) - .scaffoldBackgroundColor, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), - - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).assessment - , - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addAssessment}",onTap: () { - openAssessmentDialog(context, - isUpdate: false, model: model); - },), - - SizedBox( - height: 20, - ), - Column( - children: widget.mySelectedAssessmentList - .map((assessment) { - return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), - ), - new TextSpan( - text: assessment - .selectedICD.code - .trim() - .toUpperCase() ?? - "", - ), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment, + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + SOAPOpenItems( + label: "${TranslationBase.of(context).addAssessment}", + onTap: () { + openAssessmentDialog(context, isUpdate: false, model: model); + }, + ), + SizedBox( + height: 20, + ), + Column( + children: widget.mySelectedAssessmentList.map((assessment) { + return Container( + margin: EdgeInsets.only(left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RichText( text: new TextSpan( style: new TextStyle( - fontSize: 16, + fontSize: 12, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontWeight: FontWeight.w600), children: [ new TextSpan( - text: assessment - .selectedICD.description - .toString(), + text: "ICD : ".toUpperCase(), + ), + new TextSpan( + text: assessment.selectedICD!.code.trim().toUpperCase() ?? "", ), ], ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, - style: new TextStyle( - color: Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment - .appointmentId.toString() - - ?? - "", + Container( + width: MediaQuery.of(context).size.width * 0.50, + child: RichText( + text: new TextSpan( style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), - ), + fontSize: 16, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: assessment.selectedICD!.description.toString(), + ), + ], ), - ], + ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - color: Color(0xFF575757), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of(context).appointmentNo, + style: new TextStyle( + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), + new TextSpan( + text: assessment.appointmentId.toString() ?? "", + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), - ), - ], + ], + ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .dType + - ' : ', - style: new TextStyle( - color: Color(0xFF575757), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of(context).condition! + " : ", + style: new TextStyle( + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), + new TextSpan( + text: projectViewModel.isArabic + ? assessment.selectedDiagnosisCondition!.nameAr + : assessment.selectedDiagnosisCondition!.nameEn, + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), - ), - ], + ], + ), ), - ), - if (assessment.doctorName != null) RichText( text: new TextSpan( style: new TextStyle( fontSize: 12, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .doc + - ' : ', + text: TranslationBase.of(context).dType! + ' : ', style: new TextStyle( color: Color(0xFF575757), ), ), new TextSpan( - text: - assessment.doctorName ?? - '', + text: projectViewModel.isArabic + ? assessment.selectedDiagnosisType!.nameAr + : assessment.selectedDiagnosisType!.nameEn, style: new TextStyle( fontSize: 14, color: Color(0xFF2B353E), @@ -335,203 +259,193 @@ class _UpdateAssessmentPageState extends State { ], ), ), - SizedBox( - height: 6, - ), - - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - (assessment.remark != null || - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600 - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.38, - child: AppText( - assessment.remark ?? "", - fontSize: 11, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + if (assessment.doctorName != null) + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of(context).doc! + ' : ', + style: new TextStyle( + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: assessment.doctorName ?? '', + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), + ), + ], ), ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( - children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, - ), AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + (assessment.remark != null || assessment.remark != '') + ? TranslationBase.of(context).remarks! + " : " + : '', + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + Container( + width: MediaQuery.of(context).size.width * 0.38, + child: AppText( + assessment.remark ?? "", + fontSize: 11, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), - ], + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Row( + children: [ + Column( + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + DateTime.parse(assessment.createdOn ?? "")) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + assessment.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse(assessment.createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, assessment: assessment, model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, ), - ], - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, - ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon( - DoctorApp.edit, size: 18,), - ) - ], - ), - ], - ), - ); - }).toList(), - ) - ], - ) - ]), - isExpanded: isAssessmentExpand, - ), - SizedBox( - height: 130, - ), - ], + ) + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ) + ]), + isExpanded: isAssessmentExpand, + ), + SizedBox( + height: 130, + ), + ], + ), ), ), ), ), - ), - bottomSheet:Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase - .of(context) - .assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, - ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(1); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], ), - ], + ), ), ), - ),), - SizedBox( - height: 5, - ), - ], - ),) - - ), + SizedBox( + height: 5, + ), + ], + ), + )), ); } openAssessmentDialog(BuildContext context, - {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { + {MySelectedAssessment? assessment, required bool isUpdate, required SOAPViewModel model}) { if (assessment == null) { - assessment = MySelectedAssessment( - remark: '', appointmentId: widget.patientInfo.appointmentNo); + assessment = MySelectedAssessment(remark: '', appointmentId: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -539,12 +453,11 @@ class _UpdateAssessmentPageState extends State { context: context, builder: (context) { return AddAssessmentDetails( - mySelectedAssessment: assessment, + mySelectedAssessment: assessment!, patientInfo: widget.patientInfo, isUpdate: isUpdate, mySelectedAssessmentList: widget.mySelectedAssessmentList, - addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, - bool isUpdate) async { + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { widget.mySelectedAssessmentList.add(mySelectedAssessment); }); @@ -552,4 +465,3 @@ class _UpdateAssessmentPageState extends State { }); } } - diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index d98e17be..ddc6d10f 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -19,9 +19,7 @@ class AddExaminationPage extends StatefulWidget { final Function(MasterKeyModel) removeExamination; AddExaminationPage( - {this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}); + {required this.mySelectedExamination, required this.addSelectedExamination, required this.removeExamination}); @override _AddExaminationPageState createState() => _AddExaminationPageState(); @@ -31,77 +29,74 @@ class _AddExaminationPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - if (model.physicalExaminationList.length == 0) { - await model.getMasterLookup(MasterKeysService.PhysicalExamination); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - backgroundColor: Color.fromRGBO(248, 248, 248, 1), - body: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - padding: - EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16), - color: Colors.white, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + onModelReady: (model) async { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup(MasterKeysService.PhysicalExamination); + } + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + backgroundColor: Color.fromRGBO(248, 248, 248, 1), + body: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - "${TranslationBase.of(context).addExamination}", - fontSize: SizeConfig.textMultiplier * 3.3, - color: Colors.black, - fontWeight: FontWeight.w700, + Container( + padding: EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16), + color: Colors.white, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).addExamination}", + fontSize: SizeConfig.textMultiplier * 3.3, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon( + Icons.clear, + size: 40, + ), + ) + ], ), ), - InkWell( - onTap: () { - Navigator.of(context).pop(); - }, - child: Icon( - Icons.clear, - size: 40, - ), - ) - ], - ), - ), - Expanded( - child: SingleChildScrollView( - child: Column( - children: [ - Container( - margin: EdgeInsets.all(16.0), - padding: EdgeInsets.all(0.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(12), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey.shade400, - width: 0.4, - )), - ), + Expanded( + child: SingleChildScrollView( child: Column( children: [ - ExaminationsListSearchWidget( - masterList: model.physicalExaminationList, - isServiceSelected: (master) => - isServiceSelected(master), - removeHistory: (history) { - setState(() { - widget.removeExamination(history); - }); - }, - addHistory: (selectedExamination) { - setState(() { - widget.mySelectedExamination - .add(selectedExamination); + Container( + margin: EdgeInsets.all(16.0), + padding: EdgeInsets.all(0.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + children: [ + ExaminationsListSearchWidget( + masterList: model.physicalExaminationList, + isServiceSelected: (master) => isServiceSelected(master), + removeHistory: (history) { + setState(() { + widget.removeExamination(history); + }); + }, + addHistory: (selectedExamination) { + setState(() { + widget.mySelectedExamination.add(selectedExamination); }); }, ), @@ -134,8 +129,7 @@ class _AddExaminationPageState extends State { widthFactor: .80, child: Center( child: AppButton( - title: - "${TranslationBase.of(context).addExamination}", + title: "${TranslationBase.of(context).addExamination}", padding: 10, color: Color(0xFF359846), onPressed: () { @@ -155,10 +149,8 @@ class _AddExaminationPageState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = widget.mySelectedExamination.where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable exam = widget.mySelectedExamination.where((element) => + masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); if (exam.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index e990be79..17ce9c8c 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -21,12 +21,12 @@ class AddExaminationWidget extends StatefulWidget { final Function expandClick; AddExaminationWidget({ - this.item, - this.removeHistory, - this.addHistory, - this.isServiceSelected, - this.isExpand, - this.expandClick, + required this.item, + required this.removeHistory, + required this.addHistory, + required this.isServiceSelected, + required this.isExpand, + required this.expandClick, }); @override @@ -89,10 +89,8 @@ class _AddExaminationWidgetState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 8), child: InkWell( - onTap: widget.expandClick, - child: Icon(widget.isExpand - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), + onTap: widget.expandClick(), + child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ), ], ), @@ -136,9 +134,7 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 1 - ? HexColor("#D02127") - : Colors.white, + color: status == 1 ? HexColor("#D02127") : Colors.white, shape: BoxShape.circle, ), ), @@ -176,9 +172,7 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 2 - ? HexColor("#D02127") - : Colors.white, + color: status == 2 ? HexColor("#D02127") : Colors.white, shape: BoxShape.circle, ), ), @@ -216,9 +210,7 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 3 - ? HexColor("#D02127") - : Colors.white, + color: status == 3 ? HexColor("#D02127") : Colors.white, shape: BoxShape.circle, ), ), diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index d40faea5..8094fa2f 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -29,11 +29,10 @@ class ExaminationItemCard extends StatelessWidget { child: Container( child: AppText( projectViewModel.isArabic - ? examination.selectedExamination.nameAr != null && - examination.selectedExamination.nameAr != "" - ? examination.selectedExamination.nameAr - : examination.selectedExamination.nameEn - : examination.selectedExamination.nameEn, + ? examination.selectedExamination!.nameAr != null && examination.selectedExamination!.nameAr != "" + ? examination.selectedExamination!.nameAr + : examination.selectedExamination!.nameEn + : examination.selectedExamination!.nameEn, fontWeight: FontWeight.w600, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -50,7 +49,7 @@ class ExaminationItemCard extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.8, ), InkWell( - onTap: removeExamination, + onTap: removeExamination(), child: Icon( Icons.clear, size: 20, @@ -62,15 +61,15 @@ class ExaminationItemCard extends StatelessWidget { ], ), AppText( - !examination.isNormal - ? examination.isAbnormal + !examination.isNormal! + ? examination.isAbnormal! ? TranslationBase.of(context).abnormal : TranslationBase.of(context).notExamined : TranslationBase.of(context).normal, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - color: !examination.isNormal - ? examination.isAbnormal + color: !examination.isNormal! + ? examination.isAbnormal! ? Colors.red.shade800 : Colors.grey.shade800 : Colors.green.shade800, diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index 36b65d4c..f6b1d379 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -14,20 +14,18 @@ class ExaminationsListSearchWidget extends StatefulWidget { final List masterList; ExaminationsListSearchWidget( - {this.removeHistory, - this.addHistory, - this.isServiceSelected, - this.masterList}); + {required this.removeHistory, + required this.addHistory, + required this.isServiceSelected, + required this.masterList}); @override - _ExaminationsListSearchWidgetState createState() => - _ExaminationsListSearchWidgetState(); + _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); } -class _ExaminationsListSearchWidgetState - extends State { +class _ExaminationsListSearchWidgetState extends State { int expandedIndex = -1; - List items = List(); + List items = []; TextEditingController filteredSearchController = TextEditingController(); @override @@ -50,10 +48,11 @@ class _ExaminationsListSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.search, - color: Colors.black, - )), + Icons.search, + color: Colors.black, + )), ), DividerWithSpacesAround( height: 2, @@ -81,13 +80,13 @@ class _ExaminationsListSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 8fdfffc2..3dd28b01 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -32,11 +32,12 @@ class UpdateObjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key key, - this.changePageViewIndex, - this.mySelectedExamination, - this.patientInfo, - this.changeLoadingState, this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.mySelectedExamination, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -45,8 +46,7 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State { bool isSysExaminationExpand = false; - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -61,98 +61,89 @@ class _UpdateObjectivePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - widget.mySelectedExamination.clear(); - GetPhysicalExamReqModel getPhysicalExamReqModel = - GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); + onModelReady: (model) async { + widget.mySelectedExamination.clear(); + GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo); - await model.getPatientPhysicalExam(getPhysicalExamReqModel); - if (model.patientPhysicalExamList.isNotEmpty) { - if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); - } - model.patientPhysicalExamList.forEach((element) { - MasterKeyModel examMaster = model.getOneMasterKey( - masterKeys: MasterKeysService.PhysicalExamination, - id: element.examId, - ); - MySelectedExamination tempEam = MySelectedExamination( - selectedExamination: examMaster, - remark: element.remarks, - isNormal: element.isNormal, - createdBy: element.createdBy, - notExamined: element.notExamined, - isNew: element.isNew, - isAbnormal: element.isAbnormal); - widget.mySelectedExamination.add(tempEam); - }); + await model.getPatientPhysicalExam(getPhysicalExamReqModel); + if (model.patientPhysicalExamList.isNotEmpty) { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup(MasterKeysService.PhysicalExamination); } + model.patientPhysicalExamList.forEach((element) { + MasterKeyModel? examMaster = model.getOneMasterKey( + masterKeys: MasterKeysService.PhysicalExamination, + id: element.examId!, + ); + MySelectedExamination tempEam = MySelectedExamination( + selectedExamination: examMaster, + remark: element.remarks, + isNormal: element.isNormal, + createdBy: element.createdBy, + notExamined: element.notExamined, + isNew: element.isNew, + isAbnormal: element.isAbnormal); + widget.mySelectedExamination.add(tempEam); + }); + } - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), - ExpandableSOAPWidget( - headerTitle: - TranslationBase.of(context).physicalSystemExamination, - onTap: () { - setState(() { - isSysExaminationExpand = !isSysExaminationExpand; - }); - }, - child: Column( - children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addExamination}",onTap: () { - openExaminationList(context); - },), - Column( - children: - widget.mySelectedExamination.map((examination) { - return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); - }); - }).toList(), - ) - ], - + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).physicalSystemExamination, + onTap: () { + setState(() { + isSysExaminationExpand = !isSysExaminationExpand; + }); + }, + child: Column( + children: [ + SOAPOpenItems( + label: "${TranslationBase.of(context).addExamination}", + onTap: () { + openExaminationList(context); + }, + ), + Column( + children: widget.mySelectedExamination.map((examination) { + return ExaminationItemCard(examination, () { + removeExamination(examination.selectedExamination!); + }); + }).toList(), + ) + ], + ), + isExpanded: isSysExaminationExpand, ), - isExpanded: isSysExaminationExpand, - ), - SizedBox(height: MediaQuery - .of(context) - .size - .height * 0.12,) - ], + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ) + ], + ), ), ), ), - ), - bottomSheet: - Container( + bottomSheet: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(0.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0), + border: Border.all(color: HexColor('#707070'), width: 0), ), height: 80, width: double.infinity, @@ -161,50 +152,48 @@ class _UpdateObjectivePageState extends State { SizedBox( height: 10, ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + widget.changePageViewIndex(0); + }, + ), ), - ), - ], + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + ), + ], + ), ), ), - ),), + ), SizedBox( height: 5, ), ], - ),) - - - ), + ), + )), ); } @@ -213,40 +202,36 @@ class _UpdateObjectivePageState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: exam.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination!.id, + examType: exam.selectedExamination!.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + notExamined: exam.notExamined, + examinationType: exam.isNormal! + ? 1 + : exam.isAbnormal! + ? 2 + : 3, + examinationTypeName: exam.isNormal! + ? "Normal" + : exam.isAbnormal! + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew)); }); if (model.patientPhysicalExamList.isEmpty) { @@ -268,10 +253,8 @@ class _UpdateObjectivePageState extends State { } removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.mySelectedExamination - .where((element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable history = widget.mySelectedExamination.where((element) => + masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); if (history.length > 0) setState(() { @@ -317,10 +300,10 @@ class AddExaminationDailog extends StatefulWidget { final Function(MasterKeyModel) removeExamination; const AddExaminationDailog( - {Key key, - this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}) + {Key? key, + required this.mySelectedExamination, + required this.addSelectedExamination, + required this.removeExamination}) : super(key: key); @override @@ -335,8 +318,7 @@ class _AddExaminationDailogState extends State { child: BaseView( onModelReady: (model) async { if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); + await model.getMasterLookup(MasterKeysService.PhysicalExamination); } }, builder: (_, model, w) => AppScaffold( @@ -346,21 +328,19 @@ class _AddExaminationDailogState extends State { child: Container( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).physicalSystemExamination, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).physicalSystemExamination, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + ]), ))), )), ); diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 87ea1e4d..702752db 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -30,12 +30,12 @@ class UpdatePlanPage extends StatefulWidget { GetPatientProgressNoteResModel patientProgressNote; UpdatePlanPage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.patientProgressNote, - this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.patientProgressNote, + required this.currentIndex}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -45,11 +45,9 @@ class _UpdatePlanPageState extends State { bool isAddProgress = true; bool isProgressExpanded = true; - TextEditingController progressNoteController = - TextEditingController(text: null); + TextEditingController progressNoteController = TextEditingController(text: null); - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -64,33 +62,32 @@ class _UpdatePlanPageState extends State { @override void initState() { super.initState(); - if(widget.patientProgressNote.planNote !=null ){ + if (widget.patientProgressNote.planNote != null) { setState(() { isAddProgress = false; }); } } - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: widget.patientInfo.appointmentNo, - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); + GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( + appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Helpers - .parseHtmlString(model.patientProgressNoteList[0].planNote); - widget.patientProgressNote.planNote = progressNoteController.text; - widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; - widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; - widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; - widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; + progressNoteController.text = Helpers.parseHtmlString(model.patientProgressNoteList[0].planNote ?? ""); + widget.patientProgressNote.planNote = progressNoteController.text; + widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; + widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; + widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; + widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; setState(() { isAddProgress = false; }); @@ -98,267 +95,254 @@ class _UpdatePlanPageState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.90, - child: Column( - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), - - SizedBox(height: 10,), - - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).progressNote - , - onTap: () { - setState(() { - isProgressExpanded = !isProgressExpanded; - }); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if(isAddProgress) - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).progressNote, - controller: progressNoteController, - minLines: 2, - maxLines: 4, - inputType: TextInputType.multiline, - onChanged: (value){ - widget.patientProgressNote.planNote = value; - }, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.90, + child: Column( + children: [ + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + SizedBox( + height: 10, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).progressNote, + onTap: () { + setState(() { + isProgressExpanded = !isProgressExpanded; + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (isAddProgress) + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).progressNote, + controller: progressNoteController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value) { + widget.patientProgressNote.planNote = value; + }, + ), ), + SizedBox( + height: 9, ), - SizedBox( - height: 9, - ), - if ( widget.patientProgressNote.planNote != null&& !isAddProgress) - Container( - margin: - EdgeInsets.only(left: 5, right: 5, ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText('Appointment No: ',fontSize: 12,), - AppText(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), - - ], - ), - AppText( - widget.patientProgressNote.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, - ) - - ], - ), - Row( - - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText('Condition: ', - fontSize: 12,), - AppText( - widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), - ], - ), - AppText( - widget.patientProgressNote.createdOn !=null?AppDateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):AppDateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ) - ], - ), - SizedBox(height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - progressNoteController.text, - fontSize: 10, + if (widget.patientProgressNote.planNote != null && !isAddProgress) + Container( + margin: EdgeInsets.only( + left: 5, + right: 5, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'Appointment No: ', + fontSize: 12, + ), + AppText( + widget.patientProgressNote.appointmentNo.toString(), + fontWeight: FontWeight.w600, + ), + ], ), - ), - InkWell( - onTap: (){ - setState(() { - isAddProgress = true; - widget.changePageViewIndex(3,isChangeState:false); - }); - }, - child: Icon(DoctorApp.edit,size: 18,)) - ], - ), - ], - ), - ) - ], - ), - - ], + AppText( + widget.patientProgressNote.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + DateTime.parse(widget.patientProgressNote.createdOn ?? "")) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'Condition: ', + fontSize: 12, + ), + AppText(widget.patientProgressNote.mName ?? '', + fontWeight: FontWeight.w600), + ], + ), + AppText( + widget.patientProgressNote.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse(widget.patientProgressNote.createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + progressNoteController.text, + fontSize: 10, + ), + ), + InkWell( + onTap: () { + setState(() { + isAddProgress = true; + widget.changePageViewIndex(3, isChangeState: false); + }); + }, + child: Icon( + DoctorApp.edit, + size: 18, + )) + ], + ), + ], + ), + ) + ], + ), + ], + ), + isExpanded: isProgressExpanded, ), - isExpanded: isProgressExpanded, - ), - - ], + ], + ), ), ), ), - ), - bottomSheet: - Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(2); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - loading: model.state == ViewState.BusyLocal, - disabled: progressNoteController.text.isEmpty, - onPressed: () async { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - Map profile = - await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = - widget.patientProgressNote - .createdByName ?? - doctorProfile.doctorName; - widget.patientProgressNote.editedByName = - doctorProfile.doctorName; - widget.patientProgressNote.createdOn = - DateTime.now().toString(); - widget.patientProgressNote.planNote = - progressNoteController.text; - isAddProgress = !isAddProgress; - }); - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - Helpers.showErrorToast(TranslationBase.of(context) - .progressNoteErrorMsg); - } - }, - ), - ), - ], - ), - ), - ),), - SizedBox( - height: 5, - ), - ], - ),) - - ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(2); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + loading: model.state == ViewState.BusyLocal, + disabled: progressNoteController.text.isEmpty, + onPressed: () async { + if (progressNoteController.text.isNotEmpty) { + if (isAddProgress) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = + widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; + widget.patientProgressNote.editedByName = doctorProfile.doctorName; + widget.patientProgressNote.createdOn = DateTime.now().toString(); + widget.patientProgressNote.planNote = progressNoteController.text; + isAddProgress = !isAddProgress; + }); + submitPlan(model); + } else { + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); + } + }, + ), + ), + ], + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + )), ); } - submitPlan(SOAPViewModel model) async { + submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, - planNote: widget.patientProgressNote.planNote, doctorID: '', editedBy: ''); + planNote: widget.patientProgressNote.planNote, + doctorID: '', + editedBy: ''); - if(model.patientProgressNoteList.isEmpty){ + if (model.patientProgressNoteList.isEmpty) { await model.postProgressNote(postProgressNoteRequestModel); - - }else { + } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - postProgressNoteRequestModel.editedBy =doctorProfile.doctorID; + postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; await model.patchProgressNote(postProgressNoteRequestModel); - } if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else { - widget.changePageViewIndex(4,isChangeState:false); + widget.changePageViewIndex(4, isChangeState: false); } } else { Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } - - } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 31a501ce..2e185819 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -6,46 +6,42 @@ class SOAPOpenItems extends StatelessWidget { final Function onTap; final String label; - const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); + const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key); @override Widget build(BuildContext context) { - return InkWell( - onTap: onTap, + return InkWell( + onTap: onTap(), child: Container( - padding: EdgeInsets.symmetric( - vertical: 8, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0), margin: EdgeInsets.symmetric(vertical: 8), decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, width: 0.5), + border: Border.all(color: Colors.grey.shade400, width: 0.5), borderRadius: BorderRadius.all( Radius.circular(8), ), color: Colors.white, ), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "$label", - fontSize:15, - color: Colors.black, - fontWeight: FontWeight.w600, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize:13, - color: Colors.grey.shade700, - ), - ], - )), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "$label", + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: 13, + color: Colors.grey.shade700, + ), + ], + )), Icon( Icons.add_box_rounded, size: 25, @@ -56,6 +52,3 @@ class SOAPOpenItems extends StatelessWidget { ); } } - - - diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 85614b6d..dbe7368d 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -5,8 +5,9 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ - Key key, - this.currentIndex, this.changePageViewIndex, + Key? key, + required this.currentIndex, + required this.changePageViewIndex, }) : super(key: key); final int currentIndex; @@ -18,13 +19,16 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), AppText( TranslationBase.of(context).createNew, fontSize: 14, fontWeight: FontWeight.w500, ), - AppText(TranslationBase.of(context).episode, + AppText( + TranslationBase.of(context).episode, fontSize: 26, fontWeight: FontWeight.bold, ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index 8f5ecf93..4d05dd74 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -3,37 +3,32 @@ import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget { const BottomSheetTitle({ - Key key, this.title, + Key? key, + required this.title, }) : super(key: key); final String title; @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), height: 115, child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), + padding: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(top: 60), child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize:20, - color: Colors.black), + style: TextStyle(fontSize: 20, color: Colors.black), children: [ new TextSpan( - text: title, style: TextStyle( color: Color(0xFF2B353E), @@ -47,9 +42,7 @@ class BottomSheetTitle extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(DoctorApp.close_1, - size:20, - color: Color(0xFF2B353E))) + child: Icon(DoctorApp.close_1, size: 20, color: Color(0xFF2B353E))) ], ), ], diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index d4666428..7205bfba 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -13,7 +13,12 @@ class ExpandableSOAPWidget extends StatelessWidget { final bool isRequired; const ExpandableSOAPWidget( - {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) + {Key? key, + required this.isExpanded, + required this.child, + required this.onTap, + this.headerTitle, + this.isRequired = true}) : super(key: key); @override @@ -25,36 +30,30 @@ class ExpandableSOAPWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), ), child: HeaderBodyExpandableNotifier( - headerWidget: InkWell( - onTap: onTap, + headerWidget: InkWell( + onTap: onTap(), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - onTap: onTap, + onTap: onTap(), child: Row( children: [ - AppText(headerTitle, - variant: isExpanded ? "bodyText" : '', - fontSize: 15, - color: Colors.black), - if(isRequired) - Icon( - FontAwesomeIcons.asterisk, - size: 12, - ) + AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: 15, color: Colors.black), + if (isRequired) + Icon( + FontAwesomeIcons.asterisk, + size: 12, + ) ], ), ), InkWell( - onTap: onTap, - child: Icon( - isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), + onTap: onTap(), + child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline), ) ], ), @@ -64,4 +63,4 @@ class ExpandableSOAPWidget extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index c5c2e8ca..351af5ca 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -11,7 +11,7 @@ class StepsWidget extends StatelessWidget { final Function changeCurrentTab; final double height; - StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); + StepsWidget({Key? key, required this.index, required this.changeCurrentTab, this.height = 0.0}); @override Widget build(BuildContext context) { @@ -25,21 +25,18 @@ class StepsWidget extends StatelessWidget { color: Colors.transparent, ), Positioned( - top: 30 - , + top: 30, child: Center( child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.9, + width: MediaQuery.of(context).size.width * 0.9, child: Divider( color: Colors.grey, height: 0.75, thickness: 0.75, ), ), - ),), + ), + ), Positioned( top: 10, left: 0, @@ -56,8 +53,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 ? null - : Border.all( - color: Colors.black, width: 0.75), + : Border.all(color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) @@ -93,10 +89,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery - .of(context) - .size - .width * 0.25, + left: MediaQuery.of(context).size.width * 0.25, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( @@ -110,8 +103,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) @@ -149,10 +141,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery - .of(context) - .size - .width * 0.50, + left: MediaQuery.of(context).size.width * 0.50, child: InkWell( onTap: () { if (index >= 3) changeCurrentTab(2); @@ -168,8 +157,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) @@ -221,8 +209,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) @@ -232,10 +219,10 @@ class StepsWidget extends StatelessWidget { ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox( height: 5, @@ -268,21 +255,18 @@ class StepsWidget extends StatelessWidget { color: Colors.transparent, ), Positioned( - top: 30 - , + top: 30, child: Center( child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.9, + width: MediaQuery.of(context).size.width * 0.9, child: Divider( color: Colors.grey, height: 0.75, thickness: 0.75, ), ), - ),), + ), + ), Positioned( top: 10, right: 0, @@ -299,21 +283,20 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 0 ? null - : Border.all( - color: Colors.black, width: 0.75), + : Border.all(color: Colors.black, width: 0.75), shape: BoxShape.circle, color: index == 0 ? Color(0xFFCC9B14) : index > 0 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 3), Column( @@ -335,10 +318,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: MediaQuery - .of(context) - .size - .width * 0.28, + right: MediaQuery.of(context).size.width * 0.28, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -352,21 +332,20 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 1 ? Color(0xFFCC9B14) : index > 1 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 5), Column( @@ -388,10 +367,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: MediaQuery - .of(context) - .size - .width * 0.52, + right: MediaQuery.of(context).size.width * 0.52, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( @@ -405,8 +381,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 2 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 2 ? Color(0xFFCC9B14) @@ -460,8 +435,7 @@ class StepsWidget extends StatelessWidget { ? Border.all(color: Color(0xFFCC9B14), width: 2) : index > 3 ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), + : Border.all(color: Color(0xFFCCCCCC), width: 0.75), shape: BoxShape.circle, color: index == 3 ? Color(0xFFCC9B14) @@ -506,9 +480,9 @@ class StepsWidget extends StatelessWidget { class StatusLabel extends StatelessWidget { const StatusLabel({ - Key key, - this.stepId, - this.selectedStepId, + Key? key, + required this.stepId, + required this.selectedStepId, }) : super(key: key); final int stepId; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index fc7329e5..766f4ad1 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -19,20 +19,19 @@ class AddAllergies extends StatefulWidget { final Function addAllergiesFun; final List myAllergiesList; - const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) - : super(key: key); + const AddAllergies({Key? key, required this.addAllergiesFun, required this.myAllergiesList}) : super(key: key); @override _AddAllergiesState createState() => _AddAllergiesState(); } class _AddAllergiesState extends State { - List allergiesList; - List allergySeverityList; + late List allergiesList; + late List allergySeverityList; TextEditingController remarkController = TextEditingController(); TextEditingController severityController = TextEditingController(); TextEditingController allergyController = TextEditingController(); - List myAllergiesListLocal; + late List myAllergiesListLocal; @override initState() { @@ -43,9 +42,7 @@ class _AddAllergiesState extends State { GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { return InputDecoration( contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( @@ -62,10 +59,7 @@ class _AddAllergiesState extends State { ), hintText: selectedText != null ? selectedText : hintText, suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 10, - color: Theme.of(context).hintColor, - fontWeight: FontWeight.w700), + hintStyle: TextStyle(fontSize: 10, color: Theme.of(context).hintColor, fontWeight: FontWeight.w700), ); } @@ -83,105 +77,99 @@ class _AddAllergiesState extends State { } }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addAllergies, - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Center( - child: NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchAllergiesWidget( - model: model, - masterList: model.allergiesList, - removeAllergy: (master) { - setState(() { - removeAllergyFromLocalList(master); - }); - }, - addAllergy: - (MySelectedAllergy mySelectedAllergy) { - addAllergyLocally(mySelectedAllergy); - }, - addSelectedAllergy: () => widget - .addAllergiesFun(myAllergiesListLocal), - isServiceSelected: (master) => - isServiceSelected(master), - getServiceSelectedAllergy: (master) => - getSelectedAllergy(master), - ), - ), - ), + baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + BottomSheetTitle( + title: TranslationBase.of(context).addAllergies ?? "", + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchAllergiesWidget( + model: model, + masterList: model.allergiesList, + removeAllergy: (master) { + setState(() { + removeAllergyFromLocalList(master); + }); + }, + addAllergy: (MySelectedAllergy mySelectedAllergy) { + addAllergyLocally(mySelectedAllergy); + }, + addSelectedAllergy: () => widget.addAllergiesFun(myAllergiesListLocal), + isServiceSelected: (master) => isServiceSelected(master), + getServiceSelectedAllergy: (master) => getSelectedAllergy(master)!, ), ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.11, - ), - ]), - ), - ),bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), + ), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ), + ]), ), - border: Border.all(color: HexColor('#707070'), width: 0), ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: - TranslationBase.of(context).addAllergies, - padding: 10, - color: Color(0xFF359846), - onPressed: () { - widget.addAllergiesFun(myAllergiesListLocal); - }, + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).addAllergies, + padding: 10, + color: Color(0xFF359846), + onPressed: () { + widget.addAllergiesFun(myAllergiesListLocal); + }, + ), ), ), ), - ), - SizedBox( - height: 5, - ), - ], + SizedBox( + height: 5, + ), + ], + ), ), - ),), + ), ), ); } isServiceSelected(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where( - (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + Iterable allergy = myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy!.id && + masterKey.typeId == element.selectedAllergy!.typeId && + element.isChecked!); if (allergy.length > 0) { return true; } @@ -189,16 +177,14 @@ class _AddAllergiesState extends State { } removeAllergyFromLocalList(MasterKeyModel masterKey) { - myAllergiesListLocal - .removeWhere((element) => element.selectedAllergy.id == masterKey.id); + myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); } - MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where( - (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + MySelectedAllergy? getSelectedAllergy(MasterKeyModel masterKey) { + Iterable allergy = myAllergiesListLocal.where((element) => + masterKey.id == element.selectedAllergy!.id && + masterKey.typeId == element.selectedAllergy!.typeId && + element.isChecked!); if (allergy.length > 0) { return allergy.first; } @@ -207,25 +193,20 @@ class _AddAllergiesState extends State { addAllergyLocally(MySelectedAllergy mySelectedAllergy) { if (mySelectedAllergy.selectedAllergy == null) { - Helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); + Helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } else { setState(() { List allergy = - // ignore: missing_return - myAllergiesListLocal - .where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) + // ignore: missing_return + myAllergiesListLocal + .where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id) .toList(); if (allergy.isEmpty) { myAllergiesListLocal.add(mySelectedAllergy); } else { allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; + allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity; allergy.first.remark = mySelectedAllergy.remark; allergy.first.isChecked = mySelectedAllergy.isChecked; } diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 6f7439e6..3254cfdd 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -14,9 +14,9 @@ import 'add_allergies.dart'; // ignore: must_be_immutable class UpdateAllergiesWidget extends StatefulWidget { - List myAllergiesList; + List myAllergiesList; - UpdateAllergiesWidget({Key key, this.myAllergiesList}); + UpdateAllergiesWidget({Key? key, required this.myAllergiesList}); @override _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); @@ -27,30 +27,28 @@ class _UpdateAllergiesWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); changeAllState() { - setState(() { - - }); + setState(() {}); } return Column( children: [ - - - SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { - openAllergiesList(context, changeAllState); - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addAllergies}", + onTap: () { + openAllergiesList(context, changeAllState); + }, + ), SizedBox( height: 20, ), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myAllergiesList.map((selectedAllergy) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -64,45 +62,33 @@ class _UpdateAllergiesWidgetState extends State { children: [ AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn - .toUpperCase(), - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, + ? selectedAllergy.selectedAllergy!.nameAr + : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(), + textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, bold: true, color: Color(0xFF2B353E)), AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergySeverity - .nameAr - : selectedAllergy.selectedAllergySeverity - .nameEn - .toUpperCase(), - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, + ? selectedAllergy.selectedAllergySeverity!.nameAr + : selectedAllergy.selectedAllergySeverity!.nameEn!.toUpperCase(), + textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, color: Color(0xFFCC9B14)), ], ), - width: MediaQuery - .of(context) - .size - .width * 0.5, + width: MediaQuery.of(context).size.width * 0.5, ), - - if (selectedAllergy.isChecked) + if (selectedAllergy.isChecked!) InkWell( child: Row( - children: [Container( - child: AppText( - TranslationBase - .of(context) - .remove, - fontSize: 15, - variant: "bodyText", - color: HexColor("#B8382C"),), - ), + children: [ + Container( + child: AppText( + TranslationBase.of(context).remove, + fontSize: 15, + variant: "bodyText", + color: HexColor("#B8382C"), + ), + ), Icon( FontAwesomeIcons.times, color: HexColor("#B8382C"), @@ -145,12 +131,12 @@ class _UpdateAllergiesWidgetState extends State { removeAllergy(MySelectedAllergy mySelectedAllergy) { List allergy = - // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergySeverity.id == - element.selectedAllergySeverity.id && - mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id - ).toList(); + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && + mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id) + .toList(); if (allergy.length > 0) { setState(() { @@ -158,7 +144,6 @@ class _UpdateAllergiesWidgetState extends State { }); } - print(allergy); } @@ -170,7 +155,7 @@ class _UpdateAllergiesWidgetState extends State { context: context, builder: (context) { return AddAllergies( - myAllergiesList: widget.myAllergiesList, + myAllergiesList: widget.myAllergiesList, addAllergiesFun: (List mySelectedAllergy) { bool isAllDataFilled = true; mySelectedAllergy.forEach((element) { @@ -180,25 +165,16 @@ class _UpdateAllergiesWidgetState extends State { }); if (isAllDataFilled) { mySelectedAllergy.forEach((element) { - if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) { + if (!widget.myAllergiesList.contains(element.selectedAllergySeverity!.id)) { widget.myAllergiesList.add(element); } }); changeParentState(); Navigator.of(context).pop(); } else { - Helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); + Helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } }); }); } - } - - - - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 0e5e6ec1..dd64365e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -7,14 +7,14 @@ import '../medication/update_medication_widget.dart'; class UpdateChiefComplaints extends StatelessWidget { const UpdateChiefComplaints({ - Key key, - @required this.formKey, - @required this.complaintsController, - @required this.illnessController, - @required this.medicationController, - this.complaintsControllerError, - this.illnessControllerError, - this.medicationControllerError, + Key? key, + required this.formKey, + required this.complaintsController, + required this.illnessController, + required this.medicationController, + required this.complaintsControllerError, + required this.illnessControllerError, + required this.medicationControllerError, }) : super(key: key); final GlobalKey formKey; @@ -41,56 +41,43 @@ class UpdateChiefComplaints extends StatelessWidget { minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - validationError: complaintsControllerError != '' - ? complaintsControllerError - : null, + validationError: complaintsControllerError != '' ? complaintsControllerError : null, ), - SizedBox( + SizedBox( height: 20, ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .historyOfPresentIllness, + hintText: TranslationBase.of(context).historyOfPresentIllness, controller: illnessController, inputType: TextInputType.multiline, - maxLines: 25, minLines: 7, hasBorder: true, - validationError: illnessControllerError != '' - ? illnessControllerError - : null, - ), - SizedBox( - height: 10, - ), - UpdateMedicationWidget( - medicationController: medicationController, - ), - SizedBox( - height: 10, - ), + validationError: illnessControllerError != '' ? illnessControllerError : null, + ), + SizedBox( + height: 10, + ), + UpdateMedicationWidget( + medicationController: medicationController, + ), + SizedBox( + height: 10, + ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .currentMedications, + hintText: TranslationBase.of(context).currentMedications, controller: medicationController, maxLines: 25, minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - - validationError: medicationControllerError != '' - ? medicationControllerError - : null, - - ), - SizedBox( - height: 10, - ), - ]), + validationError: medicationControllerError != '' ? medicationControllerError : null, + ), + SizedBox( + height: 10, + ), + ]), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 1da8db17..82d84ba4 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -19,10 +19,15 @@ class AddHistoryDialog extends StatefulWidget { final PageController controller; final List myHistoryList; final Function addSelectedHistories; - final Function (MasterKeyModel) removeHistory; + final Function(MasterKeyModel) removeHistory; const AddHistoryDialog( - {Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) + {Key? key, + required this.changePageViewIndex, + required this.controller, + required this.myHistoryList, + required this.addSelectedHistories, + required this.removeHistory}) : super(key: key); @override @@ -55,104 +60,100 @@ class _AddHistoryDialogState extends State { body: Center( child: Container( child: Column( - children: [ - BottomSheetTitle(title:TranslationBase.of(context).addHistory), - SizedBox( - height: 10, - ), - PriorityBar(onTap: (activePriority) async { - widget.changePageViewIndex(activePriority); - }), - SizedBox( - height: 20, - ), - Expanded( - child: FractionallySizedBox( - widthFactor: 0.9, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: widget.controller, - onPageChanged: (index) { - setState(() { - }); - }, - scrollDirection: Axis.horizontal, - children: [ - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyFamilyList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - ), - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.mergeHistorySurgicalWithHistorySportList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - ), - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyMedicalList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) => - isServiceSelected(master), + children: [ + BottomSheetTitle(title: TranslationBase.of(context).addHistory!), + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) async { + widget.changePageViewIndex(activePriority); + }), + SizedBox( + height: 20, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: widget.controller, + onPageChanged: (index) { + setState(() {}); + }, + scrollDirection: Axis.horizontal, + children: [ + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyFamilyList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => isServiceSelected(master), + ), + ), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.mergeHistorySurgicalWithHistorySportList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => isServiceSelected(master), + ), + ), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyMedicalList, + removeHistory: (history) { + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history) { + setState(() { + createAndAddHistory(history); + }); + }, + addSelectedHistories: () { + widget.addSelectedHistories(); + }, + isServiceSelected: (master) => isServiceSelected(master), ), ), ], ), ), ), - SizedBox(height:MediaQuery.of(context).size.height * 0.11 ,) + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ) ], - ) - ), + )), ), bottomSheet: Container( decoration: BoxDecoration( @@ -174,8 +175,7 @@ class _AddHistoryDialogState extends State { widthFactor: .80, child: Center( child: AppButton( - title: - TranslationBase.of(context).addSelectedHistories, + title: TranslationBase.of(context).addSelectedHistories, padding: 10, color: Color(0xFF359846), onPressed: () { @@ -196,19 +196,15 @@ class _AddHistoryDialogState extends State { } createAndAddHistory(MasterKeyModel history) { - List myhistory = widget.myHistoryList.where((element) => - history.id == - element.selectedHistory.id && - history.typeId == - element.selectedHistory.typeId - ).toList(); + List myhistory = widget.myHistoryList + .where( + (element) => history.id == element.selectedHistory!.id && history.typeId == element.selectedHistory!.typeId) + .toList(); if (myhistory.isEmpty) { setState(() { - MySelectedHistory mySelectedHistory = MySelectedHistory( - remark: history.remarks ?? "", - selectedHistory: history, - isChecked: true); + MySelectedHistory mySelectedHistory = + MySelectedHistory(remark: history.remarks ?? "", selectedHistory: history, isChecked: true); widget.myHistoryList.add(mySelectedHistory); }); } else { @@ -217,18 +213,13 @@ class _AddHistoryDialogState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable history = - widget - .myHistoryList - .where((element) => - masterKey.id == element.selectedHistory.id && - masterKey.typeId == element.selectedHistory.typeId && - element.isChecked); + Iterable history = widget.myHistoryList.where((element) => + masterKey.id == element.selectedHistory!.id && + masterKey.typeId == element.selectedHistory!.typeId && + element.isChecked!); if (history.length > 0) { return true; } return false; } - } - diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index ac6ec2c5..250fac6d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -7,7 +7,7 @@ import 'package:provider/provider.dart'; class PriorityBar extends StatefulWidget { final Function onTap; - const PriorityBar({Key key, this.onTap}) : super(key: key); + const PriorityBar({Key? key, required this.onTap}) : super(key: key); @override _PriorityBarState createState() => _PriorityBarState(); @@ -27,8 +27,7 @@ class _PriorityBarState extends State { "طبي", ]; - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration(); } @@ -57,26 +56,26 @@ class _PriorityBarState extends State { children: [ Container( height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, + decoration: containerBorderDecoration(_isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), child: Center( child: Text( - (projectViewModel.isArabic) - ? _prioritiesAr[index] - : item, + (projectViewModel.isArabic) ? _prioritiesAr[index] : item, textAlign: TextAlign.center, style: TextStyle( fontSize: 14, - color: Colors.black, fontWeight: FontWeight.bold, ), ), ), ), - if(_isActive) - Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) + if (_isActive) + Container( + width: 120, + height: 4, + color: AppGlobal.appPrimaryColor, + ) ], ), ), diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index f114702d..29071248 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -14,15 +14,14 @@ import 'add_history_dialog.dart'; class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; - const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); + const UpdateHistoryWidget({Key? key, required this.myHistoryList}) : super(key: key); @override _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); } -class _UpdateHistoryWidgetState extends State - with TickerProviderStateMixin { - PageController _controller; +class _UpdateHistoryWidgetState extends State with TickerProviderStateMixin { + late PageController _controller; changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); @@ -40,17 +39,17 @@ class _UpdateHistoryWidgetState extends State ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () { - openHistoryList(context); - - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addHistory}", + onTap: () { + openHistoryList(context); + }, + ), SizedBox( height: 20, ), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myHistoryList.map((myHistory) { return Column( @@ -61,33 +60,25 @@ class _UpdateHistoryWidgetState extends State Container( child: AppText( projectViewModel.isArabic - ? myHistory.selectedHistory.nameAr - : myHistory.selectedHistory.nameEn, + ? myHistory.selectedHistory!.nameAr + : myHistory.selectedHistory!.nameEn, fontSize: 15, - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, color: Colors.black), - width: MediaQuery - .of(context) - .size - .width * 0.5, + width: MediaQuery.of(context).size.width * 0.5, ), - if (myHistory.isChecked) + if (myHistory.isChecked!) InkWell( child: Row( children: [ Container( child: AppText( - TranslationBase - .of(context) - .remove, + TranslationBase.of(context).remove, fontSize: 15, variant: "bodyText", - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, - color: HexColor("#B8382C"),), + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, + color: HexColor("#B8382C"), + ), ), Icon( FontAwesomeIcons.times, @@ -96,7 +87,7 @@ class _UpdateHistoryWidgetState extends State ), ], ), - onTap: () => removeHistory(myHistory.selectedHistory), + onTap: () => removeHistory(myHistory.selectedHistory!), ) ], ), @@ -114,14 +105,11 @@ class _UpdateHistoryWidgetState extends State removeHistory(MasterKeyModel historyKey) { List history = - // ignore: missing_return - widget.myHistoryList.where((element) => - historyKey.id == - element.selectedHistory.id && - historyKey.typeId == - element.selectedHistory.typeId - ).toList(); - + // ignore: missing_return + widget.myHistoryList + .where((element) => + historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId) + .toList(); if (history.length > 0) setState(() { @@ -153,6 +141,3 @@ class _UpdateHistoryWidgetState extends State }); } } - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 69475926..1d9e7890 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -25,27 +25,25 @@ class AddMedication extends StatefulWidget { final Function addMedicationFun; TextEditingController medicationController; - AddMedication({Key key, this.addMedicationFun, this.medicationController}) - : super(key: key); + AddMedication({Key? key, required this.addMedicationFun, required this.medicationController}) : super(key: key); @override _AddMedicationState createState() => _AddMedicationState(); } class _AddMedicationState extends State { - MasterKeyModel _selectedMedicationDose; - MasterKeyModel _selectedMedicationStrength; - MasterKeyModel _selectedMedicationRoute; - MasterKeyModel _selectedMedicationFrequency; + late MasterKeyModel _selectedMedicationDose; + late MasterKeyModel _selectedMedicationStrength; + late MasterKeyModel _selectedMedicationRoute; + late MasterKeyModel _selectedMedicationFrequency; TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - GetMedicationResponseModel _selectedMedication; + late GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @override @@ -69,316 +67,251 @@ class _AddMedicationState extends State { if (model.medicationRouteList.length == 0) { await model.getMasterLookup(MasterKeysService.MedicationRoute); } - if (model.allMedicationList.length == 0) - await model.getMedicationList(); + if (model.allMedicationList.length == 0) await model.getMedicationList(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, body: Center( child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addMedication, - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 16, - ), - Container( - // height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - _selectedMedication == null, - child: AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .searchMedicineNameHere, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState( - () => _selectedMedication = - item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: AppText(suggestion - .description + - '/' + - suggestion - .genericName), - padding: - EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input - .toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith( - input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - hintText: _selectedMedication != - null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of(context) - .searchMedicineNameHere, - minLines: 2, - maxLines: 2, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + BottomSheetTitle( + title: TranslationBase.of(context).addMedication ?? "", + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 16, + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null!; + }); + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && _selectedMedication == null, + child: AutoCompleteTextField( + decoration: TextFieldsUtils.textFieldSelectorDecoration( + TranslationBase.of(context).searchMedicineNameHere!, "", true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() => _selectedMedication = item), + suggestions: model.allMedicationList, + itemBuilder: (context, suggestion) => new Padding( + child: AppText(suggestion.description! + '/' + suggestion.genericName!), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()), + ), + ) + : AppTextFieldCustom( + hintText: _selectedMedication != null + ? _selectedMedication.description! + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of(context).searchMedicineNameHere, + minLines: 2, + maxLines: 2, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () {}, + icon: Icon( Icons.search, color: Colors.grey.shade600, )), - enabled: false, - ), - ), - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - onClick: model.medicationDoseTimeList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; + enabled: false, + ), + ), + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + onClick: model.medicationDoseTimeList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationDoseTimeList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = selectedValue; - doseController - .text = projectViewModel - .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).doseTime, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && - _selectedMedicationDose == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationStrengthList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; + doseController.text = projectViewModel.isArabic + ? _selectedMedicationDose.nameAr! + : _selectedMedicationDose.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).doseTime, + maxLines: 2, + minLines: 2, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && _selectedMedicationDose == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationStrengthList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = selectedValue; - strengthController - .text = projectViewModel - .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).strength, - maxLines: 2, - minLines: 2, - controller: strengthController, - validationError: isFormSubmitted && - _selectedMedicationStrength == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationRouteList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + strengthController.text = projectViewModel.isArabic + ? _selectedMedicationStrength.nameAr! + : _selectedMedicationStrength.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).strength, + maxLines: 2, + minLines: 2, + controller: strengthController, + validationError: isFormSubmitted && _selectedMedicationStrength == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationRouteList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = selectedValue; - routeController - .text = projectViewModel - .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 2, - minLines: 2, - controller: routeController, - validationError: isFormSubmitted && - _selectedMedicationRoute == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - onClick: model.medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationFrequencyList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + routeController.text = projectViewModel.isArabic + ? _selectedMedicationRoute.nameAr! + : _selectedMedicationRoute.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 2, + minLines: 2, + controller: routeController, + validationError: isFormSubmitted && _selectedMedicationRoute == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + onClick: model.medicationFrequencyList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationFrequencyList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = selectedValue; - frequencyController - .text = projectViewModel - .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).frequency, - enabled: false, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && - _selectedMedicationFrequency == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 30, - ), - ], - )), - ), - ), - ]), + frequencyController.text = projectViewModel.isArabic + ? _selectedMedicationFrequency.nameAr! + : _selectedMedicationFrequency.nameEn!; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).frequency, + enabled: false, + maxLines: 2, + minLines: 2, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && _selectedMedicationFrequency == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 30, + ), + ], + )), + ), + ), + ]), ), ), bottomSheet: Container( @@ -401,9 +334,7 @@ class _AddMedicationState extends State { widthFactor: .80, child: Center( child: AppButton( - title: TranslationBase.of(context) - .addMedication - .toUpperCase(), + title: TranslationBase.of(context).addMedication!.toUpperCase(), color: Color(0xFF359846), onPressed: () { setState(() { @@ -414,8 +345,7 @@ class _AddMedicationState extends State { _selectedMedicationStrength != null && _selectedMedicationRoute != null && _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + + widget.medicationController.text = widget.medicationController.text + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; Navigator.of(context).pop(); } diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index 7372e7ee..6aa3e1be 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -9,8 +9,8 @@ class UpdateMedicationWidget extends StatefulWidget { final TextEditingController medicationController; UpdateMedicationWidget({ - Key key, - this.medicationController, + Key? key, + required this.medicationController, }); @override @@ -22,11 +22,12 @@ class _UpdateMedicationWidgetState extends State { Widget build(BuildContext context) { return Column( children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () { - openMedicationList(context); - - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addMedication}", + onTap: () { + openMedicationList(context); + }, + ), SizedBox( height: 20, ) @@ -34,7 +35,6 @@ class _UpdateMedicationWidgetState extends State { ); } - openMedicationList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, @@ -49,6 +49,3 @@ class _UpdateMedicationWidgetState extends State { }); } } - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index b0db0414..11972a72 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -33,14 +33,16 @@ class UpdateSubjectivePage extends StatefulWidget { final List myAllergiesList; final List myHistoryList; final PatiantInformtion patientInfo; - final int currentIndex; + final int currentIndex; UpdateSubjectivePage( - {Key key, - this.changePageViewIndex, - this.myAllergiesList, - this.myHistoryList, - this.patientInfo, this.changeLoadingState, this.currentIndex}); + {Key? key, + required this.changePageViewIndex, + required this.myAllergiesList, + required this.myHistoryList, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -67,7 +69,7 @@ class _UpdateSubjectivePageState extends State { doctorID: '', editedBy: ''); - await model.getPatientHistories(getHistoryReqModel,isFirst: true); + await model.getPatientHistories(getHistoryReqModel, isFirst: true); if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { @@ -84,62 +86,50 @@ class _UpdateSubjectivePageState extends State { } model.patientHistoryList.forEach((element) { - if (element.historyType == - MasterKeysService.HistoryFamily.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistoryMedical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySports.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySurgical.getMasterKeyService()) { - MasterKeyModel history = model.getOneMasterKey( + if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { + MasterKeyModel? history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } @@ -157,26 +147,21 @@ class _UpdateSubjectivePageState extends State { editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); + if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity); model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); + MasterKeyModel? selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, - typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); + id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { - selectedAllergySeverity = model.getOneMasterKey( + selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, id: element.severity, - ); + )!; } MySelectedAllergy mySelectedAllergy = MySelectedAllergy( @@ -185,8 +170,7 @@ class _UpdateSubjectivePageState extends State { createdBy: element.createdBy, remark: element.remarks, selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) - widget.myAllergiesList.add(mySelectedAllergy); + if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); }); } } @@ -198,33 +182,30 @@ class _UpdateSubjectivePageState extends State { widget.myAllergiesList.clear(); widget.myHistoryList.clear(); - GetChiefComplaintReqModel getChiefComplaintReqModel = - GetChiefComplaintReqModel( - patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo, - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, - doctorID: ''); + GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( + patientMRN: widget.patientInfo.patientMRN, + appointmentNo: widget.patientInfo.appointmentNo, + episodeId: widget.patientInfo.episodeNo, + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Helpers.parseHtmlString( - model.patientChiefComplaintList[0].chiefComplaint); - illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; + complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!); + illnessController.text = model.patientChiefComplaintList[0].hopi!; + medicationController.text = !(model.patientChiefComplaintList[0].currentMedication)!.isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication! + '\n \n' + : model.patientChiefComplaintList[0].currentMedication!; } await getHistory(model); await getAllergies(model); widget.changeLoadingState(false); - }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -234,12 +215,9 @@ class _UpdateSubjectivePageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context) - .chiefComplaints - , + headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { setState(() { isChiefExpand = !isChiefExpand; @@ -259,12 +237,8 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 30, ), - - ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .histories, + headerTitle: TranslationBase.of(context).histories, isRequired: false, onTap: () { setState(() { @@ -272,22 +246,15 @@ class _UpdateSubjectivePageState extends State { }); }, child: Column( - children: [ - UpdateHistoryWidget(myHistoryList: widget.myHistoryList) - ], + children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)], ), isExpanded: isHistoryExpand, ), SizedBox( height: 30, ), - - ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .allergiesSoap - , + headerTitle: TranslationBase.of(context).allergiesSoap, isRequired: false, onTap: () { setState(() { @@ -296,8 +263,9 @@ class _UpdateSubjectivePageState extends State { }, child: Column( children: [ - UpdateAllergiesWidget(myAllergiesList: widget - .myAllergiesList,), + UpdateAllergiesWidget( + myAllergiesList: widget.myAllergiesList, + ), SizedBox( height: 30, ), @@ -306,7 +274,7 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height:MediaQuery.of(context).size.height * 0.16, + height: MediaQuery.of(context).size.height * 0.16, ), ], ), @@ -319,9 +287,7 @@ class _UpdateSubjectivePageState extends State { borderRadius: BorderRadius.all( Radius.circular(0.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0), + border: Border.all(color: HexColor('#707070'), width: 0), ), height: 80, width: double.infinity, @@ -330,40 +296,39 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color:Colors.red[700], - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - addSubjectiveInfo( - model: model, - myAllergiesList: widget.myAllergiesList, - myHistoryList: widget.myHistoryList); - }, + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + addSubjectiveInfo( + model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList); + }, + ), ), ), - ),), + ), SizedBox( height: 5, ), ], - ),), + ), + ), ), ); } - addSubjectiveInfo({SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { - formKey.currentState.save(); - formKey.currentState.validate(); + addSubjectiveInfo( + {required SOAPViewModel model, + required List myAllergiesList, + required List myHistoryList}) async { + formKey.currentState!.save(); + formKey.currentState!.validate(); complaintsControllerError = ''; medicationControllerError = ''; @@ -391,66 +356,49 @@ class _UpdateSubjectivePageState extends State { widget.changeLoadingState(true); widget.changePageViewIndex(1); - } else { setState(() { if (complaintsController.text.isEmpty) { - complaintsControllerError = TranslationBase - .of(context) - .emptyMessage; + complaintsControllerError = TranslationBase.of(context).emptyMessage!; } else if (complaintsController.text.length < 25) { - complaintsControllerError = TranslationBase - .of(context) - .chiefComplaintLength; + complaintsControllerError = TranslationBase.of(context).chiefComplaintLength!; } if (illnessController.text.isEmpty) { - illnessControllerError = TranslationBase - .of(context) - .emptyMessage; + illnessControllerError = TranslationBase.of(context).emptyMessage!; } if (medicationController.text.isEmpty) { - medicationControllerError = TranslationBase - .of(context) - .emptyMessage; + medicationControllerError = TranslationBase.of(context).emptyMessage!; } }); - Helpers.showErrorToast(TranslationBase - .of(context) - .chiefComplaintErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); } - - } - postAllergy( - {List myAllergiesList, SOAPViewModel model}) async { - PostAllergyRequestModel postAllergyRequestModel = - new PostAllergyRequestModel(); + postAllergy({required List myAllergiesList, required SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); widget.myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == - null) + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( - ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: allergy.createdBy??doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - isChecked: allergy.isChecked, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy!.id, + allergyDiseaseType: allergy.selectedAllergy!.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity!.id, + remarks: allergy.remark, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -464,60 +412,53 @@ class _UpdateSubjectivePageState extends State { appointmentNo: widget.patientInfo.appointmentNo, doctorID: '', editedBy: ''); - await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); + await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy: true); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } } - postHistories( - {List myHistoryList, SOAPViewModel model}) async { - PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(doctorID: ''); + postHistories({required List myHistoryList, required SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); widget.myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) - postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; + postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: "", - historyId: history.selectedHistory.id, - historyType: history.selectedHistory.typeId, + historyId: history.selectedHistory!.id, + historyType: history.selectedHistory!.typeId, isChecked: history.isChecked, )); }); - if (model.patientHistoryList.isEmpty) { await model.postHistories(postHistoriesRequestModel); } else { await model.patchHistories(postHistoriesRequestModel); } - if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } } - postChiefComplaint({SOAPViewModel model}) async { - formKey.currentState.save(); - if(formKey.currentState.validate()){ - PostChiefComplaintRequestModel postChiefComplaintRequestModel = - new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: medicationController.text, - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - doctorID: '', - - numberOfWeeks: 0); + postChiefComplaint({required SOAPViewModel model}) async { + formKey.currentState!.save(); + if (formKey.currentState!.validate()) { + PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + chiefComplaint: complaintsController.text, + currentMedication: medicationController.text, + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); @@ -527,8 +468,3 @@ class _UpdateSubjectivePageState extends State { } } } - - - - - 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 d9af7457..93fcff50 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -19,28 +19,25 @@ import 'plan/update_plan_page.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; - const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + const UpdateSoapIndex({Key? key, required this.isUpdate}) : super(key: key); @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); } -class _UpdateSoapIndexState extends State - with TickerProviderStateMixin { - PageController _controller; +class _UpdateSoapIndexState extends State with TickerProviderStateMixin { + PageController? _controller; int _currentIndex = 0; - List myAllergiesList = List(); - List myHistoryList = List(); - List mySelectedExamination = List(); - List mySelectedAssessment = List(); + List myAllergiesList = []; + List myHistoryList = []; + List mySelectedExamination = []; + List mySelectedAssessment = []; - GetPatientProgressNoteResModel patientProgressNote = - GetPatientProgressNoteResModel(); + GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - changePageViewIndex(pageIndex,{isChangeState = true}) { - if (pageIndex != _currentIndex && isChangeState) - changeLoadingState(true); - _controller.jumpToPage(pageIndex); + changePageViewIndex(pageIndex, {isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); + _controller?.jumpToPage(pageIndex); setState(() { _currentIndex = pageIndex; }); @@ -63,80 +60,82 @@ class _UpdateSoapIndexState extends State @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( - builder: (_, model, w) => AppScaffold( - isLoading: _isLoading, - isShowAppBar: false, - body: SingleChildScrollView( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - boxShadow: [], - color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientProfileHeaderNewDesign(patient, '7', '7',), - 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(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - mySelectedExamination: mySelectedExamination, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - mySelectedAssessmentList: mySelectedAssessment, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - patientProgressNote: patientProgressNote, - changeLoadingState: changeLoadingState) - ], + builder: (_, model, w) => AppScaffold( + isLoading: _isLoading, + isShowAppBar: false, + body: SingleChildScrollView( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: + BoxDecoration(boxShadow: [], color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign( + patient, + '7', + '7', + ), + 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(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + mySelectedExamination: mySelectedExamination, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + mySelectedAssessmentList: mySelectedAssessment, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + patientProgressNote: patientProgressNote, + changeLoadingState: changeLoadingState) + ], + ), + ) + ], + ), ), - ) - ], + ], + ), ), ), - ], - ), - ), - ), - )); + )); } } diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 7c766158..ec33ccf0 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -10,7 +10,7 @@ class LineChartCurved extends StatelessWidget { final List timeSeries; final int indexes; - LineChartCurved({this.title, this.timeSeries, this.indexes}); + LineChartCurved({required this.title, required this.timeSeries, required this.indexes}); List xAxixs = []; List yAxixs = []; @@ -105,8 +105,7 @@ class LineChartCurved extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -130,9 +129,7 @@ class LineChartCurved extends StatelessWidget { return ''; } } else { - if (value.toInt() == 0 || - value.toInt() == timeSeries.length - 1 || - xAxixs.contains(value.toInt())) { + if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { DateTime dateTime = timeSeries[value.toInt()].time; if (isDatesSameYear) { return monthFormat.format(dateTime); @@ -238,9 +235,7 @@ class LineChartCurved extends StatelessWidget { int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); - if (isDatesSameYear == false || - (previousDateYear != 0 && - previousDateYear != timeSeries[index].time.year)) { + if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { isDatesSameYear = false; } previousDateYear = timeSeries[index].time.year; diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 1c387c9a..197e517f 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -13,10 +13,14 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final bool isOX; LineChartCurvedBloodPressure( - {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); + {required this.title, + required this.timeSeries1, + required this.indexes, + required this.timeSeries2, + this.isOX = false}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; @override Widget build(BuildContext context) { @@ -43,7 +47,6 @@ class LineChartCurvedBloodPressure extends StatelessWidget { title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -55,8 +58,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), Expanded( child: Padding( - padding: - const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -75,26 +77,30 @@ class LineChartCurvedBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), + ), + SizedBox( + width: 5, ), - SizedBox(width: 5,), - AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) + AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng) ], ), - SizedBox(width: 15,), + SizedBox( + width: 15, + ), Row( children: [ Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.red), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red), + ), + SizedBox( + width: 5, ), - SizedBox(width: 5,), - AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) + AppText( + isOX ? "FIO2" : TranslationBase.of(context).diastolicLng, + ) ], ), ], @@ -123,8 +129,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -223,12 +228,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } List getData(context) { - List spots = List(); + List spots = []; for (int index = 0; index < timeSeries1.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = List(); + List spots2 = []; for (int index = 0; index < timeSeries2.length; index++) { spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); } @@ -260,11 +265,11 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - List lineChartData = List(); - if(spots.isNotEmpty){ + List lineChartData = []; + if (spots.isNotEmpty) { lineChartData.add(lineChartBarData1); } - if(spots2.isNotEmpty){ + if (spots2.isNotEmpty) { lineChartData.add(lineChartBarData2); } return lineChartData; 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/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 1e593af7..c9e08223 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -17,13 +17,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget { final String viewKey2; VitalSignBloodPressureWidget( - {Key key, - this.vitalList, - this.title1, - this.title2, - this.viewKey1, - this.title3, - this.viewKey2}); + {Key? key, + required this.vitalList, + required this.title1, + required this.title2, + required this.viewKey1, + required this.title3, + required this.viewKey2}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -63,7 +63,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -85,7 +84,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -107,7 +105,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -123,7 +120,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -153,8 +150,7 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( 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 37a7a60f..c2ff0c34 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 @@ -14,16 +14,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int appointmentNo; - int projectID; + int? appointmentNo; + int? projectID; bool isNotOneAppointment; - VitalSignDetailsScreen( - {this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); + VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -34,15 +33,13 @@ class VitalSignDetailsScreen extends StatelessWidget { String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( - onModelReady: (model) => - model.getPatientVitalSignHistory(patient, from, to, isInpatient), + onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient), builder: (_, mode, widget) => AppScaffold( baseViewModel: mode, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), - appBarTitle: TranslationBase.of(context).vitalSign, + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), + appBarTitle: TranslationBase.of(context).vitalSign!, body: mode.patientVitalSignsHistory.length > 0 ? Column( children: [ @@ -57,7 +54,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -75,8 +72,7 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.23, width: double.infinity, padding: EdgeInsets.all(12.0), - margin: EdgeInsets.symmetric( - horizontal: 16.0, vertical: 8.0), + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), decoration: BoxDecoration( shape: BoxShape.rectangle, color: Colors.white, @@ -100,17 +96,13 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 1 ? '${assetBasePath}underweight_BMI.png' : '${assetBasePath}underweight_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -118,38 +110,28 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiUnderWeight}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), AppText( "(<18.5)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 2 ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -158,40 +140,29 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).normal}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * - 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ), AppText( "(18.5-24.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 3 ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -199,38 +170,28 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiOverWeight}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), AppText( "(25-29.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 4 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -238,38 +199,28 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiObese}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), AppText( "(30-34.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 5 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -279,24 +230,17 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).bmiObeseExtreme}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * - 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ), AppText( "(35<)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ], )), @@ -308,11 +252,9 @@ class VitalSignDetailsScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Container( - margin: EdgeInsets.symmetric( - horizontal: 16.0, vertical: 16), + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ GridView.count( shrinkWrap: true, @@ -326,16 +268,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Height, - pageTitle: - TranslationBase.of( - context) - .height, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: TranslationBase.of(context).height, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -345,13 +281,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) - .height, - imagePath: - "${assetBasePath}height.png", + des: TranslationBase.of(context).height!, + imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, - unit: TranslationBase.of(context) - .cm, + unit: TranslationBase.of(context).cm!, ), ), ), @@ -360,16 +293,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Weight, - pageTitle: - TranslationBase.of( - context) - .weight, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: TranslationBase.of(context).weight, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -378,12 +305,9 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .weight, - imagePath: - "${assetBasePath}weight.png", - unit: - TranslationBase.of(context).kg, + des: TranslationBase.of(context).weight!, + imagePath: "${assetBasePath}weight.png", + unit: TranslationBase.of(context).kg!, lastVal: mode.weightKg, ), ), @@ -392,16 +316,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Temperature, - pageTitle: - TranslationBase.of( - context) - .temperature, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context).temperature, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -411,13 +329,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) - .temperature, - imagePath: - "${assetBasePath}temperature.png", + des: TranslationBase.of(context).temperature!, + imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context) - .tempC, + unit: TranslationBase.of(context).tempC!, ), ), ), @@ -426,16 +341,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .heart, - pageTitle: - TranslationBase.of( - context) - .heart, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: TranslationBase.of(context).heart, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -444,13 +353,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .heart, - imagePath: - "${assetBasePath}heart_rate.png", + des: TranslationBase.of(context).heart!, + imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, - unit: - TranslationBase.of(context).bpm, + unit: TranslationBase.of(context).bpm!, ), ), InkWell( @@ -458,16 +364,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Respiration, - pageTitle: - TranslationBase.of( - context) - .respirationRate, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context).respirationRate, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -476,14 +376,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .respirationRate, - imagePath: - "${assetBasePath}respiration_rate.png", - lastVal: - mode.respirationBeatPerMinute, - unit: TranslationBase.of(context) - .respirationSigns, + des: TranslationBase.of(context).respirationRate!, + imagePath: "${assetBasePath}respiration_rate.png", + lastVal: mode.respirationBeatPerMinute, + unit: TranslationBase.of(context).respirationSigns!, ), ), InkWell( @@ -491,16 +387,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .BloodPressure, - pageTitle: - TranslationBase.of( - context) - .bloodPressure, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context).bloodPressure, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -509,13 +399,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .bloodPressure, - imagePath: - "${assetBasePath}blood_pressure.png", + des: TranslationBase.of(context).bloodPressure!, + imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, - unit: TranslationBase.of(context) - .sysDias, + unit: TranslationBase.of(context).sysDias!, ), ), InkWell( @@ -523,16 +410,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Oxygenation, - pageTitle: - TranslationBase.of( - context) - .oxygenation, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Oxygenation, + pageTitle: TranslationBase.of(context).oxygenation, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -541,10 +422,8 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .oxygenation, - imagePath: - "${assetBasePath}oxg.png", + des: TranslationBase.of(context).oxygenation!, + imagePath: "${assetBasePath}oxg.png", lastVal: "${mode.oxygenation}%", unit: "", ), @@ -554,16 +433,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .PainScale, - pageTitle: - TranslationBase.of( - context) - .painScale, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.PainScale, + pageTitle: TranslationBase.of(context).painScale, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -572,12 +445,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .painScale, - imagePath: - "${assetBasePath}painScale.png", + des: TranslationBase.of(context).painScale!, + imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: TranslationBase.of(context).severe, + unit: TranslationBase.of(context).severe!, ), ), ], @@ -588,19 +459,17 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), ], - ), - ), - ), - ], - ) + ), + ), + ), + ], + ) : Container( - color: Theme - .of(context) - .scaffoldBackgroundColor, - child: ErrorMessage(error: TranslationBase - .of(context) - .vitalSignEmptyMsg,)), + color: Theme.of(context).scaffoldBackgroundColor, + child: ErrorMessage( + error: TranslationBase.of(context).vitalSignEmptyMsg ?? "", + )), ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index cec53580..5c83fd09 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -15,7 +15,7 @@ class VitalSignDetailsWidget extends StatefulWidget { final String viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -55,7 +55,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -77,7 +76,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -93,7 +91,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -110,8 +108,7 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 20d5b439..d051f98c 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -9,17 +9,17 @@ class VitalSignItem extends StatelessWidget { final String lastVal; final String unit; final String imagePath; - final double height; - final double width; + final double? height; + final double? width; const VitalSignItem( - {Key key, - @required this.des, + {Key? key, + required this.des, this.lastVal = 'N/A', this.unit = '', this.height, this.width, - @required this.imagePath}) + required this.imagePath}) : super(key: key); @override 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 49f82c2f..ad0dc1a7 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 @@ -14,20 +14,20 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { - final vitalSignDetails pageKey; - final String pageTitle; - List VSchart; + final vitalSignDetails? pageKey; + final String? pageTitle; + List? VSchart; PatiantInformtion patient; String patientType; String arrivalType; VitalSignItemDetailsScreen( - {this.vitalList, - this.pageKey, - this.pageTitle, - this.patient, - this.patientType, - this.arrivalType}); + {required this.vitalList, + required this.pageKey, + required this.pageTitle, + required this.patient, + required this.patientType, + required this.arrivalType}); final List vitalList; @@ -187,11 +187,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { default: } return AppScaffold( - appBarTitle: pageTitle, + appBarTitle: pageTitle ?? "", backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + appBar: PatientProfileHeaderNewDesignAppBar(patient, patientType, arrivalType), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -202,7 +201,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, @@ -220,7 +219,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { child: ListView( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - children: VSchart.map((chartInfo) { + children: VSchart!.map((chartInfo) { var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); @@ -229,20 +228,14 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return VitalSignDetailPainScale(vitalList); } - if (vitalListTemp.length != 0 && - chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { + if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || + chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( vitalList: vitalList, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], - title3: projectViewModel.isArabic - ? chartInfo['title3Ar'] - : chartInfo['title3'], + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], + title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', ); @@ -251,13 +244,9 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index ef8049ce..0d3803b8 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -11,12 +11,12 @@ import 'LineChartCurved.dart'; class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey, - @required this.title1, - @required this.title2, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey, + required this.title1, + required this.title2, }) : super(key: key); final List vitalList; @@ -31,50 +31,45 @@ class VitalSingChartAndDetials extends StatelessWidget { generateData(); return timeSeriesData.length != 0 ? Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: LineChartCurved( + title: name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + ), ), - child: LineChartCurved( - title: name, - timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ], + ), ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).graphDetails, - fontSize: SizeConfig.textMultiplier * 2.1, - fontWeight: FontWeight.bold, - - fontFamily: 'Poppins', - ), - SizedBox(height: 8,), - VitalSignDetailsWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - viewKey: viewKey, - ), - ], - ), - ), - /*AppExpandableNotifier( + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWid: VitalSignDetailsWidget( @@ -84,9 +79,9 @@ class VitalSingChartAndDetials extends StatelessWidget { viewKey: viewKey, ), ),*/ - ], - ), - ) + ], + ), + ) : Container( width: double.infinity, height: MediaQuery.of(context).size.height, @@ -100,14 +95,11 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.createdOn); - if (element.toJson()[viewKey] != null && - element.toJson()[viewKey]?.toInt() != 0) + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + if (element.toJson()[viewKey] != null && element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( TimeSeriesSales2( - new DateTime( - elementDate.year, elementDate.month, elementDate.day), + new DateTime(elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey].toDouble(), ), ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index d0416539..ba75ed30 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -11,14 +11,14 @@ import 'LineChartCurvedBloodPressure.dart'; class VitalSingChartBloodPressure extends StatelessWidget { VitalSingChartBloodPressure({ - Key key, - @required this.vitalList, - @required this.name, - @required this.viewKey1, - @required this.viewKey2, - @required this.title1, - @required this.title2, - @required this.title3, + Key? key, + required this.vitalList, + required this.name, + required this.viewKey1, + required this.viewKey2, + required this.title1, + required this.title2, + required this.title3, }) : super(key: key); final List vitalList; @@ -42,12 +42,10 @@ class VitalSingChartBloodPressure extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartCurvedBloodPressure( title: name, - isOX: title2=="SAO2", + isOX: title2 == "SAO2", timeSeries1: timeSeriesData1, timeSeries2: timeSeriesData2, indexes: timeSeriesData1.length ~/ 5.5, @@ -56,9 +54,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -115,21 +111,18 @@ class VitalSingChartBloodPressure extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey1]?.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( - new DateTime( - elementDate.year, elementDate.month, elementDate.day), + new DateTime(elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey1].toDouble(), ), ); if (element.toJson()[viewKey2]?.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( - new DateTime( - elementDate.year, elementDate.month, elementDate.day), + new DateTime(elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey2].toDouble(), ), ); diff --git a/lib/screens/prescription/add_favourite_prescription.dart b/lib/screens/prescription/add_favourite_prescription.dart index 118df049..e3a5a654 100644 --- a/lib/screens/prescription/add_favourite_prescription.dart +++ b/lib/screens/prescription/add_favourite_prescription.dart @@ -14,27 +14,27 @@ 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; + final PrescriptionViewModel? model; + 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(); } class _AddFavPrescriptionState extends State { - MedicineViewModel model; - PatiantInformtion patient; + late MedicineViewModel model; + late PatiantInformtion patient; - List entityList = List(); - ProcedureTempleteDetailsModel groupProcedures; + List entityList = []; + late ProcedureTempleteDetailsModel groupProcedures; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.categoryID), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( @@ -90,8 +90,8 @@ class _AddFavPrescriptionState extends State { context, MaterialPageRoute( builder: (context) => PrescriptionCheckOutScreen( - patient: widget.patient, - model: widget.model, + patient: widget.patient!, + model: widget.model!, groupProcedures: groupProcedures, ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f4761897..4f15871d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -20,7 +20,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/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.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'; @@ -45,44 +45,44 @@ addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion pati } postPrescription( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { + {String? duration, + String? doseTimeIn, + String? dose, + String? drugId, + String? strength, + String? route, + String? frequency, + String? indication, + String? instruction, + PrescriptionViewModel? model, + DateTime? doseTime, + String? doseUnit, + String? icdCode, + PatiantInformtion? patient, + String? patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = List(); + List prescriptionList = []; - postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.appointmentNo = patient!.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose ?? "0"), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId ?? "0"), + doseUnitId: int.parse(doseUnit ?? "1"), + route: route!.isEmpty ? 1 : int.parse(route ?? "1"), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); + doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration!.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime!.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); + await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -104,14 +104,14 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState extends State { - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; + String? routeError; + String? frequencyError; + String? doseTimeError; + String? durationError; + String? unitError; + String? strengthError; - int selectedType; + late int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -121,9 +121,9 @@ class _PrescriptionFormWidgetState extends State { bool visbiltySearch = true; final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; + late DateTime selectedDate; + late int strengthChar; + late GetMedicationResponseModel _selectedMedication; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -237,7 +237,7 @@ class _PrescriptionFormWidgetState extends State { builder: ( BuildContext context, MedicineViewModel model, - Widget child, + Widget? child, ) => NetworkBaseView( baseViewModel: model, @@ -354,7 +354,7 @@ class _PrescriptionFormWidgetState extends State { child: MedicineItemWidget( label: model.allMedicationList[index].description), onTap: () { - model.getItem(itemID: model.allMedicationList[index].itemId); + model.getItem(itemID: model.allMedicationList[index].itemId!); visbiltyPrescriptionForm = true; visbiltySearch = false; _selectedMedication = model.allMedicationList[index]; @@ -391,11 +391,11 @@ class _PrescriptionFormWidgetState extends State { activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).regular), + Text(TranslationBase.of(context).regular ?? ""), ], ), ), @@ -434,7 +434,7 @@ class _PrescriptionFormWidgetState extends State { PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.560, element: units, - elementError: unitError, + elementError: unitError ?? "", keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -453,7 +453,7 @@ class _PrescriptionFormWidgetState extends State { PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: route, - elementError: routeError, + elementError: routeError ?? "", keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -462,12 +462,12 @@ class _PrescriptionFormWidgetState extends State { route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route, + hintText: TranslationBase.of(context).route ?? "", ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency, - elementError: frequencyError, + hintText: TranslationBase.of(context).frequency ?? "", + elementError: frequencyError ?? "", element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', @@ -483,7 +483,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text)); return; @@ -492,8 +492,8 @@ class _PrescriptionFormWidgetState extends State { }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime, - elementError: doseTimeError, + hintText: TranslationBase.of(context).doseTime ?? "", + elementError: doseTimeError ?? "", element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -546,7 +546,7 @@ class _PrescriptionFormWidgetState extends State { onTap: () => selectDate(context, widget.model), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context).date ?? "", selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -562,8 +562,8 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( element: duration, - elementError: durationError, - hintText: TranslationBase.of(context).duration, + elementError: durationError ?? "", + hintText: TranslationBase.of(context).duration ?? "", elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -577,7 +577,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -604,9 +604,8 @@ class _PrescriptionFormWidgetState extends State { hintText: TranslationBase.of(context).boxQuantity, isTextFieldHasSuffix: false, dropDownText: box != null - ? TranslationBase.of(context).boxQuantity + - ": " + - model.boxQuintity.toString() + ? TranslationBase.of(context).boxQuantity ?? + "" + ": " + model.boxQuintity.toString() : null, enabled: false, ), @@ -679,7 +678,7 @@ class _PrescriptionFormWidgetState extends State { return; } - if (formKey.currentState.validate()) { + if (formKey.currentState!.validate()) { Navigator.pop(context); openDrugToDrug(model); { @@ -800,7 +799,7 @@ class _PrescriptionFormWidgetState extends State { }); } - formKey.currentState.save(); + formKey.currentState!.save(); }, ), ], @@ -829,7 +828,7 @@ class _PrescriptionFormWidgetState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -843,8 +842,8 @@ class _PrescriptionFormWidgetState extends State { } } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -943,7 +942,7 @@ class _PrescriptionFormWidgetState extends State { getPriscriptionforDrug(List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { - prescriptionList[0].entityList.forEach((element) { + prescriptionList[0].entityList!.forEach((element) { if (element.mediSpanGPICode != null) { prescriptionDetails.add({ 'DrugId': element.mediSpanGPICode, diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 15abfeb6..6b1e0df0 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -54,45 +54,34 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (model3) => model3.getDrugToDrug( - model.patientVitalSigns, - widget.listAssessment, - model2.patientAllergiesList, - widget.patient, - widget.prescription), - builder: (BuildContext context, PrescriptionViewModel model3, - Widget child) => - NetworkBaseView( - baseViewModel: model3, - child: Container( - height: SizeConfig.realScreenHeight * .4, - child: new ListView.builder( - itemCount: expandableList.length, - itemBuilder: (context, i) { - return new ExpansionTile( - title: new AppText( - expandableList[i]['name'] + - ' ' + - '(' + - getDrugInfo(expandableList[i]['level'], - model3) - .length - .toString() + - ')', - fontSize: 20, - fontWeight: FontWeight.bold, - ), - children: getDrugInfo( - expandableList[i]['level'], model3) - .map((item) { - return Container( - padding: EdgeInsets.all(10), - child: AppText( - item['comment'], - color: Colors.red[900], - )); - }).toList()); - })))) + onModelReady: (model3) => model3.getDrugToDrug(model.patientVitalSigns!, widget.listAssessment, + model2.patientAllergiesList, widget.patient, widget.prescription), + builder: (BuildContext context, PrescriptionViewModel model3, Widget? child) => NetworkBaseView( + baseViewModel: model3, + child: Container( + height: SizeConfig.realScreenHeight * .4, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new AppText( + expandableList[i]['name'] + + ' ' + + '(' + + getDrugInfo(expandableList[i]['level'], model3).length.toString() + + ')', + fontSize: 20, + fontWeight: FontWeight.bold, + ), + children: getDrugInfo(expandableList[i]['level'], model3).map((item) { + return Container( + padding: EdgeInsets.all(10), + child: AppText( + item['comment'], + color: Colors.red[900], + )); + }).toList()); + })))) : Container( height: SizeConfig.realScreenHeight * .45, child: Center( diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 27905b2d..a631ab15 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -18,7 +18,7 @@ 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/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.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'; @@ -32,12 +32,12 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class PrescriptionCheckOutScreen extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - final List prescriptionList; - final ProcedureTempleteDetailsModel groupProcedures; + final PrescriptionViewModel? model; + final PatiantInformtion? patient; + final List? prescriptionList; + final ProcedureTempleteDetailsModel? groupProcedures; - const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) + const PrescriptionCheckOutScreen({Key? key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); @override @@ -46,46 +46,46 @@ class PrescriptionCheckOutScreen extends StatefulWidget { class _PrescriptionCheckOutScreenState extends State { postPrescription( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { + {String? duration, + String? doseTimeIn, + String? dose, + String? drugId, + String? strength, + String? route, + String? frequency, + String? indication, + String? instruction, + PrescriptionViewModel? model, + DateTime? doseTime, + String? doseUnit, + String? icdCode, + PatiantInformtion? patient, + String? patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = List(); + List prescriptionList = []; - postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.appointmentNo = patient!.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose!), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId!), + doseUnitId: int.parse(doseUnit!), + route: route!.isEmpty ? 1 : int.parse(route!), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); + doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration!.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime!.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); + await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); - if (model.state == ViewState.ErrorLocal) { + if (model!.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); @@ -93,14 +93,14 @@ class _PrescriptionCheckOutScreenState extends State } } - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; + String? routeError; + String? frequencyError; + String? doseTimeError; + String? durationError; + String? unitError; + String? strengthError; - int selectedType; + late int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -110,10 +110,10 @@ class _PrescriptionCheckOutScreenState extends State bool visbiltySearch = true; final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + late DateTime selectedDate; + late int strengthChar; + late GetMedicationResponseModel _selectedMedication; + late GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -202,17 +202,17 @@ class _PrescriptionCheckOutScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); + model.getItem(itemID: int.parse(widget.groupProcedures!.aliasN!.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; }); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), + patientMRN: widget.patient!.patientMRN, + episodeID: widget.patient!.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patient.appointmentNo); + appointmentNo: widget.patient!.appointmentNo); if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); } @@ -227,7 +227,7 @@ class _PrescriptionCheckOutScreenState extends State builder: ( BuildContext context, MedicineViewModel model, - Widget child, + Widget? child, ) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), @@ -301,7 +301,7 @@ class _PrescriptionCheckOutScreenState extends State child: Column( children: [ AppText( - widget.groupProcedures.procedureName ?? "", + widget.groupProcedures!.procedureName ?? "", bold: true, ), Container( @@ -315,11 +315,11 @@ class _PrescriptionCheckOutScreenState extends State activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).regular), + Text(TranslationBase.of(context).regular!), ], ), ), @@ -358,7 +358,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.560, element: units, - elementError: unitError, + elementError: unitError ?? "", keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -377,7 +377,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: route, - elementError: routeError, + elementError: routeError ?? "", keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -386,12 +386,12 @@ class _PrescriptionCheckOutScreenState extends State route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route, + hintText: TranslationBase.of(context).route!, ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency, - elementError: frequencyError, + hintText: TranslationBase.of(context).frequency!, + elementError: frequencyError ?? "", element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', @@ -407,7 +407,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text)); return; @@ -416,8 +416,8 @@ class _PrescriptionCheckOutScreenState extends State }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime, - elementError: doseTimeError, + hintText: TranslationBase.of(context).doseTime ?? "", + elementError: doseTimeError!, element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -467,10 +467,10 @@ class _PrescriptionCheckOutScreenState extends State height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate(context, widget.model), + onTap: () => selectDate(context, widget.model!), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context).date!, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -486,8 +486,8 @@ class _PrescriptionCheckOutScreenState extends State SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( element: duration, - elementError: durationError, - hintText: TranslationBase.of(context).duration, + elementError: durationError ?? "", + hintText: TranslationBase.of(context).duration!, elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -501,7 +501,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, + itemCode: _selectedMedication.itemId!, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -545,7 +545,7 @@ class _PrescriptionCheckOutScreenState extends State TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of(context).instruction, + hintText: TranslationBase.of(context).instruction!, controller: instructionController, //keyboardType: TextInputType.number, ), @@ -602,13 +602,13 @@ class _PrescriptionCheckOutScreenState extends State return; } - if (formKey.currentState.validate()) { + if (formKey.currentState!.validate()) { Navigator.pop(context); // openDrugToDrug(model); { postPrescription( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.isEmpty + ? model.patientAssessmentList[0].icdCode10ID!.isEmpty ? "test" : model.patientAssessmentList[0].icdCode10ID.toString() : "test", @@ -623,9 +623,9 @@ class _PrescriptionCheckOutScreenState extends State doseUnit: model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), - patient: widget.patient, + patient: widget.patient!, doseTimeIn: doseTime['id'].toString(), - model: widget.model, + model: widget.model!, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() @@ -633,7 +633,7 @@ class _PrescriptionCheckOutScreenState extends State route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget.groupProcedures.aliasN + drugId: (widget!.groupProcedures!.aliasN! .replaceAll("item code ;", "")), strength: strengthController.text, indication: indicationController.text, @@ -665,19 +665,19 @@ class _PrescriptionCheckOutScreenState extends State frequencyError = null; } if (units == null) { - unitError = TranslationBase.of(context).fieldRequired; + unitError = TranslationBase.of(context).fieldRequired!; } else { unitError = null; } if (strengthController.text == "") { - strengthError = TranslationBase.of(context).fieldRequired; + strengthError = TranslationBase.of(context).fieldRequired!; } else { strengthError = null; } }); } - formKey.currentState.save(); + formKey.currentState!.save(); }, ), ], @@ -706,7 +706,7 @@ class _PrescriptionCheckOutScreenState extends State Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -720,8 +720,8 @@ class _PrescriptionCheckOutScreenState extends State } } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart index 623cee90..0c364c6d 100644 --- a/lib/screens/prescription/prescription_details_page.dart +++ b/lib/screens/prescription/prescription_details_page.dart @@ -8,13 +8,13 @@ import 'package:flutter/material.dart'; class PrescriptionDetailsPage extends StatelessWidget { final PrescriptionReport prescriptionReport; - PrescriptionDetailsPage({Key key, this.prescriptionReport}); + PrescriptionDetailsPage({required Key key, required this.prescriptionReport}); @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + appBarTitle: TranslationBase.of(context).prescriptions!, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -28,14 +28,14 @@ class PrescriptionDetailsPage extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Row( children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(5)), child: Image.network( - prescriptionReport.imageSRCUrl, + prescriptionReport.imageSRCUrl!, fit: BoxFit.cover, width: 60, height: 70, @@ -45,10 +45,9 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: AppText( - prescriptionReport.itemDescription.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), + child: AppText(prescriptionReport.itemDescription!.isNotEmpty + ? prescriptionReport.itemDescription + : prescriptionReport.itemDescriptionN), ), ), ) @@ -59,9 +58,7 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, margin: EdgeInsets.only(top: 10, left: 10, right: 10), child: Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - outside: BorderSide(width: 0.5)), + border: TableBorder.symmetric(inside: BorderSide(width: 0.5), outside: BorderSide(width: 0.5)), children: [ TableRow( children: [ @@ -109,28 +106,22 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 50, width: double.infinity, - child: - Center(child: Text(prescriptionReport.routeN))), + child: Center(child: Text(prescriptionReport.routeN ?? ""))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center( - child: - Text(prescriptionReport.frequencyN ?? ''))), + child: Center(child: Text(prescriptionReport.frequencyN ?? ''))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center( - child: Text( - '${prescriptionReport.doseDailyQuantity}'))), + child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))), Container( color: Colors.white, height: 50, width: double.infinity, - child: - Center(child: Text('${prescriptionReport.days}'))) + child: Center(child: Text('${prescriptionReport.days}'))) ], ), ], diff --git a/lib/screens/prescription/prescription_home_screen.dart b/lib/screens/prescription/prescription_home_screen.dart index 6bdfabb1..eeeb07ef 100644 --- a/lib/screens/prescription/prescription_home_screen.dart +++ b/lib/screens/prescription/prescription_home_screen.dart @@ -15,15 +15,15 @@ class PrescriptionHomeScreen extends StatefulWidget { final PrescriptionViewModel model; final PatiantInformtion patient; - const PrescriptionHomeScreen({Key key, this.model, this.patient}) : super(key: key); + const PrescriptionHomeScreen({Key? key, required this.model, required this.patient}) : super(key: key); @override _PrescriptionHomeScreenState createState() => _PrescriptionHomeScreenState(); } class _PrescriptionHomeScreenState extends State with SingleTickerProviderStateMixin { - PrescriptionViewModel model; - PatiantInformtion patient; - TabController _tabController; + late PrescriptionViewModel model; + late PatiantInformtion patient; + late TabController _tabController; int _activeTab = 0; @override void initState() { @@ -49,7 +49,7 @@ class _PrescriptionHomeScreenState extends State with Si final screenSize = MediaQuery.of(context).size; return BaseView( //onModelReady: (model) => model.getCategory(), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index b6d27af6..ffb9cee1 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -22,14 +22,14 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { final int prescriptionIndex; PrescriptionItemsInPatientPage( - {Key key, - this.prescriptions, - this.patient, - this.patientType, - this.arrivalType, - this.stopOn, - this.startOn, - this.prescriptionIndex}); + {Key? key, + required this.prescriptions, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.stopOn, + required this.startOn, + required this.prescriptionIndex}); @override Widget build(BuildContext context) { @@ -42,10 +42,9 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, baseViewModel: model, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString(), patient.arrivedOn), + appBar: PatientProfileHeaderNewDesignAppBar(patient, patient.patientType.toString(), patient.arrivedOn ?? ""), body: SingleChildScrollView( child: Container( child: Column( @@ -64,8 +63,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Container( margin: EdgeInsets.only(left: 18, right: 18), child: AppText( - model.inPatientPrescription[prescriptionIndex] - .itemDescription, + model.inPatientPrescription[prescriptionIndex].itemDescription, bold: true, ), ), @@ -93,12 +91,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), Expanded( - child: AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .direction ?? - '')), + child: AppText( + " " + model.inPatientPrescription[prescriptionIndex].direction! ?? '')), ], ), Row( @@ -107,13 +101,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .route - .toString() ?? - ''), + AppText( + " " + model.inPatientPrescription[prescriptionIndex].route.toString() ?? ''), ], ), Row( @@ -123,12 +112,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), Expanded( - child: AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .refillType ?? - '')), + child: AppText( + " " + model.inPatientPrescription[prescriptionIndex].refillType! ?? '')), ], ), Row( @@ -170,10 +155,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .unitofMeasurementDescription ?? + model.inPatientPrescription[prescriptionIndex] + .unitofMeasurementDescription! ?? ''), ], ), @@ -183,13 +166,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .dose - .toString() ?? - ''), + AppText( + " " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''), ], ), Row( @@ -199,10 +177,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .statusDescription + model.inPatientPrescription[prescriptionIndex].statusDescription .toString() ?? ''), ], @@ -213,12 +188,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).processed, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .processedBy ?? - ''), + AppText(" " + model.inPatientPrescription[prescriptionIndex].processedBy! ?? ''), ], ), Row( @@ -227,23 +197,14 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText(" " + - model - .inPatientPrescription[ - prescriptionIndex] - .dose - .toString() ?? - ''), + AppText( + " " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''), ], ), SizedBox( height: 12, ), - AppText(model - .inPatientPrescription[ - prescriptionIndex] - .comments ?? - ''), + AppText(model.inPatientPrescription[prescriptionIndex].comments ?? ''), ], ), ) diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a68f6f56..36434d43 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -17,25 +17,29 @@ class PrescriptionItemsPage extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); + PrescriptionItemsPage( + {Key? key, + required this.prescriptions, + required this.patient, + required this.patientType, + required this.arrivalType}); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), + onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions, patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100], + backgroundColor: Colors.grey[100]!, baseViewModel: model, appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, - patientType: patientType??"0", - arrivalType: arrivalType??"0", + patientType: patientType ?? "0", + arrivalType: arrivalType ?? "0", clinic: prescriptions.clinicDescription, branch: prescriptions.name, isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate!), doctorName: prescriptions.doctorName, profileUrl: prescriptions.doctorImageURL, ), @@ -43,11 +47,10 @@ class PrescriptionItemsPage extends StatelessWidget { child: Container( child: Column( children: [ - - if (!prescriptions.isInOutPatient) + if (!prescriptions.isInOutPatient!) ...List.generate( model.prescriptionReportList.length, - (index) => Container( + (index) => Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: Colors.white, @@ -59,179 +62,229 @@ class PrescriptionItemsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), - SizedBox(height: 12,), + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + model.prescriptionReportList[index].itemDescription!.isNotEmpty + ? model.prescriptionReportList[index].itemDescription + : model.prescriptionReportList[index].itemDescriptionN, + bold: true, + )), + SizedBox( + height: 12, + ), Row( children: [ - SizedBox(width: 18,), + SizedBox( + width: 18, + ), Container( decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(width: 0.5,color: Colors.grey) - ), + shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), height: 55, width: 55, child: InkWell( - onTap: (){ + onTap: () { showDialog( context: context, - builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - ) - ); + builder: (ctx) => ShowImageDialog( + imageUrl: + model.prescriptionReportEnhList[index].imageSRCUrl ?? "", + )); }, child: Padding( padding: const EdgeInsets.all(8.0), child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, + model.prescriptionReportList[index].imageSRCUrl ?? "", fit: BoxFit.cover, ), ), ), ), - SizedBox(width: 10,), - Expanded(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), - ], - ), - SizedBox(height: 12,), - AppText(model.prescriptionReportList[index].remarks ?? ''), - ], - ),) - - + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).route, + color: Colors.grey, + ), + Expanded( + child: AppText(" " + model.prescriptionReportList[index].routeN!)), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).frequency, + color: Colors.grey, + ), + AppText(" " + model.prescriptionReportList[index].frequencyN! ?? ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText( + " " + model.prescriptionReportList[index].doseDailyQuantity ?? ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).duration, + color: Colors.grey, + ), + AppText( + " " + model.prescriptionReportList[index].days.toString() ?? ''), + ], + ), + SizedBox( + height: 12, + ), + AppText(model.prescriptionReportList[index].remarks ?? ''), + ], + ), + ) ], ) ], ), ), )) - else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), - SizedBox(height: 12,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(width: 18,), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(width: 0.5,color: Colors.grey) - ), - height: 55, - width: 55, - child: InkWell( - onTap: (){ - showDialog( + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + model.prescriptionReportEnhList[index].itemDescription, + bold: true, + ), + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 18, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), + height: 55, + width: 55, + child: InkWell( + onTap: () { + showDialog( context: context, builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - ) - ); - }, - child: Stack( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - - ), + imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl!, + )); + }, + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl ?? "", + fit: BoxFit.cover, ), - Positioned( - top: 10, - right: 10, - child: Icon(EvaIcons.search,color: Colors.grey,size: 35,)) - ], - ), + ), + Positioned( + top: 10, + right: 10, + child: Icon( + EvaIcons.search, + color: Colors.grey, + size: 35, + )) + ], ), ), - SizedBox(width: 10,), - Expanded(child: Column( + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), + AppText( + TranslationBase.of(context).route, + color: Colors.grey, + ), + Expanded( + child: + AppText(" " + model.prescriptionReportEnhList[index].route! ?? '')), ], ), Row( children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), + AppText( + TranslationBase.of(context).frequency, + color: Colors.grey, + ), + AppText(" " + model.prescriptionReportEnhList[index].frequency! ?? ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText(" " + + model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? + ''), ], ), Row( children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), + AppText( + TranslationBase.of(context).duration, + color: Colors.grey, + ), + AppText(" " + model.prescriptionReportList[index].days.toString() ?? ''), ], ), - SizedBox(height: 12,), - AppText(model.prescriptionReportEnhList[index].remarks?? ''), + SizedBox( + height: 12, + ), + AppText(model.prescriptionReportEnhList[index].remarks ?? ''), ], - ),) - - - ], - ) - ], - ), + ), + ) + ], + ) + ], ), ), - ), - - - + ), + ), ], ), ), @@ -240,6 +293,3 @@ class PrescriptionItemsPage extends StatelessWidget { ); } } - - - diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 6608f108..3a1a058d 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -17,12 +17,12 @@ class NewPrescriptionScreen extends StatefulWidget { } class _NewPrescriptionScreenState extends State { - PersistentBottomSheetController _controller; + late PersistentBottomSheetController _controller; final _scaffoldKey = GlobalKey(); TextEditingController strengthController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + late PatiantInformtion patient; @override void initState() { @@ -31,705 +31,553 @@ class _NewPrescriptionScreenState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + 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, + 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( + // 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, ), - ), - 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, + ), + ], + ), + ], + ) + ], + ), + ), + ), + )), ); } selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now().add(Duration(hours: 2)), diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart index 5ce98c54..5d9a07e0 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -11,18 +11,16 @@ import 'package:flutter/material.dart'; class NewPrescriptionHistoryScreen extends StatefulWidget { @override - _NewPrescriptionHistoryScreenState createState() => - _NewPrescriptionHistoryScreenState(); + _NewPrescriptionHistoryScreenState createState() => _NewPrescriptionHistoryScreenState(); } -class _NewPrescriptionHistoryScreenState - extends State { - PersistentBottomSheetController _controller; +class _NewPrescriptionHistoryScreenState extends State { + late PersistentBottomSheetController _controller; final _scaffoldKey = GlobalKey(); TextEditingController strengthController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + late PatiantInformtion patient; @override void initState() { @@ -31,476 +29,383 @@ class _NewPrescriptionHistoryScreenState Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + 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, + 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( - 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, - ), - ], + 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, ), - ), - 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 - : "", - ), - ), - ), - ), - ], + 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: 10.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: 40, - // ), - ], + ), ), - ), - ], - ), - Divider( - height: 0, - thickness: 1.0, - color: Colors.grey, - ), - ], + ], + ), + 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), - ), - ) - ], - ), - ), - ), - )), + ), + ], + ), + ), + ) + : 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( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now().add(Duration(hours: 2)), diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index 56020ca3..38b6f3c3 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -13,19 +13,19 @@ class PrescriptionTextFiled extends StatefulWidget { final String keyName; final String keyId; final String hintText; - final double width; + final double? width; final Function(dynamic) okFunction; PrescriptionTextFiled( - {Key key, - @required this.element, - @required this.elementError, + {Key? key, + required this.element, + required this.elementError, this.width, - this.elementList, - this.keyName, - this.keyId, - this.hintText, - this.okFunction}) + required this.elementList, + required this.keyName, + required this.keyId, + required this.hintText, + required this.okFunction}) : super(key: key); @override @@ -46,8 +46,7 @@ class _PrescriptionTextFiledState extends State { attributeName: '${widget.keyName}', attributeValueId: '${widget.keyId}', okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) => - widget.okFunction(selectedValue), + okFunction: (selectedValue) => widget.okFunction(selectedValue), ); showDialog( barrierDismissible: false, @@ -66,8 +65,7 @@ class _PrescriptionTextFiledState extends State { ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, - validationError: - widget.elementList.length != 1 ? widget.elementError : null, + validationError: widget.elementList.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index b56befdb..5bd469be 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head 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'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; +import '../../widgets/shared/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -20,7 +20,7 @@ import 'package:flutter/material.dart'; class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -103,7 +103,7 @@ class PrescriptionsPage extends StatelessWidget { )), ); }, - label: TranslationBase.of(context).applyForNewPrescriptionsOrder, + label: TranslationBase.of(context).applyForNewPrescriptionsOrder ?? "", ), ...List.generate( model.prescriptionsList.length, @@ -120,13 +120,13 @@ class PrescriptionsPage extends StatelessWidget { ), ), child: DoctorCard( - doctorName: model.prescriptionsList[index].doctorName, - profileUrl: model.prescriptionsList[index].doctorImageURL, - branch: model.prescriptionsList[index].name, - clinic: model.prescriptionsList[index].clinicDescription, + doctorName: model.prescriptionsList[index].doctorName ?? "", + profileUrl: model.prescriptionsList[index].doctorImageURL ?? "", + branch: model.prescriptionsList[index].name ?? "", + clinic: model.prescriptionsList[index].clinicDescription ?? "", isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index].appointmentDate, + model.prescriptionsList[index].appointmentDate ?? "", ), ))), if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) @@ -170,10 +170,10 @@ class PrescriptionsPage extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, startOn: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].startDatetime, + model.inPatientPrescription[index].startDatetime ?? "", ), stopOn: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].stopDatetime, + model.inPatientPrescription[index].stopDatetime ?? "", ), ), ), @@ -185,7 +185,7 @@ class PrescriptionsPage extends StatelessWidget { clinic: 'basheer', isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index].prescriptionDatetime, + model.inPatientPrescription[index].prescriptionDatetime ?? "", ), createdBy: model.inPatientPrescription[index].createdByName, ))), diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 01ba6a91..81cae799 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -12,7 +12,7 @@ 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/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.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/dialogs/dailog-list-select.dart'; @@ -42,22 +42,22 @@ class UpdatePrescriptionForm extends StatefulWidget { final PrescriptionViewModel model; UpdatePrescriptionForm( - {this.drugName, - this.doseStreangth, - this.drugId, - this.remarks, - this.patient, - this.duration, - this.route, - this.dose, - this.startDate, - this.doseUnit, - this.enteredRemarks, - this.frequency, - this.model, - this.drugNameGeneric, - this.uom, - this.box}); + {required this.drugName, + required this.doseStreangth, + required this.drugId, + required this.remarks, + required this.patient, + required this.duration, + required this.route, + required this.dose, + required this.startDate, + required this.doseUnit, + required this.enteredRemarks, + required this.frequency, + required this.model, + required this.drugNameGeneric, + required this.uom, + required this.box}); @override _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); } @@ -66,35 +66,31 @@ class _UpdatePrescriptionFormState extends State { TextEditingController strengthController = TextEditingController(); TextEditingController remarksController = TextEditingController(); int testNum = 0; - int strengthChar; - PatiantInformtion patient; + late int strengthChar; + late PatiantInformtion patient; dynamic route; dynamic doseTime; dynamic frequencyUpdate; dynamic updatedDuration; dynamic units; - GetMedicationResponseModel newSelectedMedication; - GlobalKey key = - new GlobalKey>(); - List indicationList; + late GetMedicationResponseModel newSelectedMedication; + GlobalKey key = new GlobalKey>(); + late List indicationList; dynamic indication; - DateTime selectedDate; + late DateTime selectedDate; @override void initState() { super.initState(); strengthController.text = widget.doseStreangth; remarksController.text = widget.remarks; - indicationList = List(); + indicationList = []; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = { - "id": 550, - "name": "Phenytoin Hypersensitivity Syndrome" - }; + dynamic indication6 = {"id": 550, "name": "Phenytoin Hypersensitivity Syndrome"}; dynamic indication7 = {"id": 551, "name": "Asterixis"}; dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; @@ -115,8 +111,7 @@ class _UpdatePrescriptionFormState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) async { await model.getMedicationList(); @@ -127,20 +122,13 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationDoseTime(); await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); - route = model.getLookupByIdFilter( - model.itemMedicineListRoute, widget.route); - doseTime = - model.getLookupById(model.medicationDoseTimeList, widget.dose); - updatedDuration = model.getLookupById( - model.medicationDurationList, widget.duration); - units = model.getLookupByIdFilter( - model.itemMedicineListUnit, widget.doseUnit); - frequencyUpdate = model.getLookupById( - model.medicationFrequencyList, widget.frequency); + route = model.getLookupByIdFilter(model.itemMedicineListRoute, widget.route); + doseTime = model.getLookupById(model.medicationDoseTimeList, widget.dose); + updatedDuration = model.getLookupById(model.medicationDurationList, widget.duration); + units = model.getLookupByIdFilter(model.itemMedicineListUnit, widget.doseUnit); + frequencyUpdate = model.getLookupById(model.medicationFrequencyList, widget.frequency); }, - builder: - (BuildContext context, MedicineViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, MedicineViewModel model, Widget? child) => NetworkBaseView( baseViewModel: model, child: GestureDetector( onTap: () { @@ -150,15 +138,13 @@ class _UpdatePrescriptionFormState extends State { initialChildSize: 0.98, maxChildSize: 0.99, minChildSize: 0.6, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.5, child: Form( child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -244,25 +230,16 @@ class _UpdatePrescriptionFormState extends State { // height: 12, // ), Container( - height: - MediaQuery.of(context).size.height * - 0.060, + height: MediaQuery.of(context).size.height * 0.060, width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.4900, - height: MediaQuery.of(context) - .size - .height * - 0.55, + width: MediaQuery.of(context).size.width * 0.4900, + height: MediaQuery.of(context).size.height * 0.55, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), + LengthLimitingTextInputFormatter(5), // WhitelistingTextInputFormatter // .digitsOnly ], @@ -270,8 +247,7 @@ class _UpdatePrescriptionFormState extends State { hintText: widget.doseStreangth, fontSize: 15.0, controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( + keyboardType: TextInputType.numberWithOptions( decimal: true, ), onChanged: (String value) { @@ -279,8 +255,7 @@ class _UpdatePrescriptionFormState extends State { strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - "Only 5 Digits allowed for strength"); + DrAppToastMsg.showErrorToast("Only 5 Digits allowed for strength"); } }, // validator: (value) { @@ -298,59 +273,34 @@ class _UpdatePrescriptionFormState extends State { width: 10.0, ), Container( - width: MediaQuery.of(context) - .size - .width * - 0.3700, + width: MediaQuery.of(context).size.width * 0.3700, child: InkWell( - onTap: - model.itemMedicineListUnit != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListUnit != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListUnit, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units[ - 'description'] - : null, - true), + decoration: textFieldSelectorDecoration( + 'UNIT Type', units != null ? units['description'] : null, true), enabled: false, ), ), @@ -362,24 +312,16 @@ class _UpdatePrescriptionFormState extends State { height: 12, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.itemMedicineListRoute != - null + onTap: model.itemMedicineListRoute != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .itemMedicineListRoute, + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListRoute, attributeName: 'description', - attributeValueId: - 'parameterCode', - okText: TranslationBase.of( - context) - .ok, + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { route = selectedValue; @@ -392,21 +334,15 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'Route', - route != null - ? route['description'] - : null, - true), + decoration: textFieldSelectorDecoration( + 'Route', route != null ? route['description'] : null, true), enabled: false, ), ), @@ -415,23 +351,16 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDoseTimeList != - null + onTap: model.medicationDoseTimeList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDoseTimeList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { doseTime = selectedValue; @@ -441,22 +370,15 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), + decoration: textFieldSelectorDecoration(TranslationBase.of(context).doseTime!, + doseTime != null ? doseTime['nameEn'] : null, true), enabled: false, ), ), @@ -465,50 +387,36 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationFrequencyList != - null + onTap: model.medicationFrequencyList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationFrequencyList, + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationFrequencyList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { - frequencyUpdate = - selectedValue; + frequencyUpdate = selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequencyUpdate != null - ? frequencyUpdate[ - 'nameEn'] - : null, - true), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency!, + frequencyUpdate != null ? frequencyUpdate['nameEn'] : null, + true), enabled: false, ), ), @@ -517,51 +425,36 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - MediaQuery.of(context).size.height * - 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDurationList != - null + onTap: model.medicationDurationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDurationList, + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDurationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { - updatedDuration = - selectedValue; + updatedDuration = selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - updatedDuration != null - ? updatedDuration[ - 'nameEn'] - .toString() - : null, - true), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration!, + updatedDuration != null ? updatedDuration['nameEn'].toString() : null, + true), enabled: false, ), ), @@ -570,46 +463,26 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: model.patientAssessmentList - .isNotEmpty - ? screenSize.height * 0.070 - : 0.0, - width: model.patientAssessmentList - .isNotEmpty - ? double.infinity - : 0.0, - child: model.patientAssessmentList - .isNotEmpty + height: + model.patientAssessmentList.isNotEmpty ? screenSize.height * 0.070 : 0.0, + width: model.patientAssessmentList.isNotEmpty ? double.infinity : 0.0, + child: model.patientAssessmentList.isNotEmpty ? Row( children: [ Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, + width: MediaQuery.of(context).size.width * 0.29, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() + model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].icdCode10ID.toString() : '', - indication != null - ? indication[ - 'name'] - : null, + indication != null ? indication['name'] : null, true), enabled: true, readOnly: true, @@ -617,34 +490,20 @@ class _UpdatePrescriptionFormState extends State { ), ), Container( - width: - MediaQuery.of(context) - .size - .width * - 0.61, + width: MediaQuery.of(context).size.width * 0.61, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( maxLines: 3, decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .asciiDesc - .toString() + model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].asciiDesc.toString() : '', - indication != null - ? indication[ - 'name'] - : null, + indication != null ? indication['name'] : null, true), enabled: true, readOnly: true, @@ -660,22 +519,18 @@ class _UpdatePrescriptionFormState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: () => - selectDate(context, widget.model), + onTap: () => selectDate(context, widget.model), child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - AppDateUtils.getDateFormatted( - DateTime.parse( - widget.startDate)), - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: Helpers.textFieldSelectorDecoration( + AppDateUtils.getDateFormatted(DateTime.parse(widget.startDate)), + selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), @@ -689,14 +544,11 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( + ListSelectDialog dialog = ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -706,21 +558,15 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - "UOM", - widget.uom != null - ? widget.uom - : null, - true), + decoration: textFieldSelectorDecoration( + "UOM", widget.uom != null ? widget.uom : null, true), // enabled: false, readOnly: true, ), @@ -732,14 +578,11 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( + ListSelectDialog dialog = ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, + okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -749,22 +592,17 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - 'Box Quantity', - widget.box != null - ? "Box Quantity: " + - widget.box.toString() - : null, - true), + decoration: textFieldSelectorDecoration( + 'Box Quantity', + widget.box != null ? "Box Quantity: " + widget.box.toString() : null, + true), // enabled: false, readOnly: true, ), @@ -775,11 +613,8 @@ class _UpdatePrescriptionFormState extends State { ), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( controller: remarksController, maxLines: 7, @@ -790,59 +625,39 @@ class _UpdatePrescriptionFormState extends State { height: 10.0, ), SizedBox( - height: - MediaQuery.of(context).size.height * - 0.08, + height: MediaQuery.of(context).size.height * 0.08, ), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( - title: 'update prescription' - .toUpperCase(), + title: 'update prescription'.toUpperCase(), onPressed: () { - if (double.parse( - strengthController.text) > - 1000.0) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); + if (double.parse(strengthController.text) > 1000.0) { + DrAppToastMsg.showErrorToast("1000 is the MAX for the strength"); return; } - if (double.parse( - strengthController - .text) == - 0.0) { - DrAppToastMsg.showErrorToast( - "strength can't be zero"); + if (double.parse(strengthController.text) == 0.0) { + DrAppToastMsg.showErrorToast("strength can't be zero"); return; } - if (strengthController - .text.length > - 4) { - DrAppToastMsg.showErrorToast( - "strength can't be more then 4 digits "); + if (strengthController.text.length > 4) { + DrAppToastMsg.showErrorToast("strength can't be more then 4 digits "); return; } // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) updatePrescription( newStartDate: selectedDate, - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController - .text - : widget - .doseStreangth, + newDoseStreangth: strengthController.text.isNotEmpty + ? strengthController.text + : widget.doseStreangth, newUnit: units != null - ? units['parameterCode'] - .toString() + ? units['parameterCode'].toString() : widget.doseUnit, doseUnit: widget.doseUnit, - doseStreangth: - widget.doseStreangth, + doseStreangth: widget.doseStreangth, duration: widget.duration, startDate: widget.startDate, doseId: widget.dose, @@ -850,30 +665,18 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: - updatedDuration != null - ? updatedDuration['id'] - .toString() - : widget.duration, + newDuration: updatedDuration != null + ? updatedDuration['id'].toString() + : widget.duration, drugId: widget.drugId, - remarks: remarksController - .text, - route: route != null - ? route['parameterCode'] - .toString() - : widget.route, - frequency: - frequencyUpdate != null - ? frequencyUpdate[ - 'id'] - .toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'] - .toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); + remarks: remarksController.text, + route: + route != null ? route['parameterCode'].toString() : widget.route, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'].toString() + : widget.frequency, + dose: doseTime != null ? doseTime['id'].toString() : widget.dose, + enteredRemarks: widget.enteredRemarks); Navigator.pop(context); }, ), @@ -898,7 +701,7 @@ class _UpdatePrescriptionFormState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( + final DateTime? picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -912,9 +715,8 @@ class _UpdatePrescriptionFormState extends State { } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -945,30 +747,29 @@ class _UpdatePrescriptionFormState extends State { } updatePrescription( - {PrescriptionViewModel model, - int drugId, - String newDrugId, - String frequencyId, - String remarks, - String dose, - String doseId, - String frequency, - String route, - String routeId, - String startDate, - DateTime newStartDate, - String doseUnit, - String doseStreangth, - String newDoseStreangth, - String duration, - String newDuration, - String newUnit, - String enteredRemarks, - PatiantInformtion patient}) async { + {required PrescriptionViewModel model, + required int drugId, + String? newDrugId, + required String frequencyId, + required String remarks, + required String dose, + required String doseId, + required String frequency, + required String route, + required String routeId, + required String startDate, + required DateTime newStartDate, + required String doseUnit, + required String doseStreangth, + required String newDoseStreangth, + required String duration, + required String newDuration, + required String newUnit, + required String enteredRemarks, + required PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = - new PostPrescriptionReqModel(); - List sss = List(); + PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); + List sss = []; updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; updatePrescriptionReqModel.clinicID = patient.clinicId; @@ -977,31 +778,22 @@ class _UpdatePrescriptionFormState extends State { sss.add(PrescriptionRequestModel( covered: true, - dose: newDoseStreangth.isNotEmpty - ? double.parse(newDoseStreangth) - : double.parse(doseStreangth), + dose: newDoseStreangth.isNotEmpty ? double.parse(newDoseStreangth) : double.parse(doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, - doseUnitId: - newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), + doseUnitId: newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), - frequency: frequency.isNotEmpty - ? int.parse(frequency) - : int.parse(frequencyId), + frequency: frequency.isNotEmpty ? int.parse(frequency) : int.parse(frequencyId), remarks: remarks.isEmpty ? enteredRemarks : remarks, approvalRequired: true, icdcode10Id: "test2", doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: newDuration.isNotEmpty - ? int.parse(newDuration) - : int.parse(duration), - doseStartDate: - newStartDate != null ? newStartDate.toIso8601String() : startDate)); + duration: newDuration.isNotEmpty ? int.parse(newDuration) : int.parse(duration), + doseStartDate: newStartDate != null ? newStartDate.toIso8601String() : startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; - await model.updatePrescription( - updatePrescriptionReqModel, patient.patientMRN); + await model.updatePrescription(updatePrescriptionReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -1013,22 +805,22 @@ class _UpdatePrescriptionFormState extends State { void updatePrescriptionForm( {context, - String drugName, - String drugNameGeneric, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - String duration, - String doseStreangth, - String doseUnit, - String enteredRemarks, - String uom, - int box, - String startDate}) { + required String drugName, + required String drugNameGeneric, + required int drugId, + required String remarks, + required PrescriptionViewModel model, + required PatiantInformtion patient, + required String rouat, + required String frequency, + required String dose, + required String duration, + required String doseStreangth, + required String doseUnit, + required String enteredRemarks, + required String uom, + required int box, + required String startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 06e56f03..c1901411 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -23,16 +23,16 @@ class ExpansionProcedure extends StatefulWidget { final ProcedureTempleteDetailsModel groupProcedures; const ExpansionProcedure( - {Key key, - this.procedureTempleteModel, - this.model, - this.removeFavProcedure, - this.addFavProcedure, - this.selectProcedures, - this.isEntityListSelected, - this.isEntityFavListSelected, + {Key? key, + required this.procedureTempleteModel, + required this.model, + required this.removeFavProcedure, + required this.addFavProcedure, + required this.selectProcedures, + required this.isEntityListSelected, + required this.isEntityFavListSelected, this.isProcedure = true, - this.groupProcedures}) + required this.groupProcedures}) : super(key: key); @override @@ -77,8 +77,8 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: AppText( widget.isProcedure == true - ? "Procedures for " + widget.procedureTempleteModel.templateName - : "Prescription for " + widget.procedureTempleteModel.templateName, + ? "Procedures for " + widget.procedureTempleteModel.templateName! + : "Prescription for " + widget.procedureTempleteModel.templateName!, fontSize: 16.0, variant: "bodyText", bold: true, @@ -142,7 +142,7 @@ class _ExpansionProcedureState extends State { ? Checkbox( value: widget.isEntityFavListSelected(itemProcedure), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { if (widget.isEntityFavListSelected(itemProcedure)) { widget.removeFavProcedure(itemProcedure); @@ -155,8 +155,8 @@ class _ExpansionProcedureState extends State { value: itemProcedure, groupValue: widget.groupProcedures, activeColor: Color(0xffD02127), - onChanged: (newValue) { - widget.selectProcedures(newValue); + onChanged: (ProcedureTempleteDetailsModel? newValue) { + widget.selectProcedures(newValue!); })), Expanded( child: Padding( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index d998ca58..ef9478d5 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -14,19 +14,19 @@ import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { final Function onTap; final EntityList entityList; - final String categoryName; + final String? categoryName; final int categoryID; final PatiantInformtion patient; final int doctorID; const ProcedureCard({ - Key key, - this.onTap, - this.entityList, - this.categoryID, + Key? key, + required this.onTap, + required this.entityList, + required this.categoryID, this.categoryName, - this.patient, - this.doctorID, + required this.patient, + required this.doctorID, }) : super(key: key); @override @@ -54,15 +54,13 @@ class ProcedureCard extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: - entityList.orderType == 0 ? Colors.black : Colors.red[500], + color: entityList.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( child: Container( padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, - right: projectViewModel.isArabic ? 15 : 0), + left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -75,12 +73,8 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList.orderType == 0 - ? 'Routine' - : 'Urgent', - color: entityList.orderType == 0 - ? Colors.black - : Colors.red[800], + entityList.orderType == 0 ? 'Routine' : 'Urgent', + color: entityList.orderType == 0 ? Colors.black : Colors.red[800], fontWeight: FontWeight.w600, ), SizedBox( @@ -102,13 +96,13 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -174,8 +168,7 @@ class ProcedureCard extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, @@ -186,9 +179,7 @@ class ProcedureCard extends StatelessWidget { 'assets/images/male_avatar.png', height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, ))), @@ -196,8 +187,7 @@ class ProcedureCard extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -254,12 +244,11 @@ class ProcedureCard extends StatelessWidget { fontSize: 12, ), ), - if ((entityList.categoryID == 2 || - entityList.categoryID == 4) && + if ((entityList.categoryID == 2 || entityList.categoryID == 4) && doctorID == entityList.doctorID) InkWell( child: Icon(DoctorApp.edit), - onTap: onTap, + onTap: onTap(), ) ], ), diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 9b5a97ad..8fa3220e 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -20,17 +20,17 @@ import 'package:flutter/material.dart'; class AddFavouriteProcedure extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - final String categoryID; + final String? categoryID; final String addButtonTitle; final String toolbarTitle; AddFavouriteProcedure( - {Key key, - this.model, - this.patient, + {Key? key, + required this.model, + required this.patient, this.categoryID, - @required this.addButtonTitle, - @required this.toolbarTitle}); + required this.addButtonTitle, + required this.toolbarTitle}); @override _AddFavouriteProcedureState createState() => _AddFavouriteProcedureState(); @@ -39,17 +39,15 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - List entityList = List(); + ProcedureViewModel? model; + PatiantInformtion? patient; + List entityList = []; @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( @@ -73,8 +71,7 @@ class _AddFavouriteProcedureState extends State { entityList.add(history); }); }, - isEntityFavListSelected: (master) => - isEntityListSelected(master), + isEntityFavListSelected: (master) => isEntityListSelected(master), ), ), ), @@ -84,15 +81,13 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.addButtonTitle ?? - TranslationBase.of(context).addSelectedProcedures, + title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -122,9 +117,7 @@ class _AddFavouriteProcedureState 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/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 354ada19..53024aca 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -19,10 +19,8 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.appointmentNo; procedureValadteRequestModel.episodeID = patient.episodeNo; @@ -30,19 +28,18 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + required String remarks, + String? orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -50,27 +47,22 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + 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)); + 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.valadteProcedureList[0].entityList!.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -83,8 +75,7 @@ postProcedure( Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast(model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -92,8 +83,7 @@ postProcedure( } } -void addSelectedProcedure( - context, ProcedureViewModel model, PatiantInformtion patient) { +void addSelectedProcedure(context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( context: context, isScrollControlled: true, @@ -109,25 +99,23 @@ class AddSelectedProcedure extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddSelectedProcedure({Key key, this.model, this.patient}) - : super(key: key); + const AddSelectedProcedure({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddSelectedProcedureState createState() => - _AddSelectedProcedureState(patient: patient, model: model); + _AddSelectedProcedureState createState() => _AddSelectedProcedureState(patient: patient, model: model); } class _AddSelectedProcedureState extends State { - int selectedType; + late int selectedType; ProcedureViewModel model; PatiantInformtion patient; - _AddSelectedProcedureState({this.patient, this.model}); + _AddSelectedProcedureState({required this.patient, required this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -141,8 +129,7 @@ class _AddSelectedProcedureState extends State { @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: Column( children: [ @@ -156,8 +143,7 @@ class _AddSelectedProcedureState extends State { minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: (BuildContext context, - ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.20, @@ -166,29 +152,22 @@ class _AddSelectedProcedureState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + TranslationBase.of(context).pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ]), SizedBox( - height: - MediaQuery.of(context).size.height * 0.04, + height: MediaQuery.of(context).size.height * 0.04, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * - 0.79, + width: MediaQuery.of(context).size.width * 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, + hintText: TranslationBase.of(context).searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -200,36 +179,28 @@ class _AddSelectedProcedureState extends State { // categoryName: procedureName.text); // }, onClick: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) + if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model.getProcedureCategory( - patientId: patient.patientId, - categoryName: - procedureName.text); + patientId: patient.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, + TranslationBase.of(context).atLeastThreeCharacters, ); }, ), ), SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, + width: MediaQuery.of(context).size.width * 0.02, ), Expanded( child: InkWell( onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) + if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model.getProcedureCategory( - patientId: patient.patientId, - categoryName: procedureName.text); + patientId: patient.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, + TranslationBase.of(context).atLeastThreeCharacters, ); }, child: Icon( @@ -240,14 +211,12 @@ class _AddSelectedProcedureState extends State { ), ], ), - if (procedureName.text.isNotEmpty && - model.procedureList.length != 0) + if (procedureName.text.isNotEmpty && model.procedureList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, - masterList: widget - .model.categoriesList[0].entityList, + masterList: widget.model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -262,8 +231,7 @@ class _AddSelectedProcedureState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => - isEntityListSelected(master), + isEntityListSelected: (master) => isEntityListSelected(master), )), SizedBox( height: 115.0, @@ -288,8 +256,7 @@ class _AddSelectedProcedureState extends State { onPressed: () { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -313,17 +280,15 @@ class _AddSelectedProcedureState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + 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}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_lab_home_screen.dart b/lib/screens/procedures/add_lab_home_screen.dart index d86c4ecd..c6a83538 100644 --- a/lib/screens/procedures/add_lab_home_screen.dart +++ b/lib/screens/procedures/add_lab_home_screen.dart @@ -17,18 +17,16 @@ 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); + const AddLabHomeScreen({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddLabHomeScreenState createState() => - _AddLabHomeScreenState(patient: patient, model: model); + _AddLabHomeScreenState createState() => _AddLabHomeScreenState(patient: patient, model: model); } -class _AddLabHomeScreenState extends State - with SingleTickerProviderStateMixin { - _AddLabHomeScreenState({this.patient, this.model}); +class _AddLabHomeScreenState extends State with SingleTickerProviderStateMixin { + _AddLabHomeScreenState({required this.patient, required this.model}); ProcedureViewModel model; PatiantInformtion patient; - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -54,125 +52,116 @@ class _AddLabHomeScreenState extends State 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, + 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, ), - 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', - ), - ], - ), + 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, - ), - ], + ), + ), + 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}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index b8d4e7c7..025387a1 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -18,10 +18,8 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.appointmentNo; procedureValadteRequestModel.episodeID = patient.episodeNo; @@ -29,19 +27,18 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + required String remarks, + required String orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -49,27 +46,22 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + 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)); + 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.valadteProcedureList[0].entityList!.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -82,8 +74,7 @@ postProcedure( Helpers.showErrorToast(model.error); model.getLabs(patient); } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast(model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -91,8 +82,7 @@ postProcedure( } } -void addSelectedLabOrder( - context, ProcedureViewModel model, PatiantInformtion patient) { +void addSelectedLabOrder(context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( context: context, isScrollControlled: true, @@ -108,22 +98,20 @@ class AddSelectedLabOrder extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddSelectedLabOrder({Key key, this.model, this.patient}) - : super(key: key); + const AddSelectedLabOrder({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddSelectedLabOrderState createState() => - _AddSelectedLabOrderState(patient: patient, model: model); + _AddSelectedLabOrderState createState() => _AddSelectedLabOrderState(patient: patient, model: model); } class _AddSelectedLabOrderState extends State { - int selectedType; + late int selectedType; ProcedureViewModel model; PatiantInformtion patient; - _AddSelectedLabOrderState({this.patient, this.model}); + _AddSelectedLabOrderState({required this.patient, required this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; dynamic selectedCategory; @@ -137,10 +125,9 @@ class _AddSelectedLabOrderState extends State { 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( + 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, @@ -148,8 +135,7 @@ class _AddSelectedLabOrderState extends State { minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * .90, @@ -166,8 +152,7 @@ class _AddSelectedLabOrderState extends State { baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, + masterList: widget.model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -182,8 +167,7 @@ class _AddSelectedLabOrderState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => - isEntityListSelected(master), + isEntityListSelected: (master) => isEntityListSelected(master), )), ], ), @@ -204,8 +188,7 @@ class _AddSelectedLabOrderState extends State { onPressed: () { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -227,17 +210,15 @@ class _AddSelectedLabOrderState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + 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}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_procedure_homeScreen.dart b/lib/screens/procedures/add_procedure_homeScreen.dart index 39ed4b25..8b1a6d2c 100644 --- a/lib/screens/procedures/add_procedure_homeScreen.dart +++ b/lib/screens/procedures/add_procedure_homeScreen.dart @@ -15,18 +15,16 @@ import 'package:flutter/material.dart'; class AddProcedureHome extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddProcedureHome({Key key, this.model, this.patient}) : super(key: key); + const AddProcedureHome({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddProcedureHomeState createState() => - _AddProcedureHomeState(patient: patient, model: model); + _AddProcedureHomeState createState() => _AddProcedureHomeState(patient: patient, model: model); } -class _AddProcedureHomeState extends State - with SingleTickerProviderStateMixin { - _AddProcedureHomeState({this.patient, this.model}); +class _AddProcedureHomeState extends State with SingleTickerProviderStateMixin { + _AddProcedureHomeState({required this.patient, required this.model}); ProcedureViewModel model; PatiantInformtion patient; - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -55,8 +53,7 @@ class _AddProcedureHomeState extends State final screenSize = MediaQuery.of(context).size; return BaseView( //onModelReady: (model) => model.getCategory(), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, @@ -64,8 +61,7 @@ class _AddProcedureHomeState extends State minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return Container( height: MediaQuery.of(context).size.height * 1.20, child: Padding( @@ -73,24 +69,22 @@ class _AddProcedureHomeState extends State 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); - }, - ) - ]), + 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, ), @@ -98,16 +92,13 @@ class _AddProcedureHomeState extends State child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Container( - height: - MediaQuery.of(context).size.height * 0.070, + 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 + bottom: + BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 ), color: Colors.white), child: Center( @@ -118,8 +109,7 @@ class _AddProcedureHomeState extends State indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget( @@ -147,7 +137,7 @@ class _AddProcedureHomeState extends State AddFavouriteProcedure( patient: patient, model: model, - addButtonTitle: TranslationBase.of(context).addSelectedProcedures, + addButtonTitle: TranslationBase.of(context).addSelectedProcedures!, toolbarTitle: 'Add Procedure', ), AddSelectedProcedure( @@ -171,8 +161,7 @@ class _AddProcedureHomeState extends State ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index dc68aacc..dbd1d774 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -18,10 +18,8 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, - List entityList) async { - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.appointmentNo; procedureValadteRequestModel.episodeID = patient.episodeNo; @@ -29,19 +27,18 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, } postProcedure( - {ProcedureViewModel model, - String remarks, - String orderType, - PatiantInformtion patient, - List entityList}) async { + {required ProcedureViewModel model, + required String remarks, + String? orderType, + required PatiantInformtion patient, + required List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -49,27 +46,22 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + procedureValadteRequestModel.procedure = [element.procedureId!]; + List controls = []; controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + 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)); + 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.valadteProcedureList[0].entityList!.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN!); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -82,8 +74,7 @@ postProcedure( Helpers.showErrorToast(model.error); model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { - Helpers.showErrorToast( - model.valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast(model.valadteProcedureList[0].entityList![0].warringMessages); } } } else { @@ -91,8 +82,7 @@ postProcedure( } } -void addSelectedRadiologyOrder( - context, ProcedureViewModel model, PatiantInformtion patient) { +void addSelectedRadiologyOrder(context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( context: context, isScrollControlled: true, @@ -108,25 +98,23 @@ class AddSelectedRadiologyOrder extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; - const AddSelectedRadiologyOrder({Key key, this.model, this.patient}) - : super(key: key); + const AddSelectedRadiologyOrder({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddSelectedRadiologyOrderState createState() => - _AddSelectedRadiologyOrderState(patient: patient, model: model); + _AddSelectedRadiologyOrderState createState() => _AddSelectedRadiologyOrderState(patient: patient, model: model); } class _AddSelectedRadiologyOrderState extends State { - int selectedType; + late int selectedType; ProcedureViewModel model; PatiantInformtion patient; - _AddSelectedRadiologyOrderState({this.patient, this.model}); + _AddSelectedRadiologyOrderState({required this.patient, required this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = List(); - List entityListProcedure = List(); + List entityList = []; + List entityListProcedure = []; dynamic selectedCategory; @@ -140,10 +128,9 @@ class _AddSelectedRadiologyOrderState extends State { 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( + 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, @@ -151,8 +138,7 @@ class _AddSelectedRadiologyOrderState extends State { minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.0, @@ -169,8 +155,7 @@ class _AddSelectedRadiologyOrderState extends State { baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, + masterList: widget.model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -185,8 +170,7 @@ class _AddSelectedRadiologyOrderState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => - isEntityListSelected(master), + isEntityListSelected: (master) => isEntityListSelected(master), )), ], ), @@ -206,8 +190,7 @@ class _AddSelectedRadiologyOrderState extends State { fontWeight: FontWeight.w700, onPressed: () { if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context) - .fillTheMandatoryProcedureDetails); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).fillTheMandatoryProcedureDetails); return; } @@ -228,17 +211,15 @@ class _AddSelectedRadiologyOrderState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + 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}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_radiology_screen.dart b/lib/screens/procedures/add_radiology_screen.dart index 26308553..63b5f7f5 100644 --- a/lib/screens/procedures/add_radiology_screen.dart +++ b/lib/screens/procedures/add_radiology_screen.dart @@ -18,18 +18,16 @@ 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); + const AddRadiologyScreen({Key? key, required this.model, required this.patient}) : super(key: key); @override - _AddRadiologyScreenState createState() => - _AddRadiologyScreenState(patient: patient, model: model); + _AddRadiologyScreenState createState() => _AddRadiologyScreenState(patient: patient, model: model); } -class _AddRadiologyScreenState extends State - with SingleTickerProviderStateMixin { - _AddRadiologyScreenState({this.patient, this.model}); +class _AddRadiologyScreenState extends State with SingleTickerProviderStateMixin { + _AddRadiologyScreenState({required this.patient, required this.model}); ProcedureViewModel model; PatiantInformtion patient; - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -55,125 +53,116 @@ class _AddRadiologyScreenState extends State 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, + 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, ), - 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', - ), - ], - ), + 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, - ), - ], + ), + ), + 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}) { + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 801c730c..ea743e6b 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,7 +1,7 @@ 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 '../../widgets/shared/text_fields/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'; @@ -14,32 +14,30 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final Function addSelectedHistories; final Function(EntityList) removeHistory; final Function(EntityList) addHistory; - final Function(EntityList) addRemarks; + final Function(EntityList)? addRemarks; final bool Function(EntityList) isEntityListSelected; final List masterList; EntityListCheckboxSearchWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isEntityListSelected, + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isEntityListSelected, this.addRemarks}) : super(key: key); @override - _EntityListCheckboxSearchWidgetState createState() => - _EntityListCheckboxSearchWidgetState(); + _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); } -class _EntityListCheckboxSearchWidgetState - extends State { +class _EntityListCheckboxSearchWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -47,9 +45,9 @@ class _EntityListCheckboxSearchWidgetState }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -70,9 +68,7 @@ class _EntityListCheckboxSearchWidgetState child: Center( child: Container( margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white), child: ListView( children: [ TextFields( @@ -96,27 +92,21 @@ class _EntityListCheckboxSearchWidgetState title: Row( children: [ Checkbox( - value: widget.isEntityListSelected( - historyInfo), + value: widget.isEntityListSelected(historyInfo), activeColor: Color(0xffD02127), - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget.removeHistory( - historyInfo); + if (widget.isEntityListSelected(historyInfo)) { + widget.removeHistory(historyInfo); } else { - widget - .addHistory(historyInfo); + widget.addHistory(historyInfo); } }); }), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: AppText( - historyInfo.procedureName, + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: AppText(historyInfo.procedureName, fontSize: 14.0, variant: "bodyText", bold: true, @@ -128,24 +118,17 @@ class _EntityListCheckboxSearchWidgetState children: [ Container( child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12), + padding: EdgeInsets.symmetric(horizontal: 12), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 11), + padding: const EdgeInsets.symmetric(horizontal: 11), child: AppText( - TranslationBase.of( - context) - .orderType, - fontWeight: - FontWeight.w700, + TranslationBase.of(context).orderType, + fontWeight: FontWeight.w700, color: Color(0xff2B353E), ), ), @@ -154,17 +137,13 @@ class _EntityListCheckboxSearchWidgetState Row( children: [ Radio( - activeColor: - Color(0xFFD02127), + activeColor: Color(0xFFD02127), value: 0, groupValue: selectedType, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + onChanged: (int? value) { + historyInfo.type = setSelectedType(value!).toString(); - historyInfo.type = - value.toString(); + historyInfo.type = value.toString(); }, ), AppText( @@ -173,22 +152,17 @@ class _EntityListCheckboxSearchWidgetState fontWeight: FontWeight.w600, ), Radio( - activeColor: - Color(0xFFD02127), + activeColor: Color(0xFFD02127), groupValue: selectedType, value: 1, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + onChanged: (int? value) { + historyInfo.type = setSelectedType(value!).toString(); - historyInfo.type = - value.toString(); + historyInfo.type = value.toString(); }, ), AppText( - TranslationBase.of(context) - .urgent, + TranslationBase.of(context).urgent, color: Color(0xff575757), fontWeight: FontWeight.w600, ), @@ -202,11 +176,9 @@ class _EntityListCheckboxSearchWidgetState height: 2.0, ), Padding( - padding: EdgeInsets.symmetric( - horizontal: 12, vertical: 12.0), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 12.0), child: TextFields( - hintText: TranslationBase.of(context) - .remarks, + hintText: TranslationBase.of(context).remarks, //controller: remarksController, onChanged: (value) { historyInfo.remarks = value; @@ -226,8 +198,7 @@ class _EntityListCheckboxSearchWidgetState ) : Center( child: Container( - child: AppText("Sorry , No Match", - color: Color(0xFFB9382C)), + child: AppText("Sorry , No Match", color: Color(0xFFB9382C)), ), ) ], @@ -244,12 +215,12 @@ class _EntityListCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index c386afc8..9d0835ae 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel. 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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/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'; @@ -15,32 +15,32 @@ import 'ExpansionProcedure.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { final ProcedureViewModel model; - final Function addSelectedHistories; - final Function(ProcedureTempleteModel) removeHistory; - final Function(ProcedureTempleteModel) addHistory; - final Function(ProcedureTempleteModel) addRemarks; + final Function? addSelectedHistories; + final Function(ProcedureTempleteModel)? removeHistory; + final Function(ProcedureTempleteModel)? addHistory; + final Function(ProcedureTempleteModel)? addRemarks; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; - final ProcedureTempleteDetailsModel groupProcedures; + final Function(ProcedureTempleteDetailsModel)? selectProcedures; + final ProcedureTempleteDetailsModel? groupProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; - final List masterList; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; + final List? masterList; final bool isProcedure; EntityListCheckboxSearchFavProceduresWidget( - {Key key, - this.model, + {Key? key, + required this.model, this.addSelectedHistories, this.removeHistory, this.masterList, this.addHistory, - this.addFavProcedure, + required this.addFavProcedure, this.selectProcedures, - this.removeFavProcedure, + required this.removeFavProcedure, this.isEntityListSelected, this.isEntityFavListSelected, this.addRemarks, @@ -55,8 +55,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class _EntityListCheckboxSearchFavProceduresWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -64,10 +64,10 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State items = List(); - List itemsProcedure = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List itemsProcedure = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -112,11 +112,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State dummySearchList = List(); - dummySearchList.addAll(widget.masterList); + List dummySearchList = []; + dummySearchList.addAll(widget.masterList!); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.templateName.toLowerCase().contains(query.toLowerCase())) { + if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -152,7 +152,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State masterList; ProcedureListWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isEntityListSelected, - this.addRemarks}) + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isEntityListSelected, + required this.addRemarks}) : super(key: key); @override @@ -36,8 +36,8 @@ class ProcedureListWidget extends StatefulWidget { class _ProcedureListWidgetState extends State { int selectedType = 0; - int typeUrgent; - int typeRegular; + late int typeUrgent; + late int typeRegular; setSelectedType(int val) { setState(() { @@ -45,9 +45,9 @@ class _ProcedureListWidgetState extends State { }); } - List items = List(); - List remarksList = List(); - List typeList = List(); + List items = []; + List remarksList = []; + List typeList = []; @override void initState() { @@ -68,9 +68,7 @@ class _ProcedureListWidgetState extends State { child: Center( child: Container( margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: ListView( children: [ TextFields( @@ -91,15 +89,12 @@ class _ProcedureListWidgetState extends State { Row( children: [ Checkbox( - value: widget.isEntityListSelected( - historyInfo), + value: widget.isEntityListSelected(historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget - .removeHistory(historyInfo); + if (widget.isEntityListSelected(historyInfo)) { + widget.removeHistory(historyInfo); } else { widget.addHistory(historyInfo); } @@ -107,13 +102,9 @@ class _ProcedureListWidgetState extends State { }), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: AppText( - historyInfo.procedureName, - variant: "bodyText", - bold: true, - color: Colors.black), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), + child: AppText(historyInfo.procedureName, + variant: "bodyText", bold: true, color: Colors.black), ), ), ], @@ -125,9 +116,7 @@ class _ProcedureListWidgetState extends State { ) : Center( child: Container( - child: AppText( - "There's no procedures for this category", - color: Color(0xFFB9382C)), + child: AppText("There's no procedures for this category", color: Color(0xFFB9382C)), ), ) ], @@ -144,12 +133,12 @@ class _ProcedureListWidgetState extends State { } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index 76d6cf6f..aa898411 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -6,7 +6,7 @@ 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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.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'; @@ -21,23 +21,25 @@ class ProcedureCheckOutScreen extends StatefulWidget { final String toolbarTitle; ProcedureCheckOutScreen( - {this.items, this.model, this.patient,@required this.addButtonTitle,@required this.toolbarTitle}); + {required this.items, + required this.model, + required this.patient, + required this.addButtonTitle, + required this.toolbarTitle}); @override - _ProcedureCheckOutScreenState createState() => - _ProcedureCheckOutScreenState(); + _ProcedureCheckOutScreenState createState() => _ProcedureCheckOutScreenState(); } class _ProcedureCheckOutScreenState extends State { - List remarksList = List(); + List remarksList = []; final TextEditingController remarksController = TextEditingController(); - List typeList = List(); + List typeList = []; @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), isShowAppBar: false, body: SingleChildScrollView( @@ -82,10 +84,8 @@ class _ProcedureCheckOutScreenState extends State { widget.items.length, (index) => Container( margin: EdgeInsets.only(bottom: 15.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.all(Radius.circular(10.0))), + decoration: + BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10.0))), child: ExpansionTile( initiallyExpanded: true, title: Row( @@ -98,9 +98,7 @@ class _ProcedureCheckOutScreenState extends State { SizedBox( width: 6.0, ), - Expanded( - child: AppText( - widget.items[index].procedureName)), + Expanded(child: AppText(widget.items[index].procedureName)), ], ), children: [ @@ -113,11 +111,9 @@ class _ProcedureCheckOutScreenState extends State { Row( children: [ Padding( - padding: const EdgeInsets.symmetric( - horizontal: 11), + padding: const EdgeInsets.symmetric(horizontal: 11), child: AppText( - TranslationBase.of(context) - .orderType, + TranslationBase.of(context).orderType, fontWeight: FontWeight.w700, color: Color(0xff2B353E), ), @@ -129,14 +125,11 @@ class _ProcedureCheckOutScreenState extends State { Radio( activeColor: Color(0xFFD02127), value: 0, - groupValue: - widget.items[index].selectedType, + groupValue: widget.items[index].selectedType, onChanged: (value) { - widget.items[index].selectedType = - 0; + widget.items[index].selectedType = 0; setState(() { - widget.items[index].type = - value.toString(); + widget.items[index].type = value.toString(); }); }, ), @@ -147,15 +140,12 @@ class _ProcedureCheckOutScreenState extends State { ), Radio( activeColor: Color(0xFFD02127), - groupValue: - widget.items[index].selectedType, + groupValue: widget.items[index].selectedType, value: 1, onChanged: (value) { - widget.items[index].selectedType = - 1; + widget.items[index].selectedType = 1; setState(() { - widget.items[index].type = - value.toString(); + widget.items[index].type = value.toString(); }); }, ), @@ -174,8 +164,7 @@ class _ProcedureCheckOutScreenState extends State { height: 2.0, ), Padding( - padding: EdgeInsets.symmetric( - horizontal: 12, vertical: 15.0), + padding: EdgeInsets.symmetric(horizontal: 12, vertical: 15.0), child: TextFields( hintText: TranslationBase.of(context).remarks, controller: remarksController, @@ -211,7 +200,7 @@ class _ProcedureCheckOutScreenState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - List entityList = List(); + List entityList = []; widget.items.forEach((element) { entityList.add( EntityList( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index f6752c4a..a35f826d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -17,7 +17,7 @@ import 'package:flutter/material.dart'; import 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { - int doctorNameP; + int? doctorNameP; void initState() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -27,7 +27,7 @@ class ProcedureScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -38,8 +38,7 @@ class ProcedureScreen extends StatelessWidget { mrn: patient.patientId, patientType: patientType, ), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, @@ -57,8 +56,7 @@ class ProcedureScreen extends StatelessWidget { SizedBox( height: 12, ), - if (model.procedureList.length == 0 && - patient.patientStatusType != 43) + if (model.procedureList.length == 0 && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -78,8 +76,7 @@ class ProcedureScreen 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( @@ -99,8 +96,7 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) InkWell( onTap: () { @@ -156,45 +152,33 @@ class ProcedureScreen extends StatelessWidget { ), if (model.procedureList.isNotEmpty) ...List.generate( - model.procedureList[0].rowcount, + model.procedureList[0].rowcount!, (index) => ProcedureCard( - categoryID: - model.procedureList[0].entityList[index].categoryID, - entityList: model.procedureList[0].entityList[index], + categoryID: model.procedureList[0].entityList![index].categoryID!, + entityList: model.procedureList[0].entityList![index], onTap: () { - if (model.procedureList[0].entityList[index].categoryID == - 2 || - model.procedureList[0].entityList[index].categoryID == 4) + if (model.procedureList[0].entityList![index].categoryID == 2 || + model.procedureList[0].entityList![index].categoryID == 4) updateProcedureForm(context, model: model, patient: patient, - remarks: model - .procedureList[0].entityList[index].remarks, - orderType: model - .procedureList[0].entityList[index].orderType - .toString(), - orderNo: model - .procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0] - .entityList[index].procedureName, - categoreId: model - .procedureList[0].entityList[index].categoryID - .toString(), - procedureId: model.procedureList[0] - .entityList[index].procedureId, - limetNo: model.procedureList[0].entityList[index] - .lineItemNo); + remarks: model.procedureList[0].entityList![index].remarks!, + orderType: model.procedureList[0].entityList![index].orderType.toString(), + orderNo: model.procedureList[0].entityList![index].orderNo!, + procedureName: model.procedureList[0].entityList![index].procedureName!, + categoreId: model.procedureList[0].entityList![index].categoryID.toString(), + procedureId: model.procedureList[0].entityList![index].procedureId!, + limetNo: model.procedureList[0].entityList![index].lineItemNo!); // } else // Helpers.showErrorToast( // 'You Cant Update This Procedure'); }, patient: patient, - doctorID: model?.doctorProfile?.doctorID, + doctorID: model!.doctorProfile!.doctorID!, ), ), if (model.state == ViewState.ErrorLocal || - (model.procedureList.isNotEmpty && - model.procedureList[0].entityList.isEmpty)) + (model.procedureList.isNotEmpty && model.procedureList[0].entityList!.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -205,9 +189,7 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: AppText(model.procedureList.isEmpty - ? model.error - : 'No Procedure Found '), + child: AppText(model.procedureList.isEmpty ? model.error : 'No Procedure Found '), ) ], ), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 24c4ea41..1909fec7 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -9,7 +9,7 @@ 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/TextFields.dart'; +import '../../widgets/shared/text_fields/TextFields.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'; @@ -17,15 +17,15 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, - {String procedureName, - int orderNo, - int limetNo, - PatiantInformtion patient, - String orderType, - String procedureId, - String remarks, - ProcedureViewModel model, - String categoreId}) { + {required String procedureName, + required int orderNo, + required int limetNo, + required PatiantInformtion patient, + required String orderType, + required String procedureId, + required String remarks, + required ProcedureViewModel model, + required String categoreId}) { //ProcedureViewModel model2 = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); @@ -59,15 +59,15 @@ class UpdateProcedureWidget extends StatefulWidget { final int limetNo; UpdateProcedureWidget( - {this.model, - this.procedureName, - this.remarks, - this.remarksController, - this.patient, - this.procedureId, - this.categoryId, - this.orderNo, - this.limetNo}); + {required this.model, + required this.procedureName, + required this.remarks, + required this.remarksController, + required this.patient, + required this.procedureId, + required this.categoryId, + required this.orderNo, + required this.limetNo}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } @@ -85,26 +85,22 @@ class _UpdateProcedureWidgetState extends State { widget.remarksController.text = widget.remarks; } - List entityList = List(); + List entityList = []; dynamic selectedCategory; @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) => model.getCategory(), - builder: - (BuildContext context, ProcedureViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, ProcedureViewModel model, Widget? child) => NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 0.9, child: Form( child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -246,8 +242,8 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), value: 0, groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), Text('routine'), @@ -255,11 +251,11 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), groupValue: selectedType, value: 1, - onChanged: (value) { - setSelectedType(value); + onChanged: (int? value) { + setSelectedType(value!); }, ), - Text(TranslationBase.of(context).urgent), + Text(TranslationBase.of(context).urgent ?? ""), ], ), ), @@ -268,16 +264,12 @@ class _UpdateProcedureWidgetState extends State { ), Container( decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( fontSize: 15.0, controller: widget.remarksController, - hintText: widget.remarksController.text.isEmpty - ? 'No Remarks Added' - : '', + hintText: widget.remarksController.text.isEmpty ? 'No Remarks Added' : '', maxLines: 3, minLines: 2, onChanged: (value) {}, @@ -287,16 +279,13 @@ class _UpdateProcedureWidgetState extends State { height: 70.0, ), Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), child: Column( //alignment: WrapAlignment.center, children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of(context) - .updateProcedure - .toUpperCase(), + title: TranslationBase.of(context).updateProcedure!.toUpperCase(), onPressed: () { // if (entityList.isEmpty == true && // widget.remarksController.text == @@ -343,20 +332,19 @@ class _UpdateProcedureWidgetState extends State { } updateProcedure( - {ProcedureViewModel model, - String remarks, - int limetNO, - int orderNo, - String newProcedureId, - String newCategorieId, - List entityList, - String orderType, - String procedureId, - PatiantInformtion patient, - String categorieId}) async { - UpdateProcedureRequestModel updateProcedureReqModel = - new UpdateProcedureRequestModel(); - List controls = List(); + {required ProcedureViewModel model, + required String remarks, + required int limetNO, + required int orderNo, + String? newProcedureId, + String? newCategorieId, + required List entityList, + required String orderType, + required String procedureId, + required PatiantInformtion patient, + required String categorieId}) async { + UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel(); + List controls = []; ProcedureDetail controlsProcedure = new ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -385,8 +373,7 @@ class _UpdateProcedureWidgetState extends State { // else { { controls.add( - Controls( - code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), + Controls(code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: orderType), @@ -401,9 +388,7 @@ class _UpdateProcedureWidgetState extends State { // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; - await model.updateProcedure( - updateProcedureRequestModel: updateProcedureReqModel, - mrn: patient.patientMRN); + await model.updateProcedure(updateProcedureRequestModel: updateProcedureReqModel, mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -415,17 +400,15 @@ class _UpdateProcedureWidgetState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + 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}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon? suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 30c05fef..e2993767 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/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 2e0a284f..411dbe59 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -15,28 +15,29 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => - {model.getRescheduleLeave(), model.getCoveringDoctors()}, + onModelReady: (model) => {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, + appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", body: SingleChildScrollView( child: Column(children: [ - AddNewOrder( onTap: () { - openLeave( - context, - false, - ); - },label: TranslationBase.of(context).applyForReschedule,), + AddNewOrder( + onTap: () { + openLeave( + context, + false, + ); + }, + label: TranslationBase.of(context).applyForReschedule ?? "", + ), Column( - children: model.getReschduleLeave - .map((GetRescheduleLeavesResponse item) { + children: model.getReschduleLeave.map((GetRescheduleLeavesResponse item) { return RoundedContainer( child: Column( children: [ @@ -45,7 +46,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.red[800] + ? Colors.red[800]! : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 @@ -62,71 +63,55 @@ class AddRescheduleLeavScreen extends StatelessWidget { child: Wrap( children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: EdgeInsets.all(3), - margin: - EdgeInsets.only(top: 10), - child: AppText( - item.statusDescription, - fontWeight: FontWeight.bold, - color: item.status == 10 - ? Colors.red[800] - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - fontSize: 14, - ), - ), - Padding( - padding: - EdgeInsets.only(top: 10), - child: AppText( - AppDateUtils - .convertStringToDateFormat( - item.createdOn, - 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - )) - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Container( + padding: EdgeInsets.all(3), + margin: EdgeInsets.only(top: 10), + child: AppText( + item.statusDescription, + fontWeight: FontWeight.bold, + color: item.status == 10 + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + fontSize: 14, + ), + ), + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + AppDateUtils.convertStringToDateFormat( + item.createdOn ?? "", 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + )) + ]), SizedBox( height: 5, ), Container( child: AppText( item.requisitionType == 1 - ? TranslationBase.of(context) - .offTime + ? TranslationBase.of(context).offTime : item.requisitionType == 2 - ? TranslationBase.of(context) - .holiday + ? TranslationBase.of(context).holiday : item.requisitionType == 3 - ? TranslationBase.of( - context) - .changeOfSchedule - : TranslationBase.of( - context) - .newSchedule, + ? TranslationBase.of(context).changeOfSchedule + : TranslationBase.of(context).newSchedule, fontWeight: FontWeight.bold, )), SizedBox( height: 5, ), Row(children: [ - AppText(TranslationBase.of(context) - .startDate), + AppText(TranslationBase.of(context).startDate), AppText( AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom, - 'yyyy-MM-dd HH:mm'), + item.dateTimeFrom ?? "", 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -142,13 +127,10 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), Row( children: [ - AppText(TranslationBase.of(context) - .endDate), + AppText(TranslationBase.of(context).endDate), AppText( - AppDateUtils - .convertStringToDateFormat( - item.dateTimeTo, - 'yyyy-MM-dd HH:mm'), + AppDateUtils.convertStringToDateFormat( + item.dateTimeTo ?? "", 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) ], @@ -160,13 +142,10 @@ class AddRescheduleLeavScreen extends StatelessWidget { model.coveringDoctors.length > 0 ? Row(children: [ AppText( - TranslationBase.of(context) - .coveringDoctor, + TranslationBase.of(context).coveringDoctor, ), AppText( - getDoctor( - model.coveringDoctors, - item.coveringDoctorId), + getDoctor(model.coveringDoctors, item.coveringDoctorId), fontWeight: FontWeight.bold, ) ]) @@ -176,28 +155,18 @@ class AddRescheduleLeavScreen extends StatelessWidget { // .reasons, // fontWeight: FontWeight.bold, // ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.only( - bottom: 5), - child: AppText(getReasons( - model.allReasons, - item.reasonId))), - (item.status == 2) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => { - openLeave(context, true, - extendedData: item) - }, - ) - : SizedBox(), - ]), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Padding( + padding: EdgeInsets.only(bottom: 5), + child: AppText(getReasons(model.allReasons, item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset('assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => {openLeave(context, true, extendedData: item)}, + ) + : SizedBox(), + ]), ], ), SizedBox( diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index dc3d0adf..c754e468 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -37,19 +37,19 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - ProjectViewModel projectsProvider; - SickLeaveViewModel sickLeaveViewModel; - String _selectedClinic; + late ProjectViewModel projectsProvider; + late SickLeaveViewModel sickLeaveViewModel; + Map profile = {}; - var offTime = '1'; + String offTime = '1'; var date; var doctorID; var reason; var fromDate; var toDate; var clinicID; - String fromTime; - String toTime; + late String fromTime; + late String toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { @@ -99,9 +99,7 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - offTime = widget.updateData != null - ? widget.updateData.requisitionType.toString() - : offTime; + offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime; return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( @@ -121,7 +119,7 @@ class _RescheduleLeaveScreen extends State { child: AppScaffold( baseViewModel: model2, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, + appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -248,22 +246,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -271,34 +264,23 @@ class _RescheduleLeaveScreen extends State { model2.allOffTime.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( // focusColor: Colors.grey, isExpanded: true, value: offTime == null - ? model2.allOffTime[0] - ['code'] + ? model2.allOffTime[0]['code'].toString() : offTime, iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allOffTime - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - item[ - 'description'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + item['description'], + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -306,38 +288,23 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => { + onChanged: (String? newValue) => { setState(() { - offTime = newValue; + offTime = newValue!; }), if (offTime == '1') - { - model2 - .getReasons(18) - } + {model2.getReasons(18)} else if (offTime == '2') - { - model2 - .getReasons(19) - } - else if (offTime == - '3' || - offTime == '5') - { - model2 - .getReasons(102) - } + {model2.getReasons(19)} + else if (offTime == '3' || offTime == '5') + {model2.getReasons(102)} }, - items: model2.allOffTime - .map((item) { - return DropdownMenuItem< - String>( - value: item['code'] - .toString(), + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), child: Text( item['description'], - textAlign: - TextAlign.end, + textAlign: TextAlign.end, ), ); }).toList(), @@ -355,37 +322,25 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, + prefix: + IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, - onChanged: (val) => - fromDate = val, - onSaved: (val) => - fromDate = val, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, ) ], )), @@ -395,37 +350,24 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .fromTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, controller: _controller4, - onChanged: (val) => - fromTime = val, + onChanged: (val) => fromTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - fromTime = val, + onSaved: (val) => fromTime = val!, ) ], ), @@ -435,37 +377,24 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .toTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, controller: _controller5, - onChanged: (val) => - toTime = val, + onChanged: (val) => toTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - toTime = val, + onSaved: (val) => toTime = val!, ) ], ), @@ -480,33 +409,21 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: - _toDateController, + prefix: + IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -519,33 +436,21 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase - .of(context) - .toDate, + hintText: TranslationBase.of(context).toDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: - _toDateController2, + prefix: + IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, onTap: () { - _presentDatePicker( - 'toDate'); + _presentDatePicker('toDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -560,22 +465,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -583,39 +483,25 @@ class _RescheduleLeaveScreen extends State { model2.allReasons.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( focusColor: Colors.grey, isExpanded: true, value: reason == null - ? model2.allReasons[0] - ['id'] - .toString() + ? model2.allReasons[0]['id'].toString() : reason, iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allReasons - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - projectsProvider - .isArabic - ? item[ - 'nameAr'] - : item[ - 'nameEn'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + projectsProvider.isArabic + ? item['nameAr'] + : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -628,20 +514,12 @@ class _RescheduleLeaveScreen extends State { reason = newValue; }) }, - items: model2.allReasons - .map((item) { - return DropdownMenuItem< - String>( - value: item['id'] - .toString(), + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), child: Text( - projectsProvider - .isArabic - ? item['nameAr'] - : item[ - 'nameEn'], - textAlign: - TextAlign.end, + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, ), ); }).toList(), @@ -657,22 +535,17 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -683,69 +556,36 @@ class _RescheduleLeaveScreen extends State { child: DropdownSearch( mode: Mode.BOTTOM_SHEET, - dropdownSearchDecoration: - InputDecoration( - contentPadding: - EdgeInsets - .all(0), - border: - InputBorder - .none), + dropdownSearchDecoration: InputDecoration( + contentPadding: EdgeInsets.all(0), border: InputBorder.none), //maxHeight: 300, - items: model2 - .coveringDoctors - .map((item) { - return projectsProvider - .isArabic - ? item[ - 'doctorNameN'] - : item[ - 'doctorName']; + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic + ? item['doctorNameN'].toString() + : item['doctorName'].toString(); }).toList(), // label: "Doctor List", onChanged: (item) { - model2.coveringDoctors - .forEach( - (newVal) => { - if (newVal['doctorName'] == - item || - newVal['doctorName'] == - item) - { - doctorID = - newVal['DoctorID'] - } - }); + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorName'] == item || + newVal['doctorName'] == item) + {doctorID = newVal['DoctorID']} + }); }, - selectedItem: - getSelectedDoctor( - model2), + selectedItem: getSelectedDoctor(model2), showSearchBox: true, - searchBoxDecoration: - InputDecoration( - border: - OutlineInputBorder(), - contentPadding: - EdgeInsets.fromLTRB( - 12, 12, 8, 0), - labelText: - "Search Doctor", + searchBoxDecoration: InputDecoration( + border: OutlineInputBorder(), + contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), + labelText: "Search Doctor", ), popupTitle: Container( height: 50, - decoration: - BoxDecoration( - color: Theme.of( - context) - .primaryColorDark, - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 20), - topRight: - Radius.circular( - 20), + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), ), ), child: Center( @@ -753,25 +593,16 @@ class _RescheduleLeaveScreen extends State { '', style: TextStyle( fontSize: 24, - fontWeight: - FontWeight - .bold, - color: - Colors.white, + fontWeight: FontWeight.bold, + color: Colors.white, ), ), ), ), - popupShape: - RoundedRectangleBorder( - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 24), - topRight: - Radius.circular( - 24), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), ), ), ), @@ -845,17 +676,14 @@ class _RescheduleLeaveScreen extends State { )), SizedBox(height: SizeConfig.screenHeight * .3), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context) - .updateReschedule - : TranslationBase.of(context) - .addReschedule, + ? TranslationBase.of(context).updateReschedule + : TranslationBase.of(context).addReschedule, color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { @@ -865,9 +693,7 @@ class _RescheduleLeaveScreen extends State { addRecheduleLeave(model2); } } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .onlyOfftimeHoliday); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); } }, ), @@ -900,16 +726,13 @@ class _RescheduleLeaveScreen extends State { final df = new DateFormat('HH:mm:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); this.offTime = widget.updateData.requisitionType.toString(); - _toDateController.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); + _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = - df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = this.toTime.substring(0, this.toTime.length - 3); - _toDateController2.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); + _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _controller5.text = toTime; _controller4.text = fromTime; toDate = _toDateController2.text; @@ -922,8 +745,7 @@ class _RescheduleLeaveScreen extends State { getClinicName(model) { var clinicID = this.profile['ClinicID'] ?? 1; - var clinicInfo = - model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); + var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } @@ -933,16 +755,10 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString())); - toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString())); + fromDate = df.format( + DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); + toDate = df + .format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -957,8 +773,7 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -995,16 +810,10 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString(); - toDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString(); + fromDate = + df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); + toDate = + df.format(DateTime.parse(_toDateController.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -1020,8 +829,7 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -1060,8 +868,7 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) - {doctorName = newVal['doctorName']} + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} }); return doctorName; } diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 734e849a..421eacd2 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -19,17 +19,16 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddSickLeavScreen extends StatelessWidget { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => - model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), + onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -65,20 +64,17 @@ class AddSickLeavScreen extends StatelessWidget { )), Container( width: SizeConfig.screenWidth, - margin: EdgeInsets.only( - left: 20, right: 20, top: 10, bottom: 10), + margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10), padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: HexColor('#EAEAEA')), + decoration: + BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( child: Container( - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(10)), + decoration: + BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)), padding: EdgeInsets.all(3), child: IconButton( icon: Icon( @@ -94,9 +90,7 @@ class AddSickLeavScreen extends StatelessWidget { }), )), Padding( - child: AppText( - TranslationBase.of(context) - .noSickLeaveApplied, + child: AppText(TranslationBase.of(context).noSickLeaveApplied, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 16, @@ -111,8 +105,7 @@ class AddSickLeavScreen extends StatelessWidget { : SizedBox(), model.getAllSIckLeavePatient.length > 0 ? Column( - children: model.getAllSIckLeavePatient - .map((SickLeavePatientModel item) { + children: model.getAllSIckLeavePatient.map((SickLeavePatientModel item) { return RoundedContainer( margin: EdgeInsets.all(10), child: Column( @@ -131,8 +124,7 @@ class AddSickLeavScreen extends StatelessWidget { // ))), padding: EdgeInsets.all(10), child: Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 4, @@ -141,8 +133,7 @@ class AddSickLeavScreen extends StatelessWidget { // MainAxisAlignment.start, children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(3), @@ -160,8 +151,7 @@ class AddSickLeavScreen extends StatelessWidget { // : TranslationBase // .of(context) // .all, - fontWeight: - FontWeight.bold, + fontWeight: FontWeight.bold, // color: item.status == 1 // ? Colors.yellow[800] // : item.status == 2 @@ -172,34 +162,23 @@ class AddSickLeavScreen extends StatelessWidget { ), Row( children: [ - AppText(TranslationBase - .of(context) - .daysSickleave + - ": "), + AppText(TranslationBase.of(context).daysSickleave ?? "" + ": "), AppText( - item.sickLeaveDays - .toString(), - fontWeight: - FontWeight.bold, + item.sickLeaveDays.toString(), + fontWeight: FontWeight.bold, ), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .startDate + - ' ', + TranslationBase.of(context).startDate! + ' ', ), Flexible( child: AppText( AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - item.startDate)), - fontWeight: - FontWeight.bold, + AppDateUtils.convertStringToDate(item.startDate!)), + fontWeight: FontWeight.bold, ), ) ], @@ -207,38 +186,27 @@ class AddSickLeavScreen extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context) - .endDate + - ' ', + TranslationBase.of(context).endDate! + ' ', ), Flexible( child: AppText( - AppDateUtils - .getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - item.endDate, + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + item.endDate ?? "", )), - fontWeight: - FontWeight.bold, + fontWeight: FontWeight.bold, ), ) ], ), Row(children: [ - AppText(TranslationBase.of( - context) - .branch + - ": "), + AppText(TranslationBase.of(context).branch! + ": "), AppText( item.projectName ?? "", ), ]), Row(children: [ - AppText(TranslationBase.of( - context) - .clinic + - ": "), + AppText(TranslationBase.of(context).clinic! + ": "), AppText( item.clinicName ?? "", ), @@ -268,8 +236,7 @@ class AddSickLeavScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noSickLeave), + child: AppText(TranslationBase.of(context).noSickLeave), ) ], ), @@ -278,8 +245,7 @@ class AddSickLeavScreen extends StatelessWidget { ])))); } - openSickLeave(BuildContext context, isExtend, - {GetAllSickLeaveResponse extendedData}) { + openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse? extendedData}) { // showModalBottomSheet( // context: context, // builder: (context) { @@ -290,13 +256,11 @@ class AddSickLeavScreen extends StatelessWidget { FadePage( page: SickLeaveScreen( appointmentNo: isExtend == true - ? extendedData.appointmentNo + ? extendedData!.appointmentNo : patient.appointmentNo, //extendedData.appointmentNo, - patientMRN: isExtend == true - ? extendedData.patientMRN - : patient.patientMRN, + patientMRN: isExtend == true ? extendedData!.patientMRN : patient.patientMRN, isExtended: isExtend, - extendedData: extendedData, + extendedData: extendedData!, patient: patient))); } } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 3fbb3287..b97fe553 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -12,15 +12,14 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart' import 'package:flutter/material.dart'; class ShowSickLeaveScreen extends StatelessWidget { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => - model.getSickLeave(patient.patientMRN ?? patient.patientId), + onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -37,8 +36,7 @@ class ShowSickLeaveScreen extends StatelessWidget { // patient, routeArgs['patientType'], routeArgs['arrivalType']), model.getAllSIckLeave.length > 0 ? Column( - children: model.getAllSIckLeave - .map((GetAllSickLeaveResponse item) { + children: model.getAllSIckLeave.map((GetAllSickLeaveResponse item) { return RoundedContainer( margin: EdgeInsets.all(10), child: Column( @@ -48,7 +46,7 @@ class ShowSickLeaveScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 1 - ? Colors.yellow[800] + ? Colors.yellow[800]! : item.status == 2 ? Colors.green : Colors.black, @@ -56,8 +54,7 @@ class ShowSickLeaveScreen extends StatelessWidget { ))), padding: EdgeInsets.all(10), child: Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 4, @@ -66,26 +63,17 @@ class ShowSickLeaveScreen extends StatelessWidget { // MainAxisAlignment.start, children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(3), child: AppText( item.status == 1 - ? TranslationBase.of( - context) - .hold + ? TranslationBase.of(context).hold : item.status == 2 - ? TranslationBase - .of( - context) - .active - : TranslationBase - .of(context) - .all, - fontWeight: - FontWeight.bold, + ? TranslationBase.of(context).active + : TranslationBase.of(context).all, + fontWeight: FontWeight.bold, color: item.status == 1 ? Colors.yellow[800] : item.status == 2 @@ -95,72 +83,53 @@ class ShowSickLeaveScreen extends StatelessWidget { ), Row( children: [ + AppText(TranslationBase.of(context).daysSickleave), AppText( - TranslationBase.of( - context) - .daysSickleave), - AppText( - item.noOfDays - .toString(), - fontWeight: - FontWeight.bold, + item.noOfDays.toString(), + fontWeight: FontWeight.bold, ), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .startDate + - ' ', + TranslationBase.of(context).startDate! + ' ', ), Flexible( child: AppText( - AppDateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: - FontWeight.bold, + AppDateUtils.convertStringToDateFormat( + item.startDate ?? "", 'dd-MMM-yyyy'), + fontWeight: FontWeight.bold, )) ], ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - item.remarks ?? "", - ), - (item.status == 1) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1) + ? IconButton( + icon: Image.asset('assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => - { - if (item.status == - 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .sickleaveonhold) - } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - }, - ) - : SizedBox() - ]), + // color: Colors.green, //Colors.black, + onPressed: () => { + if (item.status == 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).sickleaveonhold) + } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + }, + ) + : SizedBox() + ]), ], ), SizedBox( @@ -185,8 +154,7 @@ class ShowSickLeaveScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noSickLeave), + child: AppText(TranslationBase.of(context).noSickLeave), ) ], ), diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 199a7c82..f305caf8 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -29,11 +29,7 @@ class SickLeaveScreen extends StatefulWidget { final patientMRN; final patient; SickLeaveScreen( - {this.appointmentNo, - this.patientMRN, - this.isExtended = false, - this.extendedData, - this.patient}); + {this.appointmentNo, this.patientMRN, this.isExtended = false, required this.extendedData, this.patient}); @override _SickLeaveScreenState createState() => _SickLeaveScreenState(); } @@ -41,7 +37,7 @@ class SickLeaveScreen extends StatefulWidget { class _SickLeaveScreenState extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); - String _selectedClinic; + Map profile = {}; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); void _presentDatePicker(id) { @@ -59,7 +55,7 @@ class _SickLeaveScreenState extends State { final df = new DateFormat('yyyy-MM-dd'); addSickLeave.startDate = df.format(pickedDate); - _toDateController.text = addSickLeave.startDate; + _toDateController.text = addSickLeave.startDate!; //addSickLeave.startDate = selectedDate; }); }); @@ -76,8 +72,7 @@ class _SickLeaveScreenState extends State { return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( - onModelReady: (model2) => model2.preSickLeaveStatistics( - widget.appointmentNo, widget.patientMRN), + onModelReady: (model2) => model2.preSickLeaveStatistics(widget.appointmentNo, widget.patientMRN), builder: (_, model2, w) => GestureDetector( onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); @@ -85,8 +80,8 @@ class _SickLeaveScreenState extends State { child: AppScaffold( baseViewModel: model2, appBarTitle: widget.isExtended == true - ? TranslationBase.of(context).extendSickLeave - : TranslationBase.of(context).addSickLeave, + ? TranslationBase.of(context).extendSickLeave ?? "" + : TranslationBase.of(context).addSickLeave ?? "", isShowAppBar: true, body: Center( child: Container( @@ -108,46 +103,35 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"), ), color: Colors.white), padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), - child: AppText( - TranslationBase.of(context) - .sickLeave + - ' ' + - TranslationBase.of(context) - .days)), - AppTextFormField( - borderColor: Colors.white, - onChanged: (value) { - addSickLeave.noOfDays = value; - if (widget.extendedData != null) { - widget.extendedData.noOfDays = - int.parse(value); - } - }, - hintText: widget.extendedData != null - ? widget.extendedData.noOfDays - .toString() - : '', - // validator: (value) { - // return TextValidator().validateName(value); - // }, - textInputType:TextInputType.number, - inputFormatter: ONLY_NUMBERS) - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only(top: 5, left: 10, right: 10), + child: AppText(TranslationBase.of(context).sickLeave! + + ' ' + + TranslationBase.of(context).days!)), + AppTextFormField( + borderColor: Colors.white, + onChanged: (value) { + addSickLeave.noOfDays = value; + if (widget.extendedData != null) { + widget.extendedData.noOfDays = int.parse(value); + } + }, + hintText: + widget.extendedData != null ? widget.extendedData.noOfDays.toString() : '', + // validator: (value) { + // return TextValidator().validateName(value); + // }, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS) + ]), ), SizedBox( height: 10, @@ -155,146 +139,107 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), + padding: EdgeInsets.only(top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .sickLeaveDate, + TranslationBase.of(context).sickLeaveDate, )), AppTextFormField( - hintText: widget.extendedData != null - ? widget.extendedData.startDate - : '', + hintText: widget.extendedData != null ? widget.extendedData.startDate : '', borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons.calendar_today)), + prefix: IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( - '_selectedToDate'); + _presentDatePicker('_selectedToDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { addSickLeave.startDate = value; if (widget.extendedData != null) { - widget.extendedData.startDate = - value; + widget.extendedData.startDate = value; } }), ], )), Container( - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only(top: 5), child: AppText( - TranslationBase.of(context) - .clinicName, + TranslationBase.of(context).clinicName, )), Row( mainAxisSize: MainAxisSize.max, children: [ Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: < - Widget>[ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - color: Colors - .grey, - ), - ], - ); - }).toList(); - }, - onChanged: - (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item - .toString(), - child: Text( + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName(model) ?? "", + iconSize: 0, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.getClinicNameList().map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( item, - textAlign: - TextAlign - .end, + fontSize: SizeConfig.textMultiplier * 2.1, + color: Colors.grey, ), - ); - }).toList(), - ))), + ], + ); + }).toList(); + }, + onChanged: (newValue) => {}, + items: model.getClinicNameList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, + ), + ); + }).toList(), + ))), ), ], ) ], ), )), - model2.sickLeaveStatistics[ - 'recommendedSickLeaveDays'] != - null + model2.sickLeaveStatistics['recommendedSickLeaveDays'] != null ? Padding( child: AppText( - model2.sickLeaveStatistics[ - 'recommendedSickLeaveDays'], + model2.sickLeaveStatistics['recommendedSickLeaveDays'], fontWeight: FontWeight.bold, textAlign: TextAlign.start, ), @@ -306,10 +251,8 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), padding: EdgeInsets.all(5), @@ -317,11 +260,9 @@ class _SickLeaveScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), + padding: EdgeInsets.only(top: 5, left: 10, right: 10), child: AppText( - TranslationBase.of(context) - .doctorName, + TranslationBase.of(context).doctorName, )), new IgnorePointer( ignoring: true, @@ -343,10 +284,8 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), color: Colors.white, ), padding: EdgeInsets.all(5), @@ -354,8 +293,7 @@ class _SickLeaveScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - top: 5, left: 10, right: 10), + padding: EdgeInsets.only(top: 5, left: 10, right: 10), child: AppText( TranslationBase.of(context).remarks, )), @@ -364,9 +302,7 @@ class _SickLeaveScreenState extends State { decoration: InputDecoration( contentPadding: EdgeInsets.all(20.0), border: InputBorder.none, - hintText: widget.extendedData != null - ? widget.extendedData.remarks - : ''), + hintText: widget.extendedData != null ? widget.extendedData.remarks : ''), onChanged: (value) { addSickLeave.remarks = value; if (widget.extendedData != null) { @@ -378,36 +314,26 @@ class _SickLeaveScreenState extends State { ), ), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( title: widget.isExtended == true ? TranslationBase.of(context).extend - : TranslationBase.of(context) - .addSickLeaverequest, + : TranslationBase.of(context).addSickLeaverequest, color: Colors.green, onPressed: () async { if (widget.isExtended) { - await model2.extendSickLeave( - widget.extendedData); + await model2.extendSickLeave(widget.extendedData); DrAppToastMsg.showSuccesToast( - model2.sickleaveResponse[ - 'ListSickLeavesToExtent'] - ['success']); - Navigator.of(context) - .popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; + model2.sickleaveResponse['ListSickLeavesToExtent']['success']); + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; }); - Navigator.of(context).pushNamed( - ADD_SICKLEAVE, - arguments: { - 'patient': widget.patient - }); + Navigator.of(context) + .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); //print(value); //}); } else { @@ -437,26 +363,21 @@ class _SickLeaveScreenState extends State { void _validateInputs(model2) async { try { if (addSickLeave.noOfDays == null) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterNoOfDays); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterNoOfDays); } else if (addSickLeave.remarks == null) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterRemarks); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterRemarks); } else if (addSickLeave.startDate == null) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseEnterDate); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterDate); } else { addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); await model2.addSickLeave(addSickLeave).then((value) => print(value)); - DrAppToastMsg.showSuccesToast( - model2.sickleaveResponse['ListSickLeavesToExtent']['success']); + DrAppToastMsg.showSuccesToast(model2.sickleaveResponse['ListSickLeavesToExtent']['success']); Navigator.of(context).popUntil((route) { return route.settings.name == PATIENTS_PROFILE; }); - Navigator.of(context) - .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); + Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); } } catch (err) { print(err); @@ -471,9 +392,7 @@ class _SickLeaveScreenState extends State { } getClinicName(model) { - var clinicInfo = model.clinicsList - .where((i) => i['ClinicID'] == this.profile['ClinicID']) - .toList(); + var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == this.profile['ClinicID']).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } } diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index a0962010..c0bd4e87 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -1,4 +1,3 @@ - import 'dart:convert'; import 'dart:io' show Platform; @@ -6,11 +5,22 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:flutter/services.dart'; -class VideoChannel{ +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}) async { var result; try { result = await _channel.invokeMethod( @@ -20,26 +30,22 @@ class VideoChannel{ "kSessionId": kSessionId, "kToken": kToken, "appLang": "en", - "baseUrl": BASE_URL_LIVE_CARE,//TODO change it to live + "baseUrl": BASE_URL_LIVE_CARE, //TODO change it to live "VC_ID": vcId, "TokenID": tokenID, "generalId": generalId, - "DoctorId": doctorId , + "DoctorId": doctorId, }, ); - if(result['callResponse'] == 'CallEnd') { - onCallEnd(); - } - else { - SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); - onCallNotRespond(sessionStatusModel); + if (result['callResponse'] == 'CallEnd') { + onCallEnd!(); + } else { + SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson( + Platform.isIOS ? result['sessionStatus'] : json.decode(result['sessionStatus'])); + onCallNotRespond!(sessionStatusModel); } - } catch (e) { - onFailure(e.toString()); + onFailure!(e.toString()); } - } - - -} \ No newline at end of file +} diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index bac296bf..f08a6e3c 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -40,7 +40,7 @@ class DrAppSharedPreferances { /// Get String [key] the key was saved getStringWithDefaultValue(String key, String defaultVal) async { final SharedPreferences prefs = await _prefs; - String value = prefs.getString(key); + String? value = prefs.getString(key); return value == null ? defaultVal : value; } @@ -81,10 +81,10 @@ class DrAppSharedPreferances { return prefs.getInt(key); } - getObj(String key) async{ + getObj(String key) async { final SharedPreferences prefs = await _prefs; var string = prefs.getString(key); - if (string == null ){ + if (string == null) { return null; } return json.decode(string); @@ -92,8 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - var vvas= await prefs.clear(); - var asd; + var vvas = await prefs.clear(); + var asd; } remove(String key) async { diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index 26e49670..ae638fe4 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,8 +1,3 @@ extension Extension on Object { - bool isNullOrEmpty() => this == null || this == ''; - - bool isNullEmptyOrFalse() => this == null || this == '' || !this; - - bool isNullEmptyZeroOrFalse() => - this == null || this == '' || !this || this == 0; + bool isNullOrEmpty() => this == ''; } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 634abd02..a9da05d1 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -27,8 +27,7 @@ class Helpers { get currentLanguage => null; - static showConfirmationDialog( - BuildContext context, String message, Function okFunction) { + static showConfirmationDialog(BuildContext context, String message, Function okFunction) { return showDialog( context: context, barrierDismissible: false, // user must tap button! @@ -44,7 +43,7 @@ class Helpers { ), actions: [ AppButton( - onPressed: okFunction, + onPressed: okFunction(), title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, color: Colors.green[600], @@ -65,8 +64,8 @@ class Helpers { }); } - static showCupertinoPicker(context, List items, - decKey, onSelectFun, AuthenticationViewModel model) { + static showCupertinoPicker( + context, List items, decKey, onSelectFun, AuthenticationViewModel model) { showModalBottomSheet( isDismissible: false, context: context, @@ -84,15 +83,14 @@ class Helpers { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: Text(TranslationBase.of(context).cancel, - style: textStyle(context)), + child: Text(TranslationBase.of(context).cancel ?? "", style: textStyle(context)), onPressed: () { Navigator.pop(context); }, ), CupertinoButton( child: Text( - TranslationBase.of(context).done, + TranslationBase.of(context).done ?? "", style: textStyle(context), ), onPressed: () { @@ -106,23 +104,19 @@ class Helpers { Container( height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), - child: buildPickerItems( - context, items, decKey, onSelectFun, model)) + child: buildPickerItems(context, items, decKey, onSelectFun, model)) ], ), ); }); } - static TextStyle textStyle(context) => - TextStyle(color: Theme.of(context).primaryColor); + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); - static buildPickerItems(context, List items, - decKey, onSelectFun, model) { + static buildPickerItems(context, List items, decKey, onSelectFun, model) { return CupertinoPicker( magnification: 1.5, - scrollController: - FixedExtentScrollController(initialItem: cupertinoPickerIndex), + scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), children: items.map((item) { return Text( '${item.facilityName}', @@ -148,10 +142,8 @@ class Helpers { } static Future checkConnection() async { - ConnectivityResult connectivityResult = - await (Connectivity().checkConnectivity()); - if ((connectivityResult == ConnectivityResult.mobile) || - (connectivityResult == ConnectivityResult.wifi)) { + ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); + if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { return true; } else { return false; @@ -163,9 +155,8 @@ class Helpers { List listOfHours = workingHours.split('a'); listOfHours.forEach((element) { - WorkingHours workingHours = WorkingHours(); - var from = element.substring( - element.indexOf('m ') + 2, element.indexOf('To') - 1); + WorkingHours? workingHours = WorkingHours(); + var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); @@ -202,14 +193,13 @@ class Helpers { static String parseHtmlString(String htmlString) { final document = parse(htmlString); - final String parsedString = parse(document.body.text).documentElement.text; + final String parsedString = parse(document.body!.text).documentElement!.text; return parsedString; } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, + {Icon? suffixIcon, Color? dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -239,9 +229,7 @@ class Helpers { ); } - static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, - {double borderWidth = -1}) { + static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 9ed00146..28feb82e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -7,1354 +7,1078 @@ import 'package:flutter/material.dart'; class TranslationBase { TranslationBase(this.locale); - final Locale locale; + late Locale locale; static TranslationBase of(BuildContext context) { - return Localizations.of(context, TranslationBase); + return Localizations.of(context, TranslationBase)!; } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String? get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle']![locale.languageCode]; - String get settings => localizedValues['settings'][locale.languageCode]; + String? get settings => localizedValues['settings']![locale.languageCode]; - String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String? get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo']![locale.languageCode]; - String get language => localizedValues['language'][locale.languageCode]; + String? get language => localizedValues['language']![locale.languageCode]; - String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; + String? get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]; - String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; + String? get lanArabic => localizedValues['lanArabic']![locale.languageCode]; - String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; + String? get theDoctor => localizedValues['theDoctor']![locale.languageCode]; - String get reply => localizedValues['reply'][locale.languageCode]; + String? get reply => localizedValues['reply']![locale.languageCode]; - String get time => localizedValues['time'][locale.languageCode]; + String? get time => localizedValues['time']![locale.languageCode]; - String get fileNo => localizedValues['fileNo'][locale.languageCode]; + String? get fileNo => localizedValues['fileNo']![locale.languageCode]; - String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; + String? get mobileNo => localizedValues['mobileNo']![locale.languageCode]; - String get replySuccessfully => - localizedValues['replySuccessfully'][locale.languageCode]; + String? get replySuccessfully => localizedValues['replySuccessfully']![locale.languageCode]; - String get messagesScreenToolbarTitle => - localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String? get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle']![locale.languageCode]; - String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; + String? get mySchedule => localizedValues['mySchedule']![locale.languageCode]; - String get errorNoSchedule => - localizedValues['errorNoSchedule'][locale.languageCode]; + String? get errorNoSchedule => localizedValues['errorNoSchedule']![locale.languageCode]; - String get verify => localizedValues['verify'][locale.languageCode]; + String? get verify => localizedValues['verify']![locale.languageCode]; - String get referralDoctor => - localizedValues['referralDoctor'][locale.languageCode]; + String? get referralDoctor => localizedValues['referralDoctor']![locale.languageCode]; - String get referringClinic => - localizedValues['referringClinic'][locale.languageCode]; + String? get referringClinic => localizedValues['referringClinic']![locale.languageCode]; - String get frequency => localizedValues['frequency'][locale.languageCode]; + String? get frequency => localizedValues['frequency']![locale.languageCode]; - String get priority => localizedValues['priority'][locale.languageCode]; + String? get priority => localizedValues['priority']![locale.languageCode]; - String get maxResponseTime => - localizedValues['maxResponseTime'][locale.languageCode]; + String? get maxResponseTime => localizedValues['maxResponseTime']![locale.languageCode]; - String get clinicDetailsandRemarks => - localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String? get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks']![locale.languageCode]; - String get answerSuggestions => - localizedValues['answerSuggestions'][locale.languageCode]; + String? get answerSuggestions => localizedValues['answerSuggestions']![locale.languageCode]; - String get outPatients => localizedValues['outPatients'][locale.languageCode]; + String? get outPatients => localizedValues['outPatients']![locale.languageCode]; - String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => - localizedValues['searchPatient-name'][locale.languageCode]; + String? get searchPatient => localizedValues['searchPatient']![locale.languageCode]; + String? get searchPatientDashBoard => localizedValues['searchPatientDashBoard']![locale.languageCode]; + String? get searchPatientName => localizedValues['searchPatient-name']![locale.languageCode]; - String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; + String? get searchAbout => localizedValues['searchAbout']![locale.languageCode]; - String get patient => localizedValues['patient'][locale.languageCode]; - String get patients => localizedValues['patients'][locale.languageCode]; - String get labResult => localizedValues['labResult'][locale.languageCode]; + String? get patient => localizedValues['patient']![locale.languageCode]; + String? get patients => localizedValues['patients']![locale.languageCode]; + String? get labResult => localizedValues['labResult']![locale.languageCode]; - String get todayStatistics => - localizedValues['todayStatistics'][locale.languageCode]; + String? get todayStatistics => localizedValues['todayStatistics']![locale.languageCode]; - String get familyMedicine => - localizedValues['familyMedicine'][locale.languageCode]; + String? get familyMedicine => localizedValues['familyMedicine']![locale.languageCode]; - String get arrived => localizedValues['arrived'][locale.languageCode]; + String? get arrived => localizedValues['arrived']![locale.languageCode]; - String get er => localizedValues['er'][locale.languageCode]; + String? get er => localizedValues['er']![locale.languageCode]; - String get walkIn => localizedValues['walkIn'][locale.languageCode]; + String? get walkIn => localizedValues['walkIn']![locale.languageCode]; - String get notArrived => localizedValues['notArrived'][locale.languageCode]; + String? get notArrived => localizedValues['notArrived']![locale.languageCode]; - String get radiology => localizedValues['radiology'][locale.languageCode]; + String? get radiology => localizedValues['radiology']![locale.languageCode]; - String get service => localizedValues['service'][locale.languageCode]; + String? get service => localizedValues['service']![locale.languageCode]; - String get referral => localizedValues['referral'][locale.languageCode]; + String? get referral => localizedValues['referral']![locale.languageCode]; - String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get inPatientLabel => - localizedValues['inPatientLabel'][locale.languageCode]; + String? get inPatient => localizedValues['inPatient']![locale.languageCode]; + String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; + String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; - String get inPatientAll => - localizedValues['inPatientAll'][locale.languageCode]; + String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; - String get operations => localizedValues['operations'][locale.languageCode]; + String? get operations => localizedValues['operations']![locale.languageCode]; - String get patientServices => - localizedValues['patientServices'][locale.languageCode]; + String? get patientServices => localizedValues['patientServices']![locale.languageCode]; - String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; + String? get searchMedicine => localizedValues['searchMedicine']![locale.languageCode]; + String? get searchMedicineDashboard => localizedValues['searchMedicineDashboard']![locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient'][locale.languageCode]; + String? get myReferralPatient => localizedValues['myReferralPatient']![locale.languageCode]; - String get referPatient => - localizedValues['referPatient'][locale.languageCode]; + String? get referPatient => localizedValues['referPatient']![locale.languageCode]; - String get myReferral => localizedValues['myReferral'][locale.languageCode]; + String? get myReferral => localizedValues['myReferral']![locale.languageCode]; - String get myReferredPatient => - localizedValues['myReferredPatient'][locale.languageCode]; - String get referredPatient => - localizedValues['referredPatient'][locale.languageCode]; - String get referredOn => localizedValues['referredOn'][locale.languageCode]; + String? get myReferredPatient => localizedValues['myReferredPatient']![locale.languageCode]; + String? get referredPatient => localizedValues['referredPatient']![locale.languageCode]; + String? get referredOn => localizedValues['referredOn']![locale.languageCode]; - String get firstName => localizedValues['firstName'][locale.languageCode]; + String? get firstName => localizedValues['firstName']![locale.languageCode]; - String get middleName => localizedValues['middleName'][locale.languageCode]; + String? get middleName => localizedValues['middleName']![locale.languageCode]; - String get lastName => localizedValues['lastName'][locale.languageCode]; + String? get lastName => localizedValues['lastName']![locale.languageCode]; - String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; + String? get phoneNumber => localizedValues['phoneNumber']![locale.languageCode]; - String get patientID => localizedValues['patientID'][locale.languageCode]; + String? get patientID => localizedValues['patientID']![locale.languageCode]; - String get patientFile => localizedValues['patientFile'][locale.languageCode]; + String? get patientFile => localizedValues['patientFile']![locale.languageCode]; - String get search => localizedValues['search'][locale.languageCode]; + String? get search => localizedValues['search']![locale.languageCode]; - String get onlyArrivedPatient => - localizedValues['onlyArrivedPatient'][locale.languageCode]; + String? get onlyArrivedPatient => localizedValues['onlyArrivedPatient']![locale.languageCode]; - String get searchMedicineNameHere => - localizedValues['searchMedicineNameHere'][locale.languageCode]; + String? get searchMedicineNameHere => localizedValues['searchMedicineNameHere']![locale.languageCode]; - String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; + String? get youCanFind => localizedValues['youCanFind']![locale.languageCode]; - String get itemsInSearch => - localizedValues['itemsInSearch'][locale.languageCode]; + String? get itemsInSearch => localizedValues['itemsInSearch']![locale.languageCode]; - String get qr => localizedValues['qr'][locale.languageCode]; + String? get qr => localizedValues['qr']![locale.languageCode]; - String get reader => localizedValues['reader'][locale.languageCode]; + String? get reader => localizedValues['reader']![locale.languageCode]; - String get startScanning => - localizedValues['startScanning'][locale.languageCode]; + String? get startScanning => localizedValues['startScanning']![locale.languageCode]; - String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; + String? get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]; - String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String? get scanQr => localizedValues['scanQr']![locale.languageCode]; - String get profile => localizedValues['profile'][locale.languageCode]; + String? get profile => localizedValues['profile']![locale.languageCode]; - String get gender => localizedValues['gender'][locale.languageCode]; + String? get gender => localizedValues['gender']![locale.languageCode]; - String get clinic => localizedValues['clinic'][locale.languageCode]; + String? get clinic => localizedValues['clinic']![locale.languageCode]; - String get clinicSelect => - localizedValues['clinicSelect'][locale.languageCode]; + String? get clinicSelect => localizedValues['clinicSelect']![locale.languageCode]; - String get doctorSelect => - localizedValues['doctorSelect'][locale.languageCode]; + String? get doctorSelect => localizedValues['doctorSelect']![locale.languageCode]; - String get hospital => localizedValues['hospital'][locale.languageCode]; + String? get hospital => localizedValues['hospital']![locale.languageCode]; - String get speciality => localizedValues['speciality'][locale.languageCode]; + String? get speciality => localizedValues['speciality']![locale.languageCode]; - String get errorMessage => - localizedValues['errorMessage'][locale.languageCode]; + String? get errorMessage => localizedValues['errorMessage']![locale.languageCode]; - String get patientProfile => - localizedValues['patientProfile'][locale.languageCode]; + String? get patientProfile => localizedValues['patientProfile']![locale.languageCode]; - String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String? get vitalSign => localizedValues['vitalSign']![locale.languageCode]; - String get vital => localizedValues['vital'][locale.languageCode]; + String? get vital => localizedValues['vital']![locale.languageCode]; - String get signs => localizedValues['signs'][locale.languageCode]; + String? get signs => localizedValues['signs']![locale.languageCode]; - String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String? get labOrder => localizedValues['labOrder']![locale.languageCode]; - String get lab => localizedValues['lab'][locale.languageCode]; + String? get lab => localizedValues['lab']![locale.languageCode]; - String get result => localizedValues['result'][locale.languageCode]; + String? get result => localizedValues['result']![locale.languageCode]; - String get medicines => localizedValues['medicines'][locale.languageCode]; + String? get medicines => localizedValues['medicines']![locale.languageCode]; - String get prescription => - localizedValues['prescription'][locale.languageCode]; + String? get prescription => localizedValues['prescription']![locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals'][locale.languageCode]; + String? get insuranceApprovals => localizedValues['insuranceApprovals']![locale.languageCode]; - String get insurance => localizedValues['insurance'][locale.languageCode]; + String? get insurance => localizedValues['insurance']![locale.languageCode]; - String get approvals => localizedValues['approvals'][locale.languageCode]; + String? get approvals => localizedValues['approvals']![locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String? get bodyMeasurements => localizedValues['bodyMeasurements']![locale.languageCode]; - String get temperature => localizedValues['temperature'][locale.languageCode]; + String? get temperature => localizedValues['temperature']![locale.languageCode]; - String get pulse => localizedValues['pulse'][locale.languageCode]; + String? get pulse => localizedValues['pulse']![locale.languageCode]; - String get respiration => localizedValues['respiration'][locale.languageCode]; + String? get respiration => localizedValues['respiration']![locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String? get bloodPressure => localizedValues['bloodPressure']![locale.languageCode]; - String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String? get oxygenation => localizedValues['oxygenation']![locale.languageCode]; - String get painScale => localizedValues['painScale'][locale.languageCode]; + String? get painScale => localizedValues['painScale']![locale.languageCode]; - String get errorNoVitalSign => - localizedValues['errorNoVitalSign'][locale.languageCode]; + String? get errorNoVitalSign => localizedValues['errorNoVitalSign']![locale.languageCode]; - String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String? get labOrders => localizedValues['labOrders']![locale.languageCode]; - String get errorNoLabOrders => - localizedValues['errorNoLabOrders'][locale.languageCode]; + String? get errorNoLabOrders => localizedValues['errorNoLabOrders']![locale.languageCode]; - String get answerThePatient => - localizedValues['answerThePatient'][locale.languageCode]; + String? get answerThePatient => localizedValues['answerThePatient']![locale.languageCode]; - String get pleaseEnterAnswer => - localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String? get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer']![locale.languageCode]; - String get replay => localizedValues['replay'][locale.languageCode]; + String? get replay => localizedValues['replay']![locale.languageCode]; - String get progressNote => - localizedValues['progressNote'][locale.languageCode]; + String? get progressNote => localizedValues['progressNote']![locale.languageCode]; - String get progress => localizedValues['progress'][locale.languageCode]; + String? get progress => localizedValues['progress']![locale.languageCode]; - String get note => localizedValues['note'][locale.languageCode]; + String? get note => localizedValues['note']![locale.languageCode]; - String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String? get searchNote => localizedValues['searchNote']![locale.languageCode]; - String get errorNoProgressNote => - localizedValues['errorNoProgressNote'][locale.languageCode]; + String? get errorNoProgressNote => localizedValues['errorNoProgressNote']![locale.languageCode]; - String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; - String get orderNo => localizedValues['orderNo'][locale.languageCode]; + String? get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]; + String? get orderNo => localizedValues['orderNo']![locale.languageCode]; - String get generalResult => - localizedValues['generalResult'][locale.languageCode]; + String? get generalResult => localizedValues['generalResult']![locale.languageCode]; - String get description => localizedValues['description'][locale.languageCode]; + String? get description => localizedValues['description']![locale.languageCode]; - String get value => localizedValues['value'][locale.languageCode]; + String? get value => localizedValues['value']![locale.languageCode]; - String get range => localizedValues['range'][locale.languageCode]; + String? get range => localizedValues['range']![locale.languageCode]; - String get enterId => localizedValues['enterId'][locale.languageCode]; + String? get enterId => localizedValues['enterId']![locale.languageCode]; - String get pleaseEnterYourID => - localizedValues['pleaseEnterYourID'][locale.languageCode]; + String? get pleaseEnterYourID => localizedValues['pleaseEnterYourID']![locale.languageCode]; - String get enterPassword => - localizedValues['enterPassword'][locale.languageCode]; + String? get enterPassword => localizedValues['enterPassword']![locale.languageCode]; - String get pleaseEnterPassword => - localizedValues['pleaseEnterPassword'][locale.languageCode]; + String? get pleaseEnterPassword => localizedValues['pleaseEnterPassword']![locale.languageCode]; - String get selectYourProject => - localizedValues['selectYourProject'][locale.languageCode]; + String? get selectYourProject => localizedValues['selectYourProject']![locale.languageCode]; - String get pleaseEnterYourProject => - localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String? get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject']![locale.languageCode]; - String get login => localizedValues['login'][locale.languageCode]; + String? get login => localizedValues['login']![locale.languageCode]; - String get drSulaimanAlHabib => - localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String? get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib']![locale.languageCode]; - String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; + String? get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]; - String get welcomeBackTo => - localizedValues['welcomeBackTo'][locale.languageCode]; + String? get welcomeBackTo => localizedValues['welcomeBackTo']![locale.languageCode]; - String get home => localizedValues['home'][locale.languageCode]; + String? get home => localizedValues['home']![locale.languageCode]; - String get services => localizedValues['services'][locale.languageCode]; + String? get services => localizedValues['services']![locale.languageCode]; - String get sms => localizedValues['sms'][locale.languageCode]; + String? get sms => localizedValues['sms']![locale.languageCode]; - String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; + String? get fingerprint => localizedValues['fingerprint']![locale.languageCode]; - String get faceId => localizedValues['faceId'][locale.languageCode]; + String? get faceId => localizedValues['faceId']![locale.languageCode]; - String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String? get whatsApp => localizedValues['whatsApp']![locale.languageCode]; - String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; + String? get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]; - String get pleaseChoose => - localizedValues['pleaseChoose'][locale.languageCode]; + String? get pleaseChoose => localizedValues['pleaseChoose']![locale.languageCode]; - String get choose => localizedValues['choose'][locale.languageCode]; + String? get choose => localizedValues['choose']![locale.languageCode]; - String get verification => - localizedValues['verification'][locale.languageCode]; + String? get verification => localizedValues['verification']![locale.languageCode]; - String get firstStep => localizedValues['firstStep'][locale.languageCode]; + String? get firstStep => localizedValues['firstStep']![locale.languageCode]; - String get yourAccount => - localizedValues['yourAccount!'][locale.languageCode]; + String? get yourAccount => localizedValues['yourAccount!']![locale.languageCode]; - String get verify1 => localizedValues['verify1'][locale.languageCode]; + String? get verify1 => localizedValues['verify1']![locale.languageCode]; - String get youWillReceiveA => - localizedValues['youWillReceiveA'][locale.languageCode]; + String? get youWillReceiveA => localizedValues['youWillReceiveA']![locale.languageCode]; - String get loginCode => localizedValues['loginCode'][locale.languageCode]; + String? get loginCode => localizedValues['loginCode']![locale.languageCode]; - String get smsBy => localizedValues['smsBy'][locale.languageCode]; + String? get smsBy => localizedValues['smsBy']![locale.languageCode]; - String get pleaseEnterTheCode => - localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String? get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode']![locale.languageCode]; - String get youDontHaveAnyPatient => - localizedValues['youDon\'tHaveAnyPatient'][locale.languageCode]; + String? get youDontHaveAnyPatient => localizedValues['youDon\'tHaveAnyPatient']![locale.languageCode]; - String get youDoNotHaveAnyItem => - localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String? get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem']![locale.languageCode]; - String get age => localizedValues['age'][locale.languageCode]; + String? get age => localizedValues['age']![locale.languageCode]; - String get nationality => localizedValues['nationality'][locale.languageCode]; + String? get nationality => localizedValues['nationality']![locale.languageCode]; - String get today => localizedValues['today'][locale.languageCode]; + String? get today => localizedValues['today']![locale.languageCode]; - String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String? get tomorrow => localizedValues['tomorrow']![locale.languageCode]; - String get all => localizedValues['all'][locale.languageCode]; + String? get all => localizedValues['all']![locale.languageCode]; - String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String? get nextWeek => localizedValues['nextWeek']![locale.languageCode]; - String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String? get yesterday => localizedValues['yesterday']![locale.languageCode]; - String get errorNoInsuranceApprovals => - localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String? get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals']![locale.languageCode]; - String get searchInsuranceApprovals => - localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String? get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals']![locale.languageCode]; - String get status => localizedValues['status'][locale.languageCode]; + String? get status => localizedValues['status']![locale.languageCode]; - String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String? get expiryDate => localizedValues['expiryDate']![locale.languageCode]; - String get producerName => - localizedValues['producerName'][locale.languageCode]; + String? get producerName => localizedValues['producerName']![locale.languageCode]; - String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String? get receiptOn => localizedValues['receiptOn']![locale.languageCode]; - String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String? get approvalNo => localizedValues['approvalNo']![locale.languageCode]; - String get doctor => localizedValues['doctor'][locale.languageCode]; + String? get doctor => localizedValues['doctor']![locale.languageCode]; - String get ext => localizedValues['ext'][locale.languageCode]; + String? get ext => localizedValues['ext']![locale.languageCode]; - String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String? get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]; - String get urgent => localizedValues['urgent'][locale.languageCode]; + String? get urgent => localizedValues['urgent']![locale.languageCode]; - String get routine => localizedValues['routine'][locale.languageCode]; + String? get routine => localizedValues['routine']![locale.languageCode]; - String get send => localizedValues['send'][locale.languageCode]; + String? get send => localizedValues['send']![locale.languageCode]; - String get referralFrequency => - localizedValues['referralFrequency'][locale.languageCode]; + String? get referralFrequency => localizedValues['referralFrequency']![locale.languageCode]; - String get selectReferralFrequency => - localizedValues['selectReferralFrequency'][locale.languageCode]; + String? get selectReferralFrequency => localizedValues['selectReferralFrequency']![locale.languageCode]; - String get clinicalDetailsAndRemarks => - localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String? get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]; - String get remarks => localizedValues['remarks'][locale.languageCode]; + String? get remarks => localizedValues['remarks']![locale.languageCode]; - String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String? get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]; - String get replay2 => localizedValues['replay2'][locale.languageCode]; + String? get replay2 => localizedValues['replay2']![locale.languageCode]; - String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String? get outPatient => localizedValues['outPatients']![locale.languageCode]; - String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; - String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; + String? get myOutPatient => localizedValues['myOutPatient']![locale.languageCode]; + String? get myOutPatient_2lines => localizedValues['myOutPatient_2lines']![locale.languageCode]; - String get logout => localizedValues['logout'][locale.languageCode]; + String? get logout => localizedValues['logout']![locale.languageCode]; - String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + String? get pharmaciesList => localizedValues['pharmaciesList']![locale.languageCode]; - String get price => localizedValues['price'][locale.languageCode]; + String? get price => localizedValues['price']![locale.languageCode]; - String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + String? get youCanFindItIn => localizedValues['youCanFindItIn']![locale.languageCode]; - String get radiologyReport => - localizedValues['radiologyReport'][locale.languageCode]; + String? get radiologyReport => localizedValues['radiologyReport']![locale.languageCode]; - String get orders => localizedValues['orders'][locale.languageCode]; + String? get orders => localizedValues['orders']![locale.languageCode]; - String get list => localizedValues['list'][locale.languageCode]; + String? get list => localizedValues['list']![locale.languageCode]; - String get searchOrders => - localizedValues['searchOrders'][locale.languageCode]; + String? get searchOrders => localizedValues['searchOrders']![locale.languageCode]; - String get prescriptionDetails => - localizedValues['prescriptionDetails'][locale.languageCode]; + String? get prescriptionDetails => localizedValues['prescriptionDetails']![locale.languageCode]; - String get prescriptionInfo => - localizedValues['prescriptionInfo'][locale.languageCode]; + String? get prescriptionInfo => localizedValues['prescriptionInfo']![locale.languageCode]; - String get errorNoOrders => - localizedValues['errorNoOrders'][locale.languageCode]; + String? get errorNoOrders => localizedValues['errorNoOrders']![locale.languageCode]; - String get livecare => localizedValues['livecare'][locale.languageCode]; + String? get livecare => localizedValues['livecare']![locale.languageCode]; - String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String? get beingBad => localizedValues['beingBad']![locale.languageCode]; - String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; + String? get beingGreat => localizedValues['beingGreat']![locale.languageCode]; - String get cancel => localizedValues['cancel'][locale.languageCode]; + String? get cancel => localizedValues['cancel']![locale.languageCode]; - String get ok => localizedValues['ok'][locale.languageCode]; + String? get ok => localizedValues['ok']![locale.languageCode]; - String get done => localizedValues['done'][locale.languageCode]; + String? get done => localizedValues['done']![locale.languageCode]; - String get searchMedicineImageCaption => - localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String? get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption']![locale.languageCode]; - String get type => localizedValues['type'][locale.languageCode]; + String? get type => localizedValues['type']![locale.languageCode]; - String get resumecall => localizedValues['resumecall'][locale.languageCode]; + String? get resumecall => localizedValues['resumecall']![locale.languageCode]; - String get endcallwithcharge => - localizedValues['endcallwithcharge'][locale.languageCode]; + String? get endcallwithcharge => localizedValues['endcallwithcharge']![locale.languageCode]; - String get endcall => localizedValues['endcall'][locale.languageCode]; + String? get endcall => localizedValues['endcall']![locale.languageCode]; - String get transfertoadmin => - localizedValues['transfertoadmin'][locale.languageCode]; + String? get transfertoadmin => localizedValues['transfertoadmin']![locale.languageCode]; - String get fromDate => localizedValues['fromDate'][locale.languageCode]; + String? get fromDate => localizedValues['fromDate']![locale.languageCode]; - String get toDate => localizedValues['toDate'][locale.languageCode]; + String? get toDate => localizedValues['toDate']![locale.languageCode]; - String get fromTime => localizedValues['fromTime'][locale.languageCode]; + String? get fromTime => localizedValues['fromTime']![locale.languageCode]; - String get toTime => localizedValues['toTime'][locale.languageCode]; + String? get toTime => localizedValues['toTime']![locale.languageCode]; - String get searchPatientImageCaptionTitle => - localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String? get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]; - String get searchPatientImageCaptionBody => - localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String? get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody']![locale.languageCode]; - String get welcome => localizedValues['welcome'][locale.languageCode]; + String? get welcome => localizedValues['welcome']![locale.languageCode]; - String get typeMedicineName => - localizedValues['typeMedicineName'][locale.languageCode]; + String? get typeMedicineName => localizedValues['typeMedicineName']![locale.languageCode]; - String get moreThan3Letter => - localizedValues['moreThan3Letter'][locale.languageCode]; + String? get moreThan3Letter => localizedValues['moreThan3Letter']![locale.languageCode]; - String get gender2 => localizedValues['gender2'][locale.languageCode]; + String? get gender2 => localizedValues['gender2']![locale.languageCode]; - String get age2 => localizedValues['age2'][locale.languageCode]; + String? get age2 => localizedValues['age2']![locale.languageCode]; - String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String? get sickleave => localizedValues['sick-leaves']![locale.languageCode]; - String get patientSick => - localizedValues['patient-sick'][locale.languageCode]; + String? get patientSick => localizedValues['patient-sick']![locale.languageCode]; - String get leave => localizedValues['leave'][locale.languageCode]; + String? get leave => localizedValues['leave']![locale.languageCode]; - String get submit => localizedValues['submit'][locale.languageCode]; + String? get submit => localizedValues['submit']![locale.languageCode]; - String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String? get doctorName => localizedValues['doc-name']![locale.languageCode]; - String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String? get clinicName => localizedValues['clinicname']![locale.languageCode]; - String get sickLeaveDate => - localizedValues['sick-leave-date'][locale.languageCode]; + String? get sickLeaveDate => localizedValues['sick-leave-date']![locale.languageCode]; - String get sickLeaveDays => - localizedValues['sick-leave-days'][locale.languageCode]; + String? get sickLeaveDays => localizedValues['sick-leave-days']![locale.languageCode]; - String get admissionDetail => - localizedValues['admissionDetail'][locale.languageCode]; + String? get admissionDetail => localizedValues['admissionDetail']![locale.languageCode]; - String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String? get dateTime => localizedValues['dateTime']![locale.languageCode]; - String get date => localizedValues['date'][locale.languageCode]; + String? get date => localizedValues['date']![locale.languageCode]; - String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String? get admissionNo => localizedValues['admissionNo']![locale.languageCode]; - String get losNo => localizedValues['losNo'][locale.languageCode]; + String? get losNo => localizedValues['losNo']![locale.languageCode]; - String get area => localizedValues['area'][locale.languageCode]; + String? get area => localizedValues['area']![locale.languageCode]; - String get room => localizedValues['room'][locale.languageCode]; + String? get room => localizedValues['room']![locale.languageCode]; - String get bed => localizedValues['bed'][locale.languageCode]; + String? get bed => localizedValues['bed']![locale.languageCode]; - String get previousSickLeaveIssue => - localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String? get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed']![locale.languageCode]; - String get noSickLeaveApplied => - localizedValues['no-sickleve-applied'][locale.languageCode]; + String? get noSickLeaveApplied => localizedValues['no-sickleve-applied']![locale.languageCode]; - String get applyNow => localizedValues['applynow'][locale.languageCode]; + String? get applyNow => localizedValues['applynow']![locale.languageCode]; - String get addSickLeave => - localizedValues['add-sickleave'][locale.languageCode]; + String? get addSickLeave => localizedValues['add-sickleave']![locale.languageCode]; - String get add => localizedValues['add'][locale.languageCode]; - String get addSickLeaverequest => - localizedValues['addSickLeaveRequest'][locale.languageCode]; - String get extendSickLeaverequest => - localizedValues['extendSickLeaveRequest'][locale.languageCode]; - String get approved => localizedValues['approved'][locale.languageCode]; + String? get add => localizedValues['add']![locale.languageCode]; + String? get addSickLeaverequest => localizedValues['addSickLeaveRequest']![locale.languageCode]; + String? get extendSickLeaverequest => localizedValues['extendSickLeaveRequest']![locale.languageCode]; + String? get approved => localizedValues['approved']![locale.languageCode]; - String get extended => localizedValues['extended'][locale.languageCode]; + String? get extended => localizedValues['extended']![locale.languageCode]; - String get pending => localizedValues['pending'][locale.languageCode]; + String? get pending => localizedValues['pending']![locale.languageCode]; - String get leaveStartDate => - localizedValues['leave-start-date'][locale.languageCode]; + String? get leaveStartDate => localizedValues['leave-start-date']![locale.languageCode]; - String get daysSickleave => - localizedValues['days-sick-leave'][locale.languageCode]; + String? get daysSickleave => localizedValues['days-sick-leave']![locale.languageCode]; - String get extend => localizedValues['extend'][locale.languageCode]; + String? get extend => localizedValues['extend']![locale.languageCode]; - String get extendSickLeave => - localizedValues['extend-sickleave'][locale.languageCode]; + String? get extendSickLeave => localizedValues['extend-sickleave']![locale.languageCode]; - String get targetPatient => - localizedValues['patient-target'][locale.languageCode]; + String? get targetPatient => localizedValues['patient-target']![locale.languageCode]; - String get noPrescription => - localizedValues['no-priscription-listed'][locale.languageCode]; + String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; - String get next => localizedValues['next'][locale.languageCode]; + String? get next => localizedValues['next']![locale.languageCode]; - String get previous => localizedValues['previous'][locale.languageCode]; + String? get previous => localizedValues['previous']![locale.languageCode]; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; + String? get emptyMessage => localizedValues['empty-message']![locale.languageCode]; - String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + String? get healthRecordInformation => localizedValues['healthRecordInformation']![locale.languageCode]; - String get chiefComplaintLength => - localizedValues['chiefComplaintLength'][locale.languageCode]; + String? get chiefComplaintLength => localizedValues['chiefComplaintLength']![locale.languageCode]; - String get referTo => localizedValues['referTo'][locale.languageCode]; + String? get referTo => localizedValues['referTo']![locale.languageCode]; - String get referredFrom => - localizedValues['referredFrom'][locale.languageCode]; - String get refClinic => localizedValues['refClinic'][locale.languageCode]; + String? get referredFrom => localizedValues['referredFrom']![locale.languageCode]; + String? get refClinic => localizedValues['refClinic']![locale.languageCode]; - String get branch => localizedValues['branch'][locale.languageCode]; + String? get branch => localizedValues['branch']![locale.languageCode]; - String get chooseAppointment => - localizedValues['chooseAppointment'][locale.languageCode]; + String? get chooseAppointment => localizedValues['chooseAppointment']![locale.languageCode]; - String get appointmentNo => - localizedValues['appointmentNo'][locale.languageCode]; + String? get appointmentNo => localizedValues['appointmentNo']![locale.languageCode]; - String get refer => localizedValues['refer'][locale.languageCode]; + String? get refer => localizedValues['refer']![locale.languageCode]; - String get rejected => localizedValues['rejected'][locale.languageCode]; + String? get rejected => localizedValues['rejected']![locale.languageCode]; - String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String? get sameBranch => localizedValues['sameBranch']![locale.languageCode]; - String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String? get otherBranch => localizedValues['otherBranch']![locale.languageCode]; - String get dr => localizedValues['dr'][locale.languageCode]; + String? get dr => localizedValues['dr']![locale.languageCode]; - String get previewHealth => - localizedValues['previewHealth'][locale.languageCode]; + String? get previewHealth => localizedValues['previewHealth']![locale.languageCode]; - String get summaryReport => - localizedValues['summaryReport'][locale.languageCode]; + String? get summaryReport => localizedValues['summaryReport']![locale.languageCode]; - String get accept => localizedValues['accept'][locale.languageCode]; + String? get accept => localizedValues['accept']![locale.languageCode]; - String get reject => localizedValues['reject'][locale.languageCode]; + String? get reject => localizedValues['reject']![locale.languageCode]; - String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String? get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg']![locale.languageCode]; - String get referralPatient => - localizedValues['referralPatient'][locale.languageCode]; + String? get referralPatient => localizedValues['referralPatient']![locale.languageCode]; - String get noPrescriptionListed => - localizedValues['noPrescriptionListed'][locale.languageCode]; + String? get noPrescriptionListed => localizedValues['noPrescriptionListed']![locale.languageCode]; - String get addNow => localizedValues['addNow'][locale.languageCode]; + String? get addNow => localizedValues['addNow']![locale.languageCode]; - String get orderType => localizedValues['orderType'][locale.languageCode]; + String? get orderType => localizedValues['orderType']![locale.languageCode]; - String get strength => localizedValues['strength'][locale.languageCode]; + String? get strength => localizedValues['strength']![locale.languageCode]; - String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String? get doseTime => localizedValues['doseTime']![locale.languageCode]; - String get indication => localizedValues['indication'][locale.languageCode]; + String? get indication => localizedValues['indication']![locale.languageCode]; - String get duration => localizedValues['duration'][locale.languageCode]; + String? get duration => localizedValues['duration']![locale.languageCode]; - String get instruction => localizedValues['instruction'][locale.languageCode]; + String? get instruction => localizedValues['instruction']![locale.languageCode]; - String get rescheduleLeaves => - localizedValues['reschedule-leave'][locale.languageCode]; + String? get rescheduleLeaves => localizedValues['reschedule-leave']![locale.languageCode]; - String get applyOrRescheduleLeave => - localizedValues['applyOrRescheduleLeave'][locale.languageCode]; - String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; + String? get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave']![locale.languageCode]; + String? get myQRCode => localizedValues['myQRCode']![locale.languageCode]; - String get addMedication => - localizedValues['addMedication'][locale.languageCode]; + String? get addMedication => localizedValues['addMedication']![locale.languageCode]; - String get route => localizedValues['route'][locale.languageCode]; + String? get route => localizedValues['route']![locale.languageCode]; - String get noReScheduleLeave => - localizedValues['no-reschedule-leave'][locale.languageCode]; + String? get noReScheduleLeave => localizedValues['no-reschedule-leave']![locale.languageCode]; - String get weight => localizedValues['weight'][locale.languageCode]; + String? get weight => localizedValues['weight']![locale.languageCode]; - String get kg => localizedValues['kg'][locale.languageCode]; + String? get kg => localizedValues['kg']![locale.languageCode]; - String get height => localizedValues['height'][locale.languageCode]; + String? get height => localizedValues['height']![locale.languageCode]; - String get cm => localizedValues['cm'][locale.languageCode]; + String? get cm => localizedValues['cm']![locale.languageCode]; - String get idealBodyWeight => - localizedValues['idealBodyWeight'][locale.languageCode]; + String? get idealBodyWeight => localizedValues['idealBodyWeight']![locale.languageCode]; - String get waistSize => localizedValues['waistSize'][locale.languageCode]; + String? get waistSize => localizedValues['waistSize']![locale.languageCode]; - String get inch => localizedValues['inch'][locale.languageCode]; + String? get inch => localizedValues['inch']![locale.languageCode]; - String get headCircum => localizedValues['headCircum'][locale.languageCode]; + String? get headCircum => localizedValues['headCircum']![locale.languageCode]; - String get leanBodyWeight => - localizedValues['leanBodyWeight'][locale.languageCode]; + String? get leanBodyWeight => localizedValues['leanBodyWeight']![locale.languageCode]; - String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + String? get bodyMassIndex => localizedValues['bodyMassIndex']![locale.languageCode]; - String get yourBodyMassIndex => - localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => - localizedValues['bmiUnderWeight'][locale.languageCode]; - String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => - localizedValues['bmiOverWeight'][locale.languageCode]; - String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => - localizedValues['bmiObeseExtreme'][locale.languageCode]; + String? get yourBodyMassIndex => localizedValues['yourBodyMassIndex']![locale.languageCode]; + String? get bmiUnderWeight => localizedValues['bmiUnderWeight']![locale.languageCode]; + String? get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]; + String? get bmiOverWeight => localizedValues['bmiOverWeight']![locale.languageCode]; + String? get bmiObese => localizedValues['bmiObese']![locale.languageCode]; + String? get bmiObeseExtreme => localizedValues['bmiObeseExtreme']![locale.languageCode]; - String get method => localizedValues['method'][locale.languageCode]; + String? get method => localizedValues['method']![locale.languageCode]; - String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; + String? get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]; - String get rhythm => localizedValues['rhythm'][locale.languageCode]; + String? get rhythm => localizedValues['rhythm']![locale.languageCode]; - String get respBeats => localizedValues['respBeats'][locale.languageCode]; + String? get respBeats => localizedValues['respBeats']![locale.languageCode]; - String get patternOfRespiration => - localizedValues['patternOfRespiration'][locale.languageCode]; + String? get patternOfRespiration => localizedValues['patternOfRespiration']![locale.languageCode]; - String get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String? get bloodPressureDiastoleAndSystole => + localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; - String get cuffLocation => - localizedValues['cuffLocation'][locale.languageCode]; + String? get cuffLocation => localizedValues['cuffLocation']![locale.languageCode]; - String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; + String? get cuffSize => localizedValues['cuffSize']![locale.languageCode]; - String get patientPosition => - localizedValues['patientPosition'][locale.languageCode]; + String? get patientPosition => localizedValues['patientPosition']![locale.languageCode]; - String get fio2 => localizedValues['fio2'][locale.languageCode]; + String? get fio2 => localizedValues['fio2']![locale.languageCode]; - String get sao2 => localizedValues['sao2'][locale.languageCode]; + String? get sao2 => localizedValues['sao2']![locale.languageCode]; - String get painManagement => - localizedValues['painManagement'][locale.languageCode]; + String? get painManagement => localizedValues['painManagement']![locale.languageCode]; - String get holiday => localizedValues['holiday'][locale.languageCode]; + String? get holiday => localizedValues['holiday']![locale.languageCode]; - String get to => localizedValues['to'][locale.languageCode]; + String? get to => localizedValues['to']![locale.languageCode]; - String get coveringDoctor => - localizedValues['coveringDoctor'][locale.languageCode]; + String? get coveringDoctor => localizedValues['coveringDoctor']![locale.languageCode]; - String get requestLeave => - localizedValues['requestLeave'][locale.languageCode]; + String? get requestLeave => localizedValues['requestLeave']![locale.languageCode]; - String get pleaseEnterDate => - localizedValues['pleaseEnterDate'][locale.languageCode]; + String? get pleaseEnterDate => localizedValues['pleaseEnterDate']![locale.languageCode]; - String get pleaseEnterNoOfDays => - localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String? get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays']![locale.languageCode]; - String get pleaseEnterRemarks => - localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String? get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks']![locale.languageCode]; - String get update => localizedValues['update'][locale.languageCode]; + String? get update => localizedValues['update']![locale.languageCode]; - String get admission => localizedValues['admission'][locale.languageCode]; + String? get admission => localizedValues['admission']![locale.languageCode]; - String get request => localizedValues['request'][locale.languageCode]; + String? get request => localizedValues['request']![locale.languageCode]; - String get admissionRequest => - localizedValues['admissionRequest'][locale.languageCode]; + String? get admissionRequest => localizedValues['admissionRequest']![locale.languageCode]; - String get patientDetails => - localizedValues['patientDetails'][locale.languageCode]; + String? get patientDetails => localizedValues['patientDetails']![locale.languageCode]; - String get specialityAndDoctorDetail => - localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String? get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail']![locale.languageCode]; - String get referringDate => - localizedValues['referringDate'][locale.languageCode]; + String? get referringDate => localizedValues['referringDate']![locale.languageCode]; - String get referringDoctor => - localizedValues['referringDoctor'][locale.languageCode]; + String? get referringDoctor => localizedValues['referringDoctor']![locale.languageCode]; - String get otherInformation => - localizedValues['otherInformation'][locale.languageCode]; + String? get otherInformation => localizedValues['otherInformation']![locale.languageCode]; - String get expectedDays => - localizedValues['expectedDays'][locale.languageCode]; + String? get expectedDays => localizedValues['expectedDays']![locale.languageCode]; - String get expectedAdmissionDate => - localizedValues['expectedAdmissionDate'][locale.languageCode]; + String? get expectedAdmissionDate => localizedValues['expectedAdmissionDate']![locale.languageCode]; - String get emergencyAdmission => - localizedValues['emergencyAdmission'][locale.languageCode]; - String get isSickLeaveRequired => - localizedValues['isSickLeaveRequired'][locale.languageCode]; + String? get emergencyAdmission => localizedValues['emergencyAdmission']![locale.languageCode]; + String? get isSickLeaveRequired => localizedValues['isSickLeaveRequired']![locale.languageCode]; - String get patientPregnant => - localizedValues['patientPregnant'][locale.languageCode]; + String? get patientPregnant => localizedValues['patientPregnant']![locale.languageCode]; - String get treatmentLine => - localizedValues['treatmentLine'][locale.languageCode]; + String? get treatmentLine => localizedValues['treatmentLine']![locale.languageCode]; - String get ward => localizedValues['ward'][locale.languageCode]; + String? get ward => localizedValues['ward']![locale.languageCode]; - String get preAnesthesiaReferred => - localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String? get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred']![locale.languageCode]; - String get admissionType => - localizedValues['admissionType'][locale.languageCode]; + String? get admissionType => localizedValues['admissionType']![locale.languageCode]; - String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String? get diagnosis => localizedValues['diagnosis']![locale.languageCode]; - String get allergies => localizedValues['allergies'][locale.languageCode]; + String? get allergies => localizedValues['allergies']![locale.languageCode]; - String get preOperativeOrders => - localizedValues['preOperativeOrders'][locale.languageCode]; + String? get preOperativeOrders => localizedValues['preOperativeOrders']![locale.languageCode]; - String get elementForImprovement => - localizedValues['elementForImprovement'][locale.languageCode]; + String? get elementForImprovement => localizedValues['elementForImprovement']![locale.languageCode]; - String get dischargeDate => - localizedValues['dischargeDate'][locale.languageCode]; + String? get dischargeDate => localizedValues['dischargeDate']![locale.languageCode]; - String get dietType => localizedValues['dietType'][locale.languageCode]; + String? get dietType => localizedValues['dietType']![locale.languageCode]; - String get dietTypeRemarks => - localizedValues['dietTypeRemarks'][locale.languageCode]; + String? get dietTypeRemarks => localizedValues['dietTypeRemarks']![locale.languageCode]; - String get save => localizedValues['save'][locale.languageCode]; + String? get save => localizedValues['save']![locale.languageCode]; - String get postPlansEstimatedCost => - localizedValues['postPlansEstimatedCost'][locale.languageCode]; - String get postPlans => localizedValues['postPlans'][locale.languageCode]; + String? get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost']![locale.languageCode]; + String? get postPlans => localizedValues['postPlans']![locale.languageCode]; - String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String? get ucaf => localizedValues['ucaf']![locale.languageCode]; - String get emergencyCase => - localizedValues['emergencyCase'][locale.languageCode]; + String? get emergencyCase => localizedValues['emergencyCase']![locale.languageCode]; - String get durationOfIllness => - localizedValues['durationOfIllness'][locale.languageCode]; + String? get durationOfIllness => localizedValues['durationOfIllness']![locale.languageCode]; - String get chiefComplaintsAndSymptoms => - localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String? get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]; - String get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String? get patientFeelsPainInHisBackAndCough => + localizedValues['patientFeelsPainInHisBackAndCough']![locale.languageCode]; - String get additionalTextComplaints => - localizedValues['additionalTextComplaints'][locale.languageCode]; + String? get additionalTextComplaints => localizedValues['additionalTextComplaints']![locale.languageCode]; - String get otherConditions => - localizedValues['otherConditions'][locale.languageCode]; + String? get otherConditions => localizedValues['otherConditions']![locale.languageCode]; - String get other => localizedValues['other'][locale.languageCode]; + String? get other => localizedValues['other']![locale.languageCode]; - String get how => localizedValues['how'][locale.languageCode]; + String? get how => localizedValues['how']![locale.languageCode]; - String get when => localizedValues['when'][locale.languageCode]; + String? get when => localizedValues['when']![locale.languageCode]; - String get where => localizedValues['where'][locale.languageCode]; + String? get where => localizedValues['where']![locale.languageCode]; - String get specifyPossibleLineManagement => - localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String? get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement']![locale.languageCode]; - String get significantSigns => - localizedValues['significantSigns'][locale.languageCode]; + String? get significantSigns => localizedValues['significantSigns']![locale.languageCode]; - String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String? get backAbdomen => localizedValues['backAbdomen']![locale.languageCode]; - String get reasons => localizedValues['reasons'][locale.languageCode]; + String? get reasons => localizedValues['reasons']![locale.languageCode]; - String get createNew => localizedValues['createNew'][locale.languageCode]; + String? get createNew => localizedValues['createNew']![locale.languageCode]; - String get episode => localizedValues['episode'][locale.languageCode]; + String? get episode => localizedValues['episode']![locale.languageCode]; - String get medications => localizedValues['medications'][locale.languageCode]; + String? get medications => localizedValues['medications']![locale.languageCode]; - String get procedures => localizedValues['procedures'][locale.languageCode]; + String? get procedures => localizedValues['procedures']![locale.languageCode]; - String get chiefComplaints => - localizedValues['chiefComplaints'][locale.languageCode]; + String? get chiefComplaints => localizedValues['chiefComplaints']![locale.languageCode]; - String get histories => localizedValues['histories'][locale.languageCode]; + String? get histories => localizedValues['histories']![locale.languageCode]; - String get allergiesSoap => - localizedValues['allergiesSoap'][locale.languageCode]; + String? get allergiesSoap => localizedValues['allergiesSoap']![locale.languageCode]; - String get addChiefComplaints => - localizedValues['addChiefComplaints'][locale.languageCode]; + String? get addChiefComplaints => localizedValues['addChiefComplaints']![locale.languageCode]; - String get historyOfPresentIllness => - localizedValues['historyOfPresentIllness'][locale.languageCode]; + String? get historyOfPresentIllness => localizedValues['historyOfPresentIllness']![locale.languageCode]; - String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String? get requiredMsg => localizedValues['requiredMsg']![locale.languageCode]; - String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String? get addHistory => localizedValues['addHistory']![locale.languageCode]; - String get searchHistory => - localizedValues['searchHistory'][locale.languageCode]; + String? get searchHistory => localizedValues['searchHistory']![locale.languageCode]; - String get addSelectedHistories => - localizedValues['addSelectedHistories'][locale.languageCode]; + String? get addSelectedHistories => localizedValues['addSelectedHistories']![locale.languageCode]; - String get addAllergies => - localizedValues['addAllergies'][locale.languageCode]; + String? get addAllergies => localizedValues['addAllergies']![locale.languageCode]; - String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String? get itemExist => localizedValues['itemExist']![locale.languageCode]; - String get selectAllergy => - localizedValues['selectAllergy'][locale.languageCode]; + String? get selectAllergy => localizedValues['selectAllergy']![locale.languageCode]; - String get selectSeverity => - localizedValues['selectSeverity'][locale.languageCode]; + String? get selectSeverity => localizedValues['selectSeverity']![locale.languageCode]; - String get leaveCreated => - localizedValues['leaveCreated'][locale.languageCode]; + String? get leaveCreated => localizedValues['leaveCreated']![locale.languageCode]; - String get vitalSignEmptyMsg => - localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String? get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg']![locale.languageCode]; - String get referralEmptyMsg => - localizedValues['referralEmptyMsg'][locale.languageCode]; + String? get referralEmptyMsg => localizedValues['referralEmptyMsg']![locale.languageCode]; - String get referralSuccessMsg => - localizedValues['referralSuccessMsg'][locale.languageCode]; + String? get referralSuccessMsg => localizedValues['referralSuccessMsg']![locale.languageCode]; - String get diagnoseType => - localizedValues['diagnoseType'][locale.languageCode]; + String? get diagnoseType => localizedValues['diagnoseType']![locale.languageCode]; - String get condition => localizedValues['condition'][locale.languageCode]; + String? get condition => localizedValues['condition']![locale.languageCode]; - String get id => localizedValues['id'][locale.languageCode]; + String? get id => localizedValues['id']![locale.languageCode]; - String get quantity => localizedValues['quantity'][locale.languageCode]; + String? get quantity => localizedValues['quantity']![locale.languageCode]; - String get durDays => localizedValues['durDays'][locale.languageCode]; + String? get durDays => localizedValues['durDays']![locale.languageCode]; - String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String? get codeNo => localizedValues['codeNo']![locale.languageCode]; - String get covered => localizedValues['covered'][locale.languageCode]; + String? get covered => localizedValues['covered']![locale.languageCode]; - String get approvalRequired => - localizedValues['approvalRequired'][locale.languageCode]; + String? get approvalRequired => localizedValues['approvalRequired']![locale.languageCode]; - String get uncoveredByDoctor => - localizedValues['uncoveredByDoctor'][locale.languageCode]; + String? get uncoveredByDoctor => localizedValues['uncoveredByDoctor']![locale.languageCode]; - String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String? get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]; - String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + String? get moreVerification => localizedValues['more-verify']![locale.languageCode]; - String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + String? get welcomeBack => localizedValues['welcome-back']![locale.languageCode]; - String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + String? get accountInfo => localizedValues['account-info']![locale.languageCode]; - String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + String? get useAnotherAccount => localizedValues['another-acc']![locale.languageCode]; - String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + String? get verifyLoginWith => localizedValues['verify-login-with']![locale.languageCode]; - String get register => localizedValues['register-user'][locale.languageCode]; + String? get register => localizedValues['register-user']![locale.languageCode]; - String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + String? get verifyFingerprint => localizedValues['verify-with-fingerprint']![locale.languageCode]; - String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + String? get verifyFaceID => localizedValues['verify-with-faceid']![locale.languageCode]; - String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWith => - localizedValues['verify-with'][locale.languageCode]; + String? get verifySMS => localizedValues['verify-with-sms']![locale.languageCode]; + String? get verifyWith => localizedValues['verify-with']![locale.languageCode]; - String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + String? get verifyWhatsApp => localizedValues['verify-with-whatsapp']![locale.languageCode]; - String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String? get lastLoginAt => localizedValues['last-login']![locale.languageCode]; - String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + String? get lastLoginWith => localizedValues['last-login-with']![locale.languageCode]; - String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + String? get verifyFingerprint2 => localizedValues['verify-fingerprint']![locale.languageCode]; - String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + String? get verificationMessage => localizedValues['verification_message']![locale.languageCode]; - String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + String? get validationMessage => localizedValues['validation_message']![locale.languageCode]; - String get addAssessment => - localizedValues['addAssessment'][locale.languageCode]; + String? get addAssessment => localizedValues['addAssessment']![locale.languageCode]; - String get assessment => localizedValues['assessment'][locale.languageCode]; + String? get assessment => localizedValues['assessment']![locale.languageCode]; - String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; + String? get physicalSystemExamination => localizedValues['physicalSystemExamination']![locale.languageCode]; - String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; + String? get searchExamination => localizedValues['searchExamination']![locale.languageCode]; - String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + String? get addExamination => localizedValues['addExamination']![locale.languageCode]; - String get doc => localizedValues['doc'][locale.languageCode]; + String? get doc => localizedValues['doc']![locale.languageCode]; - String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; + String? get allergicTO => localizedValues['allergicTO']![locale.languageCode]; - String get normal => localizedValues['normal'][locale.languageCode]; - String get notExamined => localizedValues['notExamined'][locale.languageCode]; + String? get normal => localizedValues['normal']![locale.languageCode]; + String? get notExamined => localizedValues['notExamined']![locale.languageCode]; - String get abnormal => localizedValues['abnormal'][locale.languageCode]; + String? get abnormal => localizedValues['abnormal']![locale.languageCode]; - String get patientNoDetailErrMsg => - localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String? get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg']![locale.languageCode]; - String get systolicLng => - localizedValues['systolic-lng'][locale.languageCode]; + String? get systolicLng => localizedValues['systolic-lng']![locale.languageCode]; - String get diastolicLng => - localizedValues['diastolic-lng'][locale.languageCode]; + String? get diastolicLng => localizedValues['diastolic-lng']![locale.languageCode]; - String get mass => localizedValues['mass'][locale.languageCode]; + String? get mass => localizedValues['mass']![locale.languageCode]; - String get tempC => localizedValues['temp-c'][locale.languageCode]; + String? get tempC => localizedValues['temp-c']![locale.languageCode]; - String get bpm => localizedValues['bpm'][locale.languageCode]; + String? get bpm => localizedValues['bpm']![locale.languageCode]; - String get respirationSigns => - localizedValues['respiration-signs'][locale.languageCode]; + String? get respirationSigns => localizedValues['respiration-signs']![locale.languageCode]; - String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String? get sysDias => localizedValues['sys-dias']![locale.languageCode]; - String get body => localizedValues['body'][locale.languageCode]; + String? get body => localizedValues['body']![locale.languageCode]; - String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + String? get respirationRate => localizedValues['respirationRate']![locale.languageCode]; - String get heart => localizedValues['heart'][locale.languageCode]; + String? get heart => localizedValues['heart']![locale.languageCode]; - String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; + String? get medicalReport => localizedValues['medicalReport']![locale.languageCode]; - String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String? get visitDate => localizedValues['visitDate']![locale.languageCode]; - String get test => localizedValues['test'][locale.languageCode]; + String? get test => localizedValues['test']![locale.languageCode]; - String get addMoreProcedure => - localizedValues['addMoreProcedure'][locale.languageCode]; + String? get addMoreProcedure => localizedValues['addMoreProcedure']![locale.languageCode]; - String get regular => localizedValues['regular'][locale.languageCode]; + String? get regular => localizedValues['regular']![locale.languageCode]; - String get searchProcedures => - localizedValues['searchProcedures'][locale.languageCode]; + String? get searchProcedures => localizedValues['searchProcedures']![locale.languageCode]; - String get procedureCategorise => - localizedValues['procedureCategorise'][locale.languageCode]; + String? get procedureCategorise => localizedValues['procedureCategorise']![locale.languageCode]; - String get selectProcedures => - localizedValues['selectProcedures'][locale.languageCode]; + String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; - String get addSelectedProcedures => - localizedValues['addSelectedProcedures'][locale.languageCode]; + String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String get updateProcedure => - localizedValues['updateProcedure'][locale.languageCode]; + String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; - String get orderProcedure => - localizedValues['orderProcedure'][locale.languageCode]; + String? get orderProcedure => localizedValues['orderProcedure']![locale.languageCode]; - String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; + String? get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]; - String get dType => localizedValues['dType'][locale.languageCode]; + String? get dType => localizedValues['dType']![locale.languageCode]; - String get addAssessmentDetails => - localizedValues['addAssessmentDetails'][locale.languageCode]; + String? get addAssessmentDetails => localizedValues['addAssessmentDetails']![locale.languageCode]; - String get progressNoteSOAP => - localizedValues['progressNoteSOAP'][locale.languageCode]; + String? get progressNoteSOAP => localizedValues['progressNoteSOAP']![locale.languageCode]; - String get addProgressNote => - localizedValues['addProgressNote'][locale.languageCode]; + String? get addProgressNote => localizedValues['addProgressNote']![locale.languageCode]; - String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String? get createdBy => localizedValues['createdBy']![locale.languageCode]; - String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String? get editedBy => localizedValues['editedBy']![locale.languageCode]; - String get currentMedications => - localizedValues['currentMedications'][locale.languageCode]; + String? get currentMedications => localizedValues['currentMedications']![locale.languageCode]; - String get noItem => localizedValues['noItem'][locale.languageCode]; + String? get noItem => localizedValues['noItem']![locale.languageCode]; - String get postUcafSuccessMsg => - localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String? get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg']![locale.languageCode]; - String get vitalSignDetailEmpty => - localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String? get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty']![locale.languageCode]; - String get onlyOfftimeHoliday => - localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String? get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday']![locale.languageCode]; - String get active => localizedValues['active'][locale.languageCode]; + String? get active => localizedValues['active']![locale.languageCode]; - String get hold => localizedValues['hold'][locale.languageCode]; + String? get hold => localizedValues['hold']![locale.languageCode]; - String get loading => localizedValues['loading'][locale.languageCode]; + String? get loading => localizedValues['loading']![locale.languageCode]; - String get assessmentErrorMsg => - localizedValues['assessmentErrorMsg'][locale.languageCode]; + String? get assessmentErrorMsg => localizedValues['assessmentErrorMsg']![locale.languageCode]; - String get examinationErrorMsg => - localizedValues['examinationErrorMsg'][locale.languageCode]; - - String get progressNoteErrorMsg => - localizedValues['progressNoteErrorMsg'][locale.languageCode]; - - String get chiefComplaintErrorMsg => - localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; - String get ICDName => localizedValues['ICDName'][locale.languageCode]; - - String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; - - String get referralRemark => - localizedValues['referralRemark'][locale.languageCode]; - String get offTime => localizedValues['offTime'][locale.languageCode]; - - String get icd => localizedValues['icd'][locale.languageCode]; - String get days => localizedValues['days'][locale.languageCode]; - String get hr => localizedValues['hr'][locale.languageCode]; - String get min => localizedValues['min'][locale.languageCode]; - String get months => localizedValues['months'][locale.languageCode]; - String get years => localizedValues['years'][locale.languageCode]; - String get referralStatusHold => - localizedValues['referralStatusHold'][locale.languageCode]; - String get referralStatusActive => - localizedValues['referralStatusActive'][locale.languageCode]; - String get referralStatusCancelled => - localizedValues['referralStatusCancelled'][locale.languageCode]; - String get referralStatusCompleted => - localizedValues['referralStatusCompleted'][locale.languageCode]; - String get referralStatusNotSeen => - localizedValues['referralStatusNotSeen'][locale.languageCode]; - String get clinicSearch => - localizedValues['clinicSearch'][locale.languageCode]; - String get doctorSearch => - localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => - localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => - localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => - localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => - localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => - localizedValues['referralSuccessMsgReject'][locale.languageCode]; - - String get patientName => - localizedValues['patient-name'][locale.languageCode]; - - String get appointmentNumber => - localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => - localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => - localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => - localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => - localizedValues['complications'][locale.languageCode]; - String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => - localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => - localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => - localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => - localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; - String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => - localizedValues['doctorResponse'][locale.languageCode]; - String get sickleaveonhold => - localizedValues['sickleaveonhold'][locale.languageCode]; - String get noClinic => localizedValues['no-clinic'][locale.languageCode]; - - String get otherStatistic => - localizedValues['otherStatistic'][locale.languageCode]; - - String get patientsreferral => - localizedValues['ptientsreferral'][locale.languageCode]; - String get myPatientsReferral => - localizedValues['myPatientsReferral'][locale.languageCode]; - String get arrivalpatient => - localizedValues['arrivalpatient'][locale.languageCode]; - String get searchmedicinepatient => - localizedValues['searchmedicinepatient'][locale.languageCode]; - String get appointmentDate => - localizedValues['appointmentDate'][locale.languageCode]; - String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; - - String get details => localizedValues['details'][locale.languageCode]; - String get liveCare => localizedValues['liveCare'][locale.languageCode]; - String get outpatient => localizedValues['out-patient'][locale.languageCode]; - String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get labResults => localizedValues['labResults'][locale.languageCode]; - String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => - localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => - localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; - String get showDetail => localizedValues['showDetail'][locale.languageCode]; - String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; - - String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; - String get reschedule => localizedValues['reschedule'][locale.languageCode]; - String get leaves => localizedValues['leaves'][locale.languageCode]; - String get openRad => localizedValues['open-rad'][locale.languageCode]; - - String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; - String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => - localizedValues['procedureName'][locale.languageCode]; - String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => - localizedValues['prescriptions'][locale.languageCode]; - String get notes => localizedValues['notes'][locale.languageCode]; - String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - String get searchWithOther => - localizedValues['searchWithOther'][locale.languageCode]; - String get hideOtherCriteria => - localizedValues['hideOtherCriteria'][locale.languageCode]; - String get applyForReschedule => - localizedValues['applyForReschedule'][locale.languageCode]; - - String get startDate => localizedValues['startDate'][locale.languageCode]; - String get endDate => localizedValues['endDate'][locale.languageCode]; - - String get addReschedule => - localizedValues['add-reschedule'][locale.languageCode]; - String get updateReschedule => - localizedValues['update-reschedule'][locale.languageCode]; - String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; - String get accepted => localizedValues['accepted'][locale.languageCode]; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; - String get unReplied => localizedValues['unReplied'][locale.languageCode]; - String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => - localizedValues['typeHereToReply'][locale.languageCode]; - String get searchHere => localizedValues['searchHere'][locale.languageCode]; - String get remove => localizedValues['remove'][locale.languageCode]; - - String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => - localizedValues['fieldRequired'][locale.languageCode]; - String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; - String get changeOfSchedule => - localizedValues['changeOfSchedule'][locale.languageCode]; - String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; - String get enterCredentials => - localizedValues['enter_credentials'][locale.languageCode]; - String get patpatientIDMobilenationalientID => - localizedValues['patientIDMobilenational'][locale.languageCode]; - - String get updateNow => localizedValues['updateNow'][locale.languageCode]; - String get updateTheApp => - localizedValues['updateTheApp'][locale.languageCode]; - String get admissionDate => - localizedValues['admission-date'][locale.languageCode]; - String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; - String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; - String get replayBefore => - localizedValues['replayBefore'][locale.languageCode]; - String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => - localizedValues['acknowledged'][locale.languageCode]; - String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; - String get pleaseEnterProcedure => - localizedValues["pleaseEnterProcedure"][locale.languageCode]; - String get fillTheMandatoryProcedureDetails => - localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; - String get atLeastThreeCharacters => - localizedValues["atLeastThreeCharacters"][locale.languageCode]; - String get searchProcedureHere => - localizedValues["searchProcedureHere"][locale.languageCode]; - String get noInsuranceApprovalFound => - localizedValues["noInsuranceApprovalFound"][locale.languageCode]; - String get procedure => localizedValues["procedure"][locale.languageCode]; - String get stopDate => localizedValues["stopDate"][locale.languageCode]; - String get processed => localizedValues["processed"][locale.languageCode]; - String get direction => localizedValues["direction"][locale.languageCode]; - String get refill => localizedValues["refill"][locale.languageCode]; - String get medicationHasBeenAdded => - localizedValues["medicationHasBeenAdded"][locale.languageCode]; - String get newPrescriptionOrder => - localizedValues["newPrescriptionOrder"][locale.languageCode]; - String get pleaseFillAllFields => - localizedValues["pleaseFillAllFields"][locale.languageCode]; - String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] - [locale.languageCode]; - String get only5DigitsAllowedForStrength => - localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; - String get unit => localizedValues["unit"][locale.languageCode]; - String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; - String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; - String get applyForRadiologyOrder => - localizedValues["applyForRadiologyOrder"][locale.languageCode]; - String get applyForNewLabOrder => - localizedValues["applyForNewLabOrder"][locale.languageCode]; - String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; - String get addRadiologyOrder => - localizedValues["addRadiologyOrder"][locale.languageCode]; - String get newRadiologyOrder => - localizedValues["newRadiologyOrder"][locale.languageCode]; - String get orderDate => localizedValues["orderDate"][locale.languageCode]; - String get examType => localizedValues["examType"][locale.languageCode]; - String get health => localizedValues["health"][locale.languageCode]; - String get summary => localizedValues["summary"][locale.languageCode]; - String get applyForNewPrescriptionsOrder => - localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; - String get noPrescriptionsFound => - localizedValues["noPrescriptionsFound"][locale.languageCode]; - String get noMedicalFileFound => - localizedValues["noMedicalFileFound"][locale.languageCode]; - String get insurance22 => localizedValues["insurance22"][locale.languageCode]; - String get approvals22 => localizedValues["approvals22"][locale.languageCode]; - String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; - String get discharged => localizedValues["discharged"][locale.languageCode]; - String get addNewOrderSheet => - localizedValues["addNewOrderSheet"][locale.languageCode]; - String get addNewProgressNote => - localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => localizedValues["notePending"][locale.languageCode]; - String get noteCanceled => - localizedValues["noteCanceled"][locale.languageCode]; - String get noteVerified => - localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; - - String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; - - String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; - String get order => localizedValues["order"][locale.languageCode]; - String get sheet => localizedValues["sheet"][locale.languageCode]; - String get medical => localizedValues["medical"][locale.languageCode]; - String get report => localizedValues["report"][locale.languageCode]; - String get discharge => localizedValues["discharge"][locale.languageCode]; - String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => - localizedValues["notRepliedYet"][locale.languageCode]; - String get clearText => localizedValues["clearText"][locale.languageCode]; - String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; - String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; - String get comments => localizedValues['comments'][locale.languageCode]; - String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; - String get endCall => localizedValues['endCall'][locale.languageCode]; - - String get transferTo => localizedValues['transferTo'][locale.languageCode]; - String get admin => localizedValues['admin'][locale.languageCode]; - String get instructions => localizedValues['instructions'][locale.languageCode]; - String get sendLC => localizedValues['sendLC'][locale.languageCode]; - String get endLC => localizedValues['endLC'][locale.languageCode]; - String get consultation => localizedValues['consultation'][locale.languageCode]; - String get resume => localizedValues['resume'][locale.languageCode]; - String get theCall => localizedValues['theCall'][locale.languageCode]; - String get createNewMedicalReport => localizedValues['createNewMedicalReport'][locale.languageCode]; - String get historyPhysicalFinding => localizedValues['historyPhysicalFinding'][locale.languageCode]; - String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData'][locale.languageCode]; - String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode]; - String get onHold => localizedValues['onHold'][locale.languageCode]; - String get verified => localizedValues['verified'][locale.languageCode]; + String? get examinationErrorMsg => localizedValues['examinationErrorMsg']![locale.languageCode]; + + String? get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg']![locale.languageCode]; + + String? get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg']![locale.languageCode]; + String? get ICDName => localizedValues['ICDName']![locale.languageCode]; + + String? get referralStatus => localizedValues['referralStatus']![locale.languageCode]; + + String? get referralRemark => localizedValues['referralRemark']![locale.languageCode]; + String? get offTime => localizedValues['offTime']![locale.languageCode]; + + String? get icd => localizedValues['icd']![locale.languageCode]; + String? get days => localizedValues['days']![locale.languageCode]; + String? get hr => localizedValues['hr']![locale.languageCode]; + String? get min => localizedValues['min']![locale.languageCode]; + String? get months => localizedValues['months']![locale.languageCode]; + String? get years => localizedValues['years']![locale.languageCode]; + String? get referralStatusHold => localizedValues['referralStatusHold']![locale.languageCode]; + String? get referralStatusActive => localizedValues['referralStatusActive']![locale.languageCode]; + String? get referralStatusCancelled => localizedValues['referralStatusCancelled']![locale.languageCode]; + String? get referralStatusCompleted => localizedValues['referralStatusCompleted']![locale.languageCode]; + String? get referralStatusNotSeen => localizedValues['referralStatusNotSeen']![locale.languageCode]; + String? get clinicSearch => localizedValues['clinicSearch']![locale.languageCode]; + String? get doctorSearch => localizedValues['doctorSearch']![locale.languageCode]; + String? get referralResponse => localizedValues['referralResponse']![locale.languageCode]; + String? get estimatedCost => localizedValues['estimatedCost']![locale.languageCode]; + String? get diagnosisDetail => localizedValues['diagnosisDetail']![locale.languageCode]; + String? get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept']![locale.languageCode]; + String? get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject']![locale.languageCode]; + + String? get patientName => localizedValues['patient-name']![locale.languageCode]; + + String? get appointmentNumber => localizedValues['appointmentNumber']![locale.languageCode]; + String? get sickLeaveComments => localizedValues['sickLeaveComments']![locale.languageCode]; + String? get pastMedicalHistory => localizedValues['pastMedicalHistory']![locale.languageCode]; + String? get pastSurgicalHistory => localizedValues['pastSurgicalHistory']![locale.languageCode]; + String? get complications => localizedValues['complications']![locale.languageCode]; + String? get floor => localizedValues['floor']![locale.languageCode]; + String? get roomCategory => localizedValues['roomCategory']![locale.languageCode]; + String? get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions']![locale.languageCode]; + String? get otherProcedure => localizedValues['otherProcedure']![locale.languageCode]; + String? get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg']![locale.languageCode]; + String? get infoStatus => localizedValues['infoStatus']![locale.languageCode]; + String? get doctorResponse => localizedValues['doctorResponse']![locale.languageCode]; + String? get sickleaveonhold => localizedValues['sickleaveonhold']![locale.languageCode]; + String? get noClinic => localizedValues['no-clinic']![locale.languageCode]; + + String? get otherStatistic => localizedValues['otherStatistic']![locale.languageCode]; + + String? get patientsreferral => localizedValues['ptientsreferral']![locale.languageCode]; + String? get myPatientsReferral => localizedValues['myPatientsReferral']![locale.languageCode]; + String? get arrivalpatient => localizedValues['arrivalpatient']![locale.languageCode]; + String? get searchmedicinepatient => localizedValues['searchmedicinepatient']![locale.languageCode]; + String? get appointmentDate => localizedValues['appointmentDate']![locale.languageCode]; + String? get arrivedP => localizedValues['arrived_p']![locale.languageCode]; + + String? get details => localizedValues['details']![locale.languageCode]; + String? get liveCare => localizedValues['liveCare']![locale.languageCode]; + String? get outpatient => localizedValues['out-patient']![locale.languageCode]; + String? get billNo => localizedValues['BillNo']![locale.languageCode]; + String? get labResults => localizedValues['labResults']![locale.languageCode]; + String? get sendSuc => localizedValues['sendSuc']![locale.languageCode]; + String? get specialResult => localizedValues['SpecialResult']![locale.languageCode]; + String? get noDataAvailable => localizedValues['noDataAvailable']![locale.languageCode]; + String? get showMoreBtn => localizedValues['show-more-btn']![locale.languageCode]; + String? get showDetail => localizedValues['showDetail']![locale.languageCode]; + String? get viewProfile => localizedValues['viewProfile']![locale.languageCode]; + + String? get fileNumber => localizedValues['fileNumber']![locale.languageCode]; + String? get reschedule => localizedValues['reschedule']![locale.languageCode]; + String? get leaves => localizedValues['leaves']![locale.languageCode]; + String? get openRad => localizedValues['open-rad']![locale.languageCode]; + + String? get totalApproval => localizedValues['totalApproval']![locale.languageCode]; + String? get procedureStatus => localizedValues['procedureStatus']![locale.languageCode]; + String? get unusedCount => localizedValues['unusedCount']![locale.languageCode]; + String? get companyName => localizedValues['companyName']![locale.languageCode]; + String? get procedureName => localizedValues['procedureName']![locale.languageCode]; + String? get usageStatus => localizedValues['usageStatus']![locale.languageCode]; + String? get prescriptions => localizedValues['prescriptions']![locale.languageCode]; + String? get notes => localizedValues['notes']![locale.languageCode]; + String? get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]; + String? get searchWithOther => localizedValues['searchWithOther']![locale.languageCode]; + String? get hideOtherCriteria => localizedValues['hideOtherCriteria']![locale.languageCode]; + String? get applyForReschedule => localizedValues['applyForReschedule']![locale.languageCode]; + + String? get startDate => localizedValues['startDate']![locale.languageCode]; + String? get endDate => localizedValues['endDate']![locale.languageCode]; + + String? get addReschedule => localizedValues['add-reschedule']![locale.languageCode]; + String? get updateReschedule => localizedValues['update-reschedule']![locale.languageCode]; + String? get sickLeave => localizedValues['sick_leave']![locale.languageCode]; + String? get accepted => localizedValues['accepted']![locale.languageCode]; + String? get cancelled => localizedValues['cancelled']![locale.languageCode]; + String? get unReplied => localizedValues['unReplied']![locale.languageCode]; + String? get replied => localizedValues['replied']![locale.languageCode]; + String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]; + String? get searchHere => localizedValues['searchHere']![locale.languageCode]; + String? get remove => localizedValues['remove']![locale.languageCode]; + + String? get step => localizedValues['step']![locale.languageCode]; + String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]; + String? get noSickLeave => localizedValues['no-sickleve']![locale.languageCode]; + String? get changeOfSchedule => localizedValues['changeOfSchedule']![locale.languageCode]; + String? get newSchedule => localizedValues['newSchedule']![locale.languageCode]; + String? get enterCredentials => localizedValues['enter_credentials']![locale.languageCode]; + String? get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational']![locale.languageCode]; + + String? get updateNow => localizedValues['updateNow']![locale.languageCode]; + String? get updateTheApp => localizedValues['updateTheApp']![locale.languageCode]; + String? get admissionDate => localizedValues['admission-date']![locale.languageCode]; + String? get noOfDays => localizedValues['noOfDays']![locale.languageCode]; + String? get numOfDays => localizedValues['numOfDays']![locale.languageCode]; + String? get replayBefore => localizedValues['replayBefore']![locale.languageCode]; + String? get trySaying => localizedValues["try-saying"]![locale.languageCode]; + String? get acknowledged => localizedValues['acknowledged']![locale.languageCode]; + String? get didntCatch => localizedValues["didntCatch"]![locale.languageCode]; + String? get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"]![locale.languageCode]; + String? get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"]![locale.languageCode]; + String? get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"]![locale.languageCode]; + String? get searchProcedureHere => localizedValues["searchProcedureHere"]![locale.languageCode]; + String? get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"]![locale.languageCode]; + String? get procedure => localizedValues["procedure"]![locale.languageCode]; + String? get stopDate => localizedValues["stopDate"]![locale.languageCode]; + String? get processed => localizedValues["processed"]![locale.languageCode]; + String? get direction => localizedValues["direction"]![locale.languageCode]; + String? get refill => localizedValues["refill"]![locale.languageCode]; + String? get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"]![locale.languageCode]; + String? get newPrescriptionOrder => localizedValues["newPrescriptionOrder"]![locale.languageCode]; + String? get pleaseFillAllFields => localizedValues["pleaseFillAllFields"]![locale.languageCode]; + String? get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"]![locale.languageCode]; + String? get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]; + String? get unit => localizedValues["unit"]![locale.languageCode]; + String? get boxQuantity => localizedValues["boxQuantity"]![locale.languageCode]; + String? get orderTestOr => localizedValues["orderTestOr"]![locale.languageCode]; + String? get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"]![locale.languageCode]; + String? get applyForNewLabOrder => localizedValues["applyForNewLabOrder"]![locale.languageCode]; + String? get addLabOrder => localizedValues["addLabOrder"]![locale.languageCode]; + String? get addRadiologyOrder => localizedValues["addRadiologyOrder"]![locale.languageCode]; + String? get newRadiologyOrder => localizedValues["newRadiologyOrder"]![locale.languageCode]; + String? get orderDate => localizedValues["orderDate"]![locale.languageCode]; + String? get examType => localizedValues["examType"]![locale.languageCode]; + String? get health => localizedValues["health"]![locale.languageCode]; + String? get summary => localizedValues["summary"]![locale.languageCode]; + String? get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]; + String? get noPrescriptionsFound => localizedValues["noPrescriptionsFound"]![locale.languageCode]; + String? get noMedicalFileFound => localizedValues["noMedicalFileFound"]![locale.languageCode]; + String? get insurance22 => localizedValues["insurance22"]![locale.languageCode]; + String? get approvals22 => localizedValues["approvals22"]![locale.languageCode]; + String? get severe => localizedValues["severe"]![locale.languageCode]; + String? get graphDetails => localizedValues["graphDetails"]![locale.languageCode]; + String? get discharged => localizedValues["discharged"]![locale.languageCode]; + String? get addNewOrderSheet => localizedValues["addNewOrderSheet"]![locale.languageCode]; + String? get addNewProgressNote => localizedValues["addNewProgressNote"]![locale.languageCode]; + String? get notePending => localizedValues["notePending"]![locale.languageCode]; + String? get noteCanceled => localizedValues["noteCanceled"]![locale.languageCode]; + String? get noteVerified => localizedValues["noteVerified"]![locale.languageCode]; + String? get noteVerify => localizedValues["noteVerify"]![locale.languageCode]; + String? get noteConfirm => localizedValues["noteConfirm"]![locale.languageCode]; + String? get noteAdd => localizedValues["noteAdd"]![locale.languageCode]; + + String? get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]; + + String? get orderSheet => localizedValues["orderSheet"]![locale.languageCode]; + String? get order => localizedValues["order"]![locale.languageCode]; + String? get sheet => localizedValues["sheet"]![locale.languageCode]; + String? get medical => localizedValues["medical"]![locale.languageCode]; + String? get report => localizedValues["report"]![locale.languageCode]; + String? get discharge => localizedValues["discharge"]![locale.languageCode]; + String? get none => localizedValues["none"]![locale.languageCode]; + String? get notRepliedYet => localizedValues["notRepliedYet"]![locale.languageCode]; + String? get clearText => localizedValues["clearText"]![locale.languageCode]; + String? get medicalReportAdd => localizedValues['medicalReportAdd']![locale.languageCode]; + String? get medicalReportVerify => localizedValues['medicalReportVerify']![locale.languageCode]; + String? get comments => localizedValues['comments']![locale.languageCode]; + String? get initiateCall => localizedValues['initiateCall']![locale.languageCode]; + String? get endCall => localizedValues['endCall']![locale.languageCode]; + + String? get transferTo => localizedValues['transferTo']![locale.languageCode]; + String? get admin => localizedValues['admin']![locale.languageCode]; + String? get instructions => localizedValues['instructions']![locale.languageCode]; + String? get sendLC => localizedValues['sendLC']![locale.languageCode]; + String? get endLC => localizedValues['endLC']![locale.languageCode]; + String? get consultation => localizedValues['consultation']![locale.languageCode]; + String? get resume => localizedValues['resume']![locale.languageCode]; + String? get theCall => localizedValues['theCall']![locale.languageCode]; + String? get createNewMedicalReport => localizedValues['createNewMedicalReport']![locale.languageCode]; + String? get historyPhysicalFinding => localizedValues['historyPhysicalFinding']![locale.languageCode]; + String? get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData']![locale.languageCode]; + String? get impressionRecommendation => localizedValues['impressionRecommendation']![locale.languageCode]; + String? get onHold => localizedValues['onHold']![locale.languageCode]; + String? get verified => localizedValues['verified']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6d091756..a43d37e9 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -4,13 +4,14 @@ import 'package:hexcolor/hexcolor.dart'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ - Key key, - this.assetPath, - this.onTap, - this.label, this.height = 20, + Key? key, + required this.assetPath, + required this.onTap, + required this.label, + this.height = 20, }) : super(key: key); final String assetPath; - final Function onTap; + final GestureTapCallback onTap; final String label; final double height; @@ -25,9 +26,7 @@ class MethodTypeCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), + border: Border.all(color: HexColor('#707070'), width: 0.1), ), height: 170, child: Padding( @@ -46,7 +45,7 @@ class MethodTypeCard extends StatelessWidget { ], ), SizedBox( - height:height , + height: height, ), AppText( label, diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 0c374e58..ca8f8075 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -9,6 +9,7 @@ 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 SMSOTP { final AuthMethodTypes type; final mobileNo; @@ -16,7 +17,7 @@ class SMSOTP { final Function onFailure; final context; - int remainingTime = 600; + late int remainingTime = 600; SMSOTP( this.context, @@ -26,7 +27,7 @@ class SMSOTP { this.onFailure, ); - final verifyAccountForm = GlobalKey(); + late final verifyAccountForm = GlobalKey(); TextEditingController digit1 = TextEditingController(text: ""); TextEditingController digit2 = TextEditingController(text: ""); @@ -43,10 +44,10 @@ class SMSOTP { final focusD2 = FocusNode(); final focusD3 = FocusNode(); final focusD4 = FocusNode(); - String errorMsg; - ProjectViewModel projectProvider; - String displayTime = ''; - bool isClosed = false; + late String errorMsg; + late ProjectViewModel projectProvider; + late String displayTime = ''; + late bool isClosed = false; displayDialog(BuildContext context) async { return showDialog( context: context, @@ -70,50 +71,45 @@ class SMSOTP { 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(); - }, - )) - ], - ) - ])), + 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 + + TranslationBase.of(context).verificationMessage! + ' XXXXXX' + - mobileNo - .toString() - .substring(mobileNo.toString().length - 3), + mobileNo.toString().substring(mobileNo.toString().length - 3), textAlign: TextAlign.start, fontWeight: FontWeight.bold, fontSize: 14, @@ -143,15 +139,12 @@ class SMSOTP { onSaved: (val) {}, validator: validateCodeDigit, onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD2); + FocusScope.of(context).requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD2); - verifyAccountFormValue['digit1'] = - val.trim(); + FocusScope.of(context).requestFocus(focusD2); + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, @@ -171,15 +164,12 @@ class SMSOTP { decoration: buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD3); + FocusScope.of(context).requestFocus(focusD3); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = - val.trim(); + FocusScope.of(context).requestFocus(focusD3); + verifyAccountFormValue['digit2'] = val.trim(); checkValue(); } }, @@ -196,19 +186,15 @@ class SMSOTP { textAlign: TextAlign.center, style: buildTextStyle(), keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), + decoration: buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); + FocusScope.of(context).requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context) - .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = - val.trim(); + FocusScope.of(context).requestFocus(focusD4); + verifyAccountFormValue['digit3'] = val.trim(); checkValue(); } }, @@ -223,16 +209,13 @@ class SMSOTP { style: buildTextStyle(), controller: digit4, keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), + decoration: buildInputDecoration(context), onFieldSubmitted: (_) { - FocusScope.of(context) - .requestFocus(focusD4); + FocusScope.of(context).requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - verifyAccountFormValue['digit4'] = - val.trim(); + verifyAccountFormValue['digit4'] = val.trim(); checkValue(); } }, @@ -248,8 +231,7 @@ class SMSOTP { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).validationMessage + - ' ', + TranslationBase.of(context).validationMessage! + ' ', fontWeight: FontWeight.w600, fontSize: 14, ), @@ -281,15 +263,15 @@ class SMSOTP { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -299,7 +281,7 @@ class SMSOTP { } // ignore: missing_return - String validateCodeDigit(value) { + String? validateCodeDigit(value) { if (value.isEmpty) { return ' '; } else if (value.length == 3) { @@ -310,28 +292,21 @@ class SMSOTP { } checkValue() async { - if (verifyAccountForm.currentState.validate()) { - onSuccess(digit1.text.toString() + - digit2.text.toString() + - digit3.text.toString() + - digit4.text.toString()); + if (verifyAccountForm.currentState!.validate()) { + onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString()); this.isClosed = true; - } } getSecondsAsDigitalClock(int inputSeconds) { - var sec_num = - int.parse(inputSeconds.toString()); // don't forget the second param + var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param var hours = (sec_num / 3600).floor(); var minutes = ((sec_num - hours * 3600) / 60).floor(); var seconds = sec_num - hours * 3600 - minutes * 60; var minutesString = ""; var secondsString = ""; - minutesString = - minutes < 10 ? "0" + minutes.toString() : minutes.toString(); - secondsString = - seconds < 10 ? "0" + seconds.toString() : seconds.toString(); + minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString(); + secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString(); return minutesString + ":" + secondsString; } @@ -341,7 +316,7 @@ class SMSOTP { displayTime = this.getSecondsAsDigitalClock(this.remainingTime); }); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(Duration(seconds: 1), () { if (this.remainingTime > 0) { if (isClosed == false) { startTimer(setState); diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 27dbe8bf..8d69edd3 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -9,26 +9,25 @@ import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { final AuthMethodTypes authMethodType; - final Function(AuthMethodTypes type, bool isActive) authenticateUser; - final Function onShowMore; + final Function(AuthMethodTypes type, bool isActive)? authenticateUser; + final GestureTapCallback? onShowMore; final AuthenticationViewModel authenticationViewModel; const VerificationMethodsList( - {Key key, - this.authMethodType, + {Key? key, + required this.authMethodType, this.authenticateUser, this.onShowMore, - this.authenticationViewModel}) + required this.authenticationViewModel}) : super(key: key); @override - _VerificationMethodsListState createState() => - _VerificationMethodsListState(); + _VerificationMethodsListState createState() => _VerificationMethodsListState(); } class _VerificationMethodsListState extends State { final LocalAuthentication auth = LocalAuthentication(); - ProjectViewModel projectsProvider; + ProjectViewModel? projectsProvider; @override Widget build(BuildContext context) { @@ -38,57 +37,45 @@ class _VerificationMethodsListState extends State { case AuthMethodTypes.WhatsApp: return MethodTypeCard( assetPath: 'assets/images/verify-whtsapp.png', - onTap: () => - {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, - label: TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifyWhatsApp, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifyWhatsApp!, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/verify-sms.png", - onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, - label:TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifySMS, + onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifySMS!, ); break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( assetPath: 'assets/images/verification_fingerprint_icon.png', onTap: () async { - if (await widget.authenticationViewModel - .checkIfBiometricAvailable(BiometricType.fingerprint)) { - - widget.authenticateUser(AuthMethodTypes.Fingerprint, true); + if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.fingerprint)) { + widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); } }, - label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFingerprint, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifyFingerprint!, ); break; case AuthMethodTypes.FaceID: return MethodTypeCard( assetPath: 'assets/images/verification_faceid_icon.png', onTap: () async { - if (await widget.authenticationViewModel - .checkIfBiometricAvailable(BiometricType.face)) { - widget.authenticateUser(AuthMethodTypes.FaceID, true); + if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.face)) { + widget.authenticateUser!(AuthMethodTypes.FaceID, true); } }, - label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFaceID, + label: TranslationBase.of(context).verifyWith ?? "" + TranslationBase.of(context).verifyFaceID!, ); break; default: return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', - onTap: widget.onShowMore, - label: TranslationBase.of(context).moreVerification, + onTap: widget.onShowMore!, + label: TranslationBase.of(context).moreVerification!, height: 0, ); } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart deleted file mode 100644 index aa532306..00000000 --- a/lib/widgets/charts/app_bar_chart.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -class AppBarChart extends StatelessWidget { - const AppBarChart({ - Key key, - @required this.seriesList, - }) : super(key: key); - - final List seriesList; - - @override - Widget build(BuildContext context) { - return Container( - height: 400, - margin: EdgeInsets.only(top: 60), - child: charts.BarChart( - seriesList, - // animate: animate, - - /// Customize the primary measure axis using a small tick renderer. - /// Use String instead of num for ordinal domain axis - /// (typically bar charts). - primaryMeasureAxis: new charts.NumericAxisSpec( - renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, - - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), - ), - ); - } -} diff --git a/lib/widgets/charts/app_line_chart.dart b/lib/widgets/charts/app_line_chart.dart index 1a29b1e6..e3265595 100644 --- a/lib/widgets/charts/app_line_chart.dart +++ b/lib/widgets/charts/app_line_chart.dart @@ -15,9 +15,9 @@ class AppLineChart extends StatelessWidget { final bool stacked; AppLineChart( - {Key key, - @required this.seriesList, - this.chartTitle, + {Key? key, + required this.seriesList, + required this.chartTitle, this.animate = true, this.includeArea = false, this.stacked = true}); @@ -33,9 +33,7 @@ class AppLineChart extends StatelessWidget { ), Expanded( child: charts.LineChart(seriesList, - defaultRenderer: charts.LineRendererConfig( - includeArea: false, stacked: true), - animate: animate), + defaultRenderer: charts.LineRendererConfig(includeArea: false, stacked: true), animate: animate), ), ], ), diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 670284a1..eed6289f 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -12,11 +12,11 @@ import 'package:flutter/material.dart'; /// [endDate] the end date class AppTimeSeriesChart extends StatelessWidget { AppTimeSeriesChart({ - Key key, - @required this.seriesList, + Key? key, + required this.seriesList, this.chartName = '', - this.startDate, - this.endDate, + required this.startDate, + required this.endDate, }); final String chartName; @@ -41,8 +41,7 @@ class AppTimeSeriesChart extends StatelessWidget { behaviors: [ charts.RangeAnnotation( [ - charts.RangeAnnotationSegment(startDate, endDate, - charts.RangeAnnotationAxisType.domain ), + charts.RangeAnnotationSegment(startDate, endDate, charts.RangeAnnotationAxisType.domain), ], ), ], diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart deleted file mode 100644 index 659e4562..00000000 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import '../shared/app_texts_widget.dart'; -import '../shared/rounded_container_widget.dart'; - -class DashboardItemTexts extends StatefulWidget { - final String label; - final String value; - final Color backgroundColor; - final bool showBorder; - final Color borderColor; - -// OWNER : Ibrahim albitar -// DATE : 05-04-2020 -// DESCRIPTION : Custom widget for dashboard items has texts widgets - - DashboardItemTexts(this.label, this.value, - {this.backgroundColor = Colors.white, - this.showBorder = false, - this.borderColor = Colors.white}); - - @override - _DashboardItemTextsState createState() => _DashboardItemTextsState(); -} - -class _DashboardItemTextsState extends State { - ProjectViewModel projectsProvider; - @override - Widget build(BuildContext context) { - projectsProvider = Provider.of(context); - return new RoundedContainer( - child: Stack( - children: [ - Align( - alignment: projectsProvider.isArabic - ? FractionalOffset.topRight - : FractionalOffset.topLeft, - child: Container( - margin: EdgeInsets.all(5), - child: AppText( - widget.label, - fontSize: 12, - ), - )), - Align( - alignment: projectsProvider.isArabic - ? FractionalOffset.bottomLeft - : FractionalOffset.bottomRight, - child: Container( - margin: EdgeInsets.all(10), - child: AppText( - widget.value, - fontWeight: FontWeight.bold, - ), - )), - ], - ), - backgroundColor: widget.backgroundColor, - showBorder: widget.showBorder, - borderColor: widget.borderColor, - margin: EdgeInsets.all(4), - ); - } -} diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index 6769c568..1980fe61 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -1,10 +1,9 @@ - import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; class GaugeChart extends StatelessWidget { final List seriesList; - final bool animate; + final bool? animate; GaugeChart(this.seriesList, {this.animate}); @@ -19,19 +18,16 @@ class GaugeChart extends StatelessWidget { @override Widget build(BuildContext context) { return new charts.PieChart(seriesList, - animate: animate, - defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); + animate: animate, defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); //); } static List> _createSampleData() { final data = [ new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment( - 'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment('Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment( - 'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment('Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), ]; return [ diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fe05d69d..bd9722e3 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -9,12 +9,10 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { - value.summaryoptions - .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + 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))}); + var list = []; + value.summaryoptions.forEach((result) => {list.add(getStack(result, value.summaryoptions.first.value, context))}); return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -32,16 +30,15 @@ class GetOutPatientStack extends StatelessWidget { ); } - getStack(Summaryoptions value, max,context) { + getStack(Summaryoptions value, max, context) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, - end: Alignment( - 0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. + colors: [Color(0x8FF5F6FA), Colors.red[50]!], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), borderRadius: BorderRadius.circular(8), @@ -55,7 +52,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 ? ((MediaQuery.of(context).size.height * 0.24) * value.value!) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), @@ -63,7 +60,7 @@ class GetOutPatientStack extends StatelessWidget { ), ), Container( - height: (MediaQuery.of(context).size.height * 0.24 ), + height: (MediaQuery.of(context).size.height * 0.24), margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart index c11af999..4361749c 100644 --- a/lib/widgets/data_display/list/custom_Item.dart +++ b/lib/widgets/data_display/list/custom_Item.dart @@ -27,17 +27,17 @@ class CustomItem extends StatelessWidget { final BoxDecoration decoration; CustomItem( - {Key key, - this.startIcon, + {Key? key, + required this.startIcon, this.disabled: false, - this.onTap, - this.startIconColor, + required this.onTap, + required this.startIconColor, this.endIcon = EvaIcons.chevronRight, - this.padding, - this.child, - this.endIconColor, + required this.padding, + required this.child, + required this.endIconColor, this.endIconSize = 20, - this.decoration, + required this.decoration, this.startIconSize = 19}) : super(key: key); @@ -52,9 +52,7 @@ class CustomItem extends StatelessWidget { if (onTap != null) onTap(); }, child: Padding( - padding: padding != null - ? padding - : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), + padding: padding != null ? padding : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), child: Row( children: [ if (startIcon != null) @@ -77,9 +75,7 @@ class CustomItem extends StatelessWidget { flex: 1, child: Icon( endIcon, - color: endIconColor != null - ? endIconColor - : Colors.grey[500], + color: endIconColor != null ? endIconColor : Colors.grey[500], size: endIconSize, ), ) diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index a35fa279..7faf32b4 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + /// Flexible container widget /// [widthFactor] If non-null, the fraction of the incoming width given to the child. /// If non-null, the child is given a tight width constraint that is the max @@ -14,15 +15,15 @@ import 'package:flutter/material.dart'; class FlexibleContainer extends StatelessWidget { final double widthFactor; final double heightFactor; - final EdgeInsets padding; + final EdgeInsets? padding; final Widget child; FlexibleContainer({ - Key key, + Key? key, this.widthFactor = 0.9, this.heightFactor = 1, this.padding, - this.child, + required this.child, }) : super(key: key); @override @@ -38,8 +39,7 @@ class FlexibleContainer extends StatelessWidget { padding: padding, width: double.infinity, decoration: BoxDecoration( - border: Border.all( - color: Theme.of(context).dividerColor, width: 2.0), + border: Border.all(color: Theme.of(context).dividerColor, width: 2.0), borderRadius: BorderRadius.circular(8.0)), child: child, ), diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 7817ba3c..042a963f 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -16,7 +16,7 @@ class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; bool isShowMore = false; - DoctorReplyWidget({Key key, this.reply}); + DoctorReplyWidget({Key? key, required this.reply}); @override _DoctorReplyWidgetState createState() => _DoctorReplyWidgetState(); @@ -29,10 +29,7 @@ class _DoctorReplyWidgetState extends State { return Container( child: CardWithBgWidget( - bgColor: - widget.reply.status == 2 - ? Color(0xFF2E303A) - : Color(0xFFD02127), + bgColor: widget.reply.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -45,17 +42,16 @@ class _DoctorReplyWidgetState extends State { children: [ RichText( text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , + text: widget.reply.status == 2 + ? "Active" + : widget.reply.status == 1 + ? "Hold" + : "Cancelled", //TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , style: TextStyle( - color: widget.reply.status == 2 - ? Color(0xFF2E303A) - : Color(0xFFD02127), - + color: widget.reply.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 2.0 * SizeConfig.textMultiplier)), @@ -66,39 +62,24 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .day - .toString() + + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).day.toString() + " " + AppDateUtils.getMonth( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .month) + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).month) .toString() .substring(0, 3) + ' ' + - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .year - .toString(), + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).year.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .hour - .toString() - + ":"+ - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .minute - .toString(), + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).hour.toString() + + ":" + + AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).minute.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) - ], ), ], @@ -108,7 +89,7 @@ class _DoctorReplyWidgetState extends State { children: [ Expanded( child: AppText( - Helpers.capitalize( widget.reply.patientName), + Helpers.capitalize(widget.reply.patientName), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -118,7 +99,7 @@ class _DoctorReplyWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber); + launch("tel://" + widget.reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -162,7 +143,6 @@ class _DoctorReplyWidgetState extends State { fit: BoxFit.cover, ), ), - ], ), SizedBox( @@ -172,89 +152,80 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ // SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')), - new TextSpan( - text: widget.reply.patientID.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ), - Container( - width: MediaQuery.of(context).size.width*0.45, - child: RichText( + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RichText( text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).age + - " : ", - style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins')), new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + text: widget.reply.patientID.toString(), style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), + fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)), ], ), ), - ) - ], - ), - - - ], - ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - child: RichText( - maxLines: 3, - overflow: TextOverflow.ellipsis, - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text:"Patient Question :" ,//TranslationBase.of(context).doctorResponse + " : ", - style: - TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), - new TextSpan( - text: widget.reply?.remarks?.trim()??'', - style: TextStyle( - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontSize: 12)), - ], + Container( + width: MediaQuery.of(context).size.width * 0.45, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age! + " : ", + style: TextStyle( + fontSize: 14, color: Color(0xFF575757), fontWeight: FontWeight.bold)), + new TextSpan( + text: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), + ], + ), + ), + ) + ], + ), + ], + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + children: [ + new TextSpan( + text: "Patient Question :", //TranslationBase.of(context).doctorResponse + " : ", + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontWeight: FontWeight.bold)), + new TextSpan( + text: widget.reply?.remarks?.trim() ?? '', + style: TextStyle(fontFamily: 'Poppins', color: Color(0xFF575757), fontSize: 12)), + ], + ), ), ), - ), - ],) + ], + ) ], ), // Container( diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index c4343a4b..0a63a4e3 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResultWidget extends StatefulWidget { final List labResult; - LabResultWidget({Key key, this.labResult}); + LabResultWidget({Key? key, required this.labResult}); @override _LabResultWidgetState createState() => _LabResultWidgetState(); @@ -41,9 +41,7 @@ class _LabResultWidgetState extends State { _showDetails = !_showDetails; }); }, - child: Icon(_showDetails - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), + child: Icon(_showDetails ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ], ), Divider( @@ -84,9 +82,7 @@ class _LabResultWidgetState extends State { child: Container( color: HexColor('#515B5D'), child: Center( - child: AppText( - TranslationBase.of(context).value, - color: Colors.white), + child: AppText(TranslationBase.of(context).value, color: Colors.white), ), height: 60), ), @@ -99,9 +95,7 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: AppText( - TranslationBase.of(context).range, - color: Colors.white), + child: AppText(TranslationBase.of(context).range, color: Colors.white), ), height: 60), ), @@ -114,8 +108,7 @@ class _LabResultWidgetState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), border: Border( - bottom: - BorderSide(color: Colors.grey, width: 0.5), + bottom: BorderSide(color: Colors.grey, width: 0.5), top: BorderSide(color: Colors.grey, width: 0.5), left: BorderSide(color: Colors.grey, width: 0.5), right: BorderSide(color: Colors.grey, width: 0.5), @@ -146,17 +139,14 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: AppText('${result.resultValue}', - color: Colors.grey[800]), + child: AppText('${result.resultValue}', color: Colors.grey[800]), ), height: 60), ), Expanded( child: Container( child: Center( - child: AppText( - '${result.referenceRange}', - color: Colors.grey[800]), + child: AppText('${result.referenceRange}', color: Colors.grey[800]), ), height: 60), ), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 453cff30..e6469186 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_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/shared/TextFields.dart'; +import '../shared/text_fields/TextFields.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/expandable-widget-header-body.dart'; @@ -19,27 +19,25 @@ class MyReferralPatientWidget extends StatefulWidget { final Function expandClick; MyReferralPatientWidget( - {Key key, - this.myReferralPatientModel, - this.model, - this.isExpand, - this.expandClick}); + {Key? key, + required this.myReferralPatientModel, + required this.model, + required this.isExpand, + required this.expandClick}); @override - _MyReferralPatientWidgetState createState() => - _MyReferralPatientWidgetState(); + _MyReferralPatientWidgetState createState() => _MyReferralPatientWidgetState(); } class _MyReferralPatientWidgetState extends State { bool _isLoading = false; final _formKey = GlobalKey(); - String error; - TextEditingController answerController; + late String error; + late TextEditingController answerController; @override void initState() { - answerController = new TextEditingController( - text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); + answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); super.initState(); } @@ -65,8 +63,7 @@ class _MyReferralPatientWidgetState extends State { headerWidget: Column( children: [ Container( - padding: - EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -76,8 +73,7 @@ class _MyReferralPatientWidgetState extends State { children: [ Container( color: Color(0xFFB8382C), - padding: EdgeInsets.symmetric( - vertical: 4, horizontal: 4), + padding: EdgeInsets.symmetric(vertical: 4, horizontal: 4), child: AppText( '${widget.myReferralPatientModel.priorityDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, @@ -124,10 +120,9 @@ class _MyReferralPatientWidgetState extends State { ), ), Container( - margin: - EdgeInsets.symmetric(horizontal: 8, vertical: 8), + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), child: InkWell( - onTap: widget.expandClick, + onTap: widget.expandClick(), child: Image.asset( "assets/images/ic_circle_arrow.png", width: 25, @@ -156,8 +151,7 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: - EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -254,8 +248,7 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: - EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -323,7 +316,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}', + '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime!)}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -351,8 +344,7 @@ class _MyReferralPatientWidgetState extends State { height: 10, ), Container( - padding: - EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -365,8 +357,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context) - .clinicDetailsandRemarks, + TranslationBase.of(context).clinicDetailsandRemarks, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -414,13 +405,12 @@ class _MyReferralPatientWidgetState extends State { controller: answerController, maxLines: 3, minLines: 2, - hintText: TranslationBase.of(context).answerThePatient, + hintText: TranslationBase.of(context).answerThePatient ?? "", fontWeight: FontWeight.normal, readOnly: _isLoading, validator: (value) { if (value.isEmpty) - return TranslationBase.of(context) - .pleaseEnterAnswer; + return TranslationBase.of(context).pleaseEnterAnswer; else return null; }, @@ -431,16 +421,13 @@ class _MyReferralPatientWidgetState extends State { width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), child: AppButton( - title : TranslationBase.of(context).replay, + title: TranslationBase.of(context).replay, onPressed: () async { final form = _formKey.currentState; - if (form.validate()) { + if (form!.validate()) { try { - await widget.model.replay( - answerController.text.toString(), - widget.myReferralPatientModel); - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).replySuccessfully); + await widget.model.replay(answerController.text.toString(), widget.myReferralPatientModel); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).replySuccessfully); } catch (e) { DrAppToastMsg.showErrorToast(e); } diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 54df8cd9..53c8e4cb 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -12,13 +12,13 @@ import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { final ListDoctorWorkingHoursTable workingHoursTable; - MyScheduleWidget({Key key, this.workingHoursTable}); + MyScheduleWidget({Key? key, required this.workingHoursTable}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); List workingHours = Helpers.getWorkingHours( - workingHoursTable.workingHours, + workingHoursTable.workingHours!, ); return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -33,13 +33,15 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , + projectViewModel.isArabic + ? AppDateUtils.getWeekDayArabic(workingHoursTable.date!.weekday) + : AppDateUtils.getWeekDay(workingHoursTable.date!.weekday), fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( - ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + ' ${workingHoursTable.date!.day} ${(AppDateUtils.getMonth(workingHoursTable.date!.month).toString().substring(0, 3))}', fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -51,15 +53,14 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: AppDateUtils.isToday(workingHoursTable.date) - ? Colors.green[500] - : Colors.transparent, + bgColor: AppDateUtils.isToday(workingHoursTable.date!) ? Colors.green[500]! : Colors.transparent, + // hasBorder: false, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (AppDateUtils.isToday(workingHoursTable.date)) + if (AppDateUtils.isToday(workingHoursTable.date!)) AppText( "Today", fontSize: 1.8 * SizeConfig.textMultiplier, @@ -74,33 +75,33 @@ class MyScheduleWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: workingHours.map((work) { return Container( - margin: EdgeInsets.only(bottom:workingHours.length>1? 15:0), + margin: EdgeInsets.only(bottom: workingHours.length > 1 ? 15 : 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 5, ), - if(workingHoursTable.clinicName!=null) - AppText( - workingHoursTable.clinicName??"", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if (workingHoursTable!.clinicName != null) + AppText( + workingHoursTable!.clinicName ?? "", + fontSize: 15, + fontWeight: FontWeight.w700, + ), Container( - width: MediaQuery.of(context).size.width*0.55, + width: MediaQuery.of(context).size.width * 0.55, child: AppText( - '${work.from} - ${work.to}', + '${work.from} - ${work.to}', fontSize: 15, fontWeight: FontWeight.w300, ), ), - if(workingHoursTable.projectName!=null) - AppText( - workingHoursTable.projectName??"", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if (workingHoursTable.projectName != null) + AppText( + workingHoursTable.projectName ?? "", + fontSize: 15, + fontWeight: FontWeight.w700, + ), ], ), ); diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index f4f78c08..482a251b 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -18,11 +18,11 @@ import '../shared/rounded_container_widget.dart'; */ class MedicineItemWidget extends StatefulWidget { - final String label; + final String? label; final Color backgroundColor; final bool showBorder; final Color borderColor; - final String url; + final String? url; MedicineItemWidget( {@required this.label, @@ -52,7 +52,7 @@ class _MedicineItemWidgetState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.network( - widget.url, + widget.url!, height: SizeConfig.imageSizeMultiplier * 15, width: SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, @@ -62,9 +62,7 @@ class _MedicineItemWidgetState extends State { Expanded( child: Padding( padding: EdgeInsets.all(5), - child: Align( - alignment: Alignment.centerLeft, - child: AppText(widget.label)))), + child: Align(alignment: Alignment.centerLeft, child: AppText(widget.label)))), Icon(EvaIcons.eye) ], ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 2174e6d5..e4673741 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -20,12 +20,12 @@ class PatientCard extends StatelessWidget { final bool isFromLiveCare; const PatientCard( - {Key key, - this.patientInfo, - this.onTap, - this.patientType, - this.arrivalType, - this.isInpatient, + {Key? key, + required this.patientInfo, + required this.onTap, + required this.patientType, + required this.arrivalType, + required this.isInpatient, this.isMyPatient = false, this.isFromSearch = false, this.isFromLiveCare = false}) @@ -49,16 +49,16 @@ class PatientCard extends StatelessWidget { bgColor: isFromLiveCare ? Colors.white : (isMyPatient && !isFromSearch) - ? Colors.green[500] + ? Colors.green[500]! : patientInfo.patientStatusType == 43 - ? Colors.green[500] + ? Colors.green[500]! : isMyPatient - ? Colors.green[500] + ? Colors.green[500]! : isInpatient - ? Colors.white + ? Colors.white! : !isFromSearch - ? Colors.red[800] - : Colors.white, + ? Colors.red[800]! + : Colors.white!, widget: Container( color: Colors.white, // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), @@ -78,8 +78,7 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context) - .arrivedP, + TranslationBase.of(context).arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -99,12 +98,8 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 - ? 'Confirmed' - : 'Booked', - color: patientInfo.status == 2 - ? Colors.green - : Colors.grey, + patientInfo.status == 2 ? 'Confirmed' : 'Booked', + color: patientInfo.status == 2 ? Colors.green : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, @@ -115,8 +110,7 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context) - .notArrived, + TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -136,27 +130,19 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 - ? 'Confirmed' - : 'Booked', - color: patientInfo.status == 2 - ? Colors.green - : Colors.grey, + patientInfo.status == 2 ? 'Confirmed' : 'Booked', + color: patientInfo.status == 2 ? Colors.green : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), ], ) - : !isFromSearch && - !isFromLiveCare && - patientInfo.patientStatusType == - null + : !isFromSearch && !isFromLiveCare && patientInfo.patientStatusType == null ? Row( children: [ AppText( - TranslationBase.of(context) - .notArrived, + TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -176,13 +162,8 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 - ? 'Booked' - : 'Confirmed', - color: - patientInfo.status == 2 - ? Colors.grey - : Colors.green, + patientInfo.status == 2 ? 'Booked' : 'Confirmed', + color: patientInfo.status == 2 ? Colors.grey : Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -192,33 +173,27 @@ class PatientCard extends StatelessWidget { : SizedBox(), this.arrivalType == '1' ? AppText( - patientInfo.startTime != null - ? patientInfo.startTime - : patientInfo.startTimes, + patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes, fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null ? AppText( - AppDateUtils.getDayMonthYearDate( - AppDateUtils - .convertStringToDate( - patientInfo.arrivedOn, + AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( + patientInfo.arrivedOn ?? "", )) + " " + - "${AppDateUtils.getStartTime(patientInfo.startTime)}", + "${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, ) - : (patientInfo.appointmentDate != - null && - patientInfo - .appointmentDate.isNotEmpty) + : (patientInfo.appointmentDate != null && + patientInfo.appointmentDate!.isNotEmpty) ? AppText( "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.appointmentDate, - ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", + patientInfo.appointmentDate ?? "", + ))} ${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -253,13 +228,10 @@ class PatientCard extends StatelessWidget { // width: MediaQuery.of(context).size.width*0.51, child: AppText( isFromLiveCare - ? Helpers.capitalize( - patientInfo.fullName) - : (Helpers.capitalize( - patientInfo.firstName) + + ? Helpers.capitalize(patientInfo.fullName) + : (Helpers.capitalize(patientInfo.firstName) + " " + - Helpers.capitalize( - patientInfo.lastName)), + Helpers.capitalize(patientInfo.lastName)), fontSize: 16, color: Color(0xff2e303a), fontWeight: FontWeight.w700, @@ -283,9 +255,9 @@ class PatientCard extends StatelessWidget { children: [ AppText( patientInfo.nationalityName != null - ? patientInfo.nationalityName.trim() + ? patientInfo.nationalityName!.trim() : patientInfo.nationality != null - ? patientInfo.nationality.trim() + ? patientInfo.nationality!.trim() : patientInfo.nationalityId != null ? patientInfo.nationalityId : "", @@ -293,20 +265,15 @@ class PatientCard extends StatelessWidget { fontSize: 14, textOverflow: TextOverflow.ellipsis, ), - patientInfo.nationality != null || - patientInfo.nationalityId != null + patientInfo.nationality != null || patientInfo.nationalityId != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - patientInfo.nationalityFlagURL != null - ? patientInfo.nationalityFlagURL - : '', + patientInfo.nationalityFlagURL != null ? patientInfo.nationalityFlagURL! : '', height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: + (BuildContext context, Object exception, StackTrace? stackTrace) { return AppText( 'No Image', fontSize: 10, @@ -341,135 +308,107 @@ class PatientCard extends StatelessWidget { width: 10, ), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .fileNumber, - style: TextStyle( - fontSize: 12, - fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.patientId.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 13)), - ], - ), - ), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientId.toString(), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 13)), + ], ), - //if (isInpatient) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).age + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ], - ), + ), + ), + //if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ], ), - if (isInpatient) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: patientInfo.admissionDate == null - ? "" - : TranslationBase.of(context) - .admissionDate + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: patientInfo.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ]))), - if (patientInfo.admissionDate != null) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context) - .numOfDays + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ]))), - if (isFromLiveCare) - Column( - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: - TranslationBase.of(context).clinic + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - patientInfo.clinicName, - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ], + ), + ), + if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: patientInfo.admissionDate == null + ? "" + : TranslationBase.of(context).admissionDate ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: patientInfo.admissionDate == null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ]))), + if (patientInfo.admissionDate != null) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), + children: [ + new TextSpan( + text: TranslationBase.of(context).numOfDays ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate ?? "")).inDays + 1}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ]))), + if (isFromLiveCare) + Column( + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), + children: [ + new TextSpan( + text: TranslationBase.of(context).clinic ?? "" + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: patientInfo.clinicName, + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), + ], ), - ], + ), ), - ])) + ], + ), + ])) ]), isFromLiveCare ? Row( @@ -486,40 +425,33 @@ class PatientCard extends StatelessWidget { ], ) : !isInpatient && !isFromSearch - ? Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ + ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', + height: 25, + width: 35, + )), + ]) + : (isInpatient == true) + ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ Container( padding: EdgeInsets.all(4), child: Image.asset( - patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' - : patientInfo.appointmentType == - 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', + 'assets/images/inpatient.png', height: 25, width: 35, )), ]) - : (isInpatient == true) - ? Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(4), - child: Image.asset( - 'assets/images/inpatient.png', - height: 25, - width: 35, - )), - ]) : SizedBox() ], ), - onTap: onTap, + onTap: onTap(), )), )); } diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart deleted file mode 100644 index c903bd7b..00000000 --- a/lib/widgets/patients/clinic_list_dropdwon.dart +++ /dev/null @@ -1,99 +0,0 @@ -// ignore: must_be_immutable -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/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 ClinicList extends StatelessWidget { - - ProjectViewModel projectsProvider; - final int clinicId; - final Function (int value) onClinicChange; - - ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); - - @override - Widget build(BuildContext context) { - // authProvider = Provider.of(context); - - projectsProvider = Provider.of(context); - return Container( - child: - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue){ - onClinicChange(newValue); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ); - } -} \ No newline at end of file diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart deleted file mode 100644 index d2a68acd..00000000 --- a/lib/widgets/patients/dynamic_elements.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -class DynamicElements extends StatefulWidget { - final PatientModel _patientSearchFormValues; - final bool isFormSubmitted; - DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); - @override - _DynamicElementsState createState() => _DynamicElementsState(); -} - -class _DynamicElementsState extends State { - TextEditingController _toDateController = new TextEditingController(); - TextEditingController _fromDateController = new TextEditingController(); - void _presentDatePicker(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime.now(), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - print(id); - var selectedDate = DateFormat.yMd().format(pickedDate); - - if (id == '_selectedFromDate') { - // _fromDateController.text = selectedDate; - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _fromDateController.text = selectedDate; - } else { - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _toDateController.text = selectedDate; - // _toDateController.text = selectedDate; - } - }); - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - {String hintText, - String selectedText, - bool isDropDown, - IconData icon}) { - 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 ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - return LayoutBuilder( - builder: (ctx, constraints) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - borderColor: Colors.white, - onTap: () => _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, - controller: _fromDateController, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_fromDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.From = "0"; - } else { - widget._patientSearchFormValues.From = - _fromDateController.text.replaceAll("/", "-"); - } - }, - readOnly: true, - )), - SizedBox( - height: 5, - ), - if (widget._patientSearchFormValues.From == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6.0))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - readOnly: true, - borderColor: Colors.white, - hintText: TranslationBase.of(context).toDate, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_toDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.To = "0"; - } else { - widget._patientSearchFormValues.To = - _toDateController.text.replaceAll("/", "-"); - } - }, - )), - if (widget._patientSearchFormValues.To == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - ], - ); - }, - ); - } -} diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index a08282c0..de4d821c 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -9,24 +9,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { - final String referralStatus; - final int referralStatusCode; - final String patientName; - final int patientGender; - final String referredDate; - final String referredTime; - final String patientID; + final String? referralStatus; + final int? referralStatusCode; + final String? patientName; + final int? patientGender; + final String? referredDate; + final String? referredTime; + final String? patientID; final isSameBranch; - final bool isReferral; - final bool isReferralClinic; - final String referralClinic; - final String remark; - final String nationality; - final String nationalityFlag; - final String doctorAvatar; - final String referralDoctorName; - final String clinicDescription; - final Widget infoIcon; + final bool? isReferral; + final bool? isReferralClinic; + final String? referralClinic; + final String? remark; + final String? nationality; + final String? nationalityFlag; + final String? doctorAvatar; + final String? referralDoctorName; + final String? clinicDescription; + final Widget? infoIcon; PatientReferralItemWidget( {this.referralStatus, @@ -44,7 +44,9 @@ class PatientReferralItemWidget extends StatelessWidget { this.doctorAvatar, this.referralDoctorName, this.clinicDescription, - this.infoIcon,this.isReferralClinic=false,this.referralClinic}); + this.infoIcon, + this.isReferralClinic = false, + this.referralClinic}); @override Widget build(BuildContext context) { @@ -59,8 +61,8 @@ class PatientReferralItemWidget extends StatelessWidget { bgColor: referralStatusCode == 1 ? Color(0xffc4aa54) : referralStatusCode == 46 - ? Colors.green[700] - : Colors.red[700], + ? Colors.green[700]! + : Colors.red[700]!, hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -74,7 +76,7 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralStatus != null ? referralStatus : "", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.9 * SizeConfig.textMultiplier!, fontWeight: FontWeight.w700, color: referralStatusCode == 1 ? Color(0xffc4aa54) @@ -83,10 +85,10 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.red[700], ), AppText( - referredDate, + referredDate!, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier!, color: Color(0XFF28353E), ) ], @@ -96,8 +98,8 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName, - fontSize: SizeConfig.textMultiplier * 2.2, + patientName!, + fontSize: SizeConfig.textMultiplier! * 2.2, fontWeight: FontWeight.bold, color: Colors.black, fontFamily: 'Poppins', @@ -119,10 +121,10 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime, + referredTime!, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ) ], @@ -141,14 +143,14 @@ class PatientReferralItemWidget extends StatelessWidget { TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), AppText( - patientID, + patientID!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -157,15 +159,20 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, + isSameBranch + ? TranslationBase.of(context).referredFrom + : TranslationBase.of(context).refClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), - AppText( - !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, + !isReferralClinic! + ? isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch + : " " + referralClinic!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -179,7 +186,7 @@ class PatientReferralItemWidget extends StatelessWidget { Row( children: [ AppText( - nationality != null ? nationality : "", + nationality != null ? nationality! : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontSize: 1.4 * SizeConfig.textMultiplier, @@ -188,12 +195,10 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - nationalityFlag, + nationalityFlag!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -207,18 +212,18 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks + " : ", + TranslationBase.of(context).remarks ?? "" + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Color(0XFF575757), ), Expanded( child: AppText( - remark, + remark ?? "", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), maxLines: 1, ), @@ -231,7 +236,7 @@ class PatientReferralItemWidget extends StatelessWidget { Container( margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( - isReferral + isReferral! ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -239,8 +244,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, @@ -249,46 +253,43 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - doctorAvatar, + doctorAvatar!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) : Container( - child: Image.asset( - patientGender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), + child: Image.asset( + patientGender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), ), ), Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName, + referralDoctorName!, fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier!, color: Colors.black, ), if (clinicDescription != null) AppText( - clinicDescription, + clinicDescription!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier!, color: Color(0XFF2E303A), ), ], @@ -297,10 +298,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), ], ), - Container( - width: double.infinity, - alignment: Alignment.centerRight, - child: infoIcon ?? Container()) + Container(width: double.infinity, alignment: Alignment.centerRight, child: infoIcon ?? Container()) ], ), // onTap: onTap, diff --git a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart index aef7a161..d1385d0e 100644 --- a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart +++ b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart @@ -21,7 +21,7 @@ class PatientHeaderWidgetNoAvatar extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - patient.firstName + ' ' + patient.lastName, + patient.firstName! + ' ' + patient.lastName!, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.2, ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index ef285150..9c5b057d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -17,26 +17,26 @@ class PatientProfileButton extends StatelessWidget { final String patientType; String arrivalType; final bool isInPatient; - String from; - String to; + String? from; + String? to; final String url = "assets/images/"; final bool isDisable; final bool isLoading; - final Function onTap; + final GestureTapCallback? onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData dartIcon; + final IconData? dartIcon; final bool isFromLiveCare; PatientProfileButton({ - Key key, - this.patient, - this.patientType, - this.arrivalType, - this.nameLine1, - this.nameLine2, - this.icon, + Key? key, + required this.patient, + required this.patientType, + required this.arrivalType, + required this.nameLine1, + required this.nameLine2, + required this.icon, this.route, this.isDisable = false, this.onTap, @@ -47,7 +47,8 @@ class PatientProfileButton extends StatelessWidget { this.isDischargedPatient = false, this.isSelectInpatient = false, this.isDartIcon = false, - this.dartIcon, this.isFromLiveCare = false, + this.dartIcon, + this.isFromLiveCare = false, }) : super(key: key); @override @@ -72,21 +73,23 @@ class PatientProfileButton extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - child: isDartIcon ? Icon( - dartIcon, size: 30, color: Color(0xFF333C45),) : new Image - .asset( - url + icon, - width: 30, - height: 30, - fit: BoxFit.contain, - ), + child: isDartIcon + ? Icon( + dartIcon, + size: 30, + color: Color(0xFF333C45), + ) + : new Image.asset( + url + icon, + width: 30, + height: 30, + fit: BoxFit.contain, + ), ) ], )), Container( - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, + alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, padding: EdgeInsets.symmetric(horizontal: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -144,7 +147,7 @@ class PatientProfileButton extends StatelessWidget { 'isInpatient': isInPatient, 'isDischargedPatient': isDischargedPatient, 'isSelectInpatient': isSelectInpatient, - "isFromLiveCare":isFromLiveCare + "isFromLiveCare": isFromLiveCare }); } } diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart deleted file mode 100644 index e0eb5b12..00000000 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; - -import './profile_general_info_content_widget.dart'; -import '../../../config/size_config.dart'; -import '../../shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:21/4/2020 - *@param: - *@return: ProfileGeneralInfoWidget - *@desc: Profile General Info Widget class - */ -class ProfileGeneralInfoWidget extends StatelessWidget { - ProfileGeneralInfoWidget({Key key, this.patient}) : super(key: key); - - PatiantInformtion patient; - - @override - Widget build(BuildContext context) { - // PatientsProvider patientsProv = Provider.of(context); - // patient = patientsProv.getSelectedPatient(); - return RoundedContainer( - child: ListView( - children: [ - ProfileGeneralInfoContentWidget( - title: "Age", - info: '${patient.age}', - ), - ProfileGeneralInfoContentWidget( - title: "Contact Number", - info: '${patient.mobileNumber}', - ), - ProfileGeneralInfoContentWidget( - title: "Email", - info: '${patient.emailAddress}', - ), - ], - ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.25, - ); - } -} diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index 275888e3..56570bb1 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -3,8 +3,9 @@ import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ - Key key, - this.onTap, this.label, + Key? key, + required this.onTap, + required this.label, }) : super(key: key); final Function onTap; @@ -13,7 +14,7 @@ class AddNewOrder extends StatelessWidget { @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap(), child: Container( width: double.maxFinite, height: 140, @@ -45,7 +46,7 @@ class AddNewOrder extends StatelessWidget { height: 10, ), AppText( - label ??'', + label ?? '', color: Colors.grey[600], fontWeight: FontWeight.w600, ) diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 80f54e12..62c23c6a 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( - {Key key, - this.name, + {Key? key, + required this.name, this.url, this.disableProfileView: false, this.radius = 60.0, @@ -15,23 +15,21 @@ class LargeAvatar extends StatelessWidget { : super(key: key); final String name; - final String url; + final String? url; final bool disableProfileView; final double radius; final double width; final double height; Widget _getAvatar() { - if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { + if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) { return CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, + radius: SizeConfig.imageSizeMultiplier * 12, // radius: (52) child: ClipRRect( - borderRadius:BorderRadius.circular(50), - + borderRadius: BorderRadius.circular(50), child: Image.network( - url, + url!, fit: BoxFit.fill, width: 700, ), @@ -67,19 +65,11 @@ class LargeAvatar extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), - colors: [ - Colors.grey[100], - Colors.grey[800], - ]), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], + gradient: LinearGradient(begin: Alignment(-1, -1), end: Alignment(1, 1), colors: [ + Colors.grey[100]!, + Colors.grey[800]!, + ]), + boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], borderRadius: BorderRadius.all(Radius.circular(50.0)), ), width: width, diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 49ad8f4e..b3915b2c 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -12,7 +12,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientPageHeaderWidget extends StatelessWidget { - final PatiantInformtion patient; PatientPageHeaderWidget(this.patient); @@ -22,10 +21,8 @@ class PatientPageHeaderWidget extends StatelessWidget { return BaseView( onModelReady: (model) async { - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patient.patientMRN??patient.patientId, - doctorID: '', - editedBy: ''); + GeneralGetReqForSOAP generalGetReqForSOAP = + GeneralGetReqForSOAP(patientMRN: patient.patientMRN ?? patient.patientId, doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); if (model.allergiesList.length == 0) { await model.getMasterLookup(MasterKeysService.Allergies); @@ -33,7 +30,6 @@ class PatientPageHeaderWidget extends StatelessWidget { if (model.allergySeverityList.length == 0) { await model.getMasterLookup(MasterKeysService.AllergySeverity); } - }, builder: (_, model, w) => Container( child: Column( @@ -47,9 +43,7 @@ class PatientPageHeaderWidget extends StatelessWidget { children: [ AvatarWidget( Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, + patient.genderDescription == "Male" ? DoctorApp.male : DoctorApp.female_icon, size: 70, color: Colors.white, ), @@ -66,7 +60,9 @@ class PatientPageHeaderWidget extends StatelessWidget { height: 5, ), AppText( - patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName, + patient.patientDetails!.fullName != null + ? patient.patientDetails!.fullName + : patient.firstName, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -74,7 +70,7 @@ class PatientPageHeaderWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).age , + TranslationBase.of(context).age, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -88,11 +84,15 @@ class PatientPageHeaderWidget extends StatelessWidget { ), ], ), - model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText( - TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ) : AppText(''), + model.patientAllergiesList.isNotEmpty && + model.getAllergicNames(projectViewModel.isArabic) != '' + ? AppText( + TranslationBase.of(context).allergicTO ?? + "" + " : " + model.getAllergicNames(projectViewModel.isArabic), + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ) + : AppText(''), ], ), ) 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..39b5ed35 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 @@ -11,8 +11,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:url_launcher/url_launcher.dart'; -class PatientProfileHeaderNewDesignAppBar extends StatelessWidget - with PreferredSizeWidget { +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -21,16 +20,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; - PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false}); + PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false}); @override Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( padding: EdgeInsets.only( @@ -41,7 +40,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 215:200 : height, + height: height == 0 + ? isInpatient + ? 215 + : 200 + : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -58,10 +61,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Expanded( child: AppText( patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.fullName??patient.patientDetails.fullName), + ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.fullName ?? patient.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -80,7 +81,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -97,9 +98,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -111,8 +110,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -132,19 +130,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1'|| patient.arrivedOn == null + arrivalType == '1' || patient.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime - : '', + patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat( - patient.arrivedOn, - 'MM-dd-yyyy HH:mm') + patient.arrivedOn ?? "", 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -152,15 +147,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" && !isFromLiveCare) + if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare) Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), patient.startTime != null @@ -172,7 +165,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget color: HexColor("#20A169"), ), child: AppText( - patient.startTime??"", + patient.startTime ?? "", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -183,14 +176,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget SizedBox( width: 3.5, ), - Container( - child: AppText( - convertDateFormat2( - patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), + Container( + child: AppText( + convertDateFormat2(patient.appointmentDate ?? ''), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), + ), SizedBox( height: 0.5, ) @@ -205,27 +197,21 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patient.patientId.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)), ], ), ), Row( children: [ AppText( - patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), @@ -233,12 +219,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -257,18 +241,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age+ " : ", - style: TextStyle(fontSize: 14)), + text: TranslationBase.of(context).age! + " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,isServerFormat: !isFromLiveCare)}", - style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 14)), + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)), ], ), ), ), - if(isInpatient) + if (isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -276,27 +258,22 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: - 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black, fontFamily: 'Poppins', ), children: [ - new TextSpan( - text: patient.admissionDate == null - ? "" - : TranslationBase.of(context) - .admissionDate + - " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: patient.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ]))), + new TextSpan( + text: patient.admissionDate == null + ? "" + : TranslationBase.of(context).admissionDate! + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: patient.admissionDate == null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), + ]))), if (patient.admissionDate != null) Row( children: [ @@ -304,14 +281,14 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget "${TranslationBase.of(context).numOfDays}: ", fontSize: 15, ), - if(isDischargedPatient && patient.dischargeDate!=null) - AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700) + if (isDischargedPatient && patient.dischargeDate != null) + AppText( + "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate ?? "").difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate ?? "")).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700) else AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate ?? "")).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], @@ -329,7 +306,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -337,8 +314,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget 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))); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + @@ -346,13 +322,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget date.day.toString().padLeft(2, '0'); } - return newDate??''; + return newDate ?? ''; } 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()); + return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now()); } myBoxDecoration() { diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 1db29087..825d02a4 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -18,17 +18,16 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final double height; final bool isHaveMargin; - PatientProfileHeaderNewDesign( - this.patient, this.patientType, this.arrivalType, - {this.height = 0.0, this.isHaveMargin=true}); + PatientProfileHeaderNewDesign(this.patient, this.patientType, this.arrivalType, + {this.height = 0.0, this.isHaveMargin = true}); @override Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient.gender!; } return Container( @@ -57,10 +56,8 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { Expanded( child: AppText( patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), + ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -79,7 +76,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient.mobileNumber!); }, child: Icon( Icons.phone, @@ -96,9 +93,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -110,8 +105,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -133,29 +127,26 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), arrivalType == '1' || patient.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime - : '', + patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( - AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.arrivedOn)), + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate(patient.arrivedOn ?? "")), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") + if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient") Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), patient.startTime != null @@ -180,8 +171,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), Container( child: AppText( - convertDateFormat2( - patient.appointmentDate.toString() ?? ''), + convertDateFormat2(patient.appointmentDate.toString() ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -200,30 +190,21 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patient.patientId.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)), ], ), ), Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), @@ -231,12 +212,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient.nationalityFlagURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -255,13 +234,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", - style: TextStyle(fontSize: 14)), + 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)), + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)), ], ), ), @@ -277,7 +254,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { } convertDateFormat2(String str) { - String newDate; + String? newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -285,8 +262,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { 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))); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + @@ -299,8 +275,7 @@ class PatientProfileHeaderNewDesign 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()); + return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now()); } myBoxDecoration() { 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)); - } -} diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 5d46e745..24f71be0 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -15,23 +15,22 @@ import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; -class PatientProfileHeaderWhitAppointmentAppBar 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; +class PatientProfileHeaderWhitAppointmentAppBar 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? episode; + final String? vistDate; - final String clinic; + final String? clinic; PatientProfileHeaderWhitAppointmentAppBar( {this.patient, this.patientType, @@ -52,10 +51,10 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); int gender = 1; - if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + if (patient!.patientDetails! != null) { + gender = patient!.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient!.gender!; } return Container( @@ -80,11 +79,9 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Expanded( child: AppText( - patient.firstName != null - ? (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.fullName??patient?.patientDetails?.fullName??""), + 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', @@ -103,7 +100,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient?.mobileNumber??""); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -120,9 +117,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -134,13 +129,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType ?? "")] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patient.patientStatusType == 43 + patient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, color: Colors.green, @@ -155,36 +149,31 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' || patient.arrivedOn == null + arrivalType == '1' || patient!.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime - : '', + patient!.startTime != null ? patient!.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( AppDateUtils.convertStringToDateFormat( - patient.arrivedOn, - 'MM-dd-yyyy HH:mm'), + patient!.arrivedOn ?? "", 'MM-dd-yyyy HH:mm'), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") + if (SERVICES_PATIANT2[int.parse(patientType ?? "")] == "List_MyOutPatient") Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), - patient.startTime != null + patient!.startTime != null ? Container( height: 15, width: 60, @@ -193,7 +182,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget color: HexColor("#20A169"), ), child: AppText( - patient.startTime ?? "", + patient!.startTime ?? "", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -206,8 +195,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), Container( child: AppText( - convertDateFormat2( - patient.appointmentDate.toString() ?? ''), + convertDateFormat2(patient!.appointmentDate.toString() ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -226,42 +214,32 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 12, fontFamily: 'Poppins')), + style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patient?.patientId?.toString() ?? "", - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 14)), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)), ], ), ), Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? - "", + patient!.nationalityName ?? patient!.nationality ?? "", fontWeight: FontWeight.bold, fontSize: 12, ), - patient.nationality != null + patient!.nationality != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient?.nationalityFlagURL??"", + patient?.nationalityFlagURL ?? "", height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -280,13 +258,11 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", - style: TextStyle(fontSize: 14)), + 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)), + "${AppDateUtils.getAgeByBirthday(patient!.patientDetails != null ? patient!.patientDetails!.dateofBirth! : patient!.dateofBirth!, context)}", + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)), ], ), ), @@ -302,14 +278,12 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + 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), + bottom: BorderSide(color: Colors.grey[400]!, width: 2.5), + left: BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -331,89 +305,72 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget flex: 5, 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: 9, - ), - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText('Order No: ', - color: Colors.grey[800], - fontSize: 12), - AppText(orderNo ?? '', fontSize: 12) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText('Invoice: ', - color: Colors.grey[800], - fontSize: 12), - AppText(invoiceNO??"", fontSize: 12) - ], - ), - if (branch != null) - Row( - children: [ - AppText('Branch: ', - color: Colors.grey[800], - fontSize: 12), - AppText(branch ?? '', fontSize: 12) - ], - ), - - if (clinic != null) - Row( - children: [ - AppText('Clinic: ', - color: Colors.grey[800], - fontSize: 12), - AppText(clinic ?? '', fontSize: 12) - ], + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText( + '${TranslationBase.of(context).dr}$doctorName', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 9, + ), + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText('Order No: ', color: Colors.grey[800], fontSize: 12), + AppText(orderNo ?? '', fontSize: 12) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText('Invoice: ', color: Colors.grey[800], fontSize: 12), + AppText(invoiceNO ?? "", fontSize: 12) + ], + ), + if (branch != null) + Row( + children: [ + AppText('Branch: ', color: Colors.grey[800], fontSize: 12), + AppText(branch ?? '', fontSize: 12) + ], + ), + if (clinic != null) + Row( + children: [ + AppText('Clinic: ', color: Colors.grey[800], fontSize: 12), + AppText(clinic ?? '', fontSize: 12) + ], + ), + if (isMedicalFile && episode != null) + Row( + children: [ + AppText('Episode: ', color: Colors.grey[800], fontSize: 12), + AppText(episode ?? '', fontSize: 12) + ], + ), + if (isMedicalFile && vistDate != null) + Row( + children: [ + AppText('Visit Date: ', color: Colors.grey[800], fontSize: 12), + AppText(vistDate ?? '', fontSize: 12) + ], + ), + if (!isMedicalFile) + Row( + children: [ + Expanded( + child: AppText( + !isPrescriptions ? 'Result Date: ' : 'Prescriptions Date ', + color: Colors.grey[800], + fontSize: 12, ), - if (isMedicalFile && episode != null) - Row( - children: [ - AppText('Episode: ', - color: Colors.grey[800], - fontSize: 12), - AppText(episode ?? '', fontSize: 12) - ], - ), - if (isMedicalFile && vistDate != null) - Row( - children: [ - AppText('Visit Date: ', - color: Colors.grey[800], - fontSize: 12), - AppText(vistDate ?? '', fontSize: 12) - ], ), - if (!isMedicalFile) - Row( - children: [ - Expanded( - child: AppText( - !isPrescriptions - ? 'Result Date: ' - : 'Prescriptions Date ', - color: Colors.grey[800], - fontSize: 12, - ), - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - fontSize: 14, - ) - ], + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', + fontSize: 14, ) - ]), + ], + ) + ]), ), ), ], @@ -437,8 +394,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget 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))); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + @@ -449,8 +405,6 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget return newDate.toString(); } - - @override Size get preferredSize => Size(double.maxFinite, 310); } diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 9d22962a..37a0d90a 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -13,8 +13,7 @@ import 'large_avatar.dart'; class PrescriptionInPatientWidget extends StatelessWidget { final List prescriptionReportForInPatientList; - PrescriptionInPatientWidget( - {Key key, this.prescriptionReportForInPatientList}); + PrescriptionInPatientWidget({Key? key, required this.prescriptionReportForInPatientList}); @override Widget build(BuildContext context) { @@ -28,8 +27,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: - Border.all(color: HexColor('#B8382C'), width: 4), + border: Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -56,19 +54,14 @@ class PrescriptionInPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, - SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: prescriptionReportForInPatientList.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.of(context).pushNamed( - IN_PATIENT_PRESCRIPTIONS_DETAILS, - arguments: { - 'prescription': - prescriptionReportForInPatientList[index] - }); + Navigator.of(context).pushNamed(IN_PATIENT_PRESCRIPTIONS_DETAILS, + arguments: {'prescription': prescriptionReportForInPatientList[index]}); }, child: CardWithBgWidgetNew( widget: Column( @@ -77,34 +70,26 @@ class PrescriptionInPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - name: - prescriptionReportForInPatientList[index] - .createdByName, + name: prescriptionReportForInPatientList[index].createdByName ?? "", radius: 10, width: 70, ), Expanded( child: Container( - margin: - EdgeInsets.only(left: 15, right: 15), + margin: EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( '${prescriptionReportForInPatientList[index].createdByName}', - fontSize: - 2.5 * SizeConfig.textMultiplier, + fontSize: 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText( - '${prescriptionReportForInPatientList[index].itemDescription}', - fontSize: - 2.5 * SizeConfig.textMultiplier, - color: - Theme.of(context).primaryColor), + AppText('${prescriptionReportForInPatientList[index].itemDescription}', + fontSize: 2.5 * SizeConfig.textMultiplier, + color: Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index bd40c3ca..3f117410 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -14,7 +14,7 @@ import 'large_avatar.dart'; class PrescriptionOutPatientWidget extends StatelessWidget { final List patientPrescriptionsList; - PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); + PrescriptionOutPatientWidget({Key? key, required this.patientPrescriptionsList}); @override Widget build(BuildContext context) { @@ -28,8 +28,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: - Border.all(color: HexColor('#B8382C'), width: 4), + border: Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -56,8 +55,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, - SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: patientPrescriptionsList.length, itemBuilder: (BuildContext context, int index) { @@ -66,10 +64,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Navigator.push( context, MaterialPageRoute( - builder: (context) => - OutPatientPrescriptionDetailsScreen( - prescriptionResModel: - patientPrescriptionsList[index], + builder: (context) => OutPatientPrescriptionDetailsScreen( + prescriptionResModel: patientPrescriptionsList[index], ), ), ); @@ -81,35 +77,27 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - url: patientPrescriptionsList[index] - .doctorImageURL, - name: patientPrescriptionsList[index] - .doctorName, + url: patientPrescriptionsList[index].doctorImageURL, + name: patientPrescriptionsList[index].doctorName ?? "", radius: 10, width: 70, ), Expanded( child: Container( - margin: - EdgeInsets.only(left: 15, right: 15), + margin: EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( '${patientPrescriptionsList[index].name}', - fontSize: - 2.5 * SizeConfig.textMultiplier, + fontSize: 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText( - '${patientPrescriptionsList[index].clinicDescription}', - fontSize: - 2.5 * SizeConfig.textMultiplier, - color: - Theme.of(context).primaryColor), + AppText('${patientPrescriptionsList[index].clinicDescription}', + fontSize: 2.5 * SizeConfig.textMultiplier, + color: Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 53228bc2..656dfd73 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -6,8 +6,7 @@ class ProfileWelcomeWidget extends StatelessWidget { final Widget clinicWidget; final double height; final bool isClinic; - ProfileWelcomeWidget(this.clinicWidget, - {this.height = 150, this.isClinic = false}); + ProfileWelcomeWidget(this.clinicWidget, {this.height = 150, this.isClinic = false}); @override Widget build(BuildContext context) { @@ -27,24 +26,23 @@ class ProfileWelcomeWidget extends StatelessWidget { SizedBox( width: 20, ), - if(authenticationViewModel.doctorProfile!=null) - CircleAvatar( - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(20), - child: Image.network( - authenticationViewModel.doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 75, - height: 75, + if (authenticationViewModel.doctorProfile != null) + CircleAvatar( + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(20), + child: Image.network( + authenticationViewModel.doctorProfile!.doctorImageURL ?? "", + fit: BoxFit.fill, + width: 75, + height: 75, + ), ), + backgroundColor: Colors.transparent, ), - backgroundColor: Colors.transparent, - ), SizedBox( height: 20, ), - ], )), ); diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart deleted file mode 100644 index f5c70ae6..00000000 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: title, info - *@return:ProfileGeneralInfoContentWidget - *@desc: Profile General Info Content Widget - */ -class ProfileGeneralInfoContentWidget extends StatelessWidget { - String title; - String info; - - ProfileGeneralInfoContentWidget({this.title, this.info}); - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 14), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - AppText( - title, - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.w700, - color: HexColor('#58434F'), - ), - AppText( - info, - color: HexColor('#707070'), - fontSize: SizeConfig.textMultiplier * 2, - ) - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart deleted file mode 100644 index df958106..00000000 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/profile_image_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:21/4/2020 - *@param: - *@return: - *@desc: Profile Header Widget class - */ -class ProfileHeaderWidget extends StatelessWidget { - ProfileHeaderWidget({ - Key key, - this.patient - }) : super(key: key); - - PatiantInformtion patient; - - @override - Widget build(BuildContext context) { - // PatientsProvider patientsProv = Provider.of(context); - // patient = patientsProv.getSelectedPatient(); - return Container( - height: SizeConfig.heightMultiplier * 30, - child: ProfileImageWidget( - url: - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", - name: patient.firstName + ' ' + patient.lastName, - des: patient.patientId.toString(), - height: SizeConfig.heightMultiplier * 17, - width: SizeConfig.heightMultiplier * 17, - color: HexColor('#58434F')), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart deleted file mode 100644 index c5417d85..00000000 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ /dev/null @@ -1,184 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.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/PatientProfileButton.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ProfileMedicalInfoWidget extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; - - ProfileMedicalInfoWidget( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.from, - this.to, this.isInpatient}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: "Health" ,//TranslationBase.of(context).medicalReport, - nameLine2: "Summary",//TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient:isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo!=null && patient.appointmentNo!=0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - if (isInpatient) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - if (isInpatient) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - nameLine1:"Order", //"Text", - nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart deleted file mode 100644 index 17feaf0a..00000000 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ /dev/null @@ -1,176 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.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/PatientProfileButton.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { - final String from; - final String to; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final bool isInpatient; - final bool isDischargedPatient; - - ProfileMedicalInfoWidgetInPatient( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.from, - this.to, - this.isInpatient, - this.isDischargedPatient = false}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index ac33eb82..3e457a8d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -8,27 +8,35 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class ProfileMedicalInfoWidgetSearch extends StatelessWidget { +class ProfileMedicalInfoWidgetSearch extends StatefulWidget { final String from; final String to; final PatiantInformtion patient; final String patientType; - final String arrivalType; - final bool isInpatient; - final bool isDischargedPatient; + final String? arrivalType; + final bool? isInpatient; + final bool? isDischargedPatient; ProfileMedicalInfoWidgetSearch( - {Key key, - this.patient, - this.patientType, + {Key? key, + required this.patient, + required this.patientType, this.arrivalType, - this.from, - this.to, + required this.from, + required this.to, this.isInpatient, this.isDischargedPatient}); - TabController _tabController; + + @override + _ProfileMedicalInfoWidgetSearchState createState() => _ProfileMedicalInfoWidgetSearchState(); +} + +class _ProfileMedicalInfoWidgetSearchState extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; + void initState() { - _tabController = TabController(length: 2); + _tabController = TabController(length: 2, vsync: this); } void dispose() { @@ -41,7 +49,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { onModelReady: (model) async {}, builder: (_, model, w) => DefaultTabController( length: 2, - initialIndex: isInpatient ? 0 : 1, + initialIndex: widget.isInpatient! ? 0 : 1, child: SizedBox( height: MediaQuery.of(context).size.height * 1.0, width: double.infinity, @@ -98,81 +106,72 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 3, children: [ PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + from: widget.from, + to: widget.to, + nameLine1: TranslationBase.of(context).vital ?? "", + nameLine2: TranslationBase.of(context).signs ?? "", route: VITAL_SIGN_DETAILS, isInPatient: true, icon: 'patient/vital_signs.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context).lab ?? "", + nameLine2: TranslationBase.of(context).result ?? "", icon: 'patient/lab_results.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + isInPatient: widget.isInpatient!, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context).radiology ?? "", + nameLine2: TranslationBase.of(context).result ?? "", icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context).patient!, + nameLine2: TranslationBase.of(context).prescription!, icon: 'patient/order_prescription.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + isDischargedPatient: widget.isDischargedPatient!, + nameLine1: TranslationBase.of(context).progress ?? "", + nameLine2: TranslationBase.of(context).note ?? "", icon: 'patient/Progress_notes.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, + isDischargedPatient: widget.isDischargedPatient!, nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, + nameLine2: "Sheet", //TranslationBase.of(context).orders, icon: 'patient/Progress_notes.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context).orders ?? "", + nameLine2: TranslationBase.of(context).procedures ?? "", icon: 'patient/Order_Procedures.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, @@ -180,10 +179,9 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", isDisable: true, route: HEALTH_SUMMARY, nameLine1: "Medical", //Health @@ -192,42 +190,38 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context).referral ?? "", + nameLine2: TranslationBase.of(context).patient ?? "", icon: 'patient/refer_patient.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, + nameLine1: TranslationBase.of(context).insurance ?? "", + nameLine2: TranslationBase.of(context).approvals ?? "", icon: 'patient/vital_signs.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", isDisable: true, route: null, nameLine1: "Discharge", nameLine2: "Summery", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context).patientSick ?? "", + nameLine2: TranslationBase.of(context).leave ?? "", icon: 'patient/patient_sick_leave.png'), ], ), @@ -240,151 +234,129 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 3, children: [ PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + from: widget.from, + to: widget.to, + nameLine1: TranslationBase.of(context).vital ?? "", + nameLine2: TranslationBase.of(context).signs ?? "", route: VITAL_SIGN_DETAILS, icon: 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: HEALTH_SUMMARY, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, + nameLine1: "Health", //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, + nameLine1: TranslationBase.of(context).lab ?? "", + nameLine2: TranslationBase.of(context).result ?? "", icon: 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", + isInPatient: widget.isInpatient!, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context).radiology ?? "", + nameLine2: TranslationBase.of(context).service ?? "", icon: 'patient/health_summary.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: TranslationBase.of(context).patient ?? "", nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context).orders ?? "", + nameLine2: TranslationBase.of(context).prescription ?? "", icon: 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, + nameLine1: TranslationBase.of(context).orders ?? "", + nameLine2: TranslationBase.of(context).procedures ?? "", icon: 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context).insurance ?? "", + nameLine2: TranslationBase.of(context).service ?? "", icon: 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, + nameLine1: TranslationBase.of(context).patientSick ?? "", + nameLine2: TranslationBase.of(context).leave ?? "", icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, + isDisable: widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient ?? "", + nameLine2: TranslationBase.of(context).ucaf ?? "", icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, + isDisable: widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral ?? "", + nameLine2: TranslationBase.of(context).patient ?? "", icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, + isDisable: widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission ?? "", + nameLine2: TranslationBase.of(context).request ?? "", icon: 'patient/admission_req.png'), - if (isInpatient) + if (widget.isInpatient!) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, + nameLine1: TranslationBase.of(context).progress ?? "", + nameLine2: TranslationBase.of(context).note ?? "", icon: 'patient/Progress_notes.png'), - if (isInpatient) + if (widget.isInpatient!) PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType ?? "", route: ORDER_NOTE, nameLine1: "Order", //"Text", nameLine2: "Sheet", @@ -406,7 +378,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { // crossAxisCount: 3, // children: [ // PatientProfileButton( - // key: key, + // // patient: patient, // patientType: patientType, // arrivalType: arrivalType, diff --git a/lib/widgets/patients/profile/profile_status_info_widget.dart b/lib/widgets/patients/profile/profile_status_info_widget.dart index d616c36f..56ffdca3 100644 --- a/lib/widgets/patients/profile/profile_status_info_widget.dart +++ b/lib/widgets/patients/profile/profile_status_info_widget.dart @@ -5,8 +5,7 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; import '../../shared/rounded_container_widget.dart'; - -/* +/* *@author: Elham Rababah *@Date:13/4/2020 *@param: @@ -15,7 +14,7 @@ import '../../shared/rounded_container_widget.dart'; */ class ProfileStatusInfoWidget extends StatelessWidget { const ProfileStatusInfoWidget({ - Key key, + Key? key, }) : super(key: key); @override diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index b8314b03..3426bcf2 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -12,7 +12,7 @@ class VitalSignDetailsWidget extends StatefulWidget { final String viewKey; VitalSignDetailsWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -24,10 +24,7 @@ class _VitalSignDetailsWidgetState extends State { return Container( decoration: BoxDecoration( color: Colors.transparent, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), - topRight: Radius.circular(10.0) - ), + borderRadius: BorderRadius.only(topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), border: Border.all(color: Colors.grey, width: 1), ), margin: EdgeInsets.all(20), @@ -38,7 +35,7 @@ class _VitalSignDetailsWidgetState extends State { children: [ Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0,color: Colors.grey[300]), + inside: BorderSide(width: 2.0, color: Colors.grey[300]!), ), children: fullData(), ), @@ -48,7 +45,7 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData(){ + List fullData() { List tableRow = []; tableRow.add(TableRow(children: [ Container( @@ -90,7 +87,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ', textAlign: TextAlign.center, ), ), @@ -112,5 +109,4 @@ class _VitalSignDetailsWidgetState extends State { }); return tableRow; } - } diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index f391e7bf..88b6a970 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -8,28 +8,19 @@ class StarRating extends StatelessWidget { final int totalCount; final bool forceStars; - StarRating( - {Key key, - this.totalAverage: 0.0, - this.size: 16.0, - this.totalCount = 5, - this.forceStars = false}) + StarRating({Key? key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount = 5, this.forceStars = false}) : super(key: key); @override Widget build(BuildContext context) { return Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - if (!forceStars && (totalAverage == null || totalAverage == 0)) - AppText("New", style: "caption"), + if (!forceStars && (totalAverage == null || totalAverage == 0)) AppText("New", style: "caption"), if (forceStars || (totalAverage != null && totalAverage > 0)) ...List.generate( 5, (index) => Padding( padding: EdgeInsets.only(right: 1.0), - child: Icon( - (index + 1) <= (totalAverage ?? 0) - ? EvaIcons.star - : EvaIcons.starOutline, + child: Icon((index + 1) <= (totalAverage ?? 0) ? EvaIcons.star : EvaIcons.starOutline, size: size, color: (index + 1) <= (totalAverage ?? 0) ? Color.fromRGBO(255, 186, 0, 1.0) diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index b13a4f10..7c7c9aba 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -17,7 +17,6 @@ import 'app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - class AppDrawer extends StatefulWidget { @override _AppDrawerState createState() => _AppDrawerState(); @@ -25,7 +24,7 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { Helpers helpers = new Helpers(); - ProjectViewModel projectsProvider; + late ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -85,8 +84,8 @@ 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', @@ -108,7 +107,7 @@ class _AppDrawerState extends State { SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase.of(context).applyOrRescheduleLeave, + TranslationBase.of(context).applyOrRescheduleLeave!, icon: DoctorApp.reschedule__1, // subTitle: , ), @@ -125,7 +124,7 @@ class _AppDrawerState extends State { SizedBox(height: 15), InkWell( child: DrawerItem( - TranslationBase.of(context).myQRCode, + TranslationBase.of(context).myQRCode!, icon: DoctorApp.qr_code_3, // subTitle: , ), @@ -151,8 +150,8 @@ class _AppDrawerState extends State { 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' @@ -168,13 +167,12 @@ class _AppDrawerState extends State { SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase.of(context).logout, + TranslationBase.of(context).logout!, icon: DoctorApp.logout_1, ), onTap: () async { Navigator.pop(context); await authenticationViewModel.logout(isFromLogin: false); - }, ), ], diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart deleted file mode 100644 index 76a7f57e..00000000 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - -class AppExpandableNotifier extends StatelessWidget { - final Widget headerWid; - final Widget bodyWid; - - AppExpandableNotifier({this.headerWid, this.bodyWid}); - - @override - Widget build(BuildContext context) { - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.all(10), - child: Card( - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: headerWid, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - header: Padding( - padding: EdgeInsets.all(10), - child: Text( - "${TranslationBase.of(context).graphDetails}", - style: TextStyle(fontWeight: FontWeight.bold), - )), - collapsed: Text(''), - expanded: bodyWid, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - child: Expandable( - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ), - initialExpanded: true, - ); - } -} diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart deleted file mode 100644 index 1e825b6c..00000000 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ /dev/null @@ -1,127 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - - -/// App Expandable Notifier with animation -/// [headerWidget] widget want to show in the header -/// [bodyWidget] widget want to show in the body -/// [title] the widget title -/// [collapsed] The widget shown in the collapsed state -class AppExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final String title; - final Widget collapsed; - final bool isExpand; - bool expandFlag = false; - var controller = new ExpandableController(); - AppExpandableNotifier( - {this.headerWidget, - this.bodyWidget, - this.title, - this.collapsed, - this.isExpand = false}); - - _AppExpandableNotifier createState() => _AppExpandableNotifier(); -} - -class _AppExpandableNotifier extends State { - - @override - void initState() { - setState(() { - if (widget.isExpand) { - widget.expandFlag = widget.isExpand; - widget.controller.expanded = true; - } - }); - super.initState(); - } - - @override - Widget build(BuildContext context) { - - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.only(left: 10, right: 10, top: 4), - child: Card( - color: Colors.grey[200], - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: widget.headerWidget, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - // hasIcon: false, - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - header: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: Text( - widget.title ?? TranslationBase.of(context).details, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2, - ), - ), - ), - ), - IconButton( - icon: new Container( - height: 28.0, - width: 30.0, - decoration: new BoxDecoration( - color: Theme.of(context).primaryColor, - shape: BoxShape.circle, - ), - child: new Center( - child: new Icon( - widget.expandFlag - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 30.0, - ), - ), - ), - onPressed: () { - setState(() { - widget.expandFlag = !widget.expandFlag; - widget.controller.expanded = widget.expandFlag; - }); - }), - ]), - collapsed: widget.collapsed ?? Container(), - expanded: widget.bodyWidget, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), - child: Expandable( - controller: widget.controller, - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 4b6d753b..789f1cd2 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -4,30 +4,27 @@ import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; class AppLoaderWidget extends StatefulWidget { - AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); + AppLoaderWidget({Key? key, this.title, this.containerColor}) : super(key: key); - final String title; - final Color containerColor; + final String? title; + final Color? containerColor; @override _AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); } class _AppLoaderWidgetState extends State { - - @override Widget build(BuildContext context) { return Container( height: MediaQuery.of(context).size.height, - child: Stack( children: [ Container( - color: widget.containerColor??Colors.grey.withOpacity(0.6), + color: widget.containerColor ?? Colors.grey.withOpacity(0.6), ), - Container(child: GifLoaderContainer(), margin: EdgeInsets.only( - bottom: MediaQuery.of(context).size.height * 0.09)) + Container( + child: GifLoaderContainer(), margin: EdgeInsets.only(bottom: MediaQuery.of(context).size.height * 0.09)) ], ), ); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e957b5d4..7500145d 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -12,14 +12,14 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; - final Widget body; + final Widget? body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel baseViewModel; - final Widget bottomSheet; - final Color backgroundColor; - final Widget appBar; - final String subtitle; + final BaseViewModel? baseViewModel; + final Widget? bottomSheet; + final Color? backgroundColor; + final PreferredSizeWidget? appBar; + final String? subtitle; final bool isHomeIcon; AppScaffold( {this.appBarTitle = '', @@ -30,7 +30,8 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle}); + this.appBar, + this.subtitle}); @override Widget build(BuildContext context) { @@ -56,8 +57,11 @@ class AppScaffold extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text(appBarTitle.toUpperCase()), - if(subtitle!=null) - Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), + if (subtitle != null) + Text( + subtitle!, + style: TextStyle(fontSize: 12, color: Colors.red), + ), ], ), leading: Builder(builder: (BuildContext context) { @@ -73,8 +77,7 @@ class AppScaffold extends StatelessWidget { ? IconButton( icon: Icon(DoctorApp.home_icon_active), color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), + onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false), ) : SizedBox() ], @@ -87,8 +90,7 @@ class AppScaffold extends StatelessWidget { baseViewModel: baseViewModel, child: body, ) - : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) + : Stack(children: [body!, buildAppLoaderWidget(isLoading)]) : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 48661a32..ff9e8e4a 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -4,31 +4,31 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { - final String text; - final String variant; - final Color color; - final FontWeight fontWeight; - final double fontSize; - final double fontHeight; - final String fontFamily; - final int maxLength; - final bool italic; - final double margin; - final double marginTop; - final double marginRight; - final double marginBottom; - final double marginLeft; - final TextAlign textAlign; - final bool bold; - final bool regular; - final bool medium; - final int maxLines; - final bool readMore; - final String style; - final bool allowExpand; - final bool visibility; - final TextOverflow textOverflow; - final TextDecoration textDecoration; + final String? text; + final String? variant; + final Color? color; + final FontWeight? fontWeight; + final double? fontSize; + final double? fontHeight; + final String? fontFamily; + final int? maxLength; + final bool? italic; + final double? margin; + final double? marginTop; + final double? marginRight; + final double? marginBottom; + final double? marginLeft; + final TextAlign? textAlign; + final bool? bold; + final bool? regular; + final bool? medium; + final int? maxLines; + final bool? readMore; + final String? style; + final bool? allowExpand; + final bool? visibility; + final TextOverflow? textOverflow; + final TextDecoration? textDecoration; AppText( this.text, { @@ -70,9 +70,9 @@ class _AppTextState extends State { void didUpdateWidget(covariant AppText oldWidget) { setState(() { if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { - text = widget.text; + text = widget.text!; } }); super.didUpdateWidget(oldWidget); @@ -80,11 +80,11 @@ class _AppTextState extends State { @override void initState() { - hidden = widget.readMore; + hidden = widget.readMore!; if (widget.style == "overline") - text = widget.text.toUpperCase(); + text = widget.text!.toUpperCase(); else { - text = widget.text; + text = widget.text!; } super.initState(); } @@ -93,12 +93,12 @@ class _AppTextState extends State { Widget build(BuildContext context) { return Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin) + ? EdgeInsets.all(widget.margin!) : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft), + top: widget.marginTop!, + right: widget.marginRight!, + bottom: widget.marginBottom!, + left: widget.marginLeft!), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -106,60 +106,45 @@ class _AppTextState extends State { Stack( children: [ Text( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, overflow: widget.maxLines != null - ? ((widget.maxLines > 1) - ? TextOverflow.fade - : TextOverflow.ellipsis) + ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, - color: - widget.color != null ? widget.color : Colors.black, + 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, + letterSpacing: widget.variant == "overline" ? 1.5 : null, fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, height: widget.fontHeight), ), - if (widget.readMore && text.length > widget.maxLength && hidden) + if (widget.readMore! && text.length > widget.maxLength! && hidden) Positioned( bottom: 0, left: 0, right: 0, child: Container( decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], - begin: Alignment.bottomCenter, - end: Alignment.topCenter)), + gradient: LinearGradient(colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), + ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), height: 30, ), ) ], ), - if (widget.allowExpand && - widget.readMore && - text.length > widget.maxLength) + if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -184,27 +169,27 @@ class _AppTextState extends State { TextStyle _getFontStyle() { switch (widget.style) { case "headline2": - return Theme.of(context).textTheme.headline2; + return Theme.of(context).textTheme.headline2!; case "headline3": - return Theme.of(context).textTheme.headline3; + return Theme.of(context).textTheme.headline3!; case "headline4": - return Theme.of(context).textTheme.headline4; + return Theme.of(context).textTheme.headline4!; case "headline5": - return Theme.of(context).textTheme.headline5; + return Theme.of(context).textTheme.headline5!; case "headline6": - return Theme.of(context).textTheme.headline6; + return Theme.of(context).textTheme.headline6!; case "bodyText2": - return Theme.of(context).textTheme.bodyText2; + return Theme.of(context).textTheme.bodyText2!; case "bodyText_15": - return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); + return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0); case "bodyText1": - return Theme.of(context).textTheme.bodyText1; + return Theme.of(context).textTheme.bodyText1!; case "caption": - return Theme.of(context).textTheme.caption; + return Theme.of(context).textTheme.caption!; case "overline": - return Theme.of(context).textTheme.overline; + return Theme.of(context).textTheme.overline!; case "button": - return Theme.of(context).textTheme.button; + return Theme.of(context).textTheme.button!; default: return TextStyle(); } @@ -289,7 +274,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return null; + return FontWeight.normal; } } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index dd64958a..04a83c3f 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -8,7 +8,7 @@ import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; final int index; - BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); + BottomNavBar({Key? key, required this.changeIndex, required this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index e69ff690..4a20864b 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -2,20 +2,15 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class BottomNavigationItem extends StatelessWidget { - final IconData icon; - final IconData activeIcon; + final IconData? icon; + final IconData? activeIcon; final ValueChanged changeIndex; - final int index; + final int? index; final int currentIndex; - final String name; + final String? name; BottomNavigationItem( - {this.icon, - this.activeIcon, - this.changeIndex, - this.index, - this.currentIndex, - this.name}); + {this.icon, this.activeIcon, required this.changeIndex, this.index, required this.currentIndex, this.name}); @override Widget build(BuildContext context) { @@ -32,22 +27,21 @@ class BottomNavigationItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), Container( child: Icon(currentIndex == index ? activeIcon : icon, - color: currentIndex == index - ? Color(0xFF333C45) - : Theme.of(context).dividerColor, - size: 22.0), + color: currentIndex == index ? Color(0xFF333C45) : Theme.of(context).dividerColor, size: 22.0), + ), + SizedBox( + height: 5, ), - SizedBox(height: 5,), Expanded( child: Text( - name, + name ?? "", style: TextStyle( - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).dividerColor, + color: currentIndex == index ? Theme.of(context).primaryColor : Theme.of(context).dividerColor, ), ), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index ed3e6e98..682be89b 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; import '../app_texts_widget.dart'; class AppButton extends StatefulWidget { - final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; - final double fontSize; - final double padding; - final Color fontColor; - final bool loading; - final bool disabled; - final FontWeight fontWeight; - final bool hasBorder; - final Color borderColor; - final double radius; - final double vPadding; - final double hPadding; + final GestureTapCallback? onPressed; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; + final double? fontSize; + final double? padding; + final Color? fontColor; + final bool? loading; + final bool? disabled; + final FontWeight? fontWeight; + final bool? hasBorder; + final Color? borderColor; + final double? radius; + final double? vPadding; + final double? hPadding; AppButton({ @required this.onPressed, @@ -51,18 +51,20 @@ class _AppButtonState extends State { return Container( // height: MediaQuery.of(context).size.height * 0.075, child: IgnorePointer( - ignoring: widget.loading ||widget.disabled, + ignoring: widget.loading! || widget.disabled!, child: RawMaterialButton( - fillColor: widget.disabled - ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), + fillColor: widget.disabled! + ? Colors.grey + : widget.color != null + ? widget.color + : HexColor("#B8382C"), splashColor: widget.color, child: Padding( - padding: (widget.hPadding > 0 || widget.vPadding > 0) - ? EdgeInsets.symmetric( - vertical: widget.vPadding, horizontal: widget.hPadding) + padding: (widget.hPadding! > 0 || widget.vPadding! > 0) + ? EdgeInsets.symmetric(vertical: widget.vPadding!, horizontal: widget.hPadding!) : EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, + top: widget.padding!, + bottom: widget.padding!, //right: SizeConfig.widthMultiplier * widget.padding, //left: SizeConfig.widthMultiplier * widget.padding ), @@ -70,8 +72,7 @@ class _AppButtonState extends State { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ - if (widget.icon != null) - Container(width: 25, height: 25, child: widget.icon), + if (widget.icon != null) Container(width: 25, height: 25, child: widget.icon), if (widget.iconData != null) Icon( widget.iconData, @@ -81,7 +82,7 @@ class _AppButtonState extends State { SizedBox( width: 5.0, ), - widget.loading + widget.loading! ? Padding( padding: EdgeInsets.all(2.6), child: SizedBox( @@ -90,7 +91,7 @@ class _AppButtonState extends State { child: CircularProgressIndicator( backgroundColor: Colors.white, valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + Colors.grey[300]!, ), ), ), @@ -99,22 +100,24 @@ class _AppButtonState extends State { child: AppText( widget.title, color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontSize: SizeConfig.textMultiplier * widget.fontSize!, fontWeight: widget.fontWeight, ), ), ], ), ), - onPressed: widget.disabled ? (){} : widget.onPressed, + onPressed: widget.disabled! ? () {} : widget.onPressed, shape: RoundedRectangleBorder( side: BorderSide( - color: - widget.hasBorder ? widget.borderColor : widget.disabled - ? Colors.grey : widget.color ?? Color(0xFFB8382C), + color: widget.hasBorder! + ? widget.borderColor! + : widget.disabled! + ? Colors.grey + : widget.color ?? Color(0xFFB8382C), width: 0.8, ), - borderRadius: BorderRadius.all(Radius.circular(widget.radius))), + borderRadius: BorderRadius.all(Radius.circular(widget.radius!))), ), ), ); diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 3c5cc32d..883a6a9b 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -3,25 +3,25 @@ import 'package:flutter/material.dart'; import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { + final GestureTapCallback? onPressed; + final String? title; + final IconData? iconData; + final Widget? icon; + final Color? color; + final double? fontSize; + final double? padding; + final Color? fontColor; + final bool? loading; + final bool? disabled; + final FontWeight? fontWeight; + final bool? hasBorder; + final Color? borderColor; + final double? radius; + final double? vPadding; + final double? hPadding; - final GestureTapCallback onPressed; - final String title; - final IconData iconData; - final Widget icon; - final Color color; - final double fontSize; - final double padding; - final Color fontColor; - final bool loading; - final bool disabled; - final FontWeight fontWeight; - final bool hasBorder; - final Color borderColor; - final double radius; - final double vPadding; - final double hPadding; - - ButtonBottomSheet({@required this.onPressed, + ButtonBottomSheet({ + @required this.onPressed, this.title, this.iconData, this.icon, @@ -36,7 +36,8 @@ class ButtonBottomSheet extends StatelessWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor,}); + this.borderColor, + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index 48c65baf..320f4402 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -15,7 +15,7 @@ import 'package:provider/provider.dart'; /// [noBorderRadius] remove border radius class SecondaryButton extends StatefulWidget { SecondaryButton( - {Key key, + {Key? key, this.label = "", this.icon, this.iconOnly = false, @@ -30,12 +30,12 @@ class SecondaryButton extends StatefulWidget { : super(key: key); final String label; - final Widget icon; - final VoidCallback onTap; + final Widget? icon; + final VoidCallback? onTap; final bool loading; - final Color color; + final Color? color; final Color textColor; - final Color borderColor; + final Color? borderColor; final bool small; final bool iconOnly; final bool disabled; @@ -45,15 +45,14 @@ class SecondaryButton extends StatefulWidget { _SecondaryButtonState createState() => _SecondaryButtonState(); } -class _SecondaryButtonState extends State - with TickerProviderStateMixin { +class _SecondaryButtonState extends State with TickerProviderStateMixin { double _buttonSize = 1.0; - AnimationController _animationController; - Animation _animation; + late AnimationController _animationController; + late Animation _animation; double _rippleSize = 0.0; - AnimationController _rippleController; - Animation _rippleAnimation; + late AnimationController _rippleController; + late Animation _rippleAnimation; @override void initState() { @@ -62,28 +61,19 @@ class _SecondaryButtonState extends State _rippleSize = 1.0; }); } - _animationController = AnimationController( - vsync: this, - lowerBound: 0.7, - upperBound: 1.0, - duration: Duration(milliseconds: 120)); - _animation = CurvedAnimation( - parent: _animationController, - curve: Curves.easeOutQuad, - reverseCurve: Curves.easeOutQuad); + _animationController = + AnimationController(vsync: this, lowerBound: 0.7, upperBound: 1.0, duration: Duration(milliseconds: 120)); + _animation = + CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuad, reverseCurve: Curves.easeOutQuad); _animation.addListener(() { setState(() { _buttonSize = _animation.value; }); }); - _rippleController = AnimationController( - vsync: this, - lowerBound: 0.0, - upperBound: 1.0, - duration: Duration(seconds: 1)); - _rippleAnimation = CurvedAnimation( - parent: _rippleController, curve: Curves.easeInOutQuint); + _rippleController = + AnimationController(vsync: this, lowerBound: 0.0, upperBound: 1.0, duration: Duration(seconds: 1)); + _rippleAnimation = CurvedAnimation(parent: _rippleController, curve: Curves.easeInOutQuint); _rippleAnimation.addListener(() { setState(() { _rippleSize = _rippleAnimation.value; @@ -102,8 +92,7 @@ class _SecondaryButtonState extends State Widget _buildIcon() { if (widget.icon != null && (widget.label != null && widget.label != "")) { return Container(height: 25.0, child: widget.icon); - } else if (widget.icon != null && - (widget.label == null || widget.label == "")) { + } else if (widget.icon != null && (widget.label == null || widget.label == "")) { return Container(height: 25.0, width: 25, child: widget.icon); } else { return Container(); @@ -142,7 +131,7 @@ class _SecondaryButtonState extends State _animationController.forward(); }, onTap: () => { - widget.disabled ? null : widget.onTap(), + widget.disabled ? null : widget.onTap!(), }, // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, @@ -151,16 +140,12 @@ class _SecondaryButtonState extends State child: Container( decoration: BoxDecoration( border: widget.borderColor != null - ? Border.all( - color: widget.borderColor.withOpacity(0.1), width: 2.0) + ? Border.all(color: widget.borderColor!.withOpacity(0.1), width: 2.0) : null, borderRadius: BorderRadius.all(Radius.circular(100.0)), boxShadow: [ BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.04), - spreadRadius: -0.0, - offset: Offset(0, 4.0), - blurRadius: 18.0) + color: Color.fromRGBO(0, 0, 0, 0.04), spreadRadius: -0.0, offset: Offset(0, 4.0), blurRadius: 18.0) ], ), child: ClipRRect( @@ -176,9 +161,7 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: widget.disabled - ? Colors.grey - : widget.color ?? Theme.of(context).buttonColor), + color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor), ), ), Positioned( @@ -191,9 +174,7 @@ class _SecondaryButtonState extends State height: MediaQuery.of(context).size.width * 2.2, decoration: BoxDecoration( shape: BoxShape.circle, - color: widget.disabled - ? Colors.grey - : widget.color ?? Theme.of(context).buttonColor, + color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor, ), ), ), @@ -202,10 +183,7 @@ class _SecondaryButtonState extends State padding: widget.iconOnly ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) : EdgeInsets.only( - top: widget.small ? 8.0 : 14.0, - bottom: widget.small ? 6.0 : 14.0, - left: 18.0, - right: 18.0), + top: widget.small ? 8.0 : 14.0, bottom: widget.small ? 6.0 : 14.0, left: 18.0, right: 18.0), child: Stack( children: [ Positioned( @@ -224,22 +202,20 @@ class _SecondaryButtonState extends State width: 19.0, child: CircularProgressIndicator( backgroundColor: Colors.white, - valueColor: - AlwaysStoppedAnimation( - Colors.grey[300], + valueColor: AlwaysStoppedAnimation( + Colors.grey[300]!, ), ), ), ) : Padding( - padding: EdgeInsets.only( - bottom: widget.small ? 4.0 : 3.0), + padding: EdgeInsets.only(bottom: widget.small ? 4.0 : 3.0), child: Text( widget.label, style: TextStyle( color: widget.textColor, fontSize: 16, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w700, fontFamily: 'Poppins'), ), ) diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 00b836bc..1b17236a 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -1,18 +1,10 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -/* - *@author: Amjad Amireh Modify for new design created by Mohammad Aljammal - *@Date:Modify date 21/5/2020 Original date 27/4/2020 - *@param: Widget - *@return: - *@desc: Card With Bg Widget - */ - class CardWithBgWidgetNew extends StatelessWidget { final Widget widget; - CardWithBgWidgetNew({@required this.widget}); + CardWithBgWidgetNew({required this.widget}); @override Widget build(BuildContext context) { @@ -21,10 +13,10 @@ class CardWithBgWidgetNew extends StatelessWidget { margin: EdgeInsets.symmetric(vertical: 10.0), width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), color: HexColor('#FFFFFF'), @@ -33,18 +25,16 @@ class CardWithBgWidgetNew extends StatelessWidget { Center( child: Container( - // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 - // margin: EdgeInsets.only(left: 10), + // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 + // margin: EdgeInsets.only(left: 10), child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center(child: widget), - )), + padding: const EdgeInsets.all(8.0), + child: Center(child: widget), + )), ) ], ), ), ); } - - } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index deeff358..1e2e19c2 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; - class CardWithBgWidget extends StatelessWidget { final Widget widget; final Color bgColor; @@ -13,7 +12,12 @@ class CardWithBgWidget extends StatelessWidget { final double marginSymmetric; CardWithBgWidget( - {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); + {required this.widget, + required this.bgColor, + this.hasBorder = true, + this.padding = 15.0, + this.marginLeft = 10.0, + this.marginSymmetric = 10.0}); @override Widget build(BuildContext context) { @@ -25,9 +29,7 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: hasBorder ? HexColor('#707070') : Colors.transparent, - width: hasBorder ? 0.30 : 0), + border: Border.all(color: hasBorder ? HexColor('#707070') : Colors.transparent, width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -35,13 +37,14 @@ class CardWithBgWidget extends StatelessWidget { children: [ if (projectProvider.isArabic) Positioned( - child: Container( + child: Container( decoration: BoxDecoration( color: bgColor ?? HexColor('#58434F'), - borderRadius: BorderRadius.only( topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10),),), + bottomLeft: Radius.circular(10), + ), + ), width: 10, ), bottom: 1, @@ -52,21 +55,19 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor ?? HexColor('#58434F'), - - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10),),), + color: bgColor ?? HexColor('#58434F'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), + ), + ), width: 7, ), bottom: 1, top: 1, left: 1, ), - Container( - padding: EdgeInsets.all(padding), - margin: EdgeInsets.only(left: marginLeft), - child: widget) + Container(padding: EdgeInsets.all(padding), margin: EdgeInsets.only(left: marginLeft), child: widget) ], ), ), diff --git a/lib/widgets/shared/charts/app_line_chart.dart b/lib/widgets/shared/charts/app_line_chart.dart deleted file mode 100644 index 422468d7..00000000 --- a/lib/widgets/shared/charts/app_line_chart.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: AppLineChart - */ -class AppLineChart extends StatelessWidget { - const AppLineChart({ - Key key, - @required this.seriesList, - this.chartTitle, - }) : super(key: key); - - final List seriesList; - - final String chartTitle; - - @override - Widget build(BuildContext context) { - return Container( - child: Column( - children: [ - Text( - 'Body Mass Index', - style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold), - ), - Expanded( - child: charts.LineChart(seriesList, - defaultRenderer: new charts.LineRendererConfig( - includeArea: false, stacked: true), - animate: true), - ), - ], - ), - ); - } -} diff --git a/lib/widgets/shared/charts/app_time_series_chart.dart b/lib/widgets/shared/charts/app_time_series_chart.dart deleted file mode 100644 index f4bd354e..00000000 --- a/lib/widgets/shared/charts/app_time_series_chart.dart +++ /dev/null @@ -1,121 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:flutter/material.dart'; - -import '../../../config/size_config.dart'; -import '../../../models/patient/vital_sign/vital_sign_res_model.dart'; -import '../../../widgets/shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: AppTimeSeriesChart - */ -class AppTimeSeriesChart extends StatelessWidget { - AppTimeSeriesChart( - {Key key, - @required this.vitalList, - @required this.viewKey, - this.chartName = ''}); - - final List vitalList; - final String chartName; - final String viewKey; - List seriesList; - - @override - Widget build(BuildContext context) { - seriesList = generateData(); - return RoundedContainer( - height: SizeConfig.realScreenHeight * 0.47, - child: Column( - children: [ - Text( - chartName, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 3), - ), - Container( - height: SizeConfig.realScreenHeight * 0.37, - child: Center( - child: Container( - child: charts.TimeSeriesChart( - seriesList, - animate: true, - behaviors: [ - new charts.RangeAnnotation( - [ - new charts.RangeAnnotationSegment( - DateTime( - vitalList[vitalList.length - 1] - .vitalSignDate - .year, - vitalList[vitalList.length - 1] - .vitalSignDate - .month + - 3, - vitalList[vitalList.length - 1] - .vitalSignDate - .day), - vitalList[0].vitalSignDate, - charts.RangeAnnotationAxisType.domain), - ], - ), - ], - ), - ), - ), - ), - ], - ), - ); - } - - /* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: generateData - */ - generateData() { - final List data = []; - if (vitalList.length > 0) { - vitalList.forEach( - (element) { - data.add( - TimeSeriesSales( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey].toInt(), - ), - ); - }, - ); - } - return [ - new charts.Series( - id: 'Sales', - domainFn: (TimeSeriesSales sales, _) => sales.time, - measureFn: (TimeSeriesSales sales, _) => sales.sales, - data: data, - ) - ]; - } -} - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: TimeSeriesSales - */ -class TimeSeriesSales { - final DateTime time; - final int sales; - - TimeSeriesSales(this.time, this.sales); -} diff --git a/lib/widgets/shared/custom_shape_clipper.dart b/lib/widgets/shared/custom_shape_clipper.dart deleted file mode 100644 index 81f5ee20..00000000 --- a/lib/widgets/shared/custom_shape_clipper.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:flutter/material.dart'; - -class CustomShapeClipper extends CustomClipper { - @override - Path getClip(Size size) { - final Path path = Path(); - path.lineTo(0.0, size.height); - - var firstEndPoint = Offset(size.width * .5, size.height / 2); - var firstControlpoint = Offset(size.width * 0.25, size.height * 0.95 + 30); - path.quadraticBezierTo(firstControlpoint.dx, firstControlpoint.dy, - firstEndPoint.dx, firstEndPoint.dy); - - var secondEndPoint = Offset(size.width, size.height * 0.10); - var secondControlPoint = Offset(size.width * .75, size.height * .10 - 20); - path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy, - secondEndPoint.dx, secondEndPoint.dy); - - path.lineTo(size.width, 0.0); - path.close(); - return path; - } - - @override - bool shouldReclip(CustomClipper oldClipper) => true; -} diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 302366b7..06875fb4 100644 --- a/lib/widgets/shared/dialogs/ShowImageDialog.dart +++ b/lib/widgets/shared/dialogs/ShowImageDialog.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class ShowImageDialog extends StatelessWidget { final String imageUrl; - const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); + const ShowImageDialog({Key? key, required this.imageUrl}) : super(key: key); @override Widget build(BuildContext context) { return SimpleDialog( @@ -12,10 +12,8 @@ class ShowImageDialog extends StatelessWidget { Container( width: 340, height: 340, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12) - ), - child: Image.network( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)), + child: Image.network( imageUrl, fit: BoxFit.fill, ), @@ -23,4 +21,4 @@ class ShowImageDialog extends StatelessWidget { ], ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 76932ecd..0a1ecb76 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -9,16 +9,16 @@ class ListSelectDialog extends StatefulWidget { final okText; final Function(dynamic) okFunction; dynamic selectedValue; - final Widget searchWidget; + final Widget? searchWidget; final bool usingSearch; - final String hintSearchText; + final String? hintSearchText; ListSelectDialog({ - @required this.list, - @required this.attributeName, - @required this.attributeValueId, + required this.list, + required this.attributeName, + required this.attributeValueId, @required this.okText, - @required this.okFunction, + required this.okFunction, this.searchWidget, this.usingSearch = false, this.hintSearchText, @@ -29,7 +29,7 @@ class ListSelectDialog extends StatefulWidget { } class _ListSelectDialogState extends State { - List items = List(); + List items = []; @override void initState() { @@ -46,7 +46,7 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context).cancel ?? ""), onPressed: () { Navigator.of(context).pop(); }); @@ -74,15 +74,16 @@ class _ListSelectDialogState extends State { child: SingleChildScrollView( child: Column( children: [ - if (widget.searchWidget != null) widget.searchWidget, - if(widget.usingSearch) + if (widget.searchWidget != null) widget.searchWidget!, + if (widget.usingSearch) Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context).size.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - widget.hintSearchText ?? TranslationBase - .of(context) - .search, null, false, suffixIcon: Icon(Icons.search,)), + widget.hintSearchText ?? TranslationBase.of(context).search ?? "", "", false, + suffixIcon: Icon( + Icons.search, + )), enabled: true, keyboardType: TextInputType.text, onChanged: (value) { @@ -92,13 +93,11 @@ class _ListSelectDialogState extends State { ...items .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId] - .toString(), + groupValue: widget.selectedValue[widget.attributeValueId].toString(), value: item[widget.attributeValueId].toString(), activeColor: Colors.blue.shade700, selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), + widget.selectedValue[widget.attributeValueId].toString(), onChanged: (val) { setState(() { widget.selectedValue = item; @@ -117,10 +116,10 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.list); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 55046c3c..0ef95900 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -9,15 +9,11 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel? selectedValue; final bool isICD; MasterKeyDailog( - {@required this.list, - @required this.okText, - @required this.okFunction, - this.selectedValue, - this.isICD = false}); + {required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -33,20 +29,20 @@ class _MasterKeyDailogState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return showAlertDialog(context, projectViewModel); + return showAlertDialog(context, projectViewModel); } showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: Text(TranslationBase.of(context).cancel!), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( child: Text(this.widget.okText), onPressed: () { - this.widget.okFunction(widget.selectedValue); + this.widget.okFunction(widget.selectedValue!); Navigator.of(context).pop(); }); // set up the AlertDialog @@ -69,23 +65,21 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: Text( - '${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), - groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), - value: widget.isICD ? widget.selectedValue.code.toString() : item - .id.toString(), - activeColor: Colors.blue.shade700, - selected: widget.isICD ? item.code.toString() == - widget.selectedValue.code.toString() : item.id.toString() == - widget.selectedValue.id.toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) + title: Text('${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + + (widget.isICD ? '/${item.code}' : '')), + groupValue: + widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(), + value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(), + activeColor: Colors.blue.shade700, + selected: widget.isICD + ? item.code.toString() == widget.selectedValue!.code.toString() + : item.id.toString() == widget.selectedValue!.id.toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) .toList() ], ), diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart deleted file mode 100644 index 68dce5a4..00000000 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ /dev/null @@ -1,92 +0,0 @@ -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:flutter/material.dart'; - -class ListSelectDialog extends StatefulWidget { - final List list; - final String attributeName; - final String attributeValueId; - final okText; - final Function(dynamic) okFunction; - dynamic selectedValue; - - ListSelectDialog( - {@required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction}); - - @override - _ListSelectDialogState createState() => _ListSelectDialogState(); -} - -class _ListSelectDialogState extends State { - @override - void initState() { - super.initState(); - widget.selectedValue = widget.selectedValue ?? widget.list[0]; - } - - @override - Widget build(BuildContext context) { - return showAlertDialog(context); - } - - showAlertDialog(BuildContext context) { - // set up the buttons - Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), - onPressed: () { - Navigator.of(context).pop(); - }); - Widget continueButton = FlatButton( - child: Text(this.widget.okText), - onPressed: () { - this.widget.okFunction(widget.selectedValue); - Navigator.of(context).pop(); - }); -// set up the AlertDialog - AlertDialog alert = AlertDialog( - // title: Text(widget.title), - content: createDialogList(), - actions: [ - cancelButton, - continueButton, - ], - ); - return alert; - } - - Widget createDialogList() { - return Container( - height: MediaQuery.of(context).size.height * 0.5, - child: SingleChildScrollView( - child: Column( - children: [ - ...widget.list - .map((item) => RadioListTile( - title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId] - .toString(), - value: item[widget.attributeValueId].toString(), - activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) - .toList() - ], - ), - ), - ); - } - - static closeAlertDialog(BuildContext context) { - Navigator.of(context).pop(); - } -} diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart index b43557cb..63a5380e 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,9 +2,10 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key key, this.height = 0, + Key? key, + this.height = 0, }); - final double height ; + final double height; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index faa4379a..7ee26c2f 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -13,9 +13,9 @@ class DoctorCard extends StatelessWidget { final String branch; final DateTime appointmentDate; final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? invoiceNO; + final String? orderNo; + final GestureTapCallback? onTap; final bool isPrescriptions; final String clinic; final bool isShowEye; @@ -23,22 +23,24 @@ class DoctorCard extends StatelessWidget { final bool isNoMargin; DoctorCard( - {this.doctorName, - this.branch, - this.profileUrl, + {required this.doctorName, + required this.branch, + required this.profileUrl, this.invoiceNO, this.onTap, - this.appointmentDate, + required this.appointmentDate, this.orderNo, this.isPrescriptions = false, - this.clinic, - this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); + required this.clinic, + this.isShowEye = true, + this.isShowTime = true, + this.isNoMargin = false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(!isNoMargin? 10:0), + margin: EdgeInsets.all(!isNoMargin ? 10 : 0), decoration: BoxDecoration( border: Border.all( width: 0.5, @@ -73,7 +75,7 @@ class DoctorCard extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions&& isShowTime) + if (!isPrescriptions && isShowTime) AppText( '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, @@ -103,74 +105,67 @@ class DoctorCard extends StatelessWidget { Expanded( child: Container( margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).orderNo + - " ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - orderNo ?? '', - fontSize: 14, - ) - ], + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).orderNo ?? "" + " ", + color: Colors.grey[500], + fontSize: 14, ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context) - .invoiceNo + - " ", - fontSize: 14, - color: Colors.grey[500], - ), - AppText( - invoiceNO, - fontSize: 14, - ) - ], + AppText( + orderNo ?? '', + fontSize: 14, + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).invoiceNo ?? "" + " ", + fontSize: 14, + color: Colors.grey[500], + ), + AppText( + invoiceNO, + fontSize: 14, + ) + ], + ), + if (clinic != null) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).clinic ?? "" + ": ", + color: Colors.grey[500], + fontSize: 14, ), - if (clinic != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - clinic, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + clinic, + fontSize: 14, + ), + ) + ], + ), + if (branch != null) + Row( + children: [ + AppText( + TranslationBase.of(context).branch ?? "" + ": ", + fontSize: 14, + color: Colors.grey[500], ), - if (branch != null) - Row( - children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontSize: 14, - color: Colors.grey[500], - ), - AppText( - branch, - fontSize: 14, - ) - ], + AppText( + branch, + fontSize: 14, ) - ]), + ], + ) + ]), ), ), if (isShowEye) diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 2b0aae7c..c843875d 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -8,18 +8,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class DoctorCardInsurance extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final GestureTapCallback? onTap; final bool isPrescriptions; - final String clinic; - final String approvalStatus; - final String patientOut; - final String branch2; + final String? clinic; + final String? approvalStatus; + final String? patientOut; + final String? branch2; DoctorCardInsurance( {this.doctorName, @@ -59,8 +59,7 @@ class DoctorCardInsurance extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: approvalStatus == "Approved" || - approvalStatus == "تمت الموافقة" + color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -68,8 +67,7 @@ class DoctorCardInsurance extends StatelessWidget { Expanded( child: Container( padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, - right: projectViewModel.isArabic ? 15 : 0), + left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( onTap: onTap, child: Column( @@ -80,8 +78,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ AppText( "$approvalStatus", - color: approvalStatus == "Approved" || - approvalStatus == "تمت الموافقة" + color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -116,7 +113,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Container( child: LargeAvatar( - name: doctorName, + name: doctorName ?? "", url: profileUrl, ), width: 55, @@ -126,90 +123,83 @@ class DoctorCardInsurance extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - 'order No:', - color: Colors.grey[500], - ), - AppText( - orderNo ?? '', - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - 'Invoice:', - color: Colors.grey[500], - ), - AppText( - invoiceNO, - ) - ], + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText( + 'order No:', + color: Colors.grey[500], ), - if (isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - //fontWeight: FontWeight.w600, - //color: Colors.grey[500], - ), - Expanded( - child: AppText( - clinic, - //fontWeight: FontWeight.w700, - fontSize: 14.0, - ), - ) - ], + AppText( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText( + 'Invoice:', + color: Colors.grey[500], ), - if (branch2 != null) - Row( - children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontSize: 14, - color: Colors.grey[500], - ), - AppText( - branch2, - fontSize: 14.0, - ) - ], + AppText( + invoiceNO, + ) + ], + ), + if (isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).clinic ?? "" + ": ", + color: Colors.grey[500], + fontSize: 14, + //fontWeight: FontWeight.w600, + //color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .approvalNo + - ": ", - fontSize: 14, - color: Colors.grey[500], - //color: Colors.grey[500], - ), - AppText( - branch, + Expanded( + child: AppText( + clinic, + //fontWeight: FontWeight.w700, fontSize: 14.0, - ) - ], + ), + ) + ], + ), + if (branch2 != null) + Row( + children: [ + AppText( + TranslationBase.of(context).branch ?? "" + ": ", + fontSize: 14, + color: Colors.grey[500], + ), + AppText( + branch2, + fontSize: 14.0, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo ?? "" + ": ", + fontSize: 14, + color: Colors.grey[500], + //color: Colors.grey[500], ), - ]), + AppText( + branch, + fontSize: 14.0, + ) + ], + ), + ]), ), ), Padding( - padding: - const EdgeInsets.symmetric(horizontal: 15.0), + padding: const EdgeInsets.symmetric(horizontal: 15.0), child: Icon( EvaIcons.eye, ), diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 2c476ec8..1c7db539 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; + class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ - Key key, + Key? key, }) : super(key: key); @override @@ -11,4 +12,4 @@ class DrAppCircularProgressIndeicator extends StatelessWidget { child: Center(child: const CircularProgressIndicator()), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 2b8ce40d..17c593f8 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -8,9 +8,9 @@ import '../shared/app_texts_widget.dart'; class DrawerItem extends StatefulWidget { final String title; final String subTitle; - final IconData icon; - final Color color; - final String assetLink; + final IconData? icon; + final Color? color; + final String? assetLink; DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @@ -26,30 +26,30 @@ class _DrawerItemState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(widget.assetLink!=null) + if (widget.assetLink != null) Container( height: 20, width: 20, - child: Image.asset(widget.assetLink), + child: Image.asset(widget.assetLink!), + ), + if (widget.assetLink == null) + Icon( + widget.icon, + color: widget.color ?? Colors.black87, + size: SizeConfig.imageSizeMultiplier * 5, ), - if(widget.assetLink==null) - Icon( - widget.icon, - color: widget.color ?? Colors.black87, - size: SizeConfig.imageSizeMultiplier * 5, - ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width *0.45, + width: MediaQuery.of(context).size.width * 0.45, child: AppText( widget.title, marginLeft: 5, marginRight: 5, - color:widget.color ??Color(0xFF2E303A), + color: widget.color ?? Color(0xFF2E303A), fontSize: 14, fontFamily: 'Poppins', fontWeight: FontWeight.w600, diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart index de9fd698..9948ad2a 100644 --- a/lib/widgets/shared/errors/dr_app_embedded_error.dart +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -2,17 +2,10 @@ import 'package:flutter/material.dart'; import '../app_texts_widget.dart'; -/* - *@author: Elham Rababah - *@Date:12/5/2020 - *@param: error - *@return: StatelessWidget - *@desc: DrAppEmbeddedError class - */ class DrAppEmbeddedError extends StatelessWidget { const DrAppEmbeddedError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; @@ -20,12 +13,12 @@ class DrAppEmbeddedError extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: AppText( - error, - color: Theme.of(context).errorColor, - textAlign: TextAlign.center, - margin: 10, - ), - ); + child: AppText( + error, + color: Theme.of(context).errorColor, + textAlign: TextAlign.center, + margin: 10, + ), + ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 21e04e6c..76b7d515 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -4,8 +4,8 @@ import '../app_texts_widget.dart'; class ErrorMessage extends StatelessWidget { const ErrorMessage({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; @@ -17,17 +17,22 @@ class ErrorMessage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), Image.asset('assets/images/no-data.png'), Center( child: Center( child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), - child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), + padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30), + child: Center( + child: AppText( + error ?? '', + textAlign: TextAlign.center, + )), ), ), ) - ], ), ), diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 20d95bcd..13b1438c 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -2,33 +2,30 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class HeaderBodyExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final Widget collapsed; - final bool isExpand; + final Widget? headerWidget; + final Widget? bodyWidget; + final Widget? collapsed; + final bool? isExpand; bool expandFlag = false; var controller = new ExpandableController(); HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); @override - _HeaderBodyExpandableNotifierState createState() => - _HeaderBodyExpandableNotifierState(); + _HeaderBodyExpandableNotifierState createState() => _HeaderBodyExpandableNotifierState(); } -class _HeaderBodyExpandableNotifierState - extends State { - +class _HeaderBodyExpandableNotifierState extends State { @override void initState() { super.initState(); - } + @override Widget build(BuildContext context) { setState(() { if (widget.isExpand == true) { - widget.expandFlag = widget.isExpand; + widget.expandFlag = widget.isExpand!; widget.controller.expanded = true; } }); @@ -50,7 +47,7 @@ class _HeaderBodyExpandableNotifierState ), // header: widget.headerWidget, collapsed: Container(), - expanded: widget.bodyWidget, + expanded: widget.bodyWidget!, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), diff --git a/lib/widgets/shared/expandable_item_widget.dart b/lib/widgets/shared/expandable_item_widget.dart deleted file mode 100644 index d369e72a..00000000 --- a/lib/widgets/shared/expandable_item_widget.dart +++ /dev/null @@ -1,91 +0,0 @@ -/* - *@author: Amjad Amireh - *@Date:27/5/2020 - *@param:listItems , headerTitle - *@return:ListItem Expand - - *@desc: - */ -import 'package:flutter/material.dart'; - -class ExpandableItem extends StatefulWidget{ - - final ListlistItems; - final String headerTitle; - - ExpandableItem(this.headerTitle,this.listItems); - - @override - _ExpandableItemState createState() => _ExpandableItemState(); - -} -class _ExpandableItemState extends State -{ - bool isExpand=false; - @override - void initState() { - super.initState(); - isExpand=false; - } - @override - Widget build(BuildContext context) { - ListlistItem=this.widget.listItems; - return Container( - child: Padding( - padding: (isExpand==true)?const EdgeInsets.all(6.0):const EdgeInsets.all(8.0), - child: Container( - decoration:BoxDecoration( - color: Colors.white, - borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(50)):BorderRadius.all(Radius.circular(25)), - - - - - - ), - child: ExpansionTile( - key: PageStorageKey(this.widget.headerTitle), - title: Container( - width: double.infinity, - - child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22,color: Colors.black,fontWeight: FontWeight.bold),)), - - trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,color: Colors.black,):Icon(Icons.keyboard_arrow_down,color: Colors.black), - onExpansionChanged: (value){ - setState(() { - isExpand=value; - }); - }, - children: [ - for(final item in listItem) - Padding( - padding: const EdgeInsets.all(8.0), - child: InkWell( - onTap: (){ - print(Text("Selected Item $item "+this.widget.headerTitle )); - //========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle ))); - }, - child: Container( - width: double.infinity, - decoration:BoxDecoration( - color: Colors.white, - - border: Border(top: BorderSide(color: Theme.of(context).dividerColor)) - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(item,style: TextStyle(color: Colors.black),), - - )), - ), - ) - - - ], - - ), - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/widgets/shared/in_patient_doctor_card.dart b/lib/widgets/shared/in_patient_doctor_card.dart new file mode 100644 index 00000000..483d040c --- /dev/null +++ b/lib/widgets/shared/in_patient_doctor_card.dart @@ -0,0 +1,194 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InPatientDoctorCard extends StatelessWidget { + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final Function? onTap; + final bool isPrescriptions; + final String? clinic; + final createdBy; + + InPatientDoctorCard( + {this.doctorName, + this.branch, + this.profileUrl, + this.invoiceNO, + this.onTap, + this.appointmentDate, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.createdBy}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap!(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: AppText( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (!isPrescriptions) + AppText( + '${AppDateUtils.getHour(appointmentDate ?? DateTime.now())}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + Row( + children: [ + AppText( + 'CreatedBy ', + //bold: true, + ), + Expanded( + child: AppText( + createdBy, + bold: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Container( + // child: LargeAvatar( + // name: doctorName, + // url: profileUrl, + // ), + // width: 55, + // height: 55, + // ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(10), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + // if (orderNo != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderNo + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // orderNo ?? '', + // fontSize: 14, + // ) + // ], + // ), + // if (invoiceNO != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .invoiceNo + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // invoiceNO, + // fontSize: 14, + // ) + // ], + // ), + // if (clinic != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).clinic + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // clinic, + // fontSize: 14, + // ) + // ], + // ), + // if (branch != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).branch + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // branch, + // fontSize: 14, + // ) + // ], + // ) + ]), + ), + ), + Icon( + EvaIcons.eye, + ) + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index b2c2224b..0d7649ee 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -6,17 +6,15 @@ class GifLoaderContainer extends StatefulWidget { _GifLoaderContainerState createState() => _GifLoaderContainerState(); } -class _GifLoaderContainerState extends State - with TickerProviderStateMixin { - GifController controller1; +class _GifLoaderContainerState extends State with TickerProviderStateMixin { + late GifController controller1; @override void initState() { controller1 = GifController(vsync: this); - WidgetsBinding.instance.addPostFrameCallback((_) { - controller1.repeat( - min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + WidgetsBinding.instance!.addPostFrameCallback((_) { + controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); }); super.initState(); } @@ -30,15 +28,14 @@ class _GifLoaderContainerState extends State @override Widget build(BuildContext context) { return Center( - //progress-loading.gif + //progress-loading.gif child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifImage( - - controller: controller1, - image: AssetImage( - "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), - ), - )); + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + controller: controller1, + image: AssetImage( + "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 7a1fc3f5..135642b4 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -25,31 +25,29 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; final List masterList; - final String buttonName; - final String hintSearchText; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key key, - this.model, - this.addSelectedAllergy, - this.removeAllergy, - this.masterList, - this.addAllergy, - this.isServiceSelected, + {Key? key, + required this.model, + required this.addSelectedAllergy, + required this.removeAllergy, + required this.masterList, + required this.addAllergy, + required this.isServiceSelected, this.buttonName, this.hintSearchText, - this.getServiceSelectedAllergy}) + required this.getServiceSelectedAllergy}) : super(key: key); @override - _MasterKeyCheckboxSearchAllergiesWidgetState createState() => - _MasterKeyCheckboxSearchAllergiesWidgetState(); + _MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState(); } -class _MasterKeyCheckboxSearchAllergiesWidgetState - extends State { - List items = List(); - MasterKeyModel _selectedAllergySeverity; +class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { + List items = []; + late MasterKeyModel _selectedAllergySeverity; bool isSubmitted = false; @override @@ -69,16 +67,13 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState height: MediaQuery.of(context).size.height * 0.70, child: Center( child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( children: [ AppTextFieldCustom( // height: // MediaQuery.of(context).size.height * 0.070, - hintText: - TranslationBase.of(context).selectAllergy, + hintText: TranslationBase.of(context).selectAllergy, isTextFieldHasSuffix: true, hasBorder: false, // controller: filteredSearchController, @@ -86,10 +81,11 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.search, - color: Colors.black, - )), + Icons.search, + color: Colors.black, + )), ), DividerWithSpacesAround(), SizedBox( @@ -99,134 +95,79 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: FractionallySizedBox( widthFactor: 0.9, child: Container( - height: - MediaQuery.of(context).size.height * 0.60, + height: MediaQuery.of(context).size.height * 0.60, child: ListView.builder( itemCount: items.length, itemBuilder: (context, index) { - bool isSelected = widget - .isServiceSelected(items[index]); - MySelectedAllergy mySelectedAllergy; + bool isSelected = widget.isServiceSelected(items[index]); + MySelectedAllergy? mySelectedAllergy; if (isSelected) { - mySelectedAllergy = - widget.getServiceSelectedAllergy( - items[index]); + mySelectedAllergy = widget.getServiceSelectedAllergy(items[index]); } TextEditingController remarkController = - TextEditingController( - text: isSelected - ? mySelectedAllergy.remark - : null); - TextEditingController severityController = - TextEditingController( - text: isSelected - ? mySelectedAllergy - .selectedAllergySeverity != - null - ? projectViewModel - .isArabic - ? mySelectedAllergy - .selectedAllergySeverity - .nameAr - : mySelectedAllergy - .selectedAllergySeverity - .nameEn - : null - : null); + TextEditingController(text: isSelected ? mySelectedAllergy!.remark : null); + TextEditingController severityController = TextEditingController( + text: isSelected + ? mySelectedAllergy!.selectedAllergySeverity != null + ? projectViewModel.isArabic + ? mySelectedAllergy.selectedAllergySeverity!.nameAr + : mySelectedAllergy.selectedAllergySeverity!.nameEn + : null + : null); return HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ Checkbox( - value: widget - .isServiceSelected( - items[index]), - activeColor: - Colors.red[800], - onChanged: (bool newValue) { + value: widget.isServiceSelected(items[index]), + activeColor: Colors.red[800], + onChanged: (bool? newValue) { setState(() { - if (widget - .isServiceSelected( - items[index])) { - widget.removeAllergy( - items[index]); + if (widget.isServiceSelected(items[index])) { + widget.removeAllergy(items[index]); } else { - MySelectedAllergy - mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[ - index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: - true, - isExpanded: - true); - widget.addAllergy( - mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + selectedAllergy: items[index], + selectedAllergySeverity: _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy(mySelectedAllergy); } }); }), InkWell( onTap: () { setState(() { - if (widget - .isServiceSelected( - items[index])) { - widget.removeAllergy( - items[index]); + if (widget.isServiceSelected(items[index])) { + widget.removeAllergy(items[index]); } else { - - MySelectedAllergy mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: - items[ - index], - selectedAllergySeverity: - _selectedAllergySeverity, - remark: null, - isChecked: true, - isExpanded: - true); - widget.addAllergy( - mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + selectedAllergy: items[index], + selectedAllergySeverity: _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy(mySelectedAllergy); } }); }, child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: Container( child: AppText( - projectViewModel - .isArabic - ? items[index] - .nameAr != - "" - ? items[index] - .nameAr - : items[index] - .nameEn - : items[index] - .nameEn, - color: - Color(0xFF575757), + projectViewModel.isArabic + ? items[index].nameAr != "" + ? items[index].nameAr + : items[index].nameEn + : items[index].nameEn, + color: Color(0xFF575757), fontSize: 16, - fontWeight: - FontWeight.w600, + fontWeight: FontWeight.w600, ), - width: - MediaQuery.of(context) - .size - .width * - 0.55, + width: MediaQuery.of(context).size.width * 0.55, ), ), ), @@ -234,27 +175,20 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ), InkWell( onTap: () { - if (mySelectedAllergy != - null) { + if (mySelectedAllergy != null) { setState(() { - mySelectedAllergy - .isExpanded = - mySelectedAllergy - .isExpanded - ? false - : true; + if (mySelectedAllergy!.isExpanded!) { + mySelectedAllergy.isExpanded = false; + } else { + mySelectedAllergy.isExpanded = true; + } }); } }, - child: Icon((mySelectedAllergy != - null - ? mySelectedAllergy - .isExpanded - : false) - ? EvaIcons - .arrowIosUpwardOutline - : EvaIcons - .arrowIosDownwardOutline)) + child: Icon( + (mySelectedAllergy != null ? mySelectedAllergy.isExpanded! : false) + ? EvaIcons.arrowIosUpwardOutline + : EvaIcons.arrowIosDownwardOutline)) ], ), bodyWidget: Center( @@ -264,104 +198,69 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Column( children: [ AppTextFieldCustom( - onClick: widget.model - .allergySeverityList != - null + onClick: widget.model.allergySeverityList != null ? () { - MasterKeyDailog - dialog = - MasterKeyDailog( - list: widget.model - .allergySeverityList, - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { + MasterKeyDailog dialog = MasterKeyDailog( + list: widget.model.allergySeverityList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { setState(() { - mySelectedAllergy - .selectedAllergySeverity = + mySelectedAllergy!.selectedAllergySeverity = selectedValue; }); }, ); showDialog( - barrierDismissible: - false, + barrierDismissible: false, context: context, - builder: - (BuildContext - context) { + builder: (BuildContext context) { return dialog; }, ); } : null, isTextFieldHasSuffix: true, - hintText: - TranslationBase.of( - context) - .selectSeverity, + hintText: TranslationBase.of(context).selectSeverity, enabled: false, maxLines: 2, minLines: 2, - controller: - severityController, + controller: severityController, ), SizedBox( height: 5, ), if (isSubmitted && - mySelectedAllergy != - null && - mySelectedAllergy - .selectedAllergySeverity == - null) + mySelectedAllergy != null && + mySelectedAllergy.selectedAllergySeverity == null) Row( children: [ CustomValidationError(), ], - mainAxisAlignment: - MainAxisAlignment - .start, + mainAxisAlignment: MainAxisAlignment.start, ), SizedBox( height: 10, ), Container( - margin: EdgeInsets.only( - left: 0, - right: 0, - top: 15), + margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: NewTextFields( - hintText: - TranslationBase.of( - context) - .remarks, + hintText: TranslationBase.of(context).remarks ?? "", fontSize: 13.5, // hintColor: Colors.black, - fontWeight: - FontWeight.w600, + fontWeight: FontWeight.w600, maxLines: 25, minLines: 3, - initialValue: isSelected - ? mySelectedAllergy - .remark - : '', + initialValue: isSelected ? mySelectedAllergy!.remark ?? "" : '', // controller: remarkControlle onChanged: (value) { if (isSelected) { - mySelectedAllergy - .remark = value; + mySelectedAllergy!.remark = value; } }, validator: (value) { if (value == null) - return TranslationBase - .of(context) - .emptyMessage; + return TranslationBase.of(context).emptyMessage; else return null; }), @@ -374,9 +273,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState ), ), ), - isExpand: mySelectedAllergy != null - ? mySelectedAllergy.isExpanded - : false, + isExpand: mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false, ); }, ), @@ -396,13 +293,13 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((items) { - if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || - items.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || + items.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(items); } }); diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 3a0a1525..6be27f94 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -17,29 +17,27 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { final Function(MasterKeyModel) addHistory; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; - final String buttonName; - final String hintSearchText; + final String? buttonName; + final String? hintSearchText; MasterKeyCheckboxSearchWidget( - {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isServiceSelected, + {Key? key, + required this.model, + required this.addSelectedHistories, + required this.removeHistory, + required this.masterList, + required this.addHistory, + required this.isServiceSelected, this.buttonName, this.hintSearchText}) : super(key: key); @override - _MasterKeyCheckboxSearchWidgetState createState() => - _MasterKeyCheckboxSearchWidgetState(); + _MasterKeyCheckboxSearchWidgetState createState() => _MasterKeyCheckboxSearchWidgetState(); } -class _MasterKeyCheckboxSearchWidgetState - extends State { - List items = List(); +class _MasterKeyCheckboxSearchWidgetState extends State { + List items = []; @override void initState() { @@ -67,9 +65,7 @@ class _MasterKeyCheckboxSearchWidgetState height: MediaQuery.of(context).size.height * 0.60, child: Center( child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: ListView( children: [ AppTextFieldCustom( @@ -82,10 +78,11 @@ class _MasterKeyCheckboxSearchWidgetState filterSearchResults(value); }, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( - Icons.search, - color: Colors.black, - )), + Icons.search, + color: Colors.black, + )), ), // SizedBox(height: 15,), @@ -109,13 +106,11 @@ class _MasterKeyCheckboxSearchWidgetState child: Row( children: [ Checkbox( - value: widget - .isServiceSelected(historyInfo), + value: widget.isServiceSelected(historyInfo), activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.isServiceSelected( - historyInfo)) { + if (widget.isServiceSelected(historyInfo)) { widget.removeHistory(historyInfo); } else { widget.addHistory(historyInfo); @@ -124,8 +119,7 @@ class _MasterKeyCheckboxSearchWidgetState }), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: AppText( projectViewModel.isArabic ? historyInfo.nameAr != "" @@ -161,13 +155,13 @@ class _MasterKeyCheckboxSearchWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((item) { - if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || - item.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || + item.nameEn!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 32232628..68b6c1cd 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -7,10 +7,10 @@ import 'app_loader_widget.dart'; import 'errors/error_message.dart'; class NetworkBaseView extends StatelessWidget { - final BaseViewModel baseViewModel; - final Widget child; + final BaseViewModel? baseViewModel; + final Widget? child; - NetworkBaseView({Key key, this.baseViewModel, this.child}); + NetworkBaseView({Key? key, this.baseViewModel, this.child}); @override Widget build(BuildContext context) { @@ -21,7 +21,7 @@ class NetworkBaseView extends StatelessWidget { } buildBaseViewWidget() { - switch (baseViewModel.state) { + switch (baseViewModel!.state) { case ViewState.ErrorLocal: case ViewState.Idle: case ViewState.BusyLocal: @@ -31,7 +31,9 @@ class NetworkBaseView extends StatelessWidget { return AppLoaderWidget(); break; case ViewState.Error: - return ErrorMessage(error: baseViewModel.error ,); + return ErrorMessage( + error: baseViewModel!.error, + ); break; } } diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index 3db93f9d..804ffca8 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -10,21 +10,15 @@ import 'package:flutter/material.dart'; *@desc: Profile Image Widget class */ class ProfileImageWidget extends StatelessWidget { - String url; - String name; - String des; - double height; - double width; - Color color; - double fontsize; + String? url; + String? name; + String? des; + double? height; + double? width; + Color? color; + double? fontsize; ProfileImageWidget( - {this.url, - this.name, - this.des, - this.height, - this.width, - this.fontsize, - this.color = Colors.black}); + {this.url, this.name, this.des, this.height, this.width, this.fontsize, this.color = Colors.black}); @override Widget build(BuildContext context) { @@ -32,24 +26,21 @@ class ProfileImageWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - height: height, - width: width, - child:CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius:BorderRadius.circular(50), - - child: Image.network( - url, - fit: BoxFit.fill, - width: 700, + height: height, + width: width, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + url!, + fit: BoxFit.fill, + width: 700, + ), ), - ), - backgroundColor: Colors.transparent, - ) - ), + backgroundColor: Colors.transparent, + )), name == null || des == null ? SizedBox() : SizedBox( @@ -60,18 +51,14 @@ class ProfileImageWidget extends StatelessWidget { : AppText( name, fontWeight: FontWeight.bold, - fontSize: fontsize == null - ? SizeConfig.textMultiplier * 3.5 - : fontsize, + fontSize: fontsize == null ? SizeConfig.textMultiplier * 3.5 : fontsize, color: color, ), des == null ? SizedBox() : AppText( des, - fontSize: fontsize == null - ? SizeConfig.textMultiplier * 2.5 - : fontsize, + fontSize: fontsize == null ? SizeConfig.textMultiplier * 2.5 : fontsize, ) ], ); diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 8364bb79..b63f4e10 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -1,24 +1,24 @@ import 'package:flutter/material.dart'; class RoundedContainer extends StatefulWidget { - final double width; - final double height; - final double raduis; - final Color backgroundColor; - final EdgeInsets margin; - final double elevation; - final bool showBorder; - final Color borderColor; - final double shadowWidth; - final double shadowSpreadRadius; - final double shadowDy; - final bool customCornerRaduis; - final double topLeft; - final double bottomRight; - final double topRight; - final double bottomLeft; - final Widget child; - final double borderWidth; + final double? width; + final double? height; + final double? raduis; + final Color? backgroundColor; + final EdgeInsets? margin; + final double? elevation; + final bool? showBorder; + final Color? borderColor; + final double? shadowWidth; + final double? shadowSpreadRadius; + final double? shadowDy; + final bool? customCornerRaduis; + final double? topLeft; + final double? bottomRight; + final double? topRight; + final double? bottomLeft; + final Widget? child; + final double? borderWidth; RoundedContainer( {@required this.child, @@ -54,34 +54,33 @@ class _RoundedContainerState extends State { decoration: widget.showBorder == true ? BoxDecoration( color: Theme.of(context).primaryColor, - border: Border.all( - color: widget.borderColor, width: widget.borderWidth), - borderRadius: widget.customCornerRaduis + border: Border.all(color: widget.borderColor!, width: widget.borderWidth!), + borderRadius: widget.customCornerRaduis! ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft), - topRight: Radius.circular(widget.topRight), - bottomRight: Radius.circular(widget.bottomRight), - bottomLeft: Radius.circular(widget.bottomLeft)) - : BorderRadius.circular(widget.raduis), + topLeft: Radius.circular(widget.topLeft!), + topRight: Radius.circular(widget.topRight!), + bottomRight: Radius.circular(widget.bottomRight!), + bottomLeft: Radius.circular(widget.bottomLeft!)) + : BorderRadius.circular(widget.raduis!), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(widget.shadowWidth), - spreadRadius: widget.shadowSpreadRadius, + color: Colors.grey.withOpacity(widget.shadowWidth!), + spreadRadius: widget.shadowSpreadRadius!, blurRadius: 5, - offset: Offset(0, widget.shadowDy), // changes position of shadow + offset: Offset(0, widget.shadowDy!), // changes position of shadow ), ]) : null, child: Card( margin: EdgeInsets.all(0), shape: RoundedRectangleBorder( - borderRadius: widget.customCornerRaduis + borderRadius: widget.customCornerRaduis! ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft), - topRight: Radius.circular(widget.topRight), - bottomRight: Radius.circular(widget.bottomRight), - bottomLeft: Radius.circular(widget.bottomLeft)) - : BorderRadius.circular(widget.raduis), + topLeft: Radius.circular(widget.topLeft!), + topRight: Radius.circular(widget.topRight!), + bottomRight: Radius.circular(widget.bottomRight!), + bottomLeft: Radius.circular(widget.bottomLeft!)) + : BorderRadius.circular(widget.raduis!), ), color: widget.backgroundColor, child: widget.child, diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index dad7e2d1..48049274 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -15,7 +15,7 @@ class SpeechToText { static var dialog; static stt.SpeechToText speech = stt.SpeechToText(); SpeechToText({ - @required this.context, + required this.context, }); showAlertDialog(BuildContext context) { @@ -44,7 +44,7 @@ typedef Disposer = void Function(); class MyStatefulBuilder extends StatefulWidget { const MyStatefulBuilder({ // @required this.builder, - @required this.dispose, + required this.dispose, }); //final StatefulWidgetBuilder builder; @@ -57,15 +57,12 @@ class MyStatefulBuilder extends StatefulWidget { class _MyStatefulBuilderState extends State { var event = RobotProvider(); var searchText; - static StreamSubscription streamSubscription; + static StreamSubscription? streamSubscription; static var isClosed = false; @override void initState() { streamSubscription = event.controller.stream.listen((p) { - if ((p['searchText'] != 'null' && - p['searchText'] != null && - p['searchText'] != "" && - isClosed == false) && + if ((p['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && isClosed == false) && mounted) { setState(() { searchText = p['searchText']; @@ -104,8 +101,7 @@ class _MyStatefulBuilderState extends State { margin: EdgeInsets.all(20), padding: EdgeInsets.all(10), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - border: Border.all(width: 2, color: Colors.red)), + borderRadius: BorderRadius.circular(100), border: Border.all(width: 2, color: Colors.red)), child: Icon( Icons.mic, color: Colors.blue, @@ -134,8 +130,7 @@ class _MyStatefulBuilderState extends State { ? Center( child: InkWell( child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.grey[300])), + decoration: BoxDecoration(border: Border.all(color: Colors.grey[300]!)), padding: EdgeInsets.all(5), child: AppText( 'Try Again', diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/text_fields/TextFields.dart similarity index 52% rename from lib/widgets/shared/TextFields.dart rename to lib/widgets/shared/text_fields/TextFields.dart index 18d8e778..26c2125b 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/text_fields/TextFields.dart @@ -4,8 +4,7 @@ import 'package:flutter/services.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -39,87 +37,90 @@ class NumberTextInputFormatter extends TextInputFormatter { final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { - TextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction = TextInputAction.done, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.fillColor, - this.hintColor, - this.hasBorder = true, - this.onTapTextFields, - this.hasLabelText = false, - this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) - : super(key: key); + TextFields({ + Key? key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction = TextInputAction.done, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.fillColor, + this.hintColor, + this.hasBorder = true, + this.onTapTextFields, + this.hasLabelText = false, + this.showLabelText = false, + this.borderRadius = 8.0, + this.borderColor, + this.borderWidth = 1, + }) : super(key: key); - final String hintText; - final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final Function onTapTextFields; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final Color fillColor; - final bool hasBorder; - final bool showLabelText; - Color borderColor; - final double borderRadius; - final double borderWidth; - bool hasLabelText; + final String? hintText; + final String? initialValue; + final String? type; + final bool? autoFocus; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final GestureTapCallback? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final FormFieldSetter? onSaved; + final GestureTapCallback? onSuffixTap; + final Function? onChanged; + final ValueChanged? onSubmit; + final bool? readOnly; + final int? maxLength; + final int? minLines; + final int? maxLines; + final bool? maxLengthEnforced; + final bool? bare; + final TextInputAction? inputAction; + final double? fontSize; + final FontWeight? fontWeight; + final bool? keepPadding; + final TextCapitalization? textCapitalization; + final List? inputFormatters; + final bool? autoValidate; + final EdgeInsets? padding; + final bool? focus; + final bool? borderOnlyError; + final Color? hintColor; + final Color? fillColor; + final bool? hasBorder; + final bool? showLabelText; + Color? borderColor; + final double? borderRadius; + final double? borderWidth; + bool? hasLabelText; @override _TextFieldsState createState() => _TextFieldsState(); @@ -142,7 +143,7 @@ class _TextFieldsState extends State { @override void didUpdateWidget(TextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); + if (widget.focus!) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -152,7 +153,7 @@ class _TextFieldsState extends State { super.dispose(); } - Widget _buildSuffixIcon() { + Widget? _buildSuffixIcon() { switch (widget.type) { case "password": { @@ -165,35 +166,30 @@ class _TextFieldsState extends State { view = false; }); }, - child: Icon(EvaIcons.eye, - size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) + child: Icon(EvaIcons.eye, size: 24.0, color: Color?.fromRGBO(78, 62, 253, 1.0))) : InkWell( onTap: () { this.setState(() { view = true; }); }, - child: Icon(EvaIcons.eyeOff, - size: 24.0, color: Colors.grey[500]))); + child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500]))); } break; default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap, + onTap: widget.onSuffixTap!, child: Icon(widget.suffixIcon, - size: 22.0, - color: widget.suffixIconColor != null - ? widget.suffixIconColor - : Colors.grey[500])); + size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else return null; } } - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { + bool? _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly!) { _focusNode.unfocus(); return true; } else { @@ -203,19 +199,18 @@ class _TextFieldsState extends State { @override Widget build(BuildContext context) { - - widget.borderColor = widget.borderColor?? Colors.grey; + widget.borderColor = widget.borderColor ?? Colors.grey; return (AnimatedContainer( duration: Duration(milliseconds: 300), - decoration: widget.bare + decoration: widget.bare! ? null : BoxDecoration(boxShadow: [ // BoxShadow( - // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), + // color: Color?.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // offset: Offset(0.0, 13.0), // blurRadius: focus ? 34.0 : 12.0) BoxShadow( - color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), + color: Color?.fromRGBO(110, 68, 80, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0) ]), @@ -225,10 +220,10 @@ class _TextFieldsState extends State { onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null + autovalidate: widget.autoValidate!, + textCapitalization: widget.textCapitalization!, + onFieldSubmitted: widget.inputAction! == TextInputAction.next + ? (widget.onSubmit! != null ? widget.onSubmit : (val) { _focusNode.nextFocus(); @@ -237,10 +232,10 @@ class _TextFieldsState extends State { textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, + maxLengthEnforced: widget.maxLengthEnforced!, initialValue: widget.initialValue, onChanged: (value) { - if (widget.showLabelText) { + if (widget.showLabelText!) { if ((value == null || value == '')) { setState(() { widget.hasLabelText = false; @@ -251,19 +246,21 @@ class _TextFieldsState extends State { }); } } - if (widget.onChanged != null) widget.onChanged(value); + if (widget.onChanged != null) widget.onChanged!(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), + readOnly: _determineReadOnly()!, obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context) + .textTheme + .bodyText1! + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -271,7 +268,7 @@ class _TextFieldsState extends State { ] : widget.inputFormatters, decoration: InputDecoration( - labelText: widget.hasLabelText ? widget.hintText : null, + labelText: widget.hasLabelText! ? widget.hintText : null, labelStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, @@ -281,68 +278,54 @@ class _TextFieldsState extends State { hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, - fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric( - vertical: - (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, - horizontal: 16.0), + vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0, horizontal: 16.0), filled: true, - fillColor: widget.bare - ? Colors.transparent - : Theme.of(context).backgroundColor, + fillColor: widget.bare! ? Colors.transparent : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, errorStyle: TextStyle( - fontSize: 12.0, - fontWeight: widget.fontWeight, - height: widget.borderOnlyError ? 0.0 : null), + fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError! ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) + borderSide: widget.hasBorder! + ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder + borderSide: widget.hasBorder! ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) + color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), + borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + borderSide: widget.hasBorder! + ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + borderRadius: widget.hasBorder! + ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) : BorderRadius.circular(0.0), ), ), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index fc7df189..8e8e24ca 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -9,24 +9,24 @@ import 'package:provider/provider.dart'; import '../app_texts_widget.dart'; class AppTextFieldCustom extends StatefulWidget { - final double height; - final Function onClick; - final String hintText; - final TextEditingController controller; - final bool isTextFieldHasSuffix; - final bool hasBorder; - final String dropDownText; - final IconButton suffixIcon; - final Color dropDownColor; - final bool enabled; - final TextInputType inputType; - final int minLines; - final int maxLines; - final List inputFormatters; - final Function(String) onChanged; - final String validationError; - final bool isPrscription; - final bool isSecure; + final double? height; + final GestureTapCallback? onClick; + final String? hintText; + final TextEditingController? controller; + final bool? isTextFieldHasSuffix; + final bool? hasBorder; + final String? dropDownText; + final IconButton? suffixIcon; + final Color? dropDownColor; + final bool? enabled; + final TextInputType? inputType; + final int? minLines; + final int? maxLines; + final List? inputFormatters; + final Function(String)? onChanged; + final String? validationError; + final bool? isPrscription; + final bool? isSecure; AppTextFieldCustom({ this.height = 0, @@ -61,18 +61,12 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 - ? widget.height + 8 - : null, - decoration: widget.hasBorder + height: widget.height != 0 && widget.maxLines == 1 ? widget.height! + 8 : null, + decoration: widget.hasBorder! ? TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), - widget.validationError == null - ? Color(0xFFEFEFEF) - : Colors.red.shade700) + Color(0Xffffffff), widget.validationError == null ? Color(0xFFEFEFEF) : Colors.red.shade700) : null, - padding: - EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), child: InkWell( onTap: widget.onClick ?? null, child: Row( @@ -87,30 +81,19 @@ class _AppTextFieldCustomState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - if ((widget.controller != null && - widget.controller.text != "") || - widget.dropDownText != null) + if ((widget.controller != null && widget.controller!.text != "") || widget.dropDownText != null) AppText( widget.hintText, color: Color(0xFF2E303A), - fontSize: widget.isPrscription == false - ? SizeConfig.textMultiplier * 1.3 - : 0, + fontSize: widget.isPrscription == false ? SizeConfig.textMultiplier * 1.3 : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null ? Container( - height: - widget.height != 0 && widget.maxLines == 1 - ? widget.height - 22 - : null, + height: widget.height != 0 && widget.maxLines == 1 ? widget.height! - 22 : null, child: TextField( - textAlign: projectViewModel.isArabic - ? TextAlign.right - : TextAlign.left, - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - widget.hintText, null, true), + textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, + decoration: TextFieldsUtils.textFieldSelectorDecoration(widget.hintText!, "", true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, fontFamily: 'Poppins', @@ -118,23 +101,18 @@ class _AppTextFieldCustomState extends State { ), controller: widget.controller, keyboardType: widget.inputType ?? - (widget.maxLines == 1 - ? TextInputType.text - : TextInputType.multiline), + (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: - widget.inputFormatters != null - ? widget.inputFormatters - : [], + inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [], onChanged: (value) { setState(() {}); if (widget.onChanged != null) { - widget.onChanged(value); + widget.onChanged!(value); } }, - obscureText: widget.isSecure), + obscureText: widget.isSecure!), ) : AppText( widget.dropDownText, @@ -146,15 +124,13 @@ class _AppTextFieldCustomState extends State { ), ), ), - widget.isTextFieldHasSuffix + widget.isTextFieldHasSuffix! ? widget.suffixIcon != null - ? widget.suffixIcon + ? widget.suffixIcon! : InkWell( child: Icon( Icons.keyboard_arrow_down, - color: widget.dropDownColor != null - ? widget.dropDownColor - : Colors.black, + color: widget.dropDownColor != null ? widget.dropDownColor : Colors.black, ), ) : Container(), @@ -162,8 +138,7 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null) - TextFieldsError(error: widget.validationError), + if (widget.validationError != null) TextFieldsError(error: widget.validationError!), ], ); } diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index cf5f0abf..1418b590 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; class AppTextFormField extends FormField { AppTextFormField( - {FormFieldSetter onSaved, - String inputFormatter, - FormFieldValidator validator, - ValueChanged onChanged, - GestureTapCallback onTap, + {FormFieldSetter? onSaved, + String? inputFormatter, + FormFieldValidator? validator, + ValueChanged? onChanged, + GestureTapCallback? onTap, bool obscureText = false, - TextEditingController controller, + TextEditingController? controller, bool autovalidate = true, - TextInputType textInputType, - String hintText, - FocusNode focusNode, - TextInputAction textInputAction=TextInputAction.done, - ValueChanged onFieldSubmitted, - IconButton prefix, - String labelText, - IconData suffixIcon, + TextInputType? textInputType, + String? hintText, + FocusNode? focusNode, + TextInputAction textInputAction = TextInputAction.done, + ValueChanged? onFieldSubmitted, + IconButton? prefix, + String? labelText, + IconData? suffixIcon, bool readOnly = false, borderColor}) : super( @@ -55,24 +55,17 @@ class AppTextFormField extends FormField { hintStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.8, ), - contentPadding: - EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), labelText: labelText, labelStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(6)), - borderSide: BorderSide( - color: borderColor != null - ? borderColor - : HexColor("#CCCCCC")), + borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), ), focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: borderColor != null - ? borderColor - : HexColor("#CCCCCC")), + borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), borderRadius: BorderRadius.all(Radius.circular(6)), ) //BorderRadius.all(Radius.circular(20)); @@ -83,7 +76,7 @@ class AppTextFormField extends FormField { ), state.hasError ? Text( - state.errorText, + state.errorText ?? "", style: TextStyle(color: Colors.red), ) : Container() diff --git a/lib/widgets/shared/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/text_fields/auto_complete_text_field.dart index 3b563f3f..d5875d43 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -8,13 +8,11 @@ class CustomAutoCompleteTextField extends StatelessWidget { final Widget child; const CustomAutoCompleteTextField({ - Key key, - this.isShowError, - this.child, + Key? key, + required this.isShowError, + required this.child, }) : super(key: key); - - @override Widget build(BuildContext context) { return Container( @@ -25,13 +23,12 @@ class CustomAutoCompleteTextField extends StatelessWidget { Color(0Xffffffff), isShowError ? Colors.red.shade700 : Color(0xFFEFEFEF), ), - padding: - EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), + padding: EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), child: child, ), if (isShowError) TextFieldsError( - error: TranslationBase.of(context).emptyMessage, + error: TranslationBase.of(context).emptyMessage ?? "", ) ], ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 41cd0573..df174f47 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -13,12 +13,12 @@ import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { final String hint; - final String initialText; + final String? initialText; final double height; - final BoxDecoration decoration; + final BoxDecoration? decoration; final bool darkMode; final bool showBottomToolbar; - final List toolbar; + final List? toolbar; final HtmlEditorController controller; HtmlRichEditor({ @@ -30,7 +30,7 @@ class HtmlRichEditor extends StatefulWidget { this.darkMode = false, this.showBottomToolbar = false, this.toolbar, - @required this.controller, + required this.controller, }) : super(key: key); @override @@ -38,7 +38,7 @@ class HtmlRichEditor extends StatefulWidget { } class _HtmlRichEditorState extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); @@ -87,19 +87,16 @@ class _HtmlRichEditorState extends State { borderRadius: BorderRadius.all( Radius.circular(30.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), )), Positioned( top: 50, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, + right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { initSpeechState().then((value) => {onVoiceText()}); }, @@ -113,8 +110,7 @@ class _HtmlRichEditorState extends State { 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, @@ -158,8 +154,7 @@ class _HtmlRichEditorState extends State { } 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; } diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index 9917b04f..ca5b417c 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -5,8 +5,7 @@ import 'package:hexcolor/hexcolor.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -28,8 +27,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -41,77 +39,88 @@ final _mobileFormatter = NumberTextInputFormatter(); class NewTextFields extends StatefulWidget { NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 15.0, - this.fontWeight = FontWeight.w500, - this.autoValidate = false, - this.hintColor, - this.isEnabled = true}) + {Key? key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 15.0, + this.fontWeight = FontWeight.w500, + this.autoValidate = false, + this.hintColor, + this.isEnabled = true, + this.onTapTextFields, + this.fillColor, + this.hasBorder, + this.showLabelText, + this.borderRadius, + this.borderWidth}) : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; + final String? hintText; + final String? initialValue; + final String? type; + final bool? autoFocus; + final bool? isEnabled; + final IconData? suffixIcon; + final Color? suffixIconColor; + final Icon? prefixIcon; + final VoidCallback? onTap; + final GestureTapCallback? onTapTextFields; + final TextEditingController? controller; + final TextInputType? keyboardType; + final FormFieldValidator? validator; + final FormFieldSetter? onSaved; + final GestureTapCallback? onSuffixTap; + final ValueChanged? onChanged; + final ValueChanged? onSubmit; + final bool? readOnly; + final int? maxLength; + final int? minLines; + final int? maxLines; + final bool? maxLengthEnforced; + final bool? bare; + final TextInputAction? inputAction; + final double? fontSize; + final FontWeight? fontWeight; + final bool? keepPadding; + final TextCapitalization? textCapitalization; + final List? inputFormatters; + final bool? autoValidate; + final EdgeInsets? padding; + final bool? focus; + final bool? borderOnlyError; + final Color? hintColor; + final Color? fillColor; + final bool? hasBorder; + final bool? showLabelText; + Color? borderColor; + final double? borderRadius; + final double? borderWidth; + bool? hasLabelText; @override _NewTextFieldsState createState() => _NewTextFieldsState(); } @@ -133,7 +142,7 @@ class _NewTextFieldsState extends State { @override void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); + if (widget.focus!) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -144,7 +153,7 @@ class _NewTextFieldsState extends State { } bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { + if (widget.readOnly != null && widget.readOnly!) { _focusNode.unfocus(); return true; } else { @@ -158,34 +167,30 @@ class _NewTextFieldsState extends State { duration: Duration(milliseconds: 300), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), color: Colors.white), child: Container( margin: EdgeInsets.only(top: 8), padding: EdgeInsets.only(top: 8), - - child: TextFormField( enabled: widget.isEnabled, initialValue: widget.initialValue, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, + autovalidate: widget.autoValidate!, + textCapitalization: widget.textCapitalization!, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) : widget.onSubmit, textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, + maxLengthEnforced: widget.maxLengthEnforced!, + onChanged: widget.onChanged!, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, @@ -195,34 +200,30 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), + style: Theme.of(context).textTheme.body2!.copyWith( + fontSize: widget.fontSize, + fontWeight: widget.fontWeight, + color: Color(0xFF575757), + fontFamily: 'Poppins'), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] : widget.inputFormatters, decoration: InputDecoration( labelText: widget.hintText, - labelStyle: - TextStyle(color: Color(0xFF2E303A), fontSize:15,fontWeight: FontWeight.w700), + labelStyle: TextStyle(color: Color(0xFF2E303A), fontSize: 15, fontWeight: FontWeight.w700), errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), + borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), + borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12), diff --git a/lib/widgets/shared/text_fields/text_field_error.dart b/lib/widgets/shared/text_fields/text_field_error.dart index 9c781db0..b327388c 100644 --- a/lib/widgets/shared/text_fields/text_field_error.dart +++ b/lib/widgets/shared/text_fields/text_field_error.dart @@ -6,8 +6,8 @@ import '../app_texts_widget.dart'; class TextFieldsError extends StatelessWidget { const TextFieldsError({ - Key key, - @required this.error, + Key? key, + required this.error, }) : super(key: key); final String error; diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 54c7e494..37c4beb2 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -1,9 +1,7 @@ import 'package:flutter/material.dart'; -class TextFieldsUtils{ - - static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, +class TextFieldsUtils { + static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1, double borderRadius = 12}) { return BoxDecoration( color: containerColor, @@ -16,9 +14,8 @@ class TextFieldsUtils{ ); } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {IconData? suffixIcon, Color? dropDownColor}) { return InputDecoration( isDense: true, contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), @@ -47,12 +44,14 @@ class TextFieldsUtils{ borderRadius: BorderRadius.circular(8), ),*/ hintText: selectedText != null ? selectedText : hintText, - suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), - + suffixIcon: Icon( + suffixIcon ?? null, + color: Colors.grey.shade600, + ), hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, ), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart deleted file mode 100644 index 8a4891fd..00000000 --- a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -/// Displays an overlay Widget anchored directly above the center of this -/// [AnchoredOverlay]. -/// -/// The overlay Widget is created by invoking the provided [overlayBuilder]. -/// -/// The [anchor] position is provided to the [overlayBuilder], but the builder -/// does not have to respect it. In other words, the [overlayBuilder] can -/// interpret the meaning of "anchor" however it wants - the overlay will not -/// be forced to be centered about the [anchor]. -/// -/// The overlay built by this [AnchoredOverlay] can be conditionally shown -/// and hidden by settings the [showOverlay] property to true or false. -/// -/// The [overlayBuilder] is invoked every time this Widget is rebuilt. -/// -class AnchoredOverlay extends StatelessWidget { - final bool showOverlay; - final Widget Function(BuildContext, Rect anchorBounds, Offset anchor) - overlayBuilder; - final Widget child; - - AnchoredOverlay({ - key, - this.showOverlay = false, - this.overlayBuilder, - this.child, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - return OverlayBuilder( - showOverlay: showOverlay, - overlayBuilder: (BuildContext overlayContext) { - // To calculate the "anchor" point we grab the render box of - // our parent Container and then we find the center of that box. - RenderBox box = context.findRenderObject() as RenderBox; - final topLeft = - box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - final Rect anchorBounds = Rect.fromLTRB( - topLeft.dx, - topLeft.dy, - bottomRight.dx, - bottomRight.dy, - ); - final anchorCenter = box.size.center(topLeft); - return overlayBuilder(overlayContext, anchorBounds, anchorCenter); - }, - child: child, - ); - }, - ); - } -} - -// -// Displays an overlay Widget as constructed by the given [overlayBuilder]. -// -// The overlay built by the [overlayBuilder] can be conditionally shown and hidden by settings the [showOverlay] -// property to true or false. -// -// The [overlayBuilder] is invoked every time this Widget is rebuilt. -// -// Implementation note: the reason we rebuild the overlay every time our state changes is because there doesn't seem -// to be any better way to invalidate the overlay itself than to invalidate this Widget. -// Remember, overlay Widgets exist in [OverlayEntry]s which are inaccessible to outside Widgets. -// But if a better approach is found then feel free to use it. -// -class OverlayBuilder extends StatefulWidget { - final bool showOverlay; - final Widget Function(BuildContext) overlayBuilder; - final Widget child; - - OverlayBuilder({ - key, - this.showOverlay = false, - this.overlayBuilder, - this.child, - }) : super(key: key); - - @override - _OverlayBuilderState createState() => _OverlayBuilderState(); -} - -class _OverlayBuilderState extends State { - OverlayEntry _overlayEntry; - - @override - void initState() { - super.initState(); - - if (widget.showOverlay) { - WidgetsBinding.instance.addPostFrameCallback((_) => showOverlay()); - } - } - - @override - void didUpdateWidget(OverlayBuilder oldWidget) { - super.didUpdateWidget(oldWidget); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); - } - - @override - void reassemble() { - super.reassemble(); - WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); - } - - @override - void dispose() { - if (isShowingOverlay()) { - hideOverlay(); - } - - super.dispose(); - } - - bool isShowingOverlay() => _overlayEntry != null; - - void showOverlay() { - if (_overlayEntry == null) { - // Create the overlay. - _overlayEntry = OverlayEntry( - builder: widget.overlayBuilder, - ); - addToOverlay(_overlayEntry); - } else { - // Rebuild overlay. - buildOverlay(); - } - } - - void addToOverlay(OverlayEntry overlayEntry) async { - Overlay.of(context).insert(overlayEntry); - final overlay = Overlay.of(context); - if (overlayEntry == null) - WidgetsBinding.instance - .addPostFrameCallback((_) => overlay.insert(overlayEntry)); - } - - void hideOverlay() { - if (_overlayEntry != null) { - _overlayEntry.remove(); - _overlayEntry = null; - } - } - - void syncWidgetAndOverlay() { - if (isShowingOverlay() && !widget.showOverlay) { - hideOverlay(); - } else if (!isShowingOverlay() && widget.showOverlay) { - showOverlay(); - } - } - - void buildOverlay() async { - WidgetsBinding.instance - .addPostFrameCallback((_) => _overlayEntry?.markNeedsBuild()); - } - - @override - Widget build(BuildContext context) { - buildOverlay(); - - return widget.child; - } -} diff --git a/lib/widgets/shared/user-guid/app_get_position.dart b/lib/widgets/shared/user-guid/app_get_position.dart deleted file mode 100644 index c0430994..00000000 --- a/lib/widgets/shared/user-guid/app_get_position.dart +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ -import 'package:flutter/material.dart'; - -class GetPosition { - final GlobalKey key; - - GetPosition({this.key}); - - Rect getRect() { - RenderBox box = key.currentContext.findRenderObject(); - - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - - Rect rect = Rect.fromLTRB( - topLeft.dx, - topLeft.dy, - bottomRight.dx, - bottomRight.dy, - ); - return rect; - } - - ///Get the bottom position of the widget - double getBottom() { - RenderBox box = key.currentContext.findRenderObject(); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dy; - } - - ///Get the top position of the widget - double getTop() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dy; - } - - ///Get the left position of the widget - double getLeft() { - RenderBox box = key.currentContext.findRenderObject(); - final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); - return topLeft.dx; - } - - ///Get the right position of the widget - double getRight() { - RenderBox box = key.currentContext.findRenderObject(); - final bottomRight = - box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); - return bottomRight.dx; - } - - double getHeight() { - return getBottom() - getTop(); - } - - double getWidth() { - return getRight() - getLeft(); - } - - double getCenter() { - return (getLeft() + getRight()) / 2; - } -} diff --git a/lib/widgets/shared/user-guid/app_shape_painter.dart b/lib/widgets/shared/user-guid/app_shape_painter.dart deleted file mode 100644 index 925d18d0..00000000 --- a/lib/widgets/shared/user-guid/app_shape_painter.dart +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -class ShapePainter extends CustomPainter { - Rect rect; - final ShapeBorder shapeBorder; - final Color color; - final double opacity; - - ShapePainter({ - @required this.rect, - this.color, - this.shapeBorder, - this.opacity, - }); - - @override - void paint(Canvas canvas, Size size) { - final paint = Paint(); - paint.color = color.withOpacity(opacity); - RRect outer = - RRect.fromLTRBR(0, 0, size.width, size.height, Radius.circular(0)); - - double radius = shapeBorder == CircleBorder() ? 50 : 3; - - RRect inner = RRect.fromRectAndRadius(rect, Radius.circular(radius)); - canvas.drawDRRect(outer, inner, paint); - } - - @override - bool shouldRepaint(CustomPainter oldDelegate) => false; -} diff --git a/lib/widgets/shared/user-guid/app_showcase.dart b/lib/widgets/shared/user-guid/app_showcase.dart deleted file mode 100644 index 38625279..00000000 --- a/lib/widgets/shared/user-guid/app_showcase.dart +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; - -import 'app_anchored_overlay_widget.dart'; -import 'app_get_position.dart'; -import 'app_shape_painter.dart'; -import 'app_showcase_widget.dart'; -import 'app_tool_tip_widget.dart'; - -class AppShowcase extends StatefulWidget { - final Widget child; - final String title; - final String description; - final ShapeBorder shapeBorder; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final GlobalKey key; - final Color overlayColor; - final double overlayOpacity; - final Widget container; - final Color showcaseBackgroundColor; - final Color textColor; - final bool showArrow; - final double height; - final double width; - final Duration animationDuration; - final VoidCallback onToolTipClick; - final VoidCallback onTargetClick; - final VoidCallback onSkipClick; - final bool disposeOnTap; - final bool disableAnimation; - - const AppShowcase( - {@required this.key, - @required this.child, - this.title, - @required this.description, - this.shapeBorder, - this.overlayColor = Colors.black, - this.overlayOpacity = 0.75, - this.titleTextStyle, - this.descTextStyle, - this.showcaseBackgroundColor = Colors.white, - this.textColor = Colors.black, - this.showArrow = true, - this.onTargetClick, - this.onSkipClick, - this.disposeOnTap, - this.animationDuration = const Duration(milliseconds: 2000), - this.disableAnimation = false}) - : height = null, - width = null, - container = null, - this.onToolTipClick = null, - assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, - "overlay opacity should be >= 0.0 and <= 1.0."), - assert( - onTargetClick == null - ? true - : (disposeOnTap == null ? false : true), - "disposeOnTap is required if you're using onTargetClick"), - assert( - disposeOnTap == null - ? true - : (onTargetClick == null ? false : true), - "onTargetClick is required if you're using disposeOnTap"), - assert(key != null || - child != null || - title != null || - showArrow != null || - description != null || - shapeBorder != null || - overlayColor != null || - titleTextStyle != null || - descTextStyle != null || - showcaseBackgroundColor != null || - textColor != null || - shapeBorder != null || - animationDuration != null); - - const AppShowcase.withWidget( - {this.key, - @required this.child, - @required this.container, - @required this.height, - @required this.width, - this.title, - this.description, - this.shapeBorder, - this.overlayColor = Colors.black, - this.overlayOpacity = 0.75, - this.titleTextStyle, - this.descTextStyle, - this.showcaseBackgroundColor = Colors.white, - this.textColor = Colors.black, - this.onTargetClick, - this.onSkipClick, - this.disposeOnTap, - this.animationDuration = const Duration(milliseconds: 2000), - this.disableAnimation = false}) - : this.showArrow = false, - this.onToolTipClick = null, - assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, - "overlay opacity should be >= 0.0 and <= 1.0."), - assert(key != null || - child != null || - title != null || - description != null || - shapeBorder != null || - overlayColor != null || - titleTextStyle != null || - descTextStyle != null || - showcaseBackgroundColor != null || - textColor != null || - shapeBorder != null || - animationDuration != null); - - @override - _AppShowcaseState createState() => _AppShowcaseState(); -} - -class _AppShowcaseState extends State - with TickerProviderStateMixin { - bool _showShowCase = false; - Animation _slideAnimation; - AnimationController _slideAnimationController; - - GetPosition position; - - @override - void initState() { - super.initState(); - - _slideAnimationController = AnimationController( - duration: widget.animationDuration, - vsync: this, - )..addStatusListener((AnimationStatus status) { - if (status == AnimationStatus.completed) { - _slideAnimationController.reverse(); - } - if (_slideAnimationController.isDismissed) { - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - }); - - _slideAnimation = CurvedAnimation( - parent: _slideAnimationController, - curve: Curves.easeInOut, - ); - - position = GetPosition(key: widget.key); - } - - @override - void dispose() { - _slideAnimationController.dispose(); - super.dispose(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - showOverlay(); - } - - /// - /// show overlay if there is any target widget - /// - void showOverlay() { - GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context); - setState(() { - _showShowCase = activeStep == widget.key; - }); - - if (activeStep == widget.key) { - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - } - - @override - Widget build(BuildContext context) { - Size size = MediaQuery.of(context).size; - return AnchoredOverlay( - overlayBuilder: (BuildContext context, Rect rectBound, Offset offset) => - buildOverlayOnTarget(offset, rectBound.size, rectBound, size), - showOverlay: true, - child: widget.child, - ); - } - - _nextIfAny() { - ShowCaseWidget.of(context).completed(widget.key); - if (!widget.disableAnimation) { - _slideAnimationController.forward(); - } - } - - _getOnTargetTap() { - if (widget.disposeOnTap == true) { - return widget.onTargetClick == null - ? () { - ShowCaseWidget.of(context).dismiss(); - } - : () { - ShowCaseWidget.of(context).dismiss(); - widget.onTargetClick(); - }; - } else { - return widget.onTargetClick ?? _nextIfAny; - } - } - - _getOnTooltipTap() { - if (widget.disposeOnTap == true) { - return widget.onToolTipClick == null - ? () { - ShowCaseWidget.of(context).dismiss(); - } - : () { - ShowCaseWidget.of(context).dismiss(); - widget.onToolTipClick(); - }; - } else { - return widget.onToolTipClick ?? () {}; - } - } - - buildOverlayOnTarget( - Offset offset, - Size size, - Rect rectBound, - Size screenSize, - ) => - Visibility( - visible: _showShowCase, - maintainAnimation: true, - maintainState: true, - child: Stack( - children: [ - GestureDetector( - onTap: _nextIfAny, - child: Container( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, - child: CustomPaint( - painter: ShapePainter( - opacity: widget.overlayOpacity, - rect: position.getRect(), - shapeBorder: widget.shapeBorder, - color: widget.overlayColor), - ), - ), - ), - _TargetWidget( - offset: offset, - size: size, - onTap: _getOnTargetTap(), - shapeBorder: widget.shapeBorder, - ), - AppToolTipWidget( - position: position, - offset: offset, - screenSize: screenSize, - title: widget.title, - description: widget.description, - animationOffset: _slideAnimation, - titleTextStyle: widget.titleTextStyle, - descTextStyle: widget.descTextStyle, - container: widget.container, - tooltipColor: widget.showcaseBackgroundColor, - textColor: widget.textColor, - showArrow: widget.showArrow, - contentHeight: widget.height, - contentWidth: widget.width, - onTooltipTap: _getOnTooltipTap(), - ), - GestureDetector( - child: AppText( - "Skip", - color: Colors.white, - fontSize: 20, - marginRight: 15, - marginLeft: 15, - marginTop: 15, - ), - onTap: widget.onSkipClick) - ], - ), - ); -} - -class _TargetWidget extends StatelessWidget { - final Offset offset; - final Size size; - final Animation widthAnimation; - final VoidCallback onTap; - final ShapeBorder shapeBorder; - - _TargetWidget({ - Key key, - @required this.offset, - this.size, - this.widthAnimation, - this.onTap, - this.shapeBorder, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Positioned( - top: offset.dy, - left: offset.dx, - child: FractionalTranslation( - translation: const Offset(-0.5, -0.5), - child: GestureDetector( - onTap: onTap, - child: Container( - height: size.height + 16, - width: size.width + 16, - decoration: ShapeDecoration( - shape: shapeBorder ?? - RoundedRectangleBorder( - borderRadius: const BorderRadius.all( - Radius.circular(8), - ), - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/app_showcase_widget.dart b/lib/widgets/shared/user-guid/app_showcase_widget.dart deleted file mode 100644 index 07577b3b..00000000 --- a/lib/widgets/shared/user-guid/app_showcase_widget.dart +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:flutter/material.dart'; - -class ShowCaseWidget extends StatefulWidget { - final Builder builder; - final VoidCallback onFinish; - - const ShowCaseWidget({@required this.builder, this.onFinish}); - - static activeTargetWidget(BuildContext context) { - return context - .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>() - .activeWidgetIds; - } - - static ShowCaseWidgetState of(BuildContext context) { - ShowCaseWidgetState state = - context.findAncestorStateOfType(); - if (state != null) { - return context.findAncestorStateOfType(); - } else { - throw Exception('Please provide ShowCaseView context'); - } - } - - @override - ShowCaseWidgetState createState() => ShowCaseWidgetState(); -} - -class ShowCaseWidgetState extends State { - List ids; - int activeWidgetId; - - void startShowCase(List widgetIds) { - setState(() { - this.ids = widgetIds; - activeWidgetId = 0; - }); - } - - void completed(GlobalKey id) { - if (ids != null && ids[activeWidgetId] == id) { - setState(() { - ++activeWidgetId; - - if (activeWidgetId >= ids.length) { - _cleanupAfterSteps(); - if (widget.onFinish != null) { - widget.onFinish(); - } - } - }); - } - } - - void dismiss() { - setState(() { - _cleanupAfterSteps(); - }); - } - - void _cleanupAfterSteps() { - ids = null; - activeWidgetId = null; - } - - @override - Widget build(BuildContext context) { - return _InheritedShowCaseView( - child: widget.builder, - activeWidgetIds: ids?.elementAt(activeWidgetId), - ); - } -} - -class _InheritedShowCaseView extends InheritedWidget { - final GlobalKey activeWidgetIds; - - _InheritedShowCaseView({ - @required this.activeWidgetIds, - @required child, - }) : super(child: child); - - @override - bool updateShouldNotify(_InheritedShowCaseView oldWidget) => - oldWidget.activeWidgetIds != activeWidgetIds; -} diff --git a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart deleted file mode 100644 index 285caa8e..00000000 --- a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright © 2020, Simform Solutions - * All rights reserved. - * https://github.com/simformsolutions/flutter_showcaseview - */ - -/* -Customized By: Ibrahim Albitar - -*/ - -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; - -import 'app_get_position.dart'; - -class AppToolTipWidget extends StatelessWidget { - final GetPosition position; - final Offset offset; - final Size screenSize; - final String title; - final String description; - final Animation animationOffset; - final TextStyle titleTextStyle; - final TextStyle descTextStyle; - final Widget container; - final Color tooltipColor; - final Color textColor; - final bool showArrow; - final double contentHeight; - final double contentWidth; - static bool isArrowUp; - final VoidCallback onTooltipTap; - - AppToolTipWidget({ - this.position, - this.offset, - this.screenSize, - this.title, - this.description, - this.animationOffset, - this.titleTextStyle, - this.descTextStyle, - this.container, - this.tooltipColor, - this.textColor, - this.showArrow, - this.contentHeight, - this.contentWidth, - this.onTooltipTap, - }); - - bool isCloseToTopOrBottom(Offset position) { - double height = 120; - if (contentHeight != null) { - height = contentHeight; - } - return (screenSize.height - position.dy) <= height; - } - - String findPositionForContent(Offset position) { - if (isCloseToTopOrBottom(position)) { - return 'ABOVE'; - } else { - return 'BELOW'; - } - } - - double _getTooltipWidth() { - double titleLength = title == null ? 0 : (title.length * 10.0); - double descriptionLength = (description.length * 7.0); - if (titleLength > descriptionLength) { - return titleLength + 10; - } else { - return descriptionLength + 10; - } - } - - bool _isLeft() { - double screenWidth = screenSize.width / 3; - return !(screenWidth <= position.getCenter()); - } - - bool _isRight() { - double screenWidth = screenSize.width / 3; - return ((screenWidth * 2) <= position.getCenter()); - } - - double _getLeft() { - if (_isLeft()) { - double leftPadding = position.getCenter() - (_getTooltipWidth() * 0.1); - if (leftPadding + _getTooltipWidth() > screenSize.width) { - leftPadding = (screenSize.width - 20) - _getTooltipWidth(); - } - if (leftPadding < 20) { - leftPadding = 14; - } - return leftPadding; - } else if (!(_isRight())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); - } else { - return null; - } - } - - double _getRight() { - if (_isRight()) { - double rightPadding = position.getCenter() + (_getTooltipWidth() / 2); - if (rightPadding + _getTooltipWidth() > screenSize.width) { - rightPadding = 14; - } - return rightPadding; - } else if (!(_isLeft())) { - return position.getCenter() - (_getTooltipWidth() * 0.5); - } else { - return null; - } - } - - double _getSpace() { - double space = position.getCenter() - (contentWidth / 2); - if (space + contentWidth > screenSize.width) { - space = screenSize.width - contentWidth - 8; - } else if (space < (contentWidth / 2)) { - space = 16; - } - return space; - } - - @override - Widget build(BuildContext context) { - final contentOrientation = findPositionForContent(offset); - final contentOffsetMultiplier = contentOrientation == "BELOW" ? 1.0 : -1.0; - isArrowUp = contentOffsetMultiplier == 1.0 ? true : false; - - final contentY = isArrowUp - ? position.getBottom() + (contentOffsetMultiplier * 3) - : position.getTop() + (contentOffsetMultiplier * 3); - - final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); - - double paddingTop = isArrowUp ? 22 : 0; - double paddingBottom = isArrowUp ? 0 : 27; - - if (!showArrow) { - paddingTop = 10; - paddingBottom = 10; - } - - if (container == null) { - return Stack( - children: [ - showArrow ? _getArrow(contentOffsetMultiplier) : Container(), - Positioned( - top: contentY, - left: _getLeft(), - right: _getRight(), - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 10), - end: Offset(0.0, 0.100), - ).animate(animationOffset), - child: Material( - color: Colors.transparent, - child: Container( - padding: - EdgeInsets.only(top: paddingTop, bottom: paddingBottom), - child: ClipRRect( - borderRadius: BorderRadius.circular(8), - child: GestureDetector( - onTap: onTooltipTap, - child: Container( - width: _getTooltipWidth(), - padding: EdgeInsets.symmetric(vertical: 8), - color: tooltipColor, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Column( - crossAxisAlignment: title != null - ? CrossAxisAlignment.start - : CrossAxisAlignment.center, - children: [ - title != null - ? Row( - children: [ - Padding( - padding: - const EdgeInsets.all(8.0), - child: Icon( - DoctorApp.search_patient), - ), - AppText( - title, - color: textColor, - margin: 2, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ) - : Container(), - AppText( - description, - color: textColor, - margin: 8, - ), - ], - ), - ) - ], - ), - ), - ), - ), - ), - ), - ), - ), - ) - ], - ); - } else { - return Stack( - children: [ - Positioned( - left: _getSpace(), - top: contentY - 10, - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 5), - end: Offset(0.0, 0.100), - ).animate(animationOffset), - child: Material( - color: Colors.transparent, - child: GestureDetector( - onTap: onTooltipTap, - child: Container( - padding: EdgeInsets.only( - top: paddingTop, - ), - color: Colors.transparent, - child: Center( - child: container, - ), - ), - ), - ), - ), - ), - ), - ], - ); - } - } - - Widget _getArrow(contentOffsetMultiplier) { - final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); - return Positioned( - top: isArrowUp ? position.getBottom() : position.getTop() - 1, - left: position.getCenter() - 24, - child: FractionalTranslation( - translation: Offset(0.0, contentFractionalOffset), - child: SlideTransition( - position: Tween( - begin: Offset(0.0, contentFractionalOffset / 5), - end: Offset(0.0, 0.150), - ).animate(animationOffset), - child: isArrowUp - ? Icon( - Icons.arrow_drop_up, - color: tooltipColor, - size: 50, - ) - : Icon( - Icons.arrow_drop_down, - color: tooltipColor, - size: 50, - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/custom_validation_error.dart b/lib/widgets/shared/user-guid/custom_validation_error.dart index a05d52a2..bbdb1f1a 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -1,21 +1,18 @@ - 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'; // ignore: must_be_immutable class CustomValidationError extends StatelessWidget { - String error; + String? error; CustomValidationError({ - Key key, this.error, + Key? key, + this.error, }) : super(key: key); @override Widget build(BuildContext context) { - if(error == null ) - error = TranslationBase - .of(context) - .emptyMessage; + if (error == null) error = TranslationBase.of(context).emptyMessage; return Column( children: [ SizedBox( @@ -23,11 +20,13 @@ class CustomValidationError extends StatelessWidget { ), Container( margin: EdgeInsets.symmetric(horizontal: 3), - child: AppText(error, color: Theme - .of(context) - .errorColor, fontSize: 14,), + child: AppText( + error, + color: Theme.of(context).errorColor, + fontSize: 14, + ), ), ], ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart deleted file mode 100644 index 9197a4a1..00000000 --- a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart +++ /dev/null @@ -1,196 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class InPatientDoctorCard extends StatelessWidget { - final String doctorName; - final String branch; - final DateTime appointmentDate; - final String profileUrl; - final String invoiceNO; - final String orderNo; - final Function onTap; - final bool isPrescriptions; - final String clinic; - final createdBy; - - InPatientDoctorCard( - {this.doctorName, - this.branch, - this.profileUrl, - this.invoiceNO, - this.onTap, - this.appointmentDate, - this.orderNo, - this.isPrescriptions = false, - this.clinic, - this.createdBy}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), - ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: InkWell( - onTap: onTap, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: AppText( - doctorName, - bold: true, - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - if (!isPrescriptions) - AppText( - '${AppDateUtils.getHour(appointmentDate)}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], - fontSize: 14, - ), - ], - ), - ), - ], - ), - Row( - children: [ - AppText( - 'CreatedBy ', - //bold: true, - ), - Expanded( - child: AppText( - createdBy, - bold: true, - ), - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // Container( - // child: LargeAvatar( - // name: doctorName, - // url: profileUrl, - // ), - // width: 55, - // height: 55, - // ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // if (orderNo != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderNo + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // orderNo ?? '', - // fontSize: 14, - // ) - // ], - // ), - // if (invoiceNO != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .invoiceNo + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // invoiceNO, - // fontSize: 14, - // ) - // ], - // ), - // if (clinic != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).clinic + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // clinic, - // fontSize: 14, - // ) - // ], - // ), - // if (branch != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).branch + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // branch, - // fontSize: 14, - // ) - // ], - // ) - ]), - ), - ), - Icon( - EvaIcons.eye, - ) - ], - ), - ), - ], - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 97a37ce1..01c40cff 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -4,29 +4,25 @@ import 'package:flutter/material.dart'; /// [page] class FadePage extends PageRouteBuilder { final Widget page; - FadePage({this.page}) - : super( - opaque: false, - fullscreenDialog: true, - barrierDismissible: true, - barrierColor: Colors.black.withOpacity(0.8), - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page, - transitionDuration: Duration(milliseconds: 300), - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) { - return FadeTransition( - opacity: animation, - child: child - ); - } - ); -} \ No newline at end of file + FadePage({required this.page}) + : super( + opaque: false, + fullscreenDialog: true, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.8), + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionDuration: Duration(milliseconds: 300), + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return FadeTransition(opacity: animation, child: child); + }); +} diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index 2c138b9e..49e2e0de 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -10,8 +10,7 @@ class SlideUpPageRoute extends PageRouteBuilder { final bool fullscreenDialog; final bool opaque; - SlideUpPageRoute( - {this.widget, this.fullscreenDialog = false, this.opaque = true}) + SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true}) : super( pageBuilder: ( BuildContext context, @@ -25,19 +24,15 @@ class SlideUpPageRoute extends PageRouteBuilder { barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierDismissible: true, transitionDuration: Duration(milliseconds: 800), - transitionsBuilder: ((BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child) { + transitionsBuilder: + ((BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { var begin = Offset(0.0, 1.0); var end = Offset.zero; var curve = Curves.easeInOutQuint; - var tween = - Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); + var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); - return SlideTransition( - position: animation.drive(tween), child: child); + return SlideTransition(position: animation.drive(tween), child: child); }), ); } diff --git a/pubspec.lock b/pubspec.lock index 2ff9dca7..fc0e350b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -345,7 +345,7 @@ packages: source: hosted version: "6.1.1" file_picker: - dependency: transitive + dependency: "direct main" description: name: file_picker url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index ce9d34be..0953574e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -85,6 +85,7 @@ dependencies: # Flutter Html View flutter_html: ^2.1.0 sticky_headers: ^0.2.0 + file_picker: ^3.0.2+2 #speech to text speech_to_text: From ea2a635925dc976091a72cb9b9e70e5dc5147268 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 13 Jun 2021 12:48:30 +0300 Subject: [PATCH 035/199] hot fix --- lib/client/base_app_client.dart | 28 ++++++++++--------- lib/core/viewModel/project_view_model.dart | 2 +- lib/widgets/shared/app_loader_widget.dart | 1 - pubspec.lock | 31 +++++++++------------- pubspec.yaml | 2 +- 5 files changed, 29 insertions(+), 35 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e2de1f86..5d55c03e 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -33,20 +33,22 @@ class BaseAppClient { try { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; - if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; - if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; - } + DoctorProfileModel ? doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile!=null) { + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile.doctorID; + if (body['DoctorID'] == "") body['DoctorID'] = null; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; + } - if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; - if (body['DoctorID'] == '') { - body['DoctorID'] = null; - } - if (body['EditedBy'] == '') { - body.remove("EditedBy"); + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; + if (body['DoctorID'] == '') { + body['DoctorID'] = null; + } + if (body['EditedBy'] == '') { + body.remove("EditedBy"); + } } if (body['TokenID'] == null) { body['TokenID'] = token ?? ''; diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index e8e5a4fe..75eecbc6 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,7 +17,7 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - late Locale _appLocale; + late Locale _appLocale = Locale(currentLanguage ); String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 789f1cd2..40f87654 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; diff --git a/pubspec.lock b/pubspec.lock index fc0e350b..859b1ad7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -126,7 +126,7 @@ packages: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "5.1.0" built_value: dependency: transitive description: @@ -175,7 +175,7 @@ packages: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.2" chewie_audio: dependency: transitive description: @@ -301,7 +301,7 @@ packages: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.6.1" + version: "0.6.2" equatable: dependency: transitive description: @@ -357,7 +357,7 @@ packages: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.3.0" firebase_core_platform_interface: dependency: transitive description: @@ -378,21 +378,21 @@ packages: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "10.0.1" + version: "10.0.2" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" fixnum: dependency: transitive description: @@ -545,7 +545,7 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "9.0.0" + version: "9.1.0" frontend_server_client: dependency: transitive description: @@ -797,14 +797,14 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.0.1" + version: "8.1.0" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.5.1" + version: "3.6.0" petitparser: dependency: transitive description: @@ -847,13 +847,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.1" - progress_hud_v2: - dependency: "direct main" - description: - name: progress_hud_v2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" protobuf: dependency: transitive description: @@ -1110,7 +1103,7 @@ packages: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.6" video_player_platform_interface: dependency: transitive description: @@ -1194,7 +1187,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.5" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0953574e..bc205213 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: flutter_flexible_toast: ^0.1.4 local_auth: ^1.1.6 http_interceptor: ^0.4.1 - progress_hud_v2: ^2.0.0 + connectivity: ^3.0.6 maps_launcher: ^2.0.0 url_launcher: ^6.0.6 From 07857b28cd9efec18e228fb58bcb4d583f3a7dfd Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 11:22:12 +0300 Subject: [PATCH 036/199] 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 037/199] 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 038/199] 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 148657e06bd04e01d3f5ab309fcf8de71599e858 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Jun 2021 15:23:37 +0300 Subject: [PATCH 039/199] 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 bb20b4d582f0c65f5960d93df4954c5877a4e2a9 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 16 Jun 2021 11:46:24 +0300 Subject: [PATCH 040/199] flutter 2 migration --- lib/client/base_app_client.dart | 7 +++-- ...on_code_for_doctor_app_response_model.dart | 28 ++++++------------- .../viewModel/authentication_view_model.dart | 14 +++++----- .../auth/verification_methods_screen.dart | 6 ++-- lib/screens/home/home_page_card.dart | 4 +-- lib/screens/home/home_patient_card.dart | 2 +- .../out_patient/out_patient_screen.dart | 6 ++-- .../prescription/add_prescription_form.dart | 24 ++++++++-------- .../procedures/ExpansionProcedure.dart | 22 +++++++-------- lib/screens/procedures/ProcedureCard.dart | 4 +-- lib/widgets/patients/PatientCard.dart | 4 +-- 11 files changed, 55 insertions(+), 66 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 5d55c03e..bba61c2a 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -31,10 +31,11 @@ class BaseAppClient { bool callLog = true; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - DoctorProfileModel ? doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile!=null) { + DoctorProfileModel? doctorProfile; + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index 0d9e5149..0ae3008e 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -3,16 +3,13 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { late String? authenticationTokenID; late List? listDoctorsClinic; - late List? listDoctorProfile; + List? listDoctorProfile; late MemberInformation? memberInformation; CheckActivationCodeForDoctorAppResponseModel( - {this.authenticationTokenID, - this.listDoctorsClinic, - this.memberInformation}); + {this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation}); - CheckActivationCodeForDoctorAppResponseModel.fromJson( - Map json) { + CheckActivationCodeForDoctorAppResponseModel.fromJson(Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { listDoctorsClinic = []; @@ -28,22 +25,19 @@ class CheckActivationCodeForDoctorAppResponseModel { }); } - memberInformation = json['memberInformation'] != null - ? new MemberInformation.fromJson(json['memberInformation']) - : null; + memberInformation = + json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null; } Map toJson() { final Map data = new Map(); data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { - data['List_DoctorsClinic'] = - this.listDoctorsClinic!.map((v) => v.toJson()).toList(); + data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { - data['List_DoctorProfile'] = - this.listDoctorProfile!.map((v) => v.toJson()).toList(); + data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { data['memberInformation'] = this.memberInformation!.toJson(); @@ -60,13 +54,7 @@ class ListDoctorsClinic { late bool? isActive; late String? clinicName; - ListDoctorsClinic( - {this.setupID, - this.projectID, - this.doctorID, - this.clinicID, - this.isActive, - this.clinicName}); + ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ListDoctorsClinic.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index bf7a20ec..a6692563 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -56,8 +56,8 @@ class AuthenticationViewModel extends BaseViewModel { CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; - late NewLoginInformationModel loggedUser; - late GetIMEIDetailsModel? user; + NewLoginInformationModel? loggedUser; + GetIMEIDetailsModel? user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); @@ -165,9 +165,9 @@ class AuthenticationViewModel extends BaseViewModel { int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation![0].memberID, - zipCode: loggedUser.zipCode, - mobileNumber: loggedUser.mobileNumber, + memberID: loggedUser!.listMemberInformation![0].memberID, + zipCode: loggedUser!.zipCode, + mobileNumber: loggedUser!.mobileNumber, otpSendType: authMethodType.getTypeIdService().toString(), password: password); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); @@ -182,8 +182,8 @@ class AuthenticationViewModel extends BaseViewModel { Future checkActivationCodeForDoctorApp({required String activationCode}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser.zipCode : user!.zipCode, - mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user!.mobile, + zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, + mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), activationCode: activationCode ?? '0000', diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 94404bc1..03d6a6e6 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -47,7 +47,7 @@ class _VerificationMethodsScreenState extends State { late ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - late AuthMethodTypes fingerPrintBefore; + AuthMethodTypes? fingerPrintBefore; late AuthMethodTypes selectedOption; late AuthenticationViewModel authenticationViewModel; @@ -410,7 +410,7 @@ class _VerificationMethodsScreenState extends State { if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + this.selectedOption = (fingerPrintBefore != null ? fingerPrintBefore : authMethodType)!; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -444,7 +444,7 @@ class _VerificationMethodsScreenState extends State { context, type, authenticationViewModel.loggedUser != null - ? authenticationViewModel.loggedUser.mobileNumber + ? authenticationViewModel.loggedUser!.mobileNumber : authenticationViewModel.user!.mobile, (value) { showDialog( diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 383e7a9e..c4743f3b 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -15,14 +15,14 @@ class HomePageCard extends StatelessWidget { final bool hasBorder; final String? imageName; final Widget child; - final Function onTap; + final GestureTapCallback onTap; final Color color; final double opacity; final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( - onTap: onTap(), + onTap: onTap, child: Container( width: 120, height: MediaQuery.of(context).orientation == Orientation.portrait ? 100 : 200, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 63b998bc..f0bee0cb 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -9,7 +9,7 @@ class HomePatientCard extends StatelessWidget { final Color backgroundIconColor; final String text; final Color textColor; - final Function onTap; + final GestureTapCallback onTap; HomePatientCard({ required this.backgroundColor, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index bb211329..ad4c3fbf 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -68,7 +68,7 @@ class _OutPatientsScreenState extends State { List _times = []; int _activeLocation = 1; - late String patientType; + String? patientType; late String patientTypeTitle; var selectedFilter = 1; late String arrivalType; @@ -252,8 +252,8 @@ class _OutPatientsScreenState extends State { padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, + patientType: "1", + arrivalType: "1", isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 4f15871d..d83ea0ee 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -121,9 +121,9 @@ class _PrescriptionFormWidgetState extends State { bool visbiltySearch = true; final myController = TextEditingController(); - late DateTime selectedDate; - late int strengthChar; - late GetMedicationResponseModel _selectedMedication; + DateTime? selectedDate; + int? strengthChar; + GetMedicationResponseModel? _selectedMedication; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -358,7 +358,7 @@ class _PrescriptionFormWidgetState extends State { visbiltyPrescriptionForm = true; visbiltySearch = false; _selectedMedication = model.allMedicationList[index]; - uom = _selectedMedication.uom; + uom = _selectedMedication!.uom; }, ); }, @@ -417,7 +417,7 @@ class _PrescriptionFormWidgetState extends State { setState(() { strengthChar = value.length; }); - if (strengthChar >= 5) { + if (strengthChar! >= 5) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).only5DigitsAllowedForStrength, ); @@ -483,7 +483,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId!, + itemCode: _selectedMedication!.itemId!, strength: double.parse(strengthController.text)); return; @@ -577,7 +577,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId!, + itemCode: _selectedMedication!.itemId!, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -661,7 +661,7 @@ class _PrescriptionFormWidgetState extends State { units != null && selectedDate != null && strengthController.text != "") { - if (_selectedMedication.isNarcotic == true) { + if (_selectedMedication!.isNarcotic == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context) .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); @@ -922,7 +922,7 @@ class _PrescriptionFormWidgetState extends State { route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: _selectedMedication.itemId.toString(), + drugId: _selectedMedication!.itemId.toString(), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, @@ -958,10 +958,10 @@ class _PrescriptionFormWidgetState extends State { } }); } - if (_selectedMedication.mediSpanGPICode != null) { + if (_selectedMedication!.mediSpanGPICode != null) { prescriptionDetails.add({ - 'DrugId': _selectedMedication.mediSpanGPICode, - 'DrugName': _selectedMedication.description, + 'DrugId': _selectedMedication!.mediSpanGPICode, + 'DrugName': _selectedMedication!.description, 'Dose': strengthController.text, 'DoseType': model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index c1901411..740ae8e6 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -15,10 +15,10 @@ class ExpansionProcedure extends StatefulWidget { final ProcedureViewModel model; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel) selectProcedures; + final Function(ProcedureTempleteDetailsModel)? selectProcedures; - final bool Function(ProcedureTempleteModel) isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; + final bool Function(ProcedureTempleteModel)? isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; final bool isProcedure; final ProcedureTempleteDetailsModel groupProcedures; @@ -28,9 +28,9 @@ class ExpansionProcedure extends StatefulWidget { required this.model, required this.removeFavProcedure, required this.addFavProcedure, - required this.selectProcedures, - required this.isEntityListSelected, - required this.isEntityFavListSelected, + this.selectProcedures, + this.isEntityListSelected, + this.isEntityFavListSelected, this.isProcedure = true, required this.groupProcedures}) : super(key: key); @@ -118,14 +118,14 @@ class _ExpansionProcedureState extends State { onTap: () { if (widget.isProcedure) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { + if (widget.isEntityFavListSelected!(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); } }); } else { - widget.selectProcedures(itemProcedure); + widget.selectProcedures!(itemProcedure); } }, child: Container( @@ -140,11 +140,11 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 11), child: widget.isProcedure ? Checkbox( - value: widget.isEntityFavListSelected(itemProcedure), + value: widget.isEntityFavListSelected!(itemProcedure), activeColor: Color(0xffD02127), onChanged: (bool? newValue) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { + if (widget.isEntityFavListSelected!(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); @@ -156,7 +156,7 @@ class _ExpansionProcedureState extends State { groupValue: widget.groupProcedures, activeColor: Color(0xffD02127), onChanged: (ProcedureTempleteDetailsModel? newValue) { - widget.selectProcedures(newValue!); + widget.selectProcedures!(newValue!); })), Expanded( child: Padding( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index ef9478d5..f110f931 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -12,7 +12,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { - final Function onTap; + final GestureTapCallback onTap; final EntityList entityList; final String? categoryName; final int categoryID; @@ -248,7 +248,7 @@ class ProcedureCard extends StatelessWidget { doctorID == entityList.doctorID) InkWell( child: Icon(DoctorApp.edit), - onTap: onTap(), + onTap: onTap, ) ], ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index e4673741..1ff05222 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; - final Function onTap; + final GestureTapCallback onTap; final String patientType; final String arrivalType; final bool isInpatient; @@ -451,7 +451,7 @@ class PatientCard extends StatelessWidget { : SizedBox() ], ), - onTap: onTap(), + onTap: onTap, )), )); } From 52eef31e2ef9a00a51804ec8ef69f8ab6a8b96a3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 09:26:36 +0300 Subject: [PATCH 041/199] change ios file to make it version 2 works on ios --- ios/Podfile | 91 ----- ios/Podfile.lock | 327 ------------------ ios/Runner.xcodeproj/project.pbxproj | 69 ++++ .../contents.xcworkspacedata | 2 +- 4 files changed, 70 insertions(+), 419 deletions(-) delete mode 100644 ios/Podfile delete mode 100644 ios/Podfile.lock diff --git a/ios/Podfile b/ios/Podfile deleted file mode 100644 index 62207805..00000000 --- a/ios/Podfile +++ /dev/null @@ -1,91 +0,0 @@ -# Uncomment this line to define a global platform for your project - platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; - end - generated_key_values = {} - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) do |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - generated_key_values[podname] = podpath - else - puts "Invalid plugin specification: #{line}" - end - end - generated_key_values -end - -target 'Runner' do - use_frameworks! - use_modular_headers! - - # Flutter Pod - - copied_flutter_dir = File.join(__dir__, 'Flutter') - copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') - copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') - unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) - # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. - # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. - # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. - - generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') - unless File.exist?(generated_xcode_build_settings_path) - raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) - cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end - end - - # Keep pod path relative so it can be checked into Podfile.lock. - pod 'Flutter', :path => 'Flutter' - pod 'OpenTok' - pod 'Alamofire', '~> 5.2' - # Plugin Pods - - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.each do |name, path| - symlink = File.join('.symlinks', 'plugins', name) - File.symlink(path, symlink) - pod name, :path => File.join(symlink, 'ios') - end -end - -# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. -install! 'cocoapods', :disable_input_output_paths => true - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end 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..9efb7e0d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -224,9 +224,78 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/DKImagePickerController/DKImagePickerController.framework", + "${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", + "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", + "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", + "${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework", + "${BUILT_PRODUCTS_DIR}/OrderedSet/OrderedSet.framework", + "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", + "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", + "${BUILT_PRODUCTS_DIR}/Try/Try.framework", + "${BUILT_PRODUCTS_DIR}/barcode_scan_fix/barcode_scan_fix.framework", + "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", + "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", + "${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework", + "${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework", + "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", + "${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework", + "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", + "${BUILT_PRODUCTS_DIR}/imei_plugin/imei_plugin.framework", + "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", + "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", + "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", + "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", + "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", + "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", + "${BUILT_PRODUCTS_DIR}/video_player/video_player.framework", + "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", + "${BUILT_PRODUCTS_DIR}/webview_flutter/webview_flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKImagePickerController.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKPhotoGallery.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OrderedSet.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Try.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan_fix.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/imei_plugin.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16..919434a6 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> From daf125b995331725258f05efb756293e1e7ad2e5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 17 Jun 2021 09:30:09 +0300 Subject: [PATCH 042/199] flutter 2 migration --- .../profile/note/progress_note_screen.dart | 20 +++++++++---------- .../refer-patient-screen-in-patient.dart | 12 +++++------ .../profile/add-order/addNewOrder.dart | 4 ++-- ..._header_with_appointment_card_app_bar.dart | 10 +++++----- .../shared/text_fields/text_fields_utils.dart | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index cb454172..939b6bf3 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -40,8 +40,8 @@ class _ProgressNoteState extends State { late List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel? authenticationViewModel; + ProjectViewModel? projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; @@ -65,8 +65,8 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { - authenticationViewModel = Provider.of(context); - projectViewModel = Provider.of(context); + // authenticationViewModel = Provider.of(context); + // projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; @@ -117,7 +117,7 @@ class _ProgressNoteState extends State { child: CardWithBgWidget( hasBorder: false, bgColor: model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != + authenticationViewModel!.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy ? Color(0xFFCC9B14) : model.patientProgressNoteList[index].status == 4 @@ -131,7 +131,7 @@ class _ProgressNoteState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != + authenticationViewModel!.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy) AppText( TranslationBase.of(context).notePending, @@ -155,7 +155,7 @@ class _ProgressNoteState extends State { ), if (model.patientProgressNoteList[index].status != 2 && model.patientProgressNoteList[index].status != 4 && - authenticationViewModel.doctorProfile!.doctorID == + authenticationViewModel!.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy) Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -350,9 +350,9 @@ class _ProgressNoteState extends State { ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDateTimeFromServerFormat( model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel.isArabic) + isArabic: projectViewModel!.isArabic) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), - isArabic: projectViewModel.isArabic), + isArabic: projectViewModel!.isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), @@ -442,7 +442,7 @@ class _ProgressNoteState extends State { padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - projectViewModel.isArabic + projectViewModel!.isArabic ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" : 'Are you sure you want $actionName this order?', fontSize: 15, 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 dc7da44d..348c611a 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 @@ -41,11 +41,11 @@ class _PatientMakeInPatientReferralScreenState extends State Date: Thu, 17 Jun 2021 12:31:43 +0300 Subject: [PATCH 043/199] fix add sick leave --- .../sick_leave/sickleave_service.dart | 5 ++-- .../viewModel/patient-referral-viewmodel.dart | 2 +- lib/core/viewModel/sick_leave_view_model.dart | 5 ++-- .../AddVerifyMedicalReport.dart | 2 +- .../refer-patient-screen-in-patient.dart | 10 +++---- lib/screens/sick-leave/add-sickleave.dart | 9 ++---- lib/screens/sick-leave/sick_leave.dart | 30 ++++++++++++------- 7 files changed, 34 insertions(+), 29 deletions(-) diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index bbddbde2..0294c3e7 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -61,9 +61,8 @@ class SickLeaveService extends BaseService { return Future.value(response); }, onFailure: (String error, int statusCode) { - DrAppToastMsg.showErrorToast(error); - // hasError = true; - // super.error = error; + hasError = true; + super.error = error; }, body: addSickLeaveRequest.toJson(), ); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 6e67aea3..a55f9732 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -200,7 +200,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: patient.appointmentNo, + admissionNo: patient.appointmentNo, /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index c5a0bc73..60eebe88 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -17,12 +17,13 @@ class SickLeaveViewModel extends BaseViewModel { get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; get postSechedule => _sickLeaveService.postReschedule; get sickleaveResponse => _sickLeaveService.sickLeaveResponse; + Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _sickLeaveService.addSickLeave(addSickLeaveRequest); if (_sickLeaveService.hasError) { error = _sickLeaveService.error!; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 3d9411a0..428ddf4a 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -86,7 +86,7 @@ class _AddVerifyMedicalReportState extends State { if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - model.insertMedicalReport(patient, txtOfMedicalReport); + await model.insertMedicalReport(patient, txtOfMedicalReport); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); 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 348c611a..8b066cbe 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 @@ -476,27 +476,27 @@ class _PatientMakeInPatientReferralScreenState extends State( onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( @@ -246,11 +246,6 @@ class AddSickLeavScreen extends StatelessWidget { } openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse? extendedData}) { - // showModalBottomSheet( - // context: context, - // builder: (context) { - // return new Container( - // child: Navigator.push( context, FadePage( @@ -260,7 +255,7 @@ class AddSickLeavScreen extends StatelessWidget { : patient.appointmentNo, //extendedData.appointmentNo, patientMRN: isExtend == true ? extendedData!.patientMRN : patient.patientMRN, isExtended: isExtend, - extendedData: extendedData!, + extendedData: extendedData??GetAllSickLeaveResponse(), patient: patient))); } } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index f305caf8..a5ced00b 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.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/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; @@ -14,6 +15,7 @@ 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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -29,7 +31,7 @@ class SickLeaveScreen extends StatefulWidget { final patientMRN; final patient; SickLeaveScreen( - {this.appointmentNo, this.patientMRN, this.isExtended = false, required this.extendedData, this.patient}); + {this.appointmentNo, this.patientMRN, this.isExtended = false, required this.extendedData, this.patient}); @override _SickLeaveScreenState createState() => _SickLeaveScreenState(); } @@ -69,7 +71,7 @@ class _SickLeaveScreenState extends State { @override Widget build(BuildContext context) { - return BaseView( + return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( onModelReady: (model2) => model2.preSickLeaveStatistics(widget.appointmentNo, widget.patientMRN), @@ -120,12 +122,12 @@ class _SickLeaveScreenState extends State { borderColor: Colors.white, onChanged: (value) { addSickLeave.noOfDays = value; - if (widget.extendedData != null) { + if (widget.extendedData.noOfDays != null) { widget.extendedData.noOfDays = int.parse(value); } }, hintText: - widget.extendedData != null ? widget.extendedData.noOfDays.toString() : '', + widget.extendedData.noOfDays != null ? widget.extendedData.noOfDays.toString() : '', // validator: (value) { // return TextValidator().validateName(value); // }, @@ -371,13 +373,21 @@ class _SickLeaveScreenState extends State { } else { addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); - await model2.addSickLeave(addSickLeave).then((value) => print(value)); + GifLoaderDialogUtils.showMyDialog(context); + await model2.addSickLeave(addSickLeave); + if(model2.state == ViewState.ErrorLocal){ + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showErrorToast(model2.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast("Sick leave created successfully"); + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; + }); + Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); + } + - DrAppToastMsg.showSuccesToast(model2.sickleaveResponse['ListSickLeavesToExtent']['success']); - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); } } catch (err) { print(err); From e4fb83826acb7227d6da9ee1e4cd617780db4f0d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 15:30:21 +0300 Subject: [PATCH 044/199] fix referral screen in out patient --- .../viewModel/patient-referral-viewmodel.dart | 2 +- lib/models/patient/patiant_info_model.dart | 199 ++++++++++-------- .../referral/refer-patient-screen.dart | 12 +- .../patient-referral-item-widget.dart | 8 +- 4 files changed, 120 insertions(+), 101 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index a55f9732..c1ae248a 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -200,7 +200,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: patient.appointmentNo, /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null + admissionNo: int.parse(patient.admissionNo!), /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null 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 16377e7a..06936a59 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,7 +1,7 @@ // TODO : it have to be changed. class PatiantInformtion { - final PatiantInformtion? patientDetails; + PatiantInformtion? patientDetails; int? genderInt; dynamic age; String? appointmentDate; @@ -75,7 +75,8 @@ class PatiantInformtion { int? vcId; String? voipToken; - PatiantInformtion( + + PatiantInformtion( {this.patientDetails, this.projectId, this.clinicId, @@ -149,93 +150,111 @@ class PatiantInformtion { this.status, this.vcId, this.voipToken}); + PatiantInformtion.fromJson(Map json) { + try { + patientDetails = + json['patientDetails'] != null ? new PatiantInformtion.fromJson( + json['patientDetails']) : null; + projectId = json["ProjectID"] ?? json["projectID"]; + clinicId = json["ClinicID"] ?? json["clinicID"]; + doctorId = json["DoctorID"] ?? json["doctorID"]; + patientId = json["PatientID"] != null + ? json["PatientID"] is String + ? int?.parse(json["PatientID"]) + : json["PatientID"] + : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN']; + doctorName = json["DoctorName"] ?? json["doctorName"]; + doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"]; + firstName = json["FirstName"] ?? json["firstName"]; + middleName = json["MiddleName"] ?? json["middleName"]; + lastName = json["LastName"] ?? json["lastName"]; + firstNameN = json["FirstNameN"] ?? json["firstNameN"]; + middleNameN = json["MiddleNameN"] ?? json["middleNameN"]; + lastNameN = json["LastNameN"] ?? json["lastNameN"]; + gender = json["Gender"] != null + ? json["Gender"] is String + ? int?.parse(json["Gender"]) + : json["Gender"] + : json["gender"]; + fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; + fullNameN = + json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; + dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; + nationalityId = json["NationalityID"] ?? json["nationalityID"]; + mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; + emailAddress = json["EmailAddress"] ?? json["emailAddress"]; + patientIdentificationNo = + json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + //TODO make 7 dynamic when the backend retrun it in patient arrival + patientType = json["PatientType"] ?? json["patientType"] ?? 1; + admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; + admissionDate = json["AdmissionDate"] ?? json["admissionDate"]; + createdOn = json["CreatedOn"] ?? json["CreatedOn"]; + roomId = json["RoomID"] ?? json["roomID"]; + bedId = json["BedID"] ?? json["bedID"]; + nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; + description = json["Description"] ?? json["description"]; + clinicDescription = + json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = + json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? + json['NationalityName']; + nationalityNameN = + json["NationalityNameN"] ?? json["nationalityNameN"] ?? + json['NationalityNameN']; + age = json["Age"] ?? json["age"]; + genderDescription = json["GenderDescription"]; + nursingStationName = json["NursingStationName"]; + appointmentDate = json["AppointmentDate"] ?? ''; + startTime = json["startTime"] ?? json['StartTime']; + appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; + appointmentType = json['appointmentType']; + appointmentTypeId = + json['appointmentTypeId'] ?? json['appointmentTypeid']; + arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; + clinicGroupId = json['clinicGroupId']; + companyName = json['companyName']; + dischargeStatus = json['dischargeStatus']; + doctorDetails = json['doctorDetails']; + endTime = json['endTime']; + episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo']; + fallRiskScore = json['fallRiskScore']; + isSigned = json['isSigned']; + medicationOrders = json['medicationOrders']; + nationality = json['nationality'] ?? json['NationalityNameN']; + 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']; + patientStatusType = + json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = + json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + startTimes = json['StartTime'] ?? json['StartTime']; + dischargeDate = json['DischargeDate']; + status = json['Status']; + vcId = json['VC_ID']; - factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null, - projectId: json["ProjectID"] ?? json["projectID"], - clinicId: json["ClinicID"] ?? json["clinicID"], - doctorId: json["DoctorID"] ?? json["doctorID"], - patientId: json["PatientID"] != null - ? json["PatientID"] is String - ? int?.parse(json["PatientID"]) - : json["PatientID"] - : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], - doctorName: json["DoctorName"] ?? json["doctorName"], - doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], - firstName: json["FirstName"] ?? json["firstName"], - middleName: json["MiddleName"] ?? json["middleName"], - lastName: json["LastName"] ?? json["lastName"], - firstNameN: json["FirstNameN"] ?? json["firstNameN"], - middleNameN: json["MiddleNameN"] ?? json["middleNameN"], - lastNameN: json["LastNameN"] ?? json["lastNameN"], - gender: json["Gender"] != null - ? json["Gender"] is String - ? int?.parse(json["Gender"]) - : json["Gender"] - : json["gender"], - fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"], - fullNameN: json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], - dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'], - nationalityId: json["NationalityID"] ?? json["nationalityID"], - mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], - emailAddress: json["EmailAddress"] ?? json["emailAddress"], - patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], - //TODO make 7 dynamic when the backend retrun it in patient arrival - patientType: json["PatientType"] ?? json["patientType"] ?? 1, - admissionNo: json["AdmissionNo"] ?? json["admissionNo"], - admissionDate: json["AdmissionDate"] ?? json["admissionDate"], - createdOn: json["CreatedOn"] ?? json["CreatedOn"], - roomId: json["RoomID"] ?? json["roomID"], - bedId: json["BedID"] ?? json["bedID"], - nursingStationId: json["NursingStationID"] ?? json["nursingStationID"], - description: json["Description"] ?? json["description"], - clinicDescription: json["ClinicDescription"] ?? json["clinicDescription"], - clinicDescriptionN: json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'], - nationalityNameN: json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'], - age: json["Age"] ?? json["age"], - genderDescription: json["GenderDescription"], - nursingStationName: json["NursingStationName"], - appointmentDate: json["AppointmentDate"] ?? '', - startTime: json["startTime"] ?? json['StartTime'], - appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], - appointmentType: json['appointmentType'], - appointmentTypeId: json['appointmentTypeId'] ?? json['appointmentTypeid'], - arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], - clinicGroupId: json['clinicGroupId'], - companyName: json['companyName'], - dischargeStatus: json['dischargeStatus'], - doctorDetails: json['doctorDetails'], - endTime: json['endTime'], - episodeNo: json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'], - fallRiskScore: json['fallRiskScore'], - 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())), - visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], - nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], - patientStatusType: json['patientStatusType'] ?? json['PatientStatusType'], - visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], - startTimes: json['StartTime'] ?? json['StartTime'], - dischargeDate: json['DischargeDate'], - status: json['Status'], - vcId: json['VC_ID'], - - arrivalTime: json['ArrivalTime'], - arrivalTimeD: json['ArrivalTimeD'], - callStatus: json['CallStatus'], - callStatusDisc: json['CallStatusDisc'], - callTypeID: json['CallTypeID'], - clientRequestID: json['ClientRequestID'], - clinicName: json['ClinicName'], - consoltationEnd: json['ConsoltationEnd'], - consultationNotes: json['ConsultationNotes'], - patientStatus: json['PatientStatus'], - voipToken: json['VoipToken'], - ); + arrivalTime = json['ArrivalTime']; + arrivalTimeD = json['ArrivalTimeD']; + callStatus = json['CallStatus']; + callStatusDisc = json['CallStatusDisc']; + callTypeID = json['CallTypeID']; + clientRequestID = json['ClientRequestID']; + clinicName = json['ClinicName']; + consoltationEnd = json['ConsoltationEnd']; + consultationNotes = json['ConsultationNotes']; + patientStatus = json['PatientStatus']; + voipToken = json['VoipToken']; + } catch (e) { + print(e); + } + } } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 772f2f90..92d3ba17 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -106,9 +106,9 @@ class _PatientMakeReferralScreenState extends State { patientGender: model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender, referredDate: - model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[0], + model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[0], referredTime: - model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[1], + model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[1], patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, @@ -136,22 +136,22 @@ class _PatientMakeReferralScreenState extends State { if (_referTo == null) { branchError = TranslationBase.of(context).fieldRequired!; } else { - branchError = null!; + branchError = null; } if (_selectedBranch == null) { hospitalError = TranslationBase.of(context).fieldRequired!; } else { - hospitalError = null!; + hospitalError = null; } if (_selectedClinic == null) { clinicError = TranslationBase.of(context).fieldRequired!; } else { - clinicError = null!; + clinicError = null; } if (_selectedDoctor == null) { doctorError = TranslationBase.of(context).fieldRequired!; } else { - doctorError = null!; + doctorError = null; } }); if (appointmentDate == null || diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index de4d821c..6209e1fc 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -85,7 +85,7 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.red[700], ), AppText( - referredDate!, + referredDate??'', fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier!, @@ -98,7 +98,7 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName!, + patientName??'', fontSize: SizeConfig.textMultiplier! * 2.2, fontWeight: FontWeight.bold, color: Colors.black, @@ -121,7 +121,7 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime!, + referredTime??'', fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier!, @@ -278,7 +278,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName!, + referralDoctorName??'', fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier!, From 73f2abbea2679da1837e24b86c718fcb8264176a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 17 Jun 2021 15:40:07 +0300 Subject: [PATCH 045/199] flutter 2 migration --- lib/config/config.dart | 4 +- .../admission-request_second-screen.dart | 6 +- .../profile/note/progress_note_screen.dart | 583 +++++++++--------- .../prescription/add_prescription_form.dart | 36 +- .../prescription/prescription_text_filed.dart | 8 +- 5 files changed, 329 insertions(+), 308 deletions(-) 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/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 42fafd8e..0c9ccb4e 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 @@ -38,7 +38,7 @@ class _AdmissionRequestSecondScreenState extends State { late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel? authenticationViewModel; - ProjectViewModel? projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; @@ -65,8 +65,8 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { - // authenticationViewModel = Provider.of(context); - // projectViewModel = Provider.of(context); + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; @@ -90,308 +90,313 @@ class _ProgressNoteState extends State { child: Column( children: [ if (!isDischargedPatient) - AddNewOrder( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - )), - ); - }, - label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet! - : TranslationBase.of(context).addProgressNote!, - ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index].status == 1 && - authenticationViewModel!.doctorProfile!.doctorID != - model.patientProgressNoteList[index].createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index].status == 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index].status == 2 - ? Colors.green[600]! - : Color(0xFFCC9B14)!, - widget: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (model.patientProgressNoteList[index].status == 1 && - authenticationViewModel!.doctorProfile!.doctorID != - model.patientProgressNoteList[index].createdBy) - AppText( - TranslationBase.of(context).notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status == 4) - AppText( - TranslationBase.of(context).noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status == 2) - AppText( - TranslationBase.of(context).noteVerified, - fontWeight: FontWeight.bold, - color: Colors.green[600], - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status != 2 && - model.patientProgressNoteList[index].status != 4 && - authenticationViewModel!.doctorProfile!.doctorID == - model.patientProgressNoteList[index].createdBy) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - note: model.patientProgressNoteList[index], - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + // AddNewOrder( + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => UpdateNoteOrder( + // patientModel: model, + // patient: patient, + // visitType: widget.visitType, + // isUpdate: false, + // )), + // ); + // }, + // label: widget.visitType == 3 + // ? TranslationBase.of(context).addNewOrderSheet! + // : TranslationBase.of(context).addProgressNote!, + // ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index].status == 1 && + authenticationViewModel!.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index].status == 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index].status == 2 + ? Colors.green[600]! + : Color(0xFFCC9B14)!, + widget: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.patientProgressNoteList[index].status == 1 && + authenticationViewModel!.doctorProfile!.doctorID != + model.patientProgressNoteList[index].createdBy) + AppText( + TranslationBase.of(context).notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 4) + AppText( + TranslationBase.of(context).noteCanceled, + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 2) + AppText( + TranslationBase.of(context).noteVerified, + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model.patientProgressNoteList[index].status != 4 && + authenticationViewModel!.doctorProfile!.doctorID == + model.patientProgressNoteList[index].createdBy) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + note: model.patientProgressNoteList[index], + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of(context).update, - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context).update, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "verify", - confirmFun: () async { - GifLoaderDialogUtils.showMyDialog(context); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo ?? ""), - cancelledNote: false, - lineItemNo: model.patientProgressNoteList[index].lineItemNo, - createdBy: model.patientProgressNoteList[index].createdBy, - notes: model.patientProgressNoteList[index].notes, - verifiedNote: true, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context, model, isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: false, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: true, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of(context).noteVerify, - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons.check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context).noteVerify, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: TranslationBase.of(context).cancel!, - confirmFun: () async { - GifLoaderDialogUtils.showMyDialog( - context, - ); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo ?? ""), - cancelledNote: true, - lineItemNo: model.patientProgressNoteList[index].lineItemNo, - createdBy: model.patientProgressNoteList[index].createdBy, - notes: model.patientProgressNoteList[index].notes, - verifiedNote: false, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context, model, isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: TranslationBase.of(context).cancel!, + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog( + context, + ); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo ?? ""), + cancelledNote: true, + lineItemNo: + model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: false, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons.trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ) - ], + SizedBox( + width: 10, + ) + ], + ), + SizedBox( + height: 10, ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.60, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).createdBy, - fontSize: 10, - ), - Expanded( - child: AppText( - model.patientProgressNoteList[index].doctorName ?? '', - fontWeight: FontWeight.w600, - fontSize: 12, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).createdBy, + fontSize: 10, ), - ), - ], + Expanded( + child: AppText( + model.patientProgressNoteList[index].doctorName ?? '', + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? ""), + isArabic: projectViewModel!.isArabic) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), + isArabic: projectViewModel!.isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour( + AppDateUtils.getDateTimeFromServerFormat( + model.patientProgressNoteList[index].createdOn ?? "")) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, ), ], + crossAxisAlignment: CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientProgressNoteList[index].notes, + fontSize: 10, ), ), - Column( - children: [ - AppText( - model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.getDateTimeFromServerFormat( - model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel!.isArabic) - : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), - isArabic: projectViewModel!.isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( - model.patientProgressNoteList[index].createdOn ?? "")) - : AppDateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], - crossAxisAlignment: CrossAxisAlignment.end, - ) - ], - ), - SizedBox( - height: 8, - ), - Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - model.patientProgressNoteList[index].notes, - fontSize: 10, - ), - ), - ]) - ], - ), - SizedBox( - height: 20, - ), - ], + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), ), - ), - ); - }), + ); + }), + ), ), - ), ], ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index d83ea0ee..260baee4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -84,7 +84,7 @@ postPrescription( postProcedureReqModel.prescriptionRequestModel = prescriptionList; await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); - if (model.state == ViewState.ErrorLocal) { + if (model.state == ViewState.Error) { Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); @@ -112,6 +112,7 @@ class _PrescriptionFormWidgetState extends State { String? strengthError; late int selectedType; + bool isSubmitted = false; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -211,7 +212,6 @@ class _PrescriptionFormWidgetState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { x = model.patientAssessmentList.map((element) { @@ -432,8 +432,11 @@ class _PrescriptionFormWidgetState extends State { width: 5.0, ), PrescriptionTextFiled( + isSubmitted: isSubmitted, width: MediaQuery.of(context).size.width * 0.560, - element: units, + element: model.itemMedicineListUnit.length == 1 + ? units = model.itemMedicineListUnit[0] + : units, elementError: unitError ?? "", keyName: 'description', keyId: 'parameterCode', @@ -451,8 +454,11 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, elementList: model.itemMedicineListRoute, - element: route, + element: model.itemMedicineListRoute.length == 1 + ? route = model.itemMedicineListRoute[0] + : route, elementError: routeError ?? "", keyId: 'parameterCode', keyName: 'description', @@ -466,9 +472,12 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, hintText: TranslationBase.of(context).frequency ?? "", elementError: frequencyError ?? "", - element: frequency, + element: model.itemMedicineList.length == 1 + ? frequency = model.itemMedicineList[0] + : frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', keyName: 'description', @@ -492,6 +501,7 @@ class _PrescriptionFormWidgetState extends State { }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, hintText: TranslationBase.of(context).doseTime ?? "", elementError: doseTimeError ?? "", element: doseTime, @@ -561,6 +571,7 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( + isSubmitted: isSubmitted, element: duration, elementError: durationError ?? "", hintText: TranslationBase.of(context).duration ?? "", @@ -664,7 +675,7 @@ class _PrescriptionFormWidgetState extends State { if (_selectedMedication!.isNarcotic == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context) .narcoticMedicineCanOnlyBePrescribedFromVida); - Navigator.pop(context); + // Navigator.pop(context); return; } @@ -766,35 +777,36 @@ class _PrescriptionFormWidgetState extends State { } } else { setState(() { + isSubmitted = true; if (duration == null) { durationError = TranslationBase.of(context).fieldRequired; } else { - durationError = null; + durationError = ""; } if (doseTime == null) { doseTimeError = TranslationBase.of(context).fieldRequired; } else { - doseTimeError = null; + doseTimeError = ""; } if (route == null) { routeError = TranslationBase.of(context).fieldRequired; } else { - routeError = null; + routeError = ""; } if (frequency == null) { frequencyError = TranslationBase.of(context).fieldRequired; } else { - frequencyError = null; + frequencyError = ""; } if (units == null) { unitError = TranslationBase.of(context).fieldRequired; } else { - unitError = null; + unitError = ""; } if (strengthController.text == "") { strengthError = TranslationBase.of(context).fieldRequired; } else { - strengthError = null; + strengthError = ""; } }); } diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index 38b6f3c3..f9803789 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -9,6 +9,7 @@ import 'package:flutter/material.dart'; class PrescriptionTextFiled extends StatefulWidget { dynamic element; final String elementError; + final bool? isSubmitted; final List elementList; final String keyName; final String keyId; @@ -25,7 +26,8 @@ class PrescriptionTextFiled extends StatefulWidget { required this.keyName, required this.keyId, required this.hintText, - required this.okFunction}) + required this.okFunction, + this.isSubmitted}) : super(key: key); @override @@ -65,7 +67,9 @@ class _PrescriptionTextFiledState extends State { ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, - validationError: widget.elementList.length != 1 ? widget.elementError : null, + validationError: widget.element == null && widget.isSubmitted == true && widget.elementList.length != 1 + ? widget.elementError + : null, enabled: false, ), ), From 764e2e29f52ed97bc978080511cc7db03dc2d2d5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 15:44:32 +0300 Subject: [PATCH 046/199] first fix from procedure --- lib/config/config.dart | 4 ++-- lib/screens/procedures/entity_list_fav_procedure.dart | 8 ++++---- lib/widgets/shared/text_fields/TextFields.dart | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) 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/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 9d0835ae..97e3bcba 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -112,11 +112,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State { default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap!, + onTap: widget.onSuffixTap??null, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else From bf54139647b04dc5925cf988991b502568a2b808 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Jun 2021 16:32:19 +0300 Subject: [PATCH 047/199] first procedure --- lib/screens/procedures/add-procedure-form.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 53024aca..6c633960 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -27,7 +27,7 @@ valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List { - late int selectedType; + int? selectedType; ProcedureViewModel model; PatiantInformtion patient; @@ -253,7 +253,7 @@ class _AddSelectedProcedureState extends State { title: TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, - onPressed: () { + onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).fillTheMandatoryProcedureDetails, @@ -261,13 +261,17 @@ class _AddSelectedProcedureState extends State { return; } - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), + + + //TODO Elham* check the static value + postProcedure( + orderType: selectedType==null?"1":selectedType.toString(), entityList: entityList, patient: patient, model: widget.model, remarks: remarksController.text); + + Navigator.pop(context); }, ), ], From 47dfde6e78c6a65ffc661fdfc64f3ab9baa5b6ec Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 20 Jun 2021 09:11:23 +0300 Subject: [PATCH 048/199] 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 049/199] 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) { From 329711a002354cf1c80fcd79dc6257b86ea7f647 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Jun 2021 16:18:38 +0300 Subject: [PATCH 050/199] fix error to make the code work with flutter 2 --- lib/config/size_config.dart | 6 +- .../live_care/AlternativeServicesList.dart | 8 +- .../live_care_login_reguest_model.dart | 10 +- .../PatientSearchRequestModel.dart | 4 +- .../referral/MyReferralPatientModel.dart | 2 +- .../MyReferralPatientRequestModel.dart | 46 +++--- .../add_referred_remarks_request.dart | 30 ++-- lib/core/service/NavigationService.dart | 10 +- lib/core/service/VideoCallService.dart | 28 ++-- lib/core/service/home/scan_qr_service.dart | 8 +- .../patient/LiveCarePatientServices.dart | 4 +- .../patient/MyReferralPatientService.dart | 16 +- .../patient-doctor-referral-service.dart | 2 +- lib/core/service/patient/patient_service.dart | 8 +- .../procedure/procedure_service.dart | 2 +- .../viewModel/LiveCarePatientViewModel.dart | 32 ++-- .../viewModel/PatientSearchViewModel.dart | 2 +- .../viewModel/authentication_view_model.dart | 2 +- lib/core/viewModel/dashboard_view_model.dart | 8 +- .../viewModel/patient-referral-viewmodel.dart | 8 +- lib/core/viewModel/patient_view_model.dart | 2 +- lib/core/viewModel/procedure_View_model.dart | 30 ++-- lib/core/viewModel/scan_qr_view_model.dart | 2 +- ...cial_clinical_care_List_Respose_Model.dart | 10 +- ...nical_care_mapping_List_Respose_Model.dart | 12 +- lib/models/livecare/start_call_req.dart | 22 +-- .../patient_profile_app_bar_model.dart | 36 ++-- lib/screens/auth/login_screen.dart | 4 +- .../auth/verification_methods_screen.dart | 34 ++-- .../home/dashboard_referral_patient.dart | 64 ++++---- .../home/dashboard_slider-item-widget.dart | 2 +- lib/screens/home/home_page_card.dart | 2 +- lib/screens/home/home_screen.dart | 57 ++++--- lib/screens/home/home_screen_header.dart | 14 +- lib/screens/home/label.dart | 10 +- lib/screens/live_care/end_call_screen.dart | 46 +++--- .../live-care_transfer_to_admin.dart | 2 +- lib/screens/live_care/video_call.dart | 2 +- .../medical-file/medical_file_details.dart | 68 ++++---- .../patients/PatientsInPatientScreen.dart | 8 +- .../patients/insurance_approvals_details.dart | 155 ++++++++---------- .../lab_result/laboratory_result_page.dart | 2 +- .../AddVerifyMedicalReport.dart | 6 +- .../medical_report/MedicalReportPage.dart | 2 +- .../PatientProfileCardModel.dart | 3 +- .../patient_profile_screen.dart | 13 +- .../radiology/radiology_details_page.dart | 2 +- .../referral/AddReplayOnReferralPatient.dart | 4 +- .../ReplySummeryOnReferralPatient.dart | 2 +- .../referral_patient_detail_in-paint.dart | 4 +- .../referral/referred-patient-screen.dart | 10 +- .../prescription/prescription_items_page.dart | 8 +- lib/screens/procedures/ProcedureType.dart | 34 ++-- .../procedures/add-favourite-procedure.dart | 34 ++-- .../procedures/add-procedure-page.dart | 52 +++--- .../base_add_procedure_tab_page.dart | 28 ++-- lib/util/NotificationPermissionUtils.dart | 2 +- lib/util/VideoChannel.dart | 8 +- lib/util/date-utils.dart | 4 +- lib/util/helpers.dart | 6 +- lib/util/translations_delegate_base.dart | 20 +-- lib/widgets/dashboard/row_count.dart | 2 +- lib/widgets/dialog/AskPermissionDialog.dart | 2 +- .../patients/patient_card/ShowTimer.dart | 4 +- .../profile/PatientProfileButton.dart | 4 +- .../profile/patient-profile-app-bar.dart | 128 +++++++-------- ...ent-profile-header-new-design-app-bar.dart | 6 +- lib/widgets/shared/app_scaffold_widget.dart | 8 +- lib/widgets/shared/app_texts_widget.dart | 2 +- .../shared/buttons/app_buttons_widget.dart | 2 +- lib/widgets/shared/drawer_item_widget.dart | 2 +- 71 files changed, 608 insertions(+), 614 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 8a9c7ac6..75c37643 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -75,7 +75,7 @@ class SizeConfig { print('isMobilePortrait $isMobilePortrait'); } - static getTextMultiplierBasedOnWidth({double width}){ + static getTextMultiplierBasedOnWidth({double? width}){ // TODO handel LandScape case if(width != null) { return width / 100; @@ -84,7 +84,7 @@ class SizeConfig { } - static getWidthMultiplier({double width}){ + static getWidthMultiplier({double? width}){ // TODO handel LandScape case if(width != null) { return width / 100; @@ -92,7 +92,7 @@ class SizeConfig { return widthMultiplier; } - static getHeightMultiplier({double height}){ + static getHeightMultiplier({double? height}){ // TODO handel LandScape case if(height != null) { return height / 100; diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index 11f27b95..28d70805 100644 --- a/lib/core/model/live_care/AlternativeServicesList.dart +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; class AlternativeService { - int serviceID; - String serviceName; - bool isSelected; + int? serviceID; + String? serviceName; + bool? isSelected; AlternativeService( {this.serviceID, this.serviceName, this.isSelected = false}); @@ -23,7 +23,7 @@ class AlternativeService { } class AlternativeServicesList with ChangeNotifier { - List _alternativeServicesList; + late List _alternativeServicesList; getServicesList(){ return _alternativeServicesList; 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 index e14d4223..90ea0ff1 100644 --- a/lib/core/model/live_care/live_care_login_reguest_model.dart +++ b/lib/core/model/live_care/live_care_login_reguest_model.dart @@ -1,9 +1,9 @@ class LiveCareUserLoginRequestModel { - String tokenID; - String generalid; - int doctorId; - int isOutKsa; - int isLogin; + String? tokenID; + String? generalid; + int? doctorId; + int? isOutKsa; + int? isLogin; LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin}); diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 7117382c..d377916e 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -11,8 +11,8 @@ class PatientSearchRequestModel { int ?searchType; String? mobileNo; String? identificationNo; - int nursingStationID; - int clinicID=0; + int? nursingStationID; + int? clinicID=0; PatientSearchRequestModel( {this.doctorID = 0, diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index ec1f7758..86a0e9c7 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -61,7 +61,7 @@ class MyReferralPatientModel { String? priorityDescription; String? referringClinicDescription; String? referringDoctorName; - int referalStatus; + int? referalStatus; MyReferralPatientModel( {this.rowID, diff --git a/lib/core/model/referral/MyReferralPatientRequestModel.dart b/lib/core/model/referral/MyReferralPatientRequestModel.dart index 08b98a99..885653a1 100644 --- a/lib/core/model/referral/MyReferralPatientRequestModel.dart +++ b/lib/core/model/referral/MyReferralPatientRequestModel.dart @@ -1,27 +1,27 @@ 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; + 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, diff --git a/lib/core/model/referral/add_referred_remarks_request.dart b/lib/core/model/referral/add_referred_remarks_request.dart index 14089513..5b7edbc6 100644 --- a/lib/core/model/referral/add_referred_remarks_request.dart +++ b/lib/core/model/referral/add_referred_remarks_request.dart @@ -1,19 +1,19 @@ 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; + 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, diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 26191ffc..11b12ec5 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -3,16 +3,16 @@ import 'package:flutter/material.dart'; class NavigationService { final GlobalKey navigatorKey = new GlobalKey(); - Future navigateTo(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); + Future navigateTo(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments); } - Future pushReplacementNamed(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments); + Future pushReplacementNamed(String routeName,{required Object arguments}) { + return navigatorKey.currentState!.pushReplacementNamed(routeName,arguments: arguments); } Future pushNamedAndRemoveUntil(String routeName) { - return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); + return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName,(asd)=>false); } } \ No newline at end of file diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index f72544a0..d07c640d 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -18,14 +18,14 @@ import 'NavigationService.dart'; class VideoCallService extends BaseService{ - StartCallRes startCallRes; - PatiantInformtion patient; + late StartCallRes startCallRes; + late 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); + DoctorProfileModel? doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg @@ -34,15 +34,15 @@ class VideoCallService extends BaseService{ patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), generalId: GENERAL_ID, - doctorId: doctorProfile.doctorID, + 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); + 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 @@ -54,10 +54,10 @@ class VideoCallService extends BaseService{ }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext); - endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { - GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext); + 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 { @@ -76,13 +76,13 @@ class VideoCallService extends BaseService{ hasError = false; await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile.doctorID; + 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; + error = _liveCarePatientServices.error!; } } diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index bc6c8820..7a0033b9 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -4,15 +4,15 @@ 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(); + List myInPatientList = []; + List inPatientList = []; Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID!; } else { requestModel.doctorID = 0; } @@ -26,7 +26,7 @@ class ScanQrService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index d8e56db7..40968550 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -113,10 +113,10 @@ class LiveCarePatientServices extends BaseService { }, isLiveCare: _isLive); } - Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { + Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async { hasError = false; await getDoctorProfile( ); - isLoginRequestModel.doctorId = super.doctorProfile.doctorID; + 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/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index c2e467d2..946d631f 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -13,7 +13,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile!.doctorID, + doctorID: doctorProfile!.doctorID!, firstName: "0", middleName: "0", lastName: "0", @@ -48,7 +48,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, + doctorID: doctorProfile!.doctorID!, firstName: "0", middleName: "0", lastName: "0", @@ -104,15 +104,15 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( - editedBy: doctorProfile.doctorID, - projectID: doctorProfile.projectID, + 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.projectID = referral.projectID!; + _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; _requestAddReferredDoctorRemarks.referalStatus = referalStatus; // _requestAddReferredDoctorRemarks.patientID = referral.patientID; diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 08e17574..fd9e25b3 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -155,7 +155,7 @@ class PatientReferralService extends LookupService { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - DoctorProfileModel doctorProfile = await getDoctorProfile(); + DoctorProfileModel? doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_OUT_PATIENT, diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 31632d27..52c10ad5 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -24,8 +24,8 @@ 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 inPatientList = []; + List myInPatientList = []; List get patientVitalSignList => _patientVitalSignList; @@ -141,7 +141,7 @@ class PatientService extends BaseService { await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; + requestModel.doctorID = doctorProfile!.doctorID!; } else { requestModel.doctorID = 0; } @@ -155,7 +155,7 @@ class PatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile.doctorID) { + if (patient.doctorId == doctorProfile!.doctorID!) { myInPatientList.add(patient); } }); 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 48a93853..51fdf98b 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -23,7 +23,7 @@ class ProcedureService extends BaseService { List procedureslist = []; List categoryList = []; - // List _templateList = List(); + // List _templateList = []; // List get templateList => _templateList; List templateList = []; diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 907bc1da..356a3826 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -71,15 +71,15 @@ class LiveCarePatientViewModel extends BaseViewModel { Future startCall({required int vCID, required bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); await getDoctorProfile(); - startCallReq.clinicId = super.doctorProfile!.clinicID; + startCallReq.clinicId = super.doctorProfile!.clinicID!; startCallReq.vCID = vCID; //["VC_ID"]; startCallReq.isrecall = isReCall; - startCallReq.doctorId = doctorProfile!.doctorID; + startCallReq.doctorId = doctorProfile!.doctorID!; startCallReq.isOutKsa = false; //["IsOutKSA"]; - startCallReq.projectName = doctorProfile!.projectName; - startCallReq.docotrName = doctorProfile!.doctorName; - startCallReq.clincName = doctorProfile!.clinicDescription; - startCallReq.docSpec = doctorProfile!.doctorTitleForProfile; + startCallReq.projectName = doctorProfile!.projectName!; + startCallReq.docotrName = doctorProfile!.doctorName!; + startCallReq.clincName = doctorProfile!.clinicDescription!; + startCallReq.docSpec = doctorProfile!.doctorTitleForProfile!; startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); @@ -92,9 +92,9 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - setSelectedCheckboxValues(AlternativeService service, bool isSelected) { - int index = alternativeServicesList.indexOf(service); - if (index != -1) alternativeServicesList[index].isSelected = isSelected; + setSelectedCheckboxValues(AlternativeService? service, bool? isSelected) { + int index = alternativeServicesList.indexOf(service!); + if (index != -1) alternativeServicesList[index].isSelected = isSelected!; notifyListeners(); } @@ -118,10 +118,10 @@ class LiveCarePatientViewModel extends BaseViewModel { } List getSelectedAlternativeServices() { - List selectedServices = List(); + List selectedServices = []; for (AlternativeService service in alternativeServicesList) { - if (service.isSelected) { - selectedServices.add(service.serviceID); + if (service.isSelected!) { + selectedServices.add(service.serviceID!); } } return selectedServices; @@ -131,7 +131,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.getAlternativeServices(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -154,7 +154,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.sendSMSInstruction(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -186,14 +186,14 @@ class LiveCarePatientViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); - userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0; + 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; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index d0bd9862..1e77f9e1 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -199,7 +199,7 @@ class PatientSearchViewModel extends BaseViewModel { } await _specialClinicsService.getSpecialClinicalCareMappingList(clinicId); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; + error = _specialClinicsService.error!; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index f63220d4..52819e43 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -232,7 +232,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess( SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel.verificationCode); + print("VerificationCode : " +sendActivationCodeForDoctorAppResponseModel!.verificationCode!); // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index e85c103c..27489733 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -66,7 +66,7 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; + error = _specialClinicsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -82,7 +82,7 @@ class DashboardViewModel extends BaseViewModel { ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error; + error = authProvider.error!; } } @@ -94,8 +94,8 @@ class DashboardViewModel extends BaseViewModel { } - GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){ - GetSpecialClinicalCareListResponseModel special ; + GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId){ + GetSpecialClinicalCareListResponseModel? special ; specialClinicalCareList.forEach((element) { if(element.clinicID == 1){ special = element; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 520004a4..8dd898bc 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -140,7 +140,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredOutPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error; + error = _referralPatientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -183,7 +183,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralOutPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; if (localBusy) setState(ViewState.ErrorLocal); else @@ -239,7 +239,7 @@ class PatientReferralViewModel extends BaseViewModel { patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient.admissionNo!), referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, @@ -395,7 +395,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus); if (_myReferralService.hasError) { - error = _myReferralService.error; + error = _myReferralService.error!; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index af0130d8..188e4be2 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -277,7 +277,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getInPatient(requestModel, false); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { // setDefaultInPatientList(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6fc0f7e1..4d68ea52 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -315,27 +315,27 @@ class ProcedureViewModel extends BaseViewModel { } Future preparePostProcedure( - {String remarks, - String orderType, - PatiantInformtion patient, - List entityList, - ProcedureType procedureType}) async { + {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; + procedureValadteRequestModel.patientMRN = patient!.patientMRN; + procedureValadteRequestModel.episodeID = patient!.episodeNo; + procedureValadteRequestModel.appointmentNo = patient!.appointmentNo; - List controlsProcedure = List(); + List controlsProcedure = []; postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - entityList.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId]; - List controls = List(); + entityList!.forEach((element) { + procedureValadteRequestModel.procedure = [element!.procedureId!]; + List controls = []; controls.add( Controls( code: "remarks", @@ -357,8 +357,8 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.procedures = controlsProcedure; await valadteProcedure(procedureValadteRequestModel); if (state == ViewState.Idle) { - if (valadteProcedureList[0].entityList.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN); + if (valadteProcedureList[0].entityList!.length == 0) { + await postProcedure(postProcedureReqModel, patient!.patientMRN!); if (state == ViewState.ErrorLocal) { Helpers.showErrorToast(error); @@ -372,7 +372,7 @@ class ProcedureViewModel extends BaseViewModel { getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { Helpers.showErrorToast( - valadteProcedureList[0].entityList[0].warringMessages); + valadteProcedureList[0].entityList![0].warringMessages); } } } else { diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index 86e975e3..ea10d13c 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -15,7 +15,7 @@ class ScanQrViewModel extends BaseViewModel { await _scanQrService.getInPatient(requestModel, true); if (_scanQrService.hasError) { - error = _scanQrService.error; + error = _scanQrService.error!; setState(ViewState.ErrorLocal); } else { 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 index ec19abb0..c732fa71 100644 --- a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart @@ -1,9 +1,9 @@ class GetSpecialClinicalCareListResponseModel { - int projectID; - int clinicID; - String clinicDescription; - String clinicDescriptionN; - bool isActive; + int? projectID; + int? clinicID; + String? clinicDescription; + String? clinicDescriptionN; + bool? isActive; GetSpecialClinicalCareListResponseModel( {this.projectID, 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 index 287f40f1..a69f812f 100644 --- 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 @@ -1,10 +1,10 @@ class GetSpecialClinicalCareMappingListResponseModel { - int mappingProjectID; - int clinicID; - int nursingStationID; - bool isActive; - int projectID; - String description; + int? mappingProjectID; + int? clinicID; + int? nursingStationID; + bool? isActive; + int? projectID; + String? description; GetSpecialClinicalCareMappingListResponseModel( {this.mappingProjectID, diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index b3ceabb5..cdc8c924 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - String clincName; - int clinicId; - String docSpec; - String docotrName; - int doctorId; - String generalid; - bool isOutKsa; - bool isrecall; - String projectName; - String tokenID; - int vCID; + String ?clincName; + int ?clinicId; + String ?docSpec; + String? docotrName; + int ?doctorId; + String? generalid; + bool? isOutKsa; + bool ? isrecall; + String? projectName; + String ?tokenID; + int ?vCID; StartCallReq( {this.clincName, diff --git a/lib/models/patient/profile/patient_profile_app_bar_model.dart b/lib/models/patient/profile/patient_profile_app_bar_model.dart index f4654a29..ea576abc 100644 --- a/lib/models/patient/profile/patient_profile_app_bar_model.dart +++ b/lib/models/patient/profile/patient_profile_app_bar_model.dart @@ -1,24 +1,24 @@ 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; + 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, diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 6adbbfe0..ba6215f2 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -55,7 +55,7 @@ class _LoginScreenState extends State { height: 10, ), Text( - TranslationBase.of(context).welcomeTo, + TranslationBase.of(context).welcomeTo??"", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -64,7 +64,7 @@ class _LoginScreenState extends State { fontFamily: 'Poppins'), ), Text( - TranslationBase.of(context).drSulaimanAlHabib, + TranslationBase.of(context).drSulaimanAlHabib!, style: TextStyle( color: Color(0xFF2B353E), fontWeight: FontWeight.bold, diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index f211781f..f8e62ea1 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -91,7 +91,7 @@ class _VerificationMethodsScreenState extends State { color: Color(0xFF2B353E), ), AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), + Helpers.capitalize(authenticationViewModel.user!.doctorName), fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -131,7 +131,7 @@ class _VerificationMethodsScreenState extends State { children: [ Text( TranslationBase.of(context) - .lastLoginAt, + .lastLoginAt!, overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', @@ -164,7 +164,7 @@ class _VerificationMethodsScreenState extends State { .getType( authenticationViewModel .user - .logInTypeID, + !.logInTypeID, context), style: TextStyle( color: @@ -191,21 +191,21 @@ class _VerificationMethodsScreenState extends State { children: [ AppText( authenticationViewModel - .user.editedOn != + .user!.editedOn != null ? AppDateUtils .getDayMonthYearDateFormatted( AppDateUtils .convertStringToDate( authenticationViewModel - .user - .editedOn)) + ! .user + !.editedOn!)) : authenticationViewModel - .user.createdOn != + .user!.createdOn! != null ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) + AppDateUtils.convertStringToDate(authenticationViewModel!.user + !.createdOn!)) : '--', textAlign: TextAlign.right, @@ -214,17 +214,17 @@ class _VerificationMethodsScreenState extends State { fontWeight: FontWeight.w700, ), AppText( - authenticationViewModel.user.editedOn != + authenticationViewModel.user!.editedOn != null ? AppDateUtils.getHour( AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != + authenticationViewModel!.user + !.editedOn!)) + : authenticationViewModel.user!.createdOn != null ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) + AppDateUtils.convertStringToDate(authenticationViewModel!.user + !.createdOn!)) : '--', textAlign: TextAlign.right, @@ -308,8 +308,8 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel:authenticationViewModel, authMethodType: SelectedAuthMethodTypesService .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), + authenticationViewModel!.user + !.logInTypeID!!), authenticateUser: (AuthMethodTypes authMethodType, diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 0b9e6765..a7e4339d 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -13,11 +13,11 @@ import 'package:flutter/material.dart'; import 'label.dart'; class DashboardReferralPatient extends StatelessWidget { - final List dashboardItemList; - final double height; - final DashboardViewModel model; + final List? dashboardItemList; + final double? height; + final DashboardViewModel? model; - const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + const DashboardReferralPatient({Key? key, this.dashboardItemList, this.height, this.model}) : super(key: key); @override Widget build(BuildContext context) { return RoundedContainer( @@ -101,30 +101,30 @@ class DashboardReferralPatient extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ RowCounts( - dashboardItemList[2] - .summaryoptions[0] + dashboardItemList![2] + .summaryoptions![0] .kPIParameter, - dashboardItemList[2] - .summaryoptions[0] - .value, - Colors.black, height: height,), + dashboardItemList![2] + .summaryoptions![0] + .value!, + Colors.black, height: height!,), RowCounts( - dashboardItemList[2] - .summaryoptions[1] + dashboardItemList![2] + .summaryoptions![1] .kPIParameter, - dashboardItemList[2] - .summaryoptions[1] - .value, - Colors.grey, height: height,), + dashboardItemList![2] + .summaryoptions![1] + .value!, + Colors.grey, height: height!,), RowCounts( - dashboardItemList[2] - .summaryoptions[2] + dashboardItemList![2] + .summaryoptions![2] .kPIParameter, - dashboardItemList[2] - .summaryoptions[2] - .value, - Colors.red, height: height,), + dashboardItemList![2] + .summaryoptions![2] + .value!, + Colors.red, height: height!,), ], ), ) @@ -138,21 +138,21 @@ class DashboardReferralPatient extends StatelessWidget { padding:EdgeInsets.all(0), child: GaugeChart( - _createReferralData(dashboardItemList))), + _createReferralData(dashboardItemList!))), Positioned( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ AppText( - model - .getPatientCount(dashboardItemList[2]) + model! + .getPatientCount(dashboardItemList![2]) .toString(), fontSize: SizeConfig.textMultiplier * 3.0, fontWeight: FontWeight.bold, ) ], ), - top: height * (SizeConfig.isHeightVeryShort?0.35:0.40), + top: height! * (SizeConfig.isHeightVeryShort?0.35:0.40), left: 0, right: 0) ]), @@ -164,16 +164,16 @@ class DashboardReferralPatient extends StatelessWidget { static List> _createReferralData(List dashboardItemList) { final data = [ new GaugeSegment( - dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), + 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), + 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), + dashboardItemList[2].summaryoptions![2].kPIParameter!, + getValue(dashboardItemList[1].summaryoptions![2].value), charts.MaterialPalette.red.shadeDefault), ]; diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 0d1a0e73..a78cfd1f 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -18,7 +18,7 @@ class DashboardSliderItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Label(firstLine:Helpers.getLabelFromKPI(item.kPIName) ,secondLine:Helpers.getNameFromKPI(item.kPIName), ), + Label(firstLine:Helpers.getLabelFromKPI(item!.kPIName!) ,secondLine:Helpers.getNameFromKPI(item!.kPIName!), ), ], ), diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 2dac78b9..75d1b713 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -18,7 +18,7 @@ class HomePageCard extends StatelessWidget { final GestureTapCallback onTap; final Color color; final double opacity; - final double width; + final double? width; final EdgeInsets margin; @override Widget build(BuildContext context) { diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index d0fb3569..95897dd3 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -38,12 +38,12 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel projectsProvider; - DoctorProfileModel profile; + ProjectViewModel ?projectsProvider; + DoctorProfileModel ?profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - String clinicId; + String? clinicId; late AuthenticationViewModel authenticationViewModel; int colorIndex = 0; final GlobalKey scaffoldKey = new GlobalKey(); @@ -142,8 +142,8 @@ class _HomeScreenState extends State { ), Container( child: Label( - firstLine: TranslationBase.of(context).patients, - secondLine: TranslationBase.of(context).services, + firstLine: TranslationBase.of(context).patients!, + secondLine: TranslationBase.of(context).services!, )), SizedBox( height: SizeConfig.heightMultiplier * .6, @@ -177,21 +177,38 @@ class _HomeScreenState extends State { List homePatientsCardsWidget(DashboardViewModel model,projectsProvider) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); - backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); - List backgroundIconColors = List(3); - backgroundIconColors[0] = Colors.white12; - backgroundIconColors[1] = Colors.white38; - backgroundIconColors[2] = Colors.white10; - List textColors = List(3); - textColors[0] = Colors.white; - textColors[1] = Color(0xFF353E47); - textColors[2] = Colors.white; + // List backgroundColors = List(3); + // backgroundColors[0] = Color(0xffD02127); + // backgroundColors[1] = Colors.grey[300]; + // backgroundColors[2] = Color(0xff2B353E); + // List backgroundIconColors = List(3); + // backgroundIconColors[0] = Colors.white12; + // backgroundIconColors[1] = Colors.white38; + // backgroundIconColors[2] = Colors.white10; + // List textColors = List(3); + // textColors[0] = Colors.white; + // textColors[1] = Color(0xFF353E47); + // textColors[2] = Colors.white; + // + // List patientCards = []; + // - List patientCards = List(); + List backgroundColors = []; + backgroundColors.add(Color(0xffD02127)); + backgroundColors.add(Colors.grey[300]!); + backgroundColors.add(Color(0xff2B353E)); + + List backgroundIconColors = []; + backgroundIconColors.add(Colors.white12); + backgroundIconColors.add(Colors.white38); + backgroundIconColors.add(Colors.white10); + + List textColors = []; + textColors.add(Colors.white); + textColors.add(Colors.black); + textColors.add(Colors.white); + List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], @@ -222,8 +239,8 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(specialClinic: model.getSpecialClinic(clinicId??projectsProvider - .doctorClinicsList[0].clinicID),), + page: PatientInPatientScreen(specialClinic: model!.getSpecialClinic(clinicId??projectsProvider + !.doctorClinicsList[0]!.clinicID!),), ), ); }, diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart index 7284b659..9b1aa63c 100644 --- a/lib/screens/home/home_screen_header.dart +++ b/lib/screens/home/home_screen_header.dart @@ -23,7 +23,7 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { double height = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6); - HomeScreenHeader({Key key, this.model, this.onOpenDrawer}) : super(key: key); + HomeScreenHeader({Key? key, required this.model, required this.onOpenDrawer}) : super(key: key); @override _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); @@ -33,11 +33,11 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { } class _HomeScreenHeaderState extends State { - ProjectViewModel projectsProvider; - int clinicId; + ProjectViewModel? projectsProvider; + int? clinicId; - AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel? authenticationViewModel; @override @@ -170,15 +170,15 @@ class _HomeScreenHeaderState extends State { ); }).toList(); }, - onChanged: (newValue) async { + onChanged: (int? newValue) async { setState(() { clinicId = newValue; }); GifLoaderDialogUtils.showMyDialog( context); - await widget.model.changeClinic(newValue, - authenticationViewModel); + await widget.model.changeClinic(newValue!, + authenticationViewModel!); GifLoaderDialogUtils.hideDialog( context); if (widget.model.state == diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index 7e853323..59c396ac 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -7,13 +7,13 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), 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; + final String? firstLine; + final String? secondLine; Color color; - final double secondLineFontSize; - final double firstLineFontSize; + final double? secondLineFontSize; + final double? firstLineFontSize; @override Widget build(BuildContext context) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 19bc2a92..ceec4474 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -24,9 +24,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { - final PatiantInformtion patient; + final PatiantInformtion? patient; - const EndCallScreen({Key? key, required this.patient,}) : super(key: key); + const EndCallScreen({Key? key, this.patient,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -34,7 +34,7 @@ class EndCallScreen extends StatefulWidget { class _EndCallScreenState extends State { bool isInpatient = false; - PatiantInformtion patient; + PatiantInformtion ?patient; bool isDischargedPatient = false; bool isSearchAndOut = false; late String patientType; @@ -53,7 +53,7 @@ class _EndCallScreenState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; if(routeArgs.containsKey('patient')) patient = routeArgs['patient']; } @@ -64,10 +64,10 @@ class _EndCallScreenState extends State { PatientProfileCardModel( TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.green[800], + color: Colors.green[800]!, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.startCall(isReCall: false, vCID: patient.vcId!).then((value) async { + await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { @@ -77,8 +77,8 @@ class _EndCallScreenState extends State { kToken: liveCareModel.startCallRes.openTokenID, kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', - vcId: patient.vcId, - patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${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, @@ -89,7 +89,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient.vcId!, + patient!.vcId!, false, );GifLoaderDialogUtils.hideDialog(context); @@ -101,7 +101,7 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient.vcId!, + patient!.vcId!, sessionStatusModel.sessionStatus == 3, ); GifLoaderDialogUtils.hideDialog(context); @@ -118,21 +118,21 @@ class _EndCallScreenState extends State { PatientProfileCardModel( TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.red[800], + color: Colors.red[800]!, onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.getAlternativeServices(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(patient.vcId, isConfirmed); + await liveCareModel.endCallWithCharge(patient!.vcId!, isConfirmed); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -153,7 +153,7 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.sendSMSInstruction(patient.vcId); + await liveCareModel.sendSMSInstruction(patient!.vcId!); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -170,7 +170,7 @@ class _EndCallScreenState extends State { TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', onTap: () { Navigator.push(context, - MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient))); + MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!))); }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), ]; @@ -187,9 +187,9 @@ class _EndCallScreenState extends State { .of(context) .scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient,isInpatient: isInpatient, + appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient!,isInpatient: isInpatient, isDischargedPatient: isDischargedPatient, - height: (patient.patientStatusType != null && patient.patientStatusType == 43) + height: (patient!.patientStatusType != null && patient!.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -235,7 +235,7 @@ class _EndCallScreenState extends State { itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, + patient: patient!, patientType: patientType, arrivalType: arrivalType, from: from, @@ -251,7 +251,7 @@ class _EndCallScreenState extends State { isLoading: cardsList[index].isLoading, isDartIcon: cardsList[index].isDartIcon, dartIcon: cardsList[index].dartIcon, - color: cardsList[index].color, + color: cardsList[index].color, ), ), ], @@ -351,10 +351,10 @@ class _EndCallScreenState extends State { } class CheckBoxListWidget extends StatefulWidget { - final LiveCarePatientViewModel model; + final LiveCarePatientViewModel? model; const CheckBoxListWidget({ - Key key, + Key? key, this.model, }) : super(key: key); @@ -368,7 +368,7 @@ class _CheckBoxListState extends State { return SingleChildScrollView( child: Column( children: [ - ...widget.model.alternativeServicesList + ...widget.model!.alternativeServicesList .map( (element) => Container( child: CheckboxListTile( @@ -380,7 +380,7 @@ class _CheckBoxListState extends State { value: element.isSelected, onChanged: (newValue) { setState(() { - widget.model + widget.model! .setSelectedCheckboxValues(element, newValue); }); }, 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 d30f996c..4b9200ad 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -113,7 +113,7 @@ class _LivaCareTransferToAdminState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await 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/video_call.dart b/lib/screens/live_care/video_call.dart index 10bab392..6c959f3a 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -66,7 +66,7 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, - patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", + patientName: widget.patientData.fullName != null ? widget.patientData.fullName! : widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 2ea90f0d..6dff0abc 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -90,8 +90,8 @@ class _MedicalFileDetailsState extends State { bool isHistoryExpand = true; bool isAssessmentExpand = true; - PatientProfileAppBarModel patientProfileAppBarModel; - ProjectViewModel projectViewModel; + PatientProfileAppBarModel? patientProfileAppBarModel; + ProjectViewModel? projectViewModel; @override void didChangeDependencies() { @@ -129,13 +129,13 @@ class _MedicalFileDetailsState extends State { } }, builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => + (BuildContext? context, MedicalFileViewModel? model, Widget ?child) => AppScaffold( - patientProfileAppBarModel: patientProfileAppBarModel, + patientProfileAppBarModel: patientProfileAppBarModel!, isShowAppBar: true, appBarTitle: TranslationBase - .of(context) - .medicalReport + .of(context!)! + .medicalReport! .toUpperCase(), body: NetworkBaseView( baseViewModel: model, @@ -144,13 +144,13 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && + model!.medicalFileList!.length != 0 && model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations + .medicalFileList![0] + .entityList![0] + .timelines![encounterNumber] + .timeLineEvents![0] + .consulations! .length != 0 ? Padding( @@ -160,7 +160,7 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -205,7 +205,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -224,7 +224,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -254,7 +254,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -297,7 +297,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -319,7 +319,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -342,7 +342,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -361,7 +361,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -383,7 +383,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -401,7 +401,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -432,7 +432,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -475,7 +475,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -498,7 +498,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -520,7 +520,7 @@ class _MedicalFileDetailsState extends State { AppText( AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -544,7 +544,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -563,7 +563,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -600,7 +600,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] + model.medicalFileList![0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -645,7 +645,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -663,7 +663,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).examType! + ": "), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -678,7 +678,7 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -694,7 +694,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).abnormal! + ": "), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -710,7 +710,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] + .medicalFileList![0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 88f85440..c1c96c95 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -18,9 +18,9 @@ import 'DischargedPatientPage.dart'; import 'InPatientPage.dart'; class PatientInPatientScreen extends StatefulWidget { - GetSpecialClinicalCareListResponseModel specialClinic; + GetSpecialClinicalCareListResponseModel? specialClinic; - PatientInPatientScreen({Key key, this.specialClinic}); + PatientInPatientScreen({Key? key, this.specialClinic}); @override _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); @@ -30,7 +30,7 @@ class _PatientInPatientScreenState extends State with Si late TabController _tabController; int _activeTab = 0; - int selectedMapId; + int? selectedMapId; @override @@ -182,7 +182,7 @@ class _PatientInPatientScreenState extends State with Si ); }).toList(); }, - onChanged: (newValue) async { + onChanged: (int? newValue) async { setState(() { selectedMapId = newValue; }); diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 5275eff6..1d039a72 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -32,8 +32,8 @@ class _InsuranceApprovalsDetailsState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + ProjectViewModel projectViewModel = Provider.of(context!); + final routeArgs = ModalRoute.of(context!)!.settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -44,7 +44,7 @@ class _InsuranceApprovalsDetailsState extends State { appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext context, InsuranceViewModel model, Widget child) => + builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) => AppScaffold( isShowAppBar: true, baseViewModel: model, @@ -62,7 +62,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context!).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -72,7 +72,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context!).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -99,19 +99,16 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption != null - ? model - .insuranceApprovalInPatient[ + ? model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption ?? "" : "", - color: model - .insuranceApprovalInPatient[ + color: model!.insuranceApprovalInPatient[ indexInsurance] .approvalStatusDescption != null @@ -128,10 +125,9 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - .doctorName + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -159,10 +155,9 @@ class _InsuranceApprovalsDetailsState extends State { BorderRadius.circular( 50), child: Image.network( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - .doctorImage, + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -191,15 +186,14 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .clinic + + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, ), Expanded( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .clinicName, fontSize: 14, @@ -212,14 +206,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .approvalNo + + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .approvalNo .toString(), @@ -235,8 +228,7 @@ class _InsuranceApprovalsDetailsState extends State { fontSize: 14, ), AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] .unUsedCount .toString(), @@ -249,7 +241,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .companyName + + .companyName! + ": ", color: Colors.grey[500], ), @@ -261,13 +253,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -280,12 +272,12 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", color: Colors.grey[500], ), AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -312,21 +304,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .usageStatus, fontWeight: FontWeight.w700, ), @@ -343,10 +335,9 @@ class _InsuranceApprovalsDetailsState extends State { child: ListView.builder( shrinkWrap: true, physics: ScrollPhysics(), - itemCount: model - .insuranceApprovalInPatient[ + itemCount: model!.insuranceApprovalInPatient[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -359,10 +350,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -375,10 +365,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -391,10 +380,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApprovalInPatient[ + model!.insuranceApprovalInPatient[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", @@ -439,7 +427,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context!).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -449,7 +437,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context!).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -476,19 +464,16 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .approvalStatusDescption != null - ? model - .insuranceApproval[ + ? model!.insuranceApproval[ indexInsurance] .approvalStatusDescption ?? "" : "", - color: model - .insuranceApproval[ + color: model!.insuranceApproval[ indexInsurance] .approvalStatusDescption != null @@ -503,9 +488,8 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - model - .insuranceApproval[indexInsurance] - .doctorName + model!.insuranceApproval[indexInsurance] + .doctorName! .toUpperCase(), color: Colors.black, fontSize: 18, @@ -533,10 +517,9 @@ class _InsuranceApprovalsDetailsState extends State { BorderRadius.circular( 50), child: Image.network( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - .doctorImage, + .doctorImage!, fit: BoxFit.fill, width: 700, ), @@ -565,15 +548,14 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .clinic + + .clinic! + ": ", color: Colors.grey[500], fontSize: 14, ), Expanded( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .clinicName, fontSize: 14, @@ -586,14 +568,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .approvalNo + + .approvalNo! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .approvalNo .toString(), @@ -606,14 +587,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .unusedCount + + .unusedCount! + ": ", color: Colors.grey[500], fontSize: 14, ), AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] .unUsedCount .toString(), @@ -626,7 +606,7 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .companyName + + .companyName! + ": ", color: Colors.grey[500], ), @@ -638,13 +618,13 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .receiptOn + + .receiptOn! + ": ", color: Colors.grey[500], ), Expanded( child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -657,17 +637,16 @@ class _InsuranceApprovalsDetailsState extends State { AppText( TranslationBase.of( context) - .expiryDate + + .expiryDate! + ": ", color: Colors.grey[500], ), - if (model - .insuranceApproval[ + if (model!.insuranceApproval[ indexInsurance] .expiryDate != null) AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, @@ -694,21 +673,21 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .usageStatus, fontWeight: FontWeight.w700, ), @@ -725,10 +704,9 @@ class _InsuranceApprovalsDetailsState extends State { child: ListView.builder( shrinkWrap: true, physics: ScrollPhysics(), - itemCount: model - .insuranceApproval[ + itemCount: model!.insuranceApproval[ indexInsurance] - .apporvalDetails + .apporvalDetails! .length, itemBuilder: (BuildContext context, @@ -741,10 +719,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.procedureName ?? "", @@ -757,10 +734,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.status ?? "", @@ -773,10 +749,9 @@ class _InsuranceApprovalsDetailsState extends State { Expanded( child: Container( child: AppText( - model - .insuranceApproval[ + model!.insuranceApproval[ indexInsurance] - ?.apporvalDetails[ + ?.apporvalDetails![ index] ?.isInvoicedDesc ?? "", 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 2f5f6e69..b9783a9b 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -39,7 +39,7 @@ class _LaboratoryResultPageState extends State { patientProfileAppBarModel: PatientProfileAppBarModel( patient:widget.patient,isInpatient:widget.isInpatient, isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate,), + appointmentDate: widget.patientLabOrders.orderDate!,), baseViewModel: model, body: AppScaffold( diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 06ca9256..1f78b242 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -59,10 +59,10 @@ class _AddVerifyMedicalReportState extends State { HtmlRichEditor( initialText: (medicalReport != null ? medicalReport.reportDataHtml - : model.medicalReportTemplate - .length > 0 ? model - .medicalReportTemplate[0] : ""), + : model!.medicalReportTemplate! + .length! > 0 ? model.medicalReportTemplate[0].templateTextHtml!: ""), hint: "Write the medical report ", + controller: _controller, height: MediaQuery .of(context) diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 0d40f0a3..47ab7ac1 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -112,7 +112,7 @@ class MedicalReportPage extends StatelessWidget { hasBorder: false, bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) - : Colors.green[700], + : Colors.green[700]!, widget: Column( children: [ Row( diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index 39148cf9..9808bb97 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -13,7 +13,8 @@ class PatientProfileCardModel { final bool isSelectInpatient; final bool isDartIcon; final IconData? dartIcon; - final Color color; + final Color? color; + PatientProfileCardModel(this.nameLine1, this.nameLine2, this.route, this.icon, {this.isInPatient = 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 228d87ae..a2ceb550 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -54,8 +54,8 @@ class _PatientProfileScreenState extends State with Single int index = 0; int _activeTab = 0; - StreamController videoCallDurationStreamController; - Stream videoCallDurationStream = (() async*{})(); + late StreamController videoCallDurationStreamController; + late Stream videoCallDurationStream; //= (() async*{})(); TODO Elham* @override void initState() { _tabController = TabController(length: 2, vsync: this); @@ -103,7 +103,7 @@ class _PatientProfileScreenState extends State with Single _activeTab = 1; } - StreamSubscription callTimer; + late StreamSubscription callTimer; callConnected(){ callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) ..onDone(() { @@ -117,7 +117,7 @@ class _PatientProfileScreenState extends State with Single callDisconnected(){ callTimer.cancel(); - videoCallDurationStreamController.sink.add(null); + videoCallDurationStreamController.sink.add(''); } @override @@ -299,7 +299,8 @@ class _PatientProfileScreenState extends State with Single onPressed: () async { // Navigator.push(context, MaterialPageRoute( // builder: (BuildContext context) => - // EndCallScreen(patient:patient)));if (isCallFinished) { + // EndCallScreen(patient:patient))) + if (isCallFinished) { Navigator.push( context, MaterialPageRoute( @@ -319,7 +320,7 @@ class _PatientProfileScreenState extends State with Single GifLoaderDialogUtils.hideDialog(context); AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); - }); + }, type: ''); } diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index db3d0bfd..79bb7614 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -33,7 +33,7 @@ class RadiologyDetailsPage extends StatelessWidget { builder: (_, model, widget) => AppScaffold( patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, - appointmentDate: finalRadiology.orderDate, + appointmentDate: finalRadiology.orderDate!, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, branch: finalRadiology.projectName, diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 2069f446..76fabbbf 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -24,8 +24,8 @@ import 'ReplySummeryOnReferralPatient.dart'; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; - final AddReferredRemarksRequestModel myReferralInPatientRequestModel; - final bool isEdited; + final AddReferredRemarksRequestModel? myReferralInPatientRequestModel; + final bool? isEdited; const AddReplayOnReferralPatient( {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel, diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 2a48e079..cfd37cd0 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -37,7 +37,7 @@ class _ReplySummeryOnReferralPatientState builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).summeryReply, + appBarTitle: TranslationBase.of(context).summeryReply!, body: Container( child: Column( 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 7d6bdb08..68194da5 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 @@ -428,7 +428,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), ), - if (referredPatient.referredDoctorRemarks.isNotEmpty) + if (referredPatient.referredDoctorRemarks!.isNotEmpty) Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), @@ -487,7 +487,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { widget: AddReplayOnReferralPatient( patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, - isEdited: referredPatient.referredDoctorRemarks.isNotEmpty, + isEdited: referredPatient.referredDoctorRemarks!.isNotEmpty, ), ), ); diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index c94de944..0848eee2 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -138,10 +138,10 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).inPatient), value: PatientType.IN_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; - radioOnChange(value); + patientType = value!; + radioOnChange(value!); }); }, ), @@ -151,9 +151,9 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).outpatient), value: PatientType.OUT_PATIENT, groupValue: patientType, - onChanged: (PatientType value) { + onChanged: (PatientType? value) { setState(() { - patientType = value; + patientType = value!; radioOnChange(value); }); }, diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 2d1d5c4d..bed9825f 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -34,13 +34,13 @@ class PrescriptionItemsPage extends StatelessWidget { baseViewModel: model, patientProfileAppBarModel: PatientProfileAppBarModel( patient: patient, - clinic: prescriptions.clinicDescription, - branch: prescriptions.name, + clinic: prescriptions.clinicDescription!, + branch: prescriptions.name!, isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( prescriptions.appointmentDate!), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, + doctorName: prescriptions.doctorName!, + profileUrl: prescriptions.doctorImageURL!, isAppointmentHeader: true, ), body: SingleChildScrollView( diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 28a72041..39b52a28 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -10,19 +10,19 @@ enum ProcedureType { extension procedureType on ProcedureType { String getFavouriteTabName(BuildContext context) { - return TranslationBase.of(context).favoriteTemplates; + return TranslationBase.of(context).favoriteTemplates!; } String getAllLabelName(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).allProcedures; + return TranslationBase.of(context).allProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).allLab; + return TranslationBase.of(context).allLab!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).allRadiology; + return TranslationBase.of(context).allRadiology!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).allPrescription; + return TranslationBase.of(context).allPrescription!; default: return ""; } @@ -31,13 +31,13 @@ extension procedureType on ProcedureType { String getToolbarLabel(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -46,13 +46,13 @@ extension procedureType on ProcedureType { String getAddButtonTitle(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures; + return TranslationBase.of(context).addProcedures!; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder; + return TranslationBase.of(context).addLabOrder!; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder; + return TranslationBase.of(context).addRadiologyOrder!; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription; + return TranslationBase.of(context).addPrescription!; default: return ""; } @@ -61,7 +61,7 @@ extension procedureType on ProcedureType { String getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ''; case ProcedureType.LAB_RESULT: return "02"; case ProcedureType.RADIOLOGY: @@ -69,20 +69,20 @@ extension procedureType on ProcedureType { case ProcedureType.PRESCRIPTION: return "55"; default: - return null; + return ''; } } String getCategoryName() { switch (this) { case ProcedureType.PROCEDURE: - return null; + return ''; case ProcedureType.LAB_RESULT: return "Laboratory"; case ProcedureType.RADIOLOGY: return "Radiology"; default: - return null; + return ''; } } } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 04194d80..6c9dfd8b 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -24,11 +24,11 @@ class AddFavouriteProcedure extends StatefulWidget { final ProcedureType procedureType; AddFavouriteProcedure({ - Key key, - this.model, - this.prescriptionModel, - this.patient, - @required this.procedureType, + Key? key, + required this.model, + required this.prescriptionModel, + required this.patient, + required this.procedureType, }); @override @@ -38,26 +38,26 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel model; - PatiantInformtion patient; - List entityList = List(); - ProcedureTempleteDetailsModel groupProcedures; + ProcedureViewModel? model; + PatiantInformtion? patient; + List entityList = []; + late ProcedureTempleteDetailsModel groupProcedures; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), - if (model.templateList.length != 0) + if (model!.templateList.length != 0) Expanded( child: EntityListCheckboxSearchFavProceduresWidget( isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), @@ -88,8 +88,8 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.procedureType.getAddButtonTitle(context) ?? - TranslationBase.of(context).addSelectedProcedures, + title: widget.procedureType.getAddButtonTitle(context!) ?? + TranslationBase.of(context!).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { @@ -114,7 +114,7 @@ class _AddFavouriteProcedureState extends State { } else { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .fillTheMandatoryProcedureDetails, ); return; @@ -126,8 +126,8 @@ class _AddFavouriteProcedureState extends State { items: entityList, model: model, patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context), - toolbarTitle: widget.procedureType.getToolbarLabel(context), + 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 e0b7374f..9f953267 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, @required this.procedureType}) + {Key? key, required this.model, required this.patient, required this.procedureType}) : super(key: key); @override @@ -30,17 +30,17 @@ class AddProcedurePage extends StatefulWidget { } class _AddProcedurePageState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - ProcedureType procedureType; + 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(); + List entityList = []; + List entityListProcedure = []; TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -56,17 +56,17 @@ class _AddProcedurePageState extends State { return BaseView( onModelReady: (model) { model.getProcedureCategory( - categoryName: procedureType.getCategoryName(), - categoryID: procedureType.getCategoryId(), - patientId: patient.patientId); + categoryName: procedureType!.getCategoryName(), + categoryID: procedureType!.getCategoryId(), + patientId: patient!.patientId); }, - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: Column( children: [ Container( - height: MediaQuery.of(context).size.height * 0.070, + height: MediaQuery.of(context!).size.height * 0.070, ), Expanded( child: NetworkBaseView( @@ -86,7 +86,7 @@ class _AddProcedurePageState extends State { MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) + TranslationBase.of(context!) .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, @@ -95,15 +95,15 @@ class _AddProcedurePageState extends State { ), SizedBox( height: - MediaQuery.of(context).size.height * 0.02, + MediaQuery.of(context!).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * + width: MediaQuery.of(context!).size.width * 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context) + hintText: TranslationBase.of(context!) .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -113,7 +113,7 @@ class _AddProcedurePageState extends State { ), ), SizedBox( - width: MediaQuery.of(context).size.width * + width: MediaQuery.of(context!).size.width * 0.02, ), Expanded( @@ -121,13 +121,13 @@ class _AddProcedurePageState extends State { onTap: () { if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, + model!.getProcedureCategory( + patientId: patient!.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .atLeastThreeCharacters, ); }, @@ -144,13 +144,13 @@ class _AddProcedurePageState extends State { if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && - model.categoriesList.length != 0) + model!.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( model: widget.model, masterList: - model.categoriesList[0].entityList, + model!.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -181,24 +181,24 @@ class _AddProcedurePageState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: procedureType.getAddButtonTitle(context), + title: procedureType!.getAddButtonTitle(context!), fontWeight: FontWeight.w700, color: Color(0xff359846), onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) + TranslationBase.of(context!) .fillTheMandatoryProcedureDetails, ); return; } - await this.model.preparePostProcedure( + await this.model!.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, remarks: remarksController.text); - Navigator.pop(context); + Navigator.pop(context!); }, ), ], diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index bdf19051..202a261f 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -15,13 +15,13 @@ import 'add-favourite-procedure.dart'; import 'add-procedure-page.dart'; class BaseAddProcedureTabPage extends StatefulWidget { - final ProcedureViewModel model; - final PrescriptionViewModel prescriptionModel; - final PatiantInformtion patient; - final ProcedureType procedureType; + final ProcedureViewModel? model; + final PrescriptionViewModel? prescriptionModel; + final PatiantInformtion? patient; + final ProcedureType? procedureType; const BaseAddProcedureTabPage( - {Key key, + {Key? key, this.model, this.prescriptionModel, this.patient, @@ -30,7 +30,7 @@ class BaseAddProcedureTabPage extends StatefulWidget { @override _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( - patient: patient, model: model, procedureType: procedureType); + patient: patient!, model: model!, procedureType: procedureType!); } class _BaseAddProcedureTabPageState extends State @@ -39,9 +39,9 @@ class _BaseAddProcedureTabPageState extends State final PatiantInformtion patient; final ProcedureType procedureType; - _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); + _BaseAddProcedureTabPageState({required this.patient, required this.model, required this.procedureType}); - TabController _tabController; + late TabController _tabController; int _activeTab = 0; @override @@ -68,7 +68,7 @@ class _BaseAddProcedureTabPageState extends State final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( @@ -154,17 +154,17 @@ class _BaseAddProcedureTabPageState extends State AddFavouriteProcedure( model: this.model, prescriptionModel: - widget.prescriptionModel, + widget.prescriptionModel!, patient: patient, procedureType: procedureType, ), if (widget.procedureType == ProcedureType.PRESCRIPTION) PrescriptionFormWidget( - widget.prescriptionModel, - widget.patient, - widget.prescriptionModel - .prescriptionList) + widget.prescriptionModel!, + widget.patient!, + widget!.prescriptionModel! + .prescriptionList!) else AddProcedurePage( model: this.model, diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart index 8950fae3..550fedc5 100644 --- a/lib/util/NotificationPermissionUtils.dart +++ b/lib/util/NotificationPermissionUtils.dart @@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart'; class AppPermissionsUtils { - static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { + static requestVideoCallPermission({required BuildContext context, required String type,required Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index dc60efaf..d06e39c0 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -19,9 +19,9 @@ class VideoChannel { String? tokenID, String? generalId, int? doctorId, - String patientName, Function()? onCallEnd, + required String patientName, Function()? onCallEnd, Function(SessionStatusModel sessionStatusModel)? onCallNotRespond, - Function(String error)? onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { + Function(String error)? onFailure, VoidCallback? onCallConnected, VoidCallback? onCallDisconnected}) async { onCallConnected = onCallConnected ?? (){}; onCallDisconnected = onCallDisconnected ?? (){}; @@ -29,10 +29,10 @@ class VideoChannel { try { _channel.setMethodCallHandler((call) { if(call.method == 'onCallConnected'){ - onCallConnected(); + onCallConnected!(); } if(call.method == 'onCallDisconnected'){ - onCallDisconnected(); + onCallDisconnected!(); } return true as dynamic; }); diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 9b00ba2b..55700a75 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -396,7 +396,7 @@ class AppDateUtils { static convertDateFormatImproved(String str) { - String newDate; + String newDate =''; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -413,6 +413,6 @@ class AppDateUtils { date.day.toString().padLeft(2, '0'); } - return newDate??''; + return newDate; } } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 2376e191..a0e2acda 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -271,10 +271,10 @@ class Helpers { } - static String timeFrom({Duration duration}) { + 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)); + String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60)); + String twoDigitSeconds = twoDigits(duration!.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 270b4ad3..69f5eafe 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -847,8 +847,8 @@ class TranslationBase { String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String get addProcedures => - localizedValues['addProcedures'][locale.languageCode]; + String? get addProcedures => + localizedValues['addProcedures']![locale.languageCode]; String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; @@ -1081,14 +1081,14 @@ 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]; - 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]; + 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]; + 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/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index dcadb8be..ce401b2f 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class RowCounts extends StatelessWidget { final name; final int count; - final double height; + final double? height; final Color c; RowCounts(this.name, this.count, this.c, {this.height}); @override diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index 58718373..f7a23925 100644 --- a/lib/widgets/dialog/AskPermissionDialog.dart +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -10,7 +10,7 @@ class AskPermissionDialog extends StatefulWidget { final String type; final Function onTapGrant; - AskPermissionDialog({this.type, this.onTapGrant}); + AskPermissionDialog({required this.type, required this.onTapGrant}); @override _AskPermissionDialogState createState() => _AskPermissionDialogState(); diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index b769588b..022571fa 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -9,7 +9,7 @@ class ShowTimer extends StatefulWidget { const ShowTimer({ - Key key, this.patientInfo, + Key? key, required this.patientInfo, }) : super(key: key); @override @@ -50,7 +50,7 @@ class _ShowTimerState extends State { generateShowTimerString() { DateTime now = DateTime.now(); - DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); + DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!); String timer = AppDateUtils.differenceBetweenDateAndCurrent( liveCareDate, context, isShowSecond: true, isShowDays: false); diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 31d281ae..6191fd4d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -27,8 +27,8 @@ class PatientProfileButton extends StatelessWidget { final bool isSelectInpatient; final bool isDartIcon; final IconData? dartIcon; - final bool isFromLiveCare; - final Color color; + final bool? isFromLiveCare; + final Color? color; PatientProfileButton({ Key? key, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index c39caef1..8b7a4c05 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -16,20 +16,20 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatientProfileAppBarModel patientProfileAppBarModel; final bool isFromLabResult; - final VoidCallback onPressed; + final VoidCallback? onPressed; PatientProfileAppBar( - {this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed}); + {required this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); int gender = 1; - if (patientProfileAppBarModel.patient.patientDetails != null) { - gender = patientProfileAppBarModel.patient.patientDetails.gender; + if (patientProfileAppBarModel.patient!.patientDetails != null) { + gender = patientProfileAppBarModel.patient!.patientDetails!.gender!; } else { - gender = patientProfileAppBarModel.patient.gender; + gender = patientProfileAppBarModel.patient!.gender!; } return Container( @@ -54,22 +54,22 @@ class PatientProfileAppBar extends StatelessWidget color: Color(0xFF2B353E), //Colors.black, onPressed: () { if(onPressed!=null) - onPressed(); + onPressed!(); Navigator.pop(context); }, ), Expanded( child: AppText( - patientProfileAppBarModel.patient.firstName != null + patientProfileAppBarModel.patient!.firstName != null ? (Helpers.capitalize( - patientProfileAppBarModel.patient.firstName) + + patientProfileAppBarModel.patient!.firstName) + " " + Helpers.capitalize( - patientProfileAppBarModel.patient.lastName)) + patientProfileAppBarModel.patient!.lastName)) : Helpers.capitalize( - patientProfileAppBarModel.patient.fullName ?? + patientProfileAppBarModel.patient!.fullName ?? patientProfileAppBarModel - .patient.patientDetails.fullName), + .patient!.patientDetails!.fullName!), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -90,7 +90,7 @@ class PatientProfileAppBar extends StatelessWidget child: InkWell( onTap: () { launch("tel://" + - patientProfileAppBarModel.patient.mobileNumber); + patientProfileAppBarModel.patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -121,13 +121,13 @@ class PatientProfileAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - patientProfileAppBarModel.patient.patientStatusType != null + patientProfileAppBarModel.patient!.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ patientProfileAppBarModel - .patient.patientStatusType == + .patient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, @@ -143,14 +143,14 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - patientProfileAppBarModel.patient.startTime != + patientProfileAppBarModel.patient!.startTime != null ? AppText( patientProfileAppBarModel - .patient.startTime != + .patient!.startTime != null ? patientProfileAppBarModel - .patient.startTime + .patient!.startTime : '', fontWeight: FontWeight.w700, fontSize: 12, @@ -180,7 +180,7 @@ class PatientProfileAppBar extends StatelessWidget ), new TextSpan( text: patientProfileAppBarModel - .patient.patientId + .patient!.patientId .toString(), style: TextStyle( fontWeight: FontWeight.w700, @@ -194,28 +194,28 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText( - patientProfileAppBarModel.patient.nationalityName ?? + patientProfileAppBarModel.patient!.nationalityName ?? patientProfileAppBarModel - .patient.nationality ?? + .patient!.nationality ?? patientProfileAppBarModel - .patient.nationalityId ?? + .patient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), patientProfileAppBarModel - .patient.nationalityFlagURL != + .patient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( patientProfileAppBarModel - .patient.nationalityFlagURL, + .patient!.nationalityFlagURL!, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace stackTrace) { + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -234,7 +234,7 @@ class PatientProfileAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age + " : ", + text: TranslationBase.of(context).age! + " : ", style: TextStyle( fontSize: 10, fontWeight: FontWeight.w600, @@ -242,7 +242,7 @@ class PatientProfileAppBar extends StatelessWidget )), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient.patientDetails != null ? patientProfileAppBarModel.patient.patientDetails.dateofBirth ?? "" : patientProfileAppBarModel.patient.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.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, @@ -253,15 +253,15 @@ class PatientProfileAppBar extends StatelessWidget ), ), - if (patientProfileAppBarModel.patient.appointmentDate != + if (patientProfileAppBarModel.patient!.appointmentDate != null && patientProfileAppBarModel - .patient.appointmentDate.isNotEmpty && !isFromLabResult) + .patient!.appointmentDate!.isNotEmpty && !isFromLabResult) Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + " : ", + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 10, color: Color(0xFF575757), fontWeight: FontWeight.w600, @@ -274,7 +274,7 @@ class PatientProfileAppBar extends StatelessWidget AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( patientProfileAppBarModel - .patient.appointmentDate)), + .patient!.appointmentDate!)), fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -284,7 +284,7 @@ class PatientProfileAppBar extends StatelessWidget ) ], ), - if (patientProfileAppBarModel.isFromLabResult) + if (patientProfileAppBarModel.isFromLabResult!) Container( child: RichText( text: new TextSpan( @@ -304,7 +304,7 @@ class PatientProfileAppBar extends StatelessWidget )), new TextSpan( text: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12)), @@ -316,10 +316,10 @@ class PatientProfileAppBar extends StatelessWidget Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patientProfileAppBarModel.patient.admissionDate != + if (patientProfileAppBarModel.patient!.admissionDate != null && patientProfileAppBarModel - .patient.admissionDate.isNotEmpty) + .patient!.admissionDate!.isNotEmpty) Container( child: RichText( text: new TextSpan( @@ -332,26 +332,26 @@ class PatientProfileAppBar extends StatelessWidget children: [ new TextSpan( text: patientProfileAppBarModel - .patient.admissionDate == + .patient!.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate + + .admissionDate! + " : ", style: TextStyle(fontSize: 10)), new TextSpan( text: patientProfileAppBarModel - .patient.admissionDate == + .patient!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), )), ]))), - if (patientProfileAppBarModel.patient.admissionDate != + if (patientProfileAppBarModel.patient!.admissionDate != null) Row( children: [ @@ -360,20 +360,20 @@ class PatientProfileAppBar extends StatelessWidget fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), - if (patientProfileAppBarModel - .isDischargedPatient && + if (patientProfileAppBarModel! + .isDischargedPatient! && patientProfileAppBarModel - .patient.dischargeDate != + .patient!.dischargeDate != null) AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient.admissionDate)).inDays + 1}", + "${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}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -386,7 +386,7 @@ class PatientProfileAppBar extends StatelessWidget ), ), ]), - if (patientProfileAppBarModel.isAppointmentHeader) + if (patientProfileAppBarModel.isAppointmentHeader!) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -401,8 +401,8 @@ class PatientProfileAppBar extends StatelessWidget shape: BoxShape.rectangle, border: Border( bottom: - BorderSide(color: Colors.grey[400], width: 2.5), - left: BorderSide(color: Colors.grey[400], width: 2.5), + BorderSide(color: Colors.grey[400]!, width: 2.5), + left: BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -436,7 +436,7 @@ class PatientProfileAppBar extends StatelessWidget if (patientProfileAppBarModel.orderNo != null && !patientProfileAppBarModel - .isPrescriptions) + .isPrescriptions!) Row( children: [ AppText( @@ -454,8 +454,8 @@ class PatientProfileAppBar extends StatelessWidget ), if (patientProfileAppBarModel.invoiceNO != null && - !patientProfileAppBarModel - .isPrescriptions) + !patientProfileAppBarModel! + .isPrescriptions!) Row( children: [ AppText( @@ -506,7 +506,7 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (patientProfileAppBarModel - .isMedicalFile && + .isMedicalFile! && patientProfileAppBarModel.episode != null) Row( @@ -525,7 +525,7 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (patientProfileAppBarModel - .isMedicalFile && + .isMedicalFile! && patientProfileAppBarModel.visitDate != null) Row( @@ -544,12 +544,12 @@ class PatientProfileAppBar extends StatelessWidget ], ), if (!patientProfileAppBarModel - .isMedicalFile) + .isMedicalFile!) Row( children: [ AppText( !patientProfileAppBarModel - .isPrescriptions + .isPrescriptions! ? 'Result Date:' : 'Prescriptions Date ', fontSize: 10, @@ -557,7 +557,7 @@ class PatientProfileAppBar extends StatelessWidget color: Color(0xFF575757), ), AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', fontSize: 12, ) ], @@ -581,14 +581,14 @@ class PatientProfileAppBar extends StatelessWidget Size get preferredSize => Size( double.maxFinite, patientProfileAppBarModel.height == 0 - ? patientProfileAppBarModel.isAppointmentHeader + ? patientProfileAppBarModel.isAppointmentHeader! ? 270 - : ((patientProfileAppBarModel.patient.appointmentDate != null &&patientProfileAppBarModel.patient.appointmentDate.isNotEmpty ) - ? patientProfileAppBarModel.isFromLabResult?170:150 - : patientProfileAppBarModel.patient.admissionDate != null - ? patientProfileAppBarModel.isFromLabResult?170:150 - : patientProfileAppBarModel.isDischargedPatient - ? 240 - : 130) - : patientProfileAppBarModel.height); + : ((patientProfileAppBarModel.patient!.appointmentDate! != null &&patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty ) + ? patientProfileAppBarModel.isFromLabResult!?170:150 + : patientProfileAppBarModel.patient!.admissionDate != null + ? patientProfileAppBarModel.isFromLabResult!?170:150 + : patientProfileAppBarModel.isDischargedPatient! + ? 240! + : 130!) + : patientProfileAppBarModel.height!); } 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 251d2e65..d5ddd66c 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 @@ -20,10 +20,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred final bool isDischargedPatient; final bool isFromLiveCare; - final Stream videoCallDurationStream; + final Stream videoCallDurationStream; PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, - {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream}); + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, required this.videoCallDurationStream}); @override Widget build(BuildContext context) { @@ -101,7 +101,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred 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),), + child: Text(snapshot.data!, style: TextStyle(color: Colors.white),), ), ); else diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index fa09aa72..a8c59032 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -21,12 +21,12 @@ class AppScaffold extends StatelessWidget { final Widget? bottomSheet; final Color? backgroundColor; final PreferredSizeWidget? appBar; - final Widget drawer; - final Widget bottomNavigationBar; + final Widget? drawer; + final Widget? bottomNavigationBar; final String? subtitle; final bool isHomeIcon; final bool extendBody; - final PatientProfileAppBarModel patientProfileAppBarModel; + final PatientProfileAppBarModel? patientProfileAppBarModel; AppScaffold( {this.appBarTitle = '', @@ -57,7 +57,7 @@ class AppScaffold extends StatelessWidget { bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar ? patientProfileAppBarModel != null ? PatientProfileAppBar( - patientProfileAppBarModel: patientProfileAppBarModel,) : appBar ?? + patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ?? AppBar( elevation: 0, backgroundColor: Colors.white, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 6c46ea36..108b987c 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -18,7 +18,7 @@ class AppText extends StatefulWidget { final double? marginRight; final double? marginBottom; final double? marginLeft; - final double letterSpacing; + final double? letterSpacing; final TextAlign? textAlign; final bool? bold; final bool? regular; diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 4b80ae0a..a4dafc9e 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -22,7 +22,7 @@ class AppButton extends StatefulWidget { final double? radius; final double? vPadding; final double? hPadding; - final double height; + final double? height; AppButton({ @required this.onPressed, diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 4a38bfac..5da3f232 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -11,7 +11,7 @@ class DrawerItem extends StatefulWidget { final IconData? icon; final Color? color; final String? assetLink; - final double drawerWidth; + final double? drawerWidth; DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth}); From a1ef72295472532e63372f37cb370fb538c774d3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Jun 2021 17:07:04 +0300 Subject: [PATCH 051/199] fix yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e1040a32..80b6502a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -91,7 +91,7 @@ dependencies: speech_to_text: path: speech_to_text - quiver: ^2.1.5 + quiver: ^3.0.0 # Html Editor Enhanced html_editor_enhanced: ^2.1.1 From 95c7161987efc26f46cafa91c693923bbf6b002a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 21 Jun 2021 10:30:24 +0300 Subject: [PATCH 052/199] fix flutter 2 issue --- .../live_care/live_care_patient_screen.dart | 4 +- pubspec.lock | 376 +++++++++++------- pubspec.yaml | 1 + 3 files changed, 240 insertions(+), 141 deletions(-) diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index f92ced53..aee028cf 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -39,8 +39,8 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { _liveCareViewModel.isLogin(0); - _liveCareViewModel = null!; - timer?.cancel(); + // _liveCareViewModel = null!; + timer.cancel(); super.dispose(); } diff --git a/pubspec.lock b/pubspec.lock index e4fdc2dc..f6841219 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.6.1" autocomplete_textfield: dependency: "direct main" description: @@ -56,14 +56,14 @@ packages: name: bazel_worker url: "https://pub.dartlang.org" source: hosted - version: "0.1.25" + version: "1.0.0" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: @@ -119,49 +119,49 @@ packages: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "2.12.2" + version: "2.16.3" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "5.1.0" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" charts_common: dependency: transitive description: name: charts_common url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" charts_flutter: dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.10.0" checked_yaml: dependency: transitive description: @@ -175,14 +175,14 @@ packages: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "0.9.10" + version: "1.2.2" chewie_audio: dependency: transitive description: name: chewie_audio url: "https://pub.dartlang.org" source: hosted - version: "1.0.0+1" + version: "1.2.0" cli_util: dependency: transitive description: @@ -196,7 +196,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: @@ -210,35 +210,35 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" connectivity: dependency: "direct main" description: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+5" + version: "3.0.6" connectivity_for_web: dependency: transitive description: name: connectivity_for_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.1+4" + version: "0.4.0" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+7" + version: "0.2.0" connectivity_platform_interface: dependency: transitive description: name: connectivity_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.1" convert: dependency: transitive description: @@ -253,27 +253,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.5" - css_colors: - dependency: transitive - description: - name: css_colors - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.16.2" + version: "0.17.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.0.3" dart_style: dependency: transitive description: @@ -287,124 +280,152 @@ packages: name: date_time_picker url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "2.0.0" device_info: dependency: "direct main" description: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.2+10" + version: "2.0.2" device_info_platform_interface: dependency: transitive description: name: device_info_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.1" dropdown_search: dependency: "direct main" description: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.6.3" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.2.6" + version: "2.0.3" eva_icons_flutter: dependency: "direct main" description: name: eva_icons_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.0" expandable: dependency: "direct main" description: name: expandable url: "https://pub.dartlang.org" source: hosted - version: "4.1.4" + version: "5.0.1" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "5.2.1" + version: "6.1.2" + file_picker: + dependency: "direct main" + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2+2" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.5.3" + version: "1.3.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "4.0.1" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.1+1" + version: "1.1.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "7.0.3" + version: "10.0.2" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.11" + version: "1.0.0" fl_chart: dependency: "direct main" description: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.12.3" + version: "0.36.2" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_colorpicker: + dependency: "direct main" + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" flutter_device_type: dependency: "direct main" description: name: flutter_device_type url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.0" flutter_flexible_toast: dependency: "direct main" description: @@ -425,19 +446,54 @@ packages: name: flutter_html url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.1.0" flutter_inappwebview: dependency: transitive description: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "4.0.0+4" + version: "5.3.2" + flutter_keyboard_visibility: + dependency: transitive + description: + name: flutter_keyboard_visibility + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.2" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_layout_grid: + dependency: transitive + description: + name: flutter_layout_grid + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3+1" flutter_page_indicator: dependency: transitive description: @@ -451,21 +507,21 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "1.0.11" + version: "2.0.2" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.4.0" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.18.1" + version: "0.22.0" flutter_swiper: dependency: "direct main" description: @@ -489,14 +545,14 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "8.12.0" + version: "9.1.0" get_it: dependency: "direct main" description: name: get_it url: "https://pub.dartlang.org" source: hosted - version: "4.0.4" + version: "7.1.3" glob: dependency: transitive description: @@ -517,35 +573,35 @@ packages: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" + version: "2.0.4" html: dependency: "direct main" description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+4" + version: "0.15.0" html_editor_enhanced: dependency: "direct main" description: name: html_editor_enhanced url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "2.2.0+1-dev.1" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.13.3" http_interceptor: dependency: "direct main" description: name: http_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.4.1" http_multi_server: dependency: transitive description: @@ -559,7 +615,7 @@ packages: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" imei_plugin: dependency: "direct main" description: @@ -567,13 +623,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + infinite_listview: + dependency: transitive + description: + name: infinite_listview + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.16.1" + version: "0.17.0" io: dependency: transitive description: @@ -587,21 +650,21 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "4.0.1" local_auth: dependency: "direct main" description: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "0.6.3+4" + version: "1.1.6" logging: dependency: transitive description: @@ -615,21 +678,21 @@ packages: name: maps_launcher url: "https://pub.dartlang.org" source: hosted - version: "1.2.2+2" + version: "2.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" mime: dependency: transitive description: @@ -643,7 +706,7 @@ packages: name: nested url: "https://pub.dartlang.org" source: hosted - version: "0.0.4" + version: "1.0.0" node_interop: dependency: transitive description: @@ -657,14 +720,21 @@ packages: name: node_io url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - open_iconic_flutter: + version: "1.1.1" + numberpicker: dependency: transitive description: - name: open_iconic_flutter + name: numberpicker url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "2.1.1" + numerus: + dependency: transitive + description: + name: numerus + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" package_config: dependency: transitive description: @@ -678,91 +748,98 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.4.1+1" + version: "0.5.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.1" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+2" + version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "2.0.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.11.1" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "2.1.9+1" + version: "3.0.1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "5.1.0+2" + version: "8.1.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.6.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.1.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "2.0.0" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0+1" pool: dependency: transitive description: @@ -776,28 +853,21 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "3.0.13" - progress_hud_v2: - dependency: "direct main" - description: - name: progress_hud_v2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" + version: "4.2.1" protobuf: dependency: transitive description: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "2.0.0" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.3" + version: "5.0.0" pub_semver: dependency: transitive description: @@ -818,7 +888,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.1" scratch_space: dependency: transitive description: @@ -826,62 +896,55 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.4+3" - screen: - dependency: transitive - description: - name: screen - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.12+4" + version: "2.0.6" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+4" + version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+11" + version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.2+7" + version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+3" + version: "2.0.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "0.7.9" + version: "1.1.4" shelf_web_socket: dependency: transitive description: @@ -907,7 +970,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" speech_to_text: dependency: "direct main" description: @@ -921,21 +984,21 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" sticky_headers: dependency: "direct main" description: name: sticky_headers url: "https://pub.dartlang.org" source: hosted - version: "0.1.8+1" + version: "0.2.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: @@ -949,21 +1012,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.3.0" timing: dependency: transitive description: @@ -978,97 +1041,132 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.6" + tuple: + dependency: transitive + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.7.10" + version: "6.0.6" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+4" + version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+9" + version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.0.3" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.5+3" + version: "2.0.1" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+3" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.2" + version: "2.0.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.0" video_player: dependency: transitive description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "0.10.12+5" + version: "2.1.6" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "4.1.0" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+1" + version: "2.0.1" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" wakelock: dependency: transitive description: name: wakelock url: "https://pub.dartlang.org" source: hosted - version: "0.1.4+2" + version: "0.5.2" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+1" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" watcher: dependency: transitive description: @@ -1089,28 +1187,28 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.3.24" + version: "2.0.8" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.4+1" + version: "2.2.2" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "4.5.1" + version: "5.1.2" yaml: dependency: transitive description: @@ -1119,5 +1217,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.22.0 <2.0.0" + dart: ">=2.13.0 <3.0.0" + flutter: ">=2.2.0" diff --git a/pubspec.yaml b/pubspec.yaml index 80b6502a..e582ef08 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -92,6 +92,7 @@ dependencies: path: speech_to_text quiver: ^3.0.0 + flutter_colorpicker: ^0.5.0 # Html Editor Enhanced html_editor_enhanced: ^2.1.1 From 550d54c034c26a0d24d73e6fe398cf2238e4f047 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 21 Jun 2021 15:11:57 +0300 Subject: [PATCH 053/199] flutter 2 migration fix --- lib/client/base_app_client.dart | 6 +- lib/config/size_config.dart | 29 +- lib/core/service/patient/patient_service.dart | 2 +- .../prescription/prescription_service.dart | 2 +- .../prescription/prescriptions_service.dart | 2 +- .../viewModel/authentication_view_model.dart | 17 +- lib/core/viewModel/dashboard_view_model.dart | 14 +- lib/core/viewModel/patient_view_model.dart | 22 +- lib/core/viewModel/procedure_View_model.dart | 42 +- lib/core/viewModel/project_view_model.dart | 4 +- .../auth/verification_methods_screen.dart | 540 ++++---- .../home/dashboard_referral_patient.dart | 241 ++-- .../home/dashboard_slider-item-widget.dart | 22 +- lib/screens/home/home_screen.dart | 46 +- .../live-care_transfer_to_admin.dart | 28 +- .../medical-file/medical_file_details.dart | 89 +- lib/screens/patients/InPatientPage.dart | 150 +-- .../insurance_approval_screen_patient.dart | 2 +- .../patients/insurance_approvals_details.dart | 1198 ++++++++--------- .../patient_search/patient_search_screen.dart | 2 +- .../lab_result/laboratory_result_page.dart | 14 +- .../AddVerifyMedicalReport.dart | 136 +- .../profile/note/progress_note_screen.dart | 17 +- .../patient_profile_screen.dart | 83 +- .../ReplySummeryOnReferralPatient.dart | 22 +- .../referral/referred-patient-screen.dart | 119 +- .../assessment/update_assessment_page.dart | 2 +- .../vital_sign/vital_sign_details_screen.dart | 4 +- .../vital_sign_item_details_screen.dart | 6 +- .../prescription/add_prescription_form.dart | 6 +- .../prescription_checkout_screen.dart | 10 +- .../prescription_item_in_patient_page.dart | 32 +- .../prescription/prescription_items_page.dart | 22 +- lib/screens/procedures/ProcedureCard.dart | 9 +- .../procedures/add-favourite-procedure.dart | 32 +- .../procedures/add-procedure-page.dart | 65 +- .../base_add_procedure_tab_page.dart | 42 +- .../procedures/procedure_checkout_screen.dart | 8 +- lib/screens/procedures/procedure_screen.dart | 6 +- lib/util/helpers.dart | 7 +- lib/widgets/doctor/doctor_reply_widget.dart | 2 +- lib/widgets/doctor/my_schedule_widget.dart | 4 +- .../patient-referral-item-widget.dart | 44 +- .../patients/patient_card/PatientCard.dart | 17 +- .../profile/add-order/addNewOrder.dart | 2 +- .../profile/patient-profile-app-bar.dart | 366 ++--- lib/widgets/shared/StarRating.dart | 4 +- .../shared/buttons/secondary_button.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 4 +- lib/widgets/shared/doctor_card.dart | 2 +- lib/widgets/shared/errors/error_message.dart | 2 +- 51 files changed, 1555 insertions(+), 1994 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 00069e3a..5286a54b 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -44,10 +44,10 @@ class BaseAppClient { if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; + body['ProjectID'] = doctorProfile.projectID; } - if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID; if (body['DoctorID'] == '') { body['DoctorID'] = null; } @@ -56,7 +56,7 @@ class BaseAppClient { } } if (body['TokenID'] == null) { - body['TokenID'] = token ?? ''; + body['TokenID'] = token; } // body['TokenID'] = "@dm!n" ?? ''; String lang = await sharedPref.getString(APP_Language); diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 75c37643..2cbec3eb 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -37,16 +37,16 @@ class SizeConfig { } else if (constraints.maxHeight < 1000) { isHeightMiddle = true; } else { - isHeightLarge = true; + isHeightLarge = true; } - if(constraints.maxWidth > 600) { + if (constraints.maxWidth > 600) { isWidthLarge = true; } if (orientation == Orientation.portrait) { isPortrait = true; - if (realScreenWidth! < 450) { + if (realScreenWidth < 450) { isMobilePortrait = true; } screenHeight = realScreenHeight; @@ -57,8 +57,8 @@ class SizeConfig { screenHeight = realScreenWidth; screenWidth = realScreenHeight; } - _blockWidth = (screenWidth! / 100); - _blockHeight = (screenHeight! / 100)!; + _blockWidth = (screenWidth / 100); + _blockHeight = (screenHeight / 100); textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; @@ -75,27 +75,26 @@ class SizeConfig { print('isMobilePortrait $isMobilePortrait'); } - static getTextMultiplierBasedOnWidth({double? width}){ + static getTextMultiplierBasedOnWidth({double? width}) { // TODO handel LandScape case - if(width != null) { - return width / 100; + if (width != null) { + return width / 100; } return widthMultiplier; } - - static getWidthMultiplier({double? width}){ + static getWidthMultiplier({double? width}) { // TODO handel LandScape case - if(width != null) { - return width / 100; + if (width != null) { + return width / 100; } return widthMultiplier; } - static getHeightMultiplier({double? height}){ + static getHeightMultiplier({double? height}) { // TODO handel LandScape case - if(height != null) { - return height / 100; + if (height != null) { + return height / 100; } return heightMultiplier; } diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 52c10ad5..3d97ae10 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -428,7 +428,7 @@ class PatientService extends BaseService { referralClinic: selectedClinicID.toString(), referralDoctor: selectedDoctorID.toString(), createdBy: doctorID!, - editedBy: doctorID!, + editedBy: doctorID, patientID: patientID!, patientTypeID: patientTypeID!, referringClinic: clinicId!, diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index 96399156..4a672412 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -203,7 +203,7 @@ class PrescriptionService extends LookupService { "Gender": patient.gender == 1 ? 'Male' : 'Female', "Age": AppDateUtils.convertDateFromServerFormat(patient.dateofBirth!, 'dd/MM/yyyy') }, - "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, + "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg}, "objPrescriptionItems": prescription, "objAllergies": getAllergiesObj(allergy), "objDiagnosis": getDiagnosisObj(lstAssessments), diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index 83fc9fd3..22e5044d 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -124,7 +124,7 @@ class PrescriptionsService extends BaseService { bool isInPatient = false; prescriptionsList.forEach((element) { if (prescriptionsOrder!.appointmentNo == "0") { - if (element.dischargeNo == int.parse(prescriptionsOrder!.dischargeID)) { + if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.projectID = element.projectID; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 52819e43..a38cd0eb 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -184,7 +184,7 @@ class AuthenticationViewModel extends BaseViewModel { mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), - activationCode: activationCode ?? '0000', + activationCode: activationCode, oTPSendType: await sharedPref.getInt(OTP_TYPE), generalid: "Cs2020@2016\$2958"); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); @@ -232,8 +232,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!); - // DrAppToastMsg.showSuccesToast("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, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); sharedPref.setString(LOGIN_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.logInTokenID!); @@ -270,11 +270,12 @@ class AuthenticationViewModel extends BaseViewModel { /// get doctor profile based on clinic model Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async { ProfileReqModel docInfo = new ProfileReqModel( - doctorID: clinicInfo.doctorID, - clinicID: clinicInfo.clinicID, - license: true, - projectID: clinicInfo.projectID, - tokenID: '',); //TODO change the lan + doctorID: clinicInfo.doctorID, + clinicID: clinicInfo.clinicID, + license: true, + projectID: clinicInfo.projectID, + tokenID: '', + ); //TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error!; diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 27489733..409fc935 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -24,8 +24,8 @@ class DashboardViewModel extends BaseViewModel { String? get sServiceID => _dashboardService.sServiceID; - List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; - + List get specialClinicalCareList => + _specialClinicsService.specialClinicalCareList; Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); @@ -82,7 +82,7 @@ class DashboardViewModel extends BaseViewModel { ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error!; + error = authProvider.error; } } @@ -93,16 +93,14 @@ class DashboardViewModel extends BaseViewModel { return value.toString(); } - - GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId){ - GetSpecialClinicalCareListResponseModel? special ; + GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId) { + GetSpecialClinicalCareListResponseModel? special; specialClinicalCareList.forEach((element) { - if(element.clinicID == 1){ + if (element.clinicID == 1) { special = element; } }); return special; - } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 188e4be2..7b25b6fe 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -110,7 +110,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientRadiology(patient); if (_patientService.hasError) { - error = _patientService.error!!; + error = _patientService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -231,16 +231,16 @@ class PatientViewModel extends BaseViewModel { Future referToDoctor( {required String selectedDoctorID, - required String selectedClinicID, - required int admissionNo, - required String extension, - required String priority, - required String frequency, - required String referringDoctorRemarks, - required int patientID, - required int patientTypeID, - required String roomID, - required int projectID}) async { + required String selectedClinicID, + required int admissionNo, + required String extension, + required String priority, + required String frequency, + required String referringDoctorRemarks, + required int patientID, + required int patientTypeID, + required String roomID, + required int projectID}) async { setState(ViewState.BusyLocal); await _patientService.referToDoctor( selectedClinicID: selectedClinicID, diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 4d68ea52..81edda20 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -23,8 +23,7 @@ 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; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; class ProcedureViewModel extends BaseViewModel { //TODO Hussam clean it @@ -78,15 +77,12 @@ 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); @@ -318,14 +314,13 @@ class ProcedureViewModel extends BaseViewModel { {String? remarks, String? orderType, PatiantInformtion? patient, - List ? entityList, + List? entityList, ProcedureType? procedureType}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = - new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient!.patientMRN; - procedureValadteRequestModel.episodeID = patient!.episodeNo; - procedureValadteRequestModel.appointmentNo = patient!.appointmentNo; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; List controlsProcedure = []; @@ -334,31 +329,23 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.patientMRN = patient.patientMRN; entityList!.forEach((element) { - procedureValadteRequestModel.procedure = [element!.procedureId!]; + procedureValadteRequestModel.procedure = [element.procedureId!]; List controls = []; controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( - Controls( - code: "ordertype", - controlValue: procedureType == ProcedureType.PROCEDURE - ? element.type ?? "1" - : "0"), + Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"), ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); + 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!); + await postProcedure(postProcedureReqModel, patient.patientMRN!); if (state == ViewState.ErrorLocal) { Helpers.showErrorToast(error); @@ -371,8 +358,7 @@ class ProcedureViewModel extends BaseViewModel { Helpers.showErrorToast(error); getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { - Helpers.showErrorToast( - valadteProcedureList[0].entityList![0].warringMessages); + Helpers.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages); } } } else { diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 75eecbc6..c1ca9bbb 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,7 +17,7 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - late Locale _appLocale = Locale(currentLanguage ); + late Locale _appLocale = Locale(currentLanguage); String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; @@ -52,7 +52,7 @@ class ProjectViewModel with ChangeNotifier { void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); - _appLocale = Locale(currentLanguage ?? 'en'); + _appLocale = Locale(currentLanguage); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index f8e62ea1..d41c6e2b 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -61,68 +61,63 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?6:4), - ), - if(authenticationViewModel.isFromLogin) - InkWell( - onTap: (){ - authenticationViewModel.setUnverified(false,isFromLogin: false); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, - child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4), ), + 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: SizeConfig.heightMultiplier*(SizeConfig.isHeightVeryShort?3:4), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4), ), authenticationViewModel.user != null && isMoreOption == false ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - AppText( - TranslationBase.of(context).welcomeBack, - fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4, - fontWeight: FontWeight.w700, - color: Color(0xFF2B353E), - ), - AppText( - Helpers.capitalize(authenticationViewModel.user!.doctorName), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: SizeConfig.heightMultiplier*4, - ), - AppText( - TranslationBase.of(context).accountInfo , - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - ), - SizedBox( - height: SizeConfig.heightMultiplier*4 - ), - 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, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText( + TranslationBase.of(context).welcomeBack, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + fontWeight: FontWeight.w700, + color: Color(0xFF2B353E), + ), + AppText( + Helpers.capitalize(authenticationViewModel.user!.doctorName), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + ), + SizedBox( + height: SizeConfig.heightMultiplier * 4, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + ), + SizedBox(height: SizeConfig.heightMultiplier * 4), + 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, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Container( width: SizeConfig.realScreenWidth * .5, padding: EdgeInsets.all(0), @@ -130,277 +125,198 @@ class _VerificationMethodsScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - TranslationBase.of(context) - .lastLoginAt!, + TranslationBase.of(context).lastLoginAt!, overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, ), ), Container( - width: MediaQuery.of(context) - .size - .width * - 0.55, + 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, + fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, fontFamily: 'Poppins', ), children: [ TextSpan( - text: authenticationViewModel - .getType( - authenticationViewModel - .user - !.logInTypeID, - context), + text: authenticationViewModel.getType( + authenticationViewModel.user!.logInTypeID, context), style: TextStyle( - color: - Color(0xFF2B353E), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.5, + color: Color(0xFF2B353E), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, fontFamily: 'Poppins', - fontWeight: - FontWeight.w700, + fontWeight: FontWeight.w700, ), ) ]), ), ), ], - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, ), ), Column( mainAxisAlignment: MainAxisAlignment.start, - children: [ AppText( - authenticationViewModel - .user!.editedOn != - null - ? AppDateUtils - .getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - authenticationViewModel - ! .user - !.editedOn!)) - : authenticationViewModel - .user!.createdOn! != - null + 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: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, + AppDateUtils.convertStringToDate( + authenticationViewModel.user!.createdOn!)) + : '--', + textAlign: TextAlign.right, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, + 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: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + ) + ], ), - 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: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, - - ) + ), + SizedBox( + height: SizeConfig.heightMultiplier * 3, + ), + Row( + children: [ + //todo add translation + AppText( + "Please Verify", + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox( + height: SizeConfig.heightMultiplier * 2, + ), ], - ), - ), - SizedBox( - height: SizeConfig.heightMultiplier*3, - ), - - Row( - children: [ - - //todo add translation - AppText( - "Please Verify", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ), - SizedBox( - height: SizeConfig.heightMultiplier*2, - ), - ], - ) + ) : 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: SizeConfig.getTextMultiplierBasedOnWidth()* 4 , - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - textAlign: TextAlign.left, - ), - ) - : AppText( - TranslationBase.of(context) - .verifyFingerprint2, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth()* 4, - textAlign: TextAlign.start, - ), - ]), + 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: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + textAlign: TextAlign.left, + ), + ) + : AppText( + TranslationBase.of(context).verifyFingerprint2, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + 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, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, 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), + 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; + }); + }, )) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: - MainAxisAlignment.center, + ]), + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, 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), - )) - ], - ), - ]), + 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), + )) + ], + ), + ]), // ) ], @@ -410,36 +326,36 @@ class _VerificationMethodsScreenState extends State { ), ), ), - bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( - // color: Colors.green, - height: SizeConfig.heightMultiplier * 10 , - width: double.infinity, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppButton( - title: TranslationBase - .of(context) - .useAnotherAccount, - color: Color(0xFFD02127), - - fontWeight: FontWeight.w700, - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 8 : 6), - hPadding: 1, - - onPressed: () { - authenticationViewModel.deleteUser(); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, + bottomSheet: authenticationViewModel.user == null + ? SizedBox( + height: 0, + ) + : Container( + // color: Colors.green, + height: SizeConfig.heightMultiplier * 10, + width: double.infinity, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).useAnotherAccount, + color: Color(0xFFD02127), + fontWeight: FontWeight.w700, + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 8 : 6), + hPadding: 1, + onPressed: () { + authenticationViewModel.deleteUser(); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + ), + ], + ), ), - - ], + ), ), - ), - ),), ); } diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index a7e4339d..fd5ab744 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -1,4 +1,3 @@ - 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'; @@ -29,152 +28,117 @@ class DashboardReferralPatient extends StatelessWidget { 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: [ - SizedBox( - height: SizeConfig - .getHeightMultiplier( - height: height) * - (SizeConfig.isHeightVeryShort - ? 3 - : SizeConfig.isHeightShort + 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: [ + 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), - secondLineFontSize: SizeConfig - .getHeightMultiplier( - height: height) * - (SizeConfig.isHeightVeryShort - ? 5 - : SizeConfig.isHeightShort + : 2)), + Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).referral, + color: Color(0xFF2B353E), + secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort ? 7 - : 12),), - - SizedBox( - height: SizeConfig - .getHeightMultiplier( - height: height) * - (SizeConfig.isHeightVeryShort - ? 5 - : SizeConfig.isHeightShort - ? 10 - : 5) - ) - ], - ),), - 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!,), - ], + : 12), ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - padding:EdgeInsets.all(0), - - child: GaugeChart( - _createReferralData(dashboardItemList!))), - Positioned( + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 10 + : 5)) + ], + ), + ), + Expanded( + flex: 1, child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - model! - .getPatientCount(dashboardItemList![2]) - .toString(), - fontSize: SizeConfig.textMultiplier * 3.0, - fontWeight: FontWeight.bold, - ) + 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!, + ), ], ), - top: height! * (SizeConfig.isHeightVeryShort?0.35:0.40), - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + ) + ], + )), + ), + 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! * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + 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), + 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 [ @@ -191,5 +155,4 @@ class DashboardReferralPatient extends StatelessWidget { 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 a78cfd1f..3c633430 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -15,18 +15,24 @@ class DashboardSliderItemWidget extends StatelessWidget { Widget build(BuildContext context) { return Column( children: [ - Row( + Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Label(firstLine:Helpers.getLabelFromKPI(item!.kPIName!) ,secondLine:Helpers.getNameFromKPI(item!.kPIName!), ), - + Label( + firstLine: Helpers.getLabelFromKPI(item.kPIName!), + secondLine: Helpers.getNameFromKPI(item.kPIName!), + ), ], ), - - - - new Container( - height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13), + new Container( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, children: List.generate(item.summaryoptions!.length, (int index) { diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 95897dd3..5c97cb9c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -38,8 +38,8 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel ?projectsProvider; - DoctorProfileModel ?profile; + ProjectViewModel? projectsProvider; + DoctorProfileModel? profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; @@ -48,7 +48,6 @@ class _HomeScreenState extends State { int colorIndex = 0; final GlobalKey scaffoldKey = new GlobalKey(); - @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); @@ -60,7 +59,6 @@ class _HomeScreenState extends State { } return BaseView( - onModelReady: (model) async { await model.setFirebaseNotification(projectsProvider, authenticationViewModel); await model.getDashboard(); @@ -71,9 +69,9 @@ class _HomeScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: HomeScreenHeader( + appBar: HomeScreenHeader( model: model, - onOpenDrawer: (){ + onOpenDrawer: () { Scaffold.of(context).openDrawer(); }, ), @@ -108,13 +106,10 @@ class _HomeScreenState extends State { height: SizeConfig.heightMultiplier * 3, ), sliderActiveIndex == 1 - ? DashboardSliderItemWidget( - model.dashboardItemsList[4]) + ? DashboardSliderItemWidget(model.dashboardItemsList[4]) : sliderActiveIndex == 0 - ? DashboardSliderItemWidget( - model.dashboardItemsList[3]) - : DashboardSliderItemWidget( - model.dashboardItemsList[6]), + ? DashboardSliderItemWidget(model.dashboardItemsList[3]) + : DashboardSliderItemWidget(model.dashboardItemsList[6]), ], ), ), @@ -131,7 +126,8 @@ class _HomeScreenState extends State { borderRadius: BorderRadius.only( topRight: Radius.circular(70), )), - padding: EdgeInsets.only(left: SizeConfig.widthMultiplier * 3.1, top: 10, right: SizeConfig.widthMultiplier * 3.1), + 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, @@ -154,7 +150,9 @@ class _HomeScreenState extends State { ? 16 : SizeConfig.isHeightShort ? 14 - : SizeConfig.isHeightLarge?15:13), + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, children: [ @@ -162,8 +160,13 @@ class _HomeScreenState extends State { ], ), ), - SizedBox(height: SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?4:2)) - + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 3 + : SizeConfig.isHeightShort + ? 4 + : 2)) ], ), ), @@ -174,7 +177,7 @@ class _HomeScreenState extends State { ); } - List homePatientsCardsWidget(DashboardViewModel model,projectsProvider) { + List homePatientsCardsWidget(DashboardViewModel model, projectsProvider) { colorIndex = 0; // List backgroundColors = List(3); @@ -193,7 +196,6 @@ class _HomeScreenState extends State { // List patientCards = []; // - List backgroundColors = []; backgroundColors.add(Color(0xffD02127)); backgroundColors.add(Colors.grey[300]!); @@ -239,8 +241,9 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(specialClinic: model!.getSpecialClinic(clinicId??projectsProvider - !.doctorClinicsList[0]!.clinicID!),), + page: PatientInPatientScreen( + specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!), + ), ), ); }, @@ -327,6 +330,3 @@ class _HomeScreenState extends State { } } } - - - 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 4b9200ad..00cb9579 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -110,20 +110,20 @@ class _LivaCareTransferToAdminState extends State { if (noteController.text.isNotEmpty) { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - await 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(); - } - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + await 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(); + } + }); } }); }, diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 6dff0abc..7fab2bd8 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -104,10 +104,9 @@ class _MedicalFileDetailsState extends State { isPrescriptions: true, isMedicalFile: true, episode: episode, - visitDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', + visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', isAppointmentHeader: true, ); @@ -128,30 +127,20 @@ class _MedicalFileDetailsState extends State { model.getMedicalFile(mrn: pp); } }, - builder: - (BuildContext? context, MedicalFileViewModel? model, Widget ?child) => - AppScaffold( - 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] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations! - .length != + builder: (BuildContext? context, MedicalFileViewModel? model, Widget? child) => AppScaffold( + 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].timelines![encounterNumber].timeLineEvents![0] + .consulations!.length != 0 ? Padding( padding: EdgeInsets.all(10.0), @@ -160,7 +149,7 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model.medicalFileList![0].entityList![0].timelines![encounterNumber] + model.medicalFileList[0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -205,7 +194,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -224,7 +213,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -254,7 +243,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList![0].entityList![0].timelines![encounterNumber] + model.medicalFileList[0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -297,7 +286,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -319,7 +308,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -342,7 +331,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -361,7 +350,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -383,7 +372,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -401,7 +390,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -432,7 +421,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList![0].entityList![0].timelines![encounterNumber] + model.medicalFileList[0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -475,7 +464,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -498,7 +487,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -520,7 +509,7 @@ class _MedicalFileDetailsState extends State { AppText( AppDateUtils.getDateFormatted(DateTime.parse( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -544,7 +533,7 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -563,7 +552,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -600,7 +589,7 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList![0].entityList![0].timelines![encounterNumber] + model.medicalFileList[0].entityList![0].timelines![encounterNumber] .timeLineEvents![0].consulations!.length != 0) Container( @@ -645,7 +634,7 @@ class _MedicalFileDetailsState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -663,7 +652,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).examType! + ": "), AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -678,7 +667,7 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -694,7 +683,7 @@ class _MedicalFileDetailsState extends State { AppText(TranslationBase.of(context).abnormal! + ": "), AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] @@ -710,7 +699,7 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList![0] + .medicalFileList[0] .entityList![0] .timelines![encounterNumber] .timeLineEvents![0] diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index 8a9d3cef..b43ac22b 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -62,87 +62,87 @@ class _InPatientPageState extends State { model.filterSearchResults(value); }), ), - model.state == ViewState.Idle?model.filteredInPatientItems.length > 0 - ? Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate(model.filteredInPatientItems.length, (index) { - if (!widget.isMyInPatient) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: - model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + model.state == ViewState.Idle + ? model.filteredInPatientItems.length > 0 + ? Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: SingleChildScrollView( + child: ListView.builder( + physics: const AlwaysScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: 70, + itemBuilder: (context, index) { + if (!widget.isMyInPatient) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else if (model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID && - widget.isMyInPatient) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: - model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if (model.filteredInPatientItems[index].doctorId == + model.doctorProfile!.doctorID && + widget.isMyInPatient) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else - return SizedBox(); - }), - SizedBox( - height: 15, - ) - ], + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else + return SizedBox(); + }), + ), ), - ), - ), - ) - : Expanded( - child: SingleChildScrollView( - child: Container(child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable ?? "")), - ), - ): Center( + ) + : Expanded( + child: SingleChildScrollView( + child: + Container(child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable ?? "")), + ), + ) + : Center( child: Container( height: 300, width: 300, - child: Image.asset( - "assets/images/progress-loading-red.gif"), + child: Image.asset("assets/images/progress-loading-red.gif"), ), ), ], diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 9090f24b..411228ed 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -37,7 +37,7 @@ class _InsuranceApprovalScreenNewState extends State ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient?.appointmentNo, projectId: patient.projectId) + appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( patientProfileAppBarModel: PatientProfileAppBarModel( diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 1d039a72..a506b113 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -32,8 +32,8 @@ class _InsuranceApprovalsDetailsState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context!); - final routeArgs = ModalRoute.of(context!)!.settings.arguments as Map; + ProjectViewModel projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -44,747 +44,599 @@ class _InsuranceApprovalsDetailsState extends State { appointmentNo: patient.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) => - AppScaffold( - isShowAppBar: true, - baseViewModel: model, - patientProfileAppBarModel: - PatientProfileAppBarModel(patient: patient), - body: patient.admissionNo != null - ? SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context!).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context!).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], + AppText( + TranslationBase.of(context!).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ], ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? model!.insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model!.insuranceApprovalInPatient[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" || - "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "تمت الموافقة" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), - ), - ], - ), - Row( - children: [ - AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - .doctorName! - .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], + AppText( + model!.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != null + ? model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption ?? + "" + : "", + color: model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != + null + ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( + ], + ), + Row( + children: [ + AppText( + model.insuranceApprovalInPatient[indexInsurance].doctorName!.toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( children: [ - Column( - children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig - .imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular( - 50), - child: Image.network( - model!.insuranceApprovalInPatient[ - indexInsurance] - .doctorImage!, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: - Colors.transparent, + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + model.insuranceApprovalInPatient[indexInsurance].doctorImage!, + fit: BoxFit.fill, + width: 700, ), ), - ], + backgroundColor: Colors.transparent, + ), ), - Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( children: [ - SizedBox( - height: 25.0, + AppText( + TranslationBase.of(context).clinic! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .clinic! + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - .clinicName, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance].clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .approvalNo! + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].approvalNo + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - 'Unused Count:', - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApprovalInPatient[indexInsurance].unUsedCount + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).companyName! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .companyName! + - ": ", - color: Colors.grey[500], - ), - AppText('Sample') - ], + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).receiptOn! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn! + - ": ", - color: Colors.grey[500], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ), - ], + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate! + - ": ", - color: Colors.grey[500], - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ], + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).expiryDate! + ": ", + color: Colors.grey[500], + ), + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, ), ], ), - ), + ], ), - ], + ), ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context!) - .procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context!) - .status, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context!) - .usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context).procedure, + fontWeight: FontWeight.w700, + ), ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model!.insuranceApprovalInPatient[ - indexInsurance] - .apporvalDetails! - .length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Column( + Expanded( + child: AppText( + TranslationBase.of(context).status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context).usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApprovalInPatient[indexInsurance].apporvalDetails!.length, + itemBuilder: (BuildContext context, int index) { + return Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Container( - child: AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails![ - index] - ?.procedureName ?? - "", - textAlign: - TextAlign - .start, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails![ - index] - ?.status ?? - "", - textAlign: - TextAlign - .center, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model!.insuranceApprovalInPatient[ - indexInsurance] - ?.apporvalDetails![ - index] - ?.isInvoicedDesc ?? - "", - textAlign: - TextAlign - .center, - ), - ), + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + .apporvalDetails![index].procedureName ?? + "", + textAlign: TextAlign.start, ), - ], + ), ), - SizedBox( - width: 5, + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + .apporvalDetails![index].status ?? + "", + textAlign: TextAlign.center, + ), + ), ), - Divider( - color: Colors.black38, + Expanded( + child: Container( + child: AppText( + model.insuranceApprovalInPatient[indexInsurance] + .apporvalDetails![index].isInvoicedDesc ?? + "", + textAlign: TextAlign.center, + ), + ), ), ], ), - ); - }), - ), - ], + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), ), - ), - ], + ], + ), ), - ), + ], ), - ], + ), ), - ), - ) - : SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context!).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context!).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], + AppText( + TranslationBase.of(context!).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ], ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( children: [ - Row( - children: [ - AppText( - model!.insuranceApproval[ - indexInsurance] - .approvalStatusDescption != - null - ? model!.insuranceApproval[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model!.insuranceApproval[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == - "Approved" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), - ), - ], + AppText( + model!.insuranceApproval[indexInsurance].approvalStatusDescption != null + ? model.insuranceApproval[indexInsurance].approvalStatusDescption ?? "" + : "", + color: model.insuranceApproval[indexInsurance].approvalStatusDescption != null + ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), - Row( - children: [ - AppText( - model!.insuranceApproval[indexInsurance] - .doctorName! - .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( + ], + ), + Row( + children: [ + AppText( + model.insuranceApproval[indexInsurance].doctorName!.toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( children: [ - Column( - children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig - .imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular( - 50), - child: Image.network( - model!.insuranceApproval[ - indexInsurance] - .doctorImage!, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: - Colors.transparent, + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + model.insuranceApproval[indexInsurance].doctorImage!, + fit: BoxFit.fill, + width: 700, ), ), - ], + backgroundColor: Colors.transparent, + ), ), - Expanded( - child: Padding( - padding: - const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, + ], + ), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( children: [ - SizedBox( - height: 25.0, + AppText( + TranslationBase.of(context).clinic! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .clinic! + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model!.insuranceApproval[ - indexInsurance] - .clinicName, - fontSize: 14, - ), - ) - ], + Expanded( + child: AppText( + model.insuranceApproval[indexInsurance].clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).approvalNo! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .approvalNo! + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model!.insuranceApproval[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApproval[indexInsurance].approvalNo.toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).unusedCount! + ": ", + color: Colors.grey[500], + fontSize: 14, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .unusedCount! + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model!.insuranceApproval[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - ], + AppText( + model.insuranceApproval[indexInsurance].unUsedCount.toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).companyName! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .companyName! + - ": ", - color: Colors.grey[500], - ), - AppText('Sample') - ], + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).receiptOn! + ": ", + color: Colors.grey[500], ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn! + - ": ", - color: Colors.grey[500], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ), - ], + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate! + - ": ", - color: Colors.grey[500], - ), - if (model!.insuranceApproval[ - indexInsurance] - .expiryDate != - null) - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ], + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).expiryDate! + ": ", + color: Colors.grey[500], ), + if (model.insuranceApproval[indexInsurance].expiryDate != null) + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + ), ], ), - ), + ], ), - ], + ), ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context!) - .procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context!) - .status, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context!) - .usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context).procedure, + fontWeight: FontWeight.w700, + ), ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model!.insuranceApproval[ - indexInsurance] - .apporvalDetails! - .length, - itemBuilder: - (BuildContext context, - int index) { - return Container( - child: Column( + Expanded( + child: AppText( + TranslationBase.of(context).status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context).usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], + ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model.insuranceApproval[indexInsurance].apporvalDetails!.length, + itemBuilder: (BuildContext context, int index) { + return Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Container( - child: AppText( - model!.insuranceApproval[ - indexInsurance] - ?.apporvalDetails![ - index] - ?.procedureName ?? - "", - textAlign: - TextAlign - .start, - ), - ), - ), - Expanded( - child: Container( - child: AppText( - model!.insuranceApproval[ - indexInsurance] - ?.apporvalDetails![ - index] - ?.status ?? - "", - textAlign: - TextAlign - .center, - ), - ), + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + .apporvalDetails![index].procedureName ?? + "", + textAlign: TextAlign.start, ), - Expanded( - child: Container( - child: AppText( - model!.insuranceApproval[ - indexInsurance] - ?.apporvalDetails![ - index] - ?.isInvoicedDesc ?? - "", - textAlign: - TextAlign - .center, - ), - ), - ), - ], + ), ), - SizedBox( - width: 5, + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + .apporvalDetails![index].status ?? + "", + textAlign: TextAlign.center, + ), + ), ), - Divider( - color: Colors.black38, + Expanded( + child: Container( + child: AppText( + model.insuranceApproval[indexInsurance] + .apporvalDetails![index].isInvoicedDesc ?? + "", + textAlign: TextAlign.center, + ), + ), ), ], ), - ); - }), - ), - ], + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), ), - ), - ], + ], + ), ), - ), + ], ), - ], + ), ), - ), - )), + ], + ), + ), + )), ); } } diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index b1be78ed..a524a7b9 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -44,7 +44,7 @@ class _PatientSearchScreenState extends State { child: Center( child: Column( children: [ - BottomSheetTitle(title: TranslationBase.of(context).searchPatient!!), + BottomSheetTitle(title: TranslationBase.of(context).searchPatient!), FractionallySizedBox( widthFactor: 0.9, child: Container( 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 b9783a9b..d807ba54 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -37,10 +37,11 @@ class _LaboratoryResultPageState extends State { builder: (_, model, w) => AppScaffold( isShowAppBar: true, patientProfileAppBarModel: PatientProfileAppBarModel( - patient:widget.patient,isInpatient:widget.isInpatient, - isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate!,), - + patient: widget.patient, + isInpatient: widget.isInpatient, + isFromLabResult: true, + appointmentDate: widget.patientLabOrders.orderDate!, + ), baseViewModel: model, body: AppScaffold( isShowAppBar: false, @@ -50,9 +51,8 @@ class _LaboratoryResultPageState extends State { LaboratoryResultWidget( onTap: () async {}, billNo: widget.patientLabOrders.invoiceNo!, - details: model.patientLabSpecialResult.length > 0 - ? model.patientLabSpecialResult[0]!.resultDataHTML - : null, + details: + model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML : null, orderNo: widget.patientLabOrders.orderNo!, patientLabOrder: widget.patientLabOrders, patient: widget.patient, diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 1f78b242..b898f849 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -54,85 +54,81 @@ class _AddVerifyMedicalReportState extends State { child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // if (model.medicalReportTemplate.length > 0) - HtmlRichEditor( - initialText: (medicalReport != null - ? medicalReport.reportDataHtml - : model!.medicalReportTemplate! - .length! > 0 ? model.medicalReportTemplate[0].templateTextHtml!: ""), - hint: "Write the medical report ", - controller: _controller, - height: - MediaQuery - .of(context) - .size - .height * - 0.75, + children: [ + // if (model.medicalReportTemplate.length > 0) + HtmlRichEditor( + initialText: (medicalReport != null + ? medicalReport.reportDataHtml + : model.medicalReportTemplate.length > 0 + ? model.medicalReportTemplate[0].templateTextHtml! + : ""), + hint: "Write the medical report ", + controller: _controller, + height: MediaQuery.of(context).size.height * 0.75, + ), + ], ), - ], + ), + ), ), - ), + ], ), ), - ], - ), - ), - ), - Container( - padding: EdgeInsets.all(16.0), - color: Colors.white, - child: Row( - children: [ - Expanded( - child: AppButton( - title: status == MedicalReportStatus.ADD - ? TranslationBase.of(context).save - : TranslationBase.of(context).save, - color: Color(0xffEAEAEA), - fontColor: Colors.black, - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - String txtOfMedicalReport = await _controller.getText(); + ), + Container( + padding: EdgeInsets.all(16.0), + color: Colors.white, + child: Row( + children: [ + Expanded( + child: AppButton( + title: status == MedicalReportStatus.ADD + ? TranslationBase.of(context).save + : TranslationBase.of(context).save, + color: Color(0xffEAEAEA), + fontColor: Colors.black, + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + String txtOfMedicalReport = await _controller.getText(); - if (txtOfMedicalReport.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await model.insertMedicalReport(patient, txtOfMedicalReport); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - } - }, + if (txtOfMedicalReport.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await model.insertMedicalReport(patient, txtOfMedicalReport); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + } + }, + ), + ), + SizedBox( + width: 8, + ), + if (medicalReport != null) + Expanded( + child: AppButton( + title: status == MedicalReportStatus.ADD + ? TranslationBase.of(context).add + : TranslationBase.of(context).verify, + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.verifyMedicalReport(patient, medicalReport); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + }, + ), + ), + ], ), ), - SizedBox( - width: 8, - ), - if (medicalReport != null) - Expanded( - child: AppButton( - title: status == MedicalReportStatus.ADD - ? TranslationBase.of(context).add - : TranslationBase.of(context).verify, - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.verifyMedicalReport(patient, medicalReport); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }, - ), - ), ], ), - ), - ], - ), )); } diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 8e47ba60..bcf09283 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -77,8 +77,7 @@ class _ProgressNoteState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, patientProfileAppBarModel: PatientProfileAppBarModel( - patient: - patient, + patient: patient, isInpatient: true, ), body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 @@ -115,21 +114,21 @@ class _ProgressNoteState extends State { child: CardWithBgWidget( hasBorder: false, bgColor: model.patientProgressNoteList[index].status == 1 && - authenticationViewModel!.doctorProfile!.doctorID != + authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy ? Color(0xFFCC9B14) : model.patientProgressNoteList[index].status == 4 ? Colors.red.shade700 : model.patientProgressNoteList[index].status == 2 ? Colors.green[600]! - : Color(0xFFCC9B14)!, + : Color(0xFFCC9B14), widget: Column( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (model.patientProgressNoteList[index].status == 1 && - authenticationViewModel!.doctorProfile!.doctorID != + authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy) AppText( TranslationBase.of(context).notePending, @@ -153,7 +152,7 @@ class _ProgressNoteState extends State { ), if (model.patientProgressNoteList[index].status != 2 && model.patientProgressNoteList[index].status != 4 && - authenticationViewModel!.doctorProfile!.doctorID == + authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy) Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -352,9 +351,9 @@ class _ProgressNoteState extends State { ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDateTimeFromServerFormat( model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel!.isArabic) + isArabic: projectViewModel.isArabic) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), - isArabic: projectViewModel!.isArabic), + isArabic: projectViewModel.isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), @@ -445,7 +444,7 @@ class _ProgressNoteState extends State { padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - projectViewModel!.isArabic + projectViewModel.isArabic ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" : 'Are you sure you want $actionName this order?', fontSize: 15, 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 a2ceb550..724bdb15 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -55,7 +55,7 @@ class _PatientProfileScreenState extends State with Single int _activeTab = 0; late StreamController videoCallDurationStreamController; - late Stream videoCallDurationStream; //= (() async*{})(); TODO Elham* + late Stream videoCallDurationStream; //= (() async*{})(); TODO Elham* @override void initState() { _tabController = TabController(length: 2, vsync: this); @@ -94,7 +94,7 @@ class _PatientProfileScreenState extends State with Single if (routeArgs.containsKey("isFromLiveCare")) { isFromLiveCare = routeArgs['isFromLiveCare']; } - if(routeArgs.containsKey("isCallFinished")) { + if (routeArgs.containsKey("isCallFinished")) { isCallFinished = routeArgs['isCallFinished']; } if (isInpatient) @@ -104,7 +104,7 @@ class _PatientProfileScreenState extends State with Single } late StreamSubscription callTimer; - callConnected(){ + callConnected() { callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) ..onDone(() { callTimer.cancel(); @@ -115,7 +115,7 @@ class _PatientProfileScreenState extends State with Single }); } - callDisconnected(){ + callDisconnected() { callTimer.cancel(); videoCallDurationStreamController.sink.add(''); } @@ -134,8 +134,9 @@ class _PatientProfileScreenState extends State with Single children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, - videoCallDurationStream: videoCallDurationStream,isInpatient: isInpatient, + PatientProfileHeaderNewDesignAppBar(patient, arrivalType, patientType, + videoCallDurationStream: videoCallDurationStream, + isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 210 @@ -192,7 +193,7 @@ class _PatientProfileScreenState extends State with Single ), if (isFromLiveCare ? patient.episodeNo != null - :patient.patientStatusType != null && patient.patientStatusType == 43) + : patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async {}, builder: (_, model, w) => Positioned( @@ -208,7 +209,9 @@ class _PatientProfileScreenState extends State with Single "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", color: isFromLiveCare ? Colors.red.shade700 - :patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, + : patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, fontColor: Colors.white, vPadding: 8, radius: 30, @@ -222,8 +225,9 @@ class _PatientProfileScreenState extends State with Single ), onPressed: () async { if ((isFromLiveCare && - patient.appointmentNo != null && - patient.appointmentNo != 0) ||patient.patientStatusType == 43) { + patient.appointmentNo != null && + patient.appointmentNo != 0) || + patient.patientStatusType == 43) { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); GifLoaderDialogUtils.showMyDialog(context); @@ -239,9 +243,11 @@ class _PatientProfileScreenState extends State with Single AppButton( title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color:isFromLiveCare - ? Colors.red.shade700 - :patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, + color: isFromLiveCare + ? Colors.red.shade700 + : patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, fontColor: Colors.white, vPadding: 8, radius: 30, @@ -255,9 +261,9 @@ class _PatientProfileScreenState extends State with Single ), onPressed: () { if ((isFromLiveCare && - patient.appointmentNo != - null && - patient.appointmentNo != 0) ||patient.patientStatusType == 43) { + patient.appointmentNo != null && + patient.appointmentNo != 0) || + patient.patientStatusType == 43) { Navigator.of(context) .pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); } @@ -298,8 +304,8 @@ class _PatientProfileScreenState extends State with Single disabled: model.state == ViewState.BusyLocal, onPressed: () async { // Navigator.push(context, MaterialPageRoute( - // builder: (BuildContext context) => - // EndCallScreen(patient:patient))) + // builder: (BuildContext context) => + // EndCallScreen(patient:patient))) if (isCallFinished) { Navigator.push( context, @@ -317,30 +323,29 @@ class _PatientProfileScreenState extends State with Single patient.appointmentNo = model.startCallRes.appointmentNo; patient.episodeNo = 0; - GifLoaderDialogUtils.hideDialog(context); - AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ - locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); - }, type: ''); - - - } - } - - - }, + GifLoaderDialogUtils.hideDialog(context); + AppPermissionsUtils.requestVideoCallPermission( + context: context, + onTapGrant: () { + locator() + .openVideo(model.startCallRes, patient, callConnected, callDisconnected); + }, + type: ''); + } + } + }, + ), + ), ), ), - ), - ), - SizedBox( - height: 5, + SizedBox( + height: 5, + ), + ], ), - ], - ), - ) : null, - ), - - + ) + : null, + ), ); } } diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index cfd37cd0..5a4eab5f 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -21,12 +21,10 @@ class ReplySummeryOnReferralPatient extends StatefulWidget { ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply); @override - _ReplySummeryOnReferralPatientState createState() => - _ReplySummeryOnReferralPatientState(this.referredPatient); + _ReplySummeryOnReferralPatientState createState() => _ReplySummeryOnReferralPatientState(this.referredPatient); } -class _ReplySummeryOnReferralPatientState - extends State { +class _ReplySummeryOnReferralPatientState extends State { final MyReferralPatientModel referredPatient; _ReplySummeryOnReferralPatientState(this.referredPatient); @@ -41,15 +39,12 @@ class _ReplySummeryOnReferralPatientState 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), + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, @@ -70,7 +65,7 @@ class _ReplySummeryOnReferralPatientState color: Color(0XFF2E303A), ), AppText( - widget.doctorReply ?? '', + widget.doctorReply, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -85,8 +80,7 @@ class _ReplySummeryOnReferralPatientState ), ), Container( - margin: - EdgeInsets.symmetric(horizontal: 16, vertical: 16), + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: Row( children: [ Expanded( @@ -99,7 +93,9 @@ class _ReplySummeryOnReferralPatientState color: Colors.red[600], ), ), - SizedBox(width: 4,), + SizedBox( + width: 4, + ), Expanded( child: AppButton( onPressed: () {}, diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 0848eee2..d7f25f5f 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -13,7 +13,6 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ReferredPatientScreen extends StatelessWidget { - PatientType patientType = PatientType.IN_PATIENT; @override @@ -40,71 +39,72 @@ class ReferredPatientScreen extends StatelessWidget { GifLoaderDialogUtils.hideDialog(context); }, ), - ),model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 - ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: 100, + ), + 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, - ), - ) - ], - ), - ) - : Expanded( - child: SingleChildScrollView( + ) + : 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)), + ...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), - ), + ), + ], ), ), - ], - ),), ), - ), + ), ], ), ), @@ -118,8 +118,7 @@ class PatientTypeRadioWidget extends StatefulWidget { PatientTypeRadioWidget(this.radioOnChange); @override - _PatientTypeRadioWidgetState createState() => - _PatientTypeRadioWidgetState(this.radioOnChange); + _PatientTypeRadioWidgetState createState() => _PatientTypeRadioWidgetState(this.radioOnChange); } class _PatientTypeRadioWidgetState extends State { @@ -141,7 +140,7 @@ class _PatientTypeRadioWidgetState extends State { onChanged: (PatientType? value) { setState(() { patientType = value!; - radioOnChange(value!); + radioOnChange(value); }); }, ), diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 91d42e96..66467177 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -198,7 +198,7 @@ class _UpdateAssessmentPageState extends State { ), ), new TextSpan( - text: assessment.appointmentId.toString() ?? "", + text: assessment.appointmentId.toString(), style: new TextStyle( fontSize: 14, color: Color(0xFF2B353E), 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 1c088af2..8b874f0f 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 @@ -38,7 +38,7 @@ class VitalSignDetailsScreen extends StatelessWidget { baseViewModel: mode, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), appBarTitle: TranslationBase.of(context).vitalSign!, body: mode.patientVitalSignsHistory.length > 0 ? Column( @@ -54,7 +54,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", + "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), 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 f71306aa..eed82785 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 @@ -190,9 +190,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { appBarTitle: pageTitle ?? "", backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - - - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -203,7 +201,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", + "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index cc6a87be..7fbefeb0 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -71,10 +71,10 @@ postPrescription( prescriptionList.add(PrescriptionRequestModel( covered: true, dose: double.parse(dose ?? "0"), - itemId: drugId!.isEmpty ? 1 : int.parse(drugId ?? "0"), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId), doseUnitId: int.parse(doseUnit ?? "1"), - route: route!.isEmpty ? 1 : int.parse(route ?? "1"), - frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), + route: route!.isEmpty ? 1 : int.parse(route), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index e57982cf..67122fd7 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -72,10 +72,10 @@ class _PrescriptionCheckOutScreenState extends State prescriptionList.add(PrescriptionRequestModel( covered: true, dose: double.parse(dose!), - itemId: drugId!.isEmpty ? 1 : int.parse(drugId!), + itemId: drugId!.isEmpty ? 1 : int.parse(drugId), doseUnitId: int.parse(doseUnit!), - route: route!.isEmpty ? 1 : int.parse(route!), - frequency: frequency!.isEmpty ? 1 : int.parse(frequency!), + route: route!.isEmpty ? 1 : int.parse(route), + frequency: frequency!.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), @@ -85,7 +85,7 @@ class _PrescriptionCheckOutScreenState extends State postProcedureReqModel.prescriptionRequestModel = prescriptionList; await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); - if (model!.state == ViewState.ErrorLocal) { + if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); @@ -617,7 +617,7 @@ class _PrescriptionCheckOutScreenState extends State route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget!.groupProcedures!.aliasN! + drugId: (widget.groupProcedures!.aliasN! .replaceAll("item code ;", "")), strength: strengthController.text, indication: indicationController.text, diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index 4429199a..e516f997 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -44,8 +44,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { isShowAppBar: true, backgroundColor: Colors.grey[100]!, baseViewModel: model, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), + patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), body: SingleChildScrollView( child: Container( child: Column( @@ -92,8 +91,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), Expanded( - child: AppText( - " " + model.inPatientPrescription[prescriptionIndex].direction! ?? '')), + child: + AppText(" " + model.inPatientPrescription[prescriptionIndex].direction!)), ], ), Row( @@ -102,8 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText( - " " + model.inPatientPrescription[prescriptionIndex].route.toString() ?? ''), + AppText(" " + model.inPatientPrescription[prescriptionIndex].route.toString()), ], ), Row( @@ -114,7 +112,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { ), Expanded( child: AppText( - " " + model.inPatientPrescription[prescriptionIndex].refillType! ?? '')), + " " + model.inPatientPrescription[prescriptionIndex].refillType!)), ], ), Row( @@ -156,9 +154,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), AppText(" " + - model.inPatientPrescription[prescriptionIndex] - .unitofMeasurementDescription! ?? - ''), + model.inPatientPrescription[prescriptionIndex].unitofMeasurementDescription!), ], ), Row( @@ -167,8 +163,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText( - " " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''), + AppText(" " + model.inPatientPrescription[prescriptionIndex].dose.toString()), ], ), Row( @@ -177,10 +172,10 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).status, color: Colors.grey, ), - AppText(" " + - model.inPatientPrescription[prescriptionIndex].statusDescription - .toString() ?? - ''), + AppText( + " " + + model.inPatientPrescription[prescriptionIndex].statusDescription.toString(), + ), ], ), Row( @@ -189,7 +184,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).processed, color: Colors.grey, ), - AppText(" " + model.inPatientPrescription[prescriptionIndex].processedBy! ?? ''), + AppText(" " + model.inPatientPrescription[prescriptionIndex].processedBy!), ], ), Row( @@ -198,8 +193,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText( - " " + model.inPatientPrescription[prescriptionIndex].dose.toString() ?? ''), + AppText(" " + model.inPatientPrescription[prescriptionIndex].dose.toString()), ], ), SizedBox( diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index bed9825f..2fb4131d 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -37,8 +37,7 @@ class PrescriptionItemsPage extends StatelessWidget { 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, @@ -123,7 +122,7 @@ class PrescriptionItemsPage extends StatelessWidget { TranslationBase.of(context).frequency, color: Colors.grey, ), - AppText(" " + model.prescriptionReportList[index].frequencyN! ?? ''), + AppText(" " + model.prescriptionReportList[index].frequencyN!), ], ), Row( @@ -132,8 +131,7 @@ class PrescriptionItemsPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText( - " " + model.prescriptionReportList[index].doseDailyQuantity ?? ''), + AppText(" " + model.prescriptionReportList[index].doseDailyQuantity), ], ), Row( @@ -142,8 +140,7 @@ class PrescriptionItemsPage extends StatelessWidget { TranslationBase.of(context).duration, color: Colors.grey, ), - AppText( - " " + model.prescriptionReportList[index].days.toString() ?? ''), + AppText(" " + model.prescriptionReportList[index].days.toString()), ], ), SizedBox( @@ -237,9 +234,7 @@ class PrescriptionItemsPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - Expanded( - child: - AppText(" " + model.prescriptionReportEnhList[index].route! ?? '')), + Expanded(child: AppText(" " + model.prescriptionReportEnhList[index].route!)), ], ), Row( @@ -248,7 +243,7 @@ class PrescriptionItemsPage extends StatelessWidget { TranslationBase.of(context).frequency, color: Colors.grey, ), - AppText(" " + model.prescriptionReportEnhList[index].frequency! ?? ''), + AppText(" " + model.prescriptionReportEnhList[index].frequency!), ], ), Row( @@ -258,8 +253,7 @@ class PrescriptionItemsPage extends StatelessWidget { color: Colors.grey, ), AppText(" " + - model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? - ''), + model.prescriptionReportEnhList[index].doseDailyQuantity.toString()), ], ), Row( @@ -268,7 +262,7 @@ class PrescriptionItemsPage extends StatelessWidget { TranslationBase.of(context).duration, color: Colors.grey, ), - AppText(" " + model.prescriptionReportList[index].days.toString() ?? ''), + AppText(" " + model.prescriptionReportList[index].days.toString()), ], ), SizedBox( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 611218c1..266bd82f 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -26,7 +26,8 @@ class ProcedureCard extends StatelessWidget { required this.categoryID, this.categoryName, required this.patient, - required this.doctorID, this.isInpatient = false, + required this.doctorID, + this.isInpatient = false, }) : super(key: key); @override @@ -189,11 +190,13 @@ class ProcedureCard extends StatelessWidget { children: [ Expanded( child: AppText( - entityList.remarks.toString() ?? '', + entityList.remarks.toString(), fontSize: 12, ), ), - if ((entityList.categoryID == 2 || entityList.categoryID == 4) && doctorID == entityList.doctorID && !isInpatient) + if ((entityList.categoryID == 2 || entityList.categoryID == 4) && + doctorID == entityList.doctorID && + !isInpatient) InkWell( child: Icon(DoctorApp.edit), onTap: onTap, diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 6c9dfd8b..1c2141e8 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -11,22 +11,21 @@ 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/buttons/app_buttons_widget.dart'; -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 PrescriptionViewModel prescriptionModel; + final ProcedureViewModel? model; + final PrescriptionViewModel? prescriptionModel; final PatiantInformtion patient; final ProcedureType procedureType; AddFavouriteProcedure({ Key? key, - required this.model, - required this.prescriptionModel, + this.model, + this.prescriptionModel, required this.patient, required this.procedureType, }); @@ -41,15 +40,13 @@ class _AddFavouriteProcedureState extends State { ProcedureViewModel? model; PatiantInformtion? patient; List entityList = []; - late ProcedureTempleteDetailsModel groupProcedures; + ProcedureTempleteDetailsModel? groupProcedures; @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => - AppScaffold( + onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( @@ -72,8 +69,7 @@ class _AddFavouriteProcedureState extends State { entityList.add(history); }); }, - isEntityFavListSelected: (master) => - isEntityListSelected(master), + isEntityFavListSelected: (master) => isEntityListSelected(master), groupProcedures: groupProcedures, selectProcedures: (selectedProcedure) { setState(() { @@ -88,12 +84,11 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.procedureType.getAddButtonTitle(context!) ?? - TranslationBase.of(context!).addSelectedProcedures, + title: widget.procedureType.getAddButtonTitle(context), color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { - if(widget.procedureType == ProcedureType.PRESCRIPTION){ + if (widget.procedureType == ProcedureType.PRESCRIPTION) { if (groupProcedures == null) { DrAppToastMsg.showErrorToast( 'Please Select item ', @@ -114,8 +109,7 @@ class _AddFavouriteProcedureState extends State { } else { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context!) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -126,8 +120,8 @@ class _AddFavouriteProcedureState extends State { items: entityList, model: model, patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context!), - toolbarTitle: widget.procedureType.getToolbarLabel(context!), + 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 9f953267..41331c08 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -16,23 +16,21 @@ import 'ProcedureType.dart'; import 'entity_list_checkbox_search_widget.dart'; class AddProcedurePage extends StatefulWidget { - final ProcedureViewModel model; + final ProcedureViewModel? model; final PatiantInformtion patient; final ProcedureType procedureType; - const AddProcedurePage( - {Key? key, required this.model, required this.patient, required this.procedureType}) - : super(key: key); + const AddProcedurePage({Key? key, this.model, required this.patient, required this.procedureType}) : super(key: key); @override - _AddProcedurePageState createState() => _AddProcedurePageState( - patient: patient, model: model, procedureType: this.procedureType); + _AddProcedurePageState createState() => + _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType); } class _AddProcedurePageState extends State { int? selectedType; ProcedureViewModel? model; - PatiantInformtion ?patient; + PatiantInformtion? patient; ProcedureType? procedureType; _AddProcedurePageState({this.patient, this.model, this.procedureType}); @@ -60,8 +58,7 @@ class _AddProcedurePageState extends State { categoryID: procedureType!.getCategoryId(), patientId: patient!.patientId); }, - builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => - AppScaffold( + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: Column( children: [ @@ -82,29 +79,24 @@ class _AddProcedurePageState extends State { Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context!) - .pleaseEnterProcedure, + TranslationBase.of(context).pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), ], ), SizedBox( - height: - MediaQuery.of(context!).size.height * 0.02, + height: MediaQuery.of(context).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context!).size.width * - 0.79, + width: MediaQuery.of(context).size.width * 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context!) - .searchProcedureHere, + hintText: TranslationBase.of(context).searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, @@ -113,22 +105,17 @@ class _AddProcedurePageState extends State { ), ), SizedBox( - width: MediaQuery.of(context!).size.width * - 0.02, + width: MediaQuery.of(context).size.width * 0.02, ), Expanded( child: InkWell( onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) + if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model!.getProcedureCategory( - patientId: patient!.patientId, - categoryName: - procedureName.text); + patientId: patient!.patientId, categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context!) - .atLeastThreeCharacters, + TranslationBase.of(context).atLeastThreeCharacters, ); }, child: Icon( @@ -141,16 +128,13 @@ class _AddProcedurePageState extends State { ), ], ), - if ((procedureType == ProcedureType.PROCEDURE - ? procedureName.text.isNotEmpty - : true) && + if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && model!.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - model!.categoriesList[0].entityList!, + model: widget.model!, + masterList: model.categoriesList[0].entityList!, removeHistory: (item) { setState(() { entityList.remove(item); @@ -165,8 +149,7 @@ class _AddProcedurePageState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => - isEntityListSelected(master), + isEntityListSelected: (master) => isEntityListSelected(master), )), ], ), @@ -181,14 +164,13 @@ class _AddProcedurePageState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: procedureType!.getAddButtonTitle(context!), + title: procedureType!.getAddButtonTitle(context), fontWeight: FontWeight.w700, color: Color(0xff359846), onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context!) - .fillTheMandatoryProcedureDetails, + TranslationBase.of(context).fillTheMandatoryProcedureDetails, ); return; } @@ -198,7 +180,7 @@ class _AddProcedurePageState extends State { entityList: entityList, patient: patient, remarks: remarksController.text); - Navigator.pop(context!); + Navigator.pop(context); }, ), ], @@ -211,8 +193,7 @@ class _AddProcedurePageState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 202a261f..8d6a42e3 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -21,21 +21,16 @@ class BaseAddProcedureTabPage extends StatefulWidget { final ProcedureType? procedureType; const BaseAddProcedureTabPage( - {Key? key, - this.model, - this.prescriptionModel, - this.patient, - @required this.procedureType}) + {Key? key, this.model, this.prescriptionModel, this.patient, @required this.procedureType}) : 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 - with SingleTickerProviderStateMixin { - final ProcedureViewModel model; +class _BaseAddProcedureTabPageState extends State with SingleTickerProviderStateMixin { + final ProcedureViewModel? model; final PatiantInformtion patient; final ProcedureType procedureType; @@ -68,8 +63,7 @@ class _BaseAddProcedureTabPageState extends State final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => - AppScaffold( + builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, @@ -131,8 +125,7 @@ class _BaseAddProcedureTabPageState extends State tabWidget( screenSize, _activeTab == 0, - procedureType - .getFavouriteTabName(context), + procedureType.getFavouriteTabName(context), ), tabWidget( screenSize, @@ -152,22 +145,15 @@ class _BaseAddProcedureTabPageState extends State controller: _tabController, children: [ AddFavouriteProcedure( - model: this.model, - prescriptionModel: - widget.prescriptionModel!, patient: patient, procedureType: procedureType, ), - if (widget.procedureType == - ProcedureType.PRESCRIPTION) - PrescriptionFormWidget( - widget.prescriptionModel!, - widget.patient!, - widget!.prescriptionModel! - .prescriptionList!) + if (widget.procedureType == ProcedureType.PRESCRIPTION) + PrescriptionFormWidget(widget.prescriptionModel!, widget.patient!, + widget.prescriptionModel!.prescriptionList) else AddProcedurePage( - model: this.model, + model: this.model!, patient: patient, procedureType: procedureType, ), @@ -193,10 +179,8 @@ class _BaseAddProcedureTabPageState extends State child: Container( height: screenSize.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, borderWidth: 0), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index 25864cea..0a150c55 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -69,7 +69,7 @@ class _ProcedureCheckOutScreenState extends State { width: 5.0, ), AppText( - widget.toolbarTitle ?? 'Add Procedure', + widget.toolbarTitle, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -196,7 +196,7 @@ class _ProcedureCheckOutScreenState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, + title: widget.addButtonTitle, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { @@ -213,9 +213,7 @@ class _ProcedureCheckOutScreenState extends State { }); Navigator.pop(context); await model.preparePostProcedure( - entityList: entityList, - patient: widget.patient, - remarks: remarksController.text); + entityList: entityList, patient: widget.patient, remarks: remarksController.text); Navigator.pop(context); Navigator.pop(context); }, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 20201360..b115c0eb 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -44,7 +44,9 @@ class ProcedureScreen extends StatelessWidget { backgroundColor: Colors.grey[100], baseViewModel: model, patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + patient: patient, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -173,7 +175,7 @@ class ProcedureScreen extends StatelessWidget { // 'You Cant Update This Procedure'); }, patient: patient, - doctorID: model!.doctorProfile!.doctorID!, + doctorID: model.doctorProfile!.doctorID!, ), ), if (model.state == ViewState.ErrorLocal || diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index a0e2acda..ad0191b9 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -264,17 +264,16 @@ class Helpers { } static getLabelFromKPI(String kpi) { - if (kpi.indexOf("(") > -1 && kpi.indexOf(")")>-1) - return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); + if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1) + return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); else return ''; - } 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)); + String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } } diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 042a963f..a8b7d477 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -218,7 +218,7 @@ class _DoctorReplyWidgetState extends State { color: Color(0xFF575757), fontWeight: FontWeight.bold)), new TextSpan( - text: widget.reply?.remarks?.trim() ?? '', + text: widget.reply.remarks?.trim() ?? '', style: TextStyle(fontFamily: 'Poppins', color: Color(0xFF575757), fontSize: 12)), ], ), diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 53c8e4cb..e7a571c5 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -82,9 +82,9 @@ class MyScheduleWidget extends StatelessWidget { SizedBox( height: 5, ), - if (workingHoursTable!.clinicName != null) + if (workingHoursTable.clinicName != null) AppText( - workingHoursTable!.clinicName ?? "", + workingHoursTable.clinicName ?? "", fontSize: 15, fontWeight: FontWeight.w700, ), diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 337f630e..e7553b9c 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,12 +1,10 @@ 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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { final String? referralStatus; @@ -50,8 +48,6 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), child: Column( @@ -76,7 +72,7 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralStatus != null ? referralStatus : "", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier!, + fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referralStatusCode == 1 ? Color(0xffc4aa54) @@ -85,10 +81,10 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.red[700], ), AppText( - referredDate??'', + referredDate ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier!, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], @@ -98,8 +94,8 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName??'', - fontSize: SizeConfig.textMultiplier! * 2.2, + patientName ?? '', + fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, color: Colors.black, fontFamily: 'Poppins', @@ -121,10 +117,10 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime??'', + referredTime ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier!, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], @@ -143,14 +139,14 @@ class PatientReferralItemWidget extends StatelessWidget { TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( patientID!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier!, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -165,16 +161,16 @@ class PatientReferralItemWidget extends StatelessWidget { : TranslationBase.of(context).refClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), - Expanded( + Expanded( child: AppText( !isReferralClinic! - ? isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch - : " " + referralClinic!, + ? isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch + : " " + referralClinic!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -218,7 +214,7 @@ class PatientReferralItemWidget extends StatelessWidget { TranslationBase.of(context).remarks ?? "" + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -226,7 +222,7 @@ class PatientReferralItemWidget extends StatelessWidget { remark ?? "", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier!, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), maxLines: 1, ), @@ -281,10 +277,10 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName??'', + referralDoctorName ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.7 * SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Colors.black, ), if (clinicDescription != null) @@ -292,7 +288,7 @@ class PatientReferralItemWidget extends StatelessWidget { clinicDescription!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.4 * SizeConfig.textMultiplier!, + fontSize: 1.4 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index beffc92f..4a27347a 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -35,7 +35,6 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), @@ -58,10 +57,10 @@ class PatientCard extends StatelessWidget { : isMyPatient ? Colors.green[500]! : isInpatient - ? Colors.white! + ? Colors.white : !isFromSearch ? Colors.red[800]! - : Colors.white!, + : Colors.white, widget: Container( color: Colors.white, // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), @@ -242,7 +241,6 @@ class PatientCard extends StatelessWidget { textOverflow: TextOverflow.ellipsis, ), ), - if (patientInfo.gender == 1) Icon( DoctorApp.male_2, @@ -253,9 +251,10 @@ class PatientCard extends StatelessWidget { DoctorApp.female_1, color: Colors.pink, ), - - if(isFromLiveCare) - ShowTimer(patientInfo: patientInfo,), + if (isFromLiveCare) + ShowTimer( + patientInfo: patientInfo, + ), ]), ), Row( @@ -462,6 +461,4 @@ class PatientCard extends StatelessWidget { )), )); } - - -} \ No newline at end of file +} diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index 83c02eb7..52929c86 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -46,7 +46,7 @@ class AddNewOrder extends StatelessWidget { height: 10, ), AppText( - label ?? '', + label, color: Colors.grey[600], fontWeight: FontWeight.w600, ) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 8b7a4c05..d6c12dc8 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -12,14 +12,12 @@ import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; -class PatientProfileAppBar extends StatelessWidget - with PreferredSizeWidget { +class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatientProfileAppBarModel patientProfileAppBarModel; final bool isFromLabResult; final VoidCallback? onPressed; - PatientProfileAppBar( - {required this.patientProfileAppBarModel, this.isFromLabResult=false, this.onPressed}); + PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed}); @override Widget build(BuildContext context) { @@ -53,23 +51,18 @@ class PatientProfileAppBar extends StatelessWidget icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, onPressed: () { - if(onPressed!=null) - onPressed!(); - Navigator.pop(context); + if (onPressed != null) onPressed!(); + Navigator.pop(context); }, ), Expanded( child: AppText( patientProfileAppBarModel.patient!.firstName != null - ? (Helpers.capitalize( - patientProfileAppBarModel.patient!.firstName) + + ? (Helpers.capitalize(patientProfileAppBarModel.patient!.firstName) + " " + - Helpers.capitalize( - patientProfileAppBarModel.patient!.lastName)) - : Helpers.capitalize( - patientProfileAppBarModel.patient!.fullName ?? - patientProfileAppBarModel - .patient!.patientDetails!.fullName!), + Helpers.capitalize(patientProfileAppBarModel.patient!.lastName)) + : Helpers.capitalize(patientProfileAppBarModel.patient!.fullName ?? + patientProfileAppBarModel.patient!.patientDetails!.fullName!), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -89,8 +82,7 @@ class PatientProfileAppBar extends StatelessWidget margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + - patientProfileAppBarModel.patient!.mobileNumber!); + launch("tel://" + patientProfileAppBarModel.patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -107,9 +99,7 @@ class PatientProfileAppBar extends StatelessWidget width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -126,9 +116,7 @@ class PatientProfileAppBar extends StatelessWidget child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patientProfileAppBarModel - .patient!.patientStatusType == - 43 + patientProfileAppBarModel.patient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, color: Colors.green, @@ -143,14 +131,10 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - patientProfileAppBarModel.patient!.startTime != - null + patientProfileAppBarModel.patient!.startTime != null ? AppText( - patientProfileAppBarModel - .patient!.startTime != - null - ? patientProfileAppBarModel - .patient!.startTime + patientProfileAppBarModel.patient!.startTime != null + ? patientProfileAppBarModel.patient!.startTime : '', fontWeight: FontWeight.w700, fontSize: 12, @@ -165,9 +149,7 @@ class PatientProfileAppBar extends StatelessWidget children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( text: TranslationBase.of(context).fileNumber, @@ -179,9 +161,7 @@ class PatientProfileAppBar extends StatelessWidget ), ), new TextSpan( - text: patientProfileAppBarModel - .patient!.patientId - .toString(), + text: patientProfileAppBarModel.patient!.patientId.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -195,27 +175,20 @@ class PatientProfileAppBar extends StatelessWidget children: [ AppText( patientProfileAppBarModel.patient!.nationalityName ?? - patientProfileAppBarModel - .patient!.nationality ?? - patientProfileAppBarModel - .patient!.nationalityId ?? + patientProfileAppBarModel.patient!.nationality ?? + patientProfileAppBarModel.patient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), - patientProfileAppBarModel - .patient!.nationalityFlagURL != - null + patientProfileAppBarModel.patient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patientProfileAppBarModel - .patient!.nationalityFlagURL!, + patientProfileAppBarModel.patient!.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -253,10 +226,9 @@ class PatientProfileAppBar extends StatelessWidget ), ), - if (patientProfileAppBarModel.patient!.appointmentDate != - null && - patientProfileAppBarModel - .patient!.appointmentDate!.isNotEmpty && !isFromLabResult) + if (patientProfileAppBarModel.patient!.appointmentDate != null && + patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty && + !isFromLabResult) Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -272,9 +244,7 @@ class PatientProfileAppBar extends StatelessWidget ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - patientProfileAppBarModel - .patient!.appointmentDate!)), + AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)), fontWeight: FontWeight.w700, fontSize: 12, color: Color(0xFF2E303A), @@ -305,9 +275,7 @@ class PatientProfileAppBar extends StatelessWidget new TextSpan( text: '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 12)), + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 12)), ], ), ), @@ -316,10 +284,8 @@ class PatientProfileAppBar extends StatelessWidget Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patientProfileAppBarModel.patient!.admissionDate != - null && - patientProfileAppBarModel - .patient!.admissionDate!.isNotEmpty) + if (patientProfileAppBarModel.patient!.admissionDate != null && + patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty) Container( child: RichText( text: new TextSpan( @@ -331,18 +297,12 @@ class PatientProfileAppBar extends StatelessWidget ), children: [ new TextSpan( - text: patientProfileAppBarModel - .patient!.admissionDate == - null + text: patientProfileAppBarModel.patient!.admissionDate == null ? "" - : TranslationBase.of(context) - .admissionDate! + - " : ", + : TranslationBase.of(context).admissionDate! + " : ", style: TextStyle(fontSize: 10)), new TextSpan( - text: patientProfileAppBarModel - .patient!.admissionDate == - null + text: patientProfileAppBarModel.patient!.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", style: TextStyle( @@ -351,20 +311,13 @@ class PatientProfileAppBar extends StatelessWidget color: Color(0xFF2E303A), )), ]))), - if (patientProfileAppBarModel.patient!.admissionDate != - null) + 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("${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, @@ -394,14 +347,11 @@ class PatientProfileAppBar extends StatelessWidget width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + 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), + bottom: BorderSide(color: Colors.grey[400]!, width: 2.5), left: BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), @@ -424,145 +374,107 @@ class PatientProfileAppBar extends StatelessWidget 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) - ], + 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), ), - if (patientProfileAppBarModel.invoiceNO != - null && - !patientProfileAppBarModel! - .isPrescriptions!) - Row( - children: [ - AppText( - 'Invoice: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .invoiceNO ?? - "", - fontSize: 12) - ], + AppText(patientProfileAppBarModel.orderNo ?? '', fontSize: 12) + ], + ), + if (patientProfileAppBarModel.invoiceNO != null && + !patientProfileAppBarModel.isPrescriptions!) + Row( + children: [ + AppText( + 'Invoice: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), ), - if (patientProfileAppBarModel.branch != - null) - Row( - children: [ - AppText( - 'Branch: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .branch ?? - '', - fontSize: 12) - ], + AppText(patientProfileAppBarModel.invoiceNO ?? "", fontSize: 12) + ], + ), + if (patientProfileAppBarModel.branch != null) + Row( + children: [ + AppText( + 'Branch: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), ), - if (patientProfileAppBarModel.clinic != - null) - Row( - children: [ - AppText( - 'Clinic: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .clinic ?? - '', - fontSize: 12) - ], + AppText(patientProfileAppBarModel.branch ?? '', fontSize: 12) + ], + ), + if (patientProfileAppBarModel.clinic != null) + Row( + children: [ + AppText( + 'Clinic: ', + fontSize: 10, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), ), - if (patientProfileAppBarModel - .isMedicalFile! && - patientProfileAppBarModel.episode != - null) - Row( - children: [ - AppText( - 'Episode: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .episode ?? - '', - fontSize: 12) - ], + 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), ), - if (patientProfileAppBarModel - .isMedicalFile! && - patientProfileAppBarModel.visitDate != - null) - Row( - children: [ - AppText( - 'Visit Date: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - patientProfileAppBarModel - .visitDate ?? - '', - fontSize: 12) - ], + 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), ), - 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, - ) - ], + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', + fontSize: 12, ) - ]), + ], + ) + ]), ), ), ], @@ -583,12 +495,16 @@ class PatientProfileAppBar extends StatelessWidget patientProfileAppBarModel.height == 0 ? patientProfileAppBarModel.isAppointmentHeader! ? 270 - : ((patientProfileAppBarModel.patient!.appointmentDate! != null &&patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty ) - ? patientProfileAppBarModel.isFromLabResult!?170:150 + : ((patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty) + ? patientProfileAppBarModel.isFromLabResult! + ? 170 + : 150 : patientProfileAppBarModel.patient!.admissionDate != null - ? patientProfileAppBarModel.isFromLabResult!?170:150 + ? patientProfileAppBarModel.isFromLabResult! + ? 170 + : 150 : patientProfileAppBarModel.isDischargedPatient! - ? 240! - : 130!) + ? 240 + : 130) : patientProfileAppBarModel.height!); } diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index 88b6a970..1caded9b 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -20,9 +20,9 @@ class StarRating extends StatelessWidget { 5, (index) => Padding( padding: EdgeInsets.only(right: 1.0), - child: Icon((index + 1) <= (totalAverage ?? 0) ? EvaIcons.star : EvaIcons.starOutline, + child: Icon((index + 1) <= (totalAverage) ? EvaIcons.star : EvaIcons.starOutline, size: size, - color: (index + 1) <= (totalAverage ?? 0) + color: (index + 1) <= (totalAverage) ? Color.fromRGBO(255, 186, 0, 1.0) : Theme.of(context).hintColor), )), diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index 320f4402..7fd680e3 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -103,7 +103,7 @@ class _SecondaryButtonState extends State with TickerProviderSt void didUpdateWidget(SecondaryButton oldWidget) { super.didUpdateWidget(oldWidget); if (oldWidget.disabled != widget.disabled) { - bool d = widget.disabled ?? false; + bool d = widget.disabled; if (!d) { _rippleController.forward(); } else { diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 1e2e19c2..02072bdb 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -39,7 +39,7 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor ?? HexColor('#58434F'), + color: bgColor, borderRadius: BorderRadius.only( topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), @@ -55,7 +55,7 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor ?? HexColor('#58434F'), + color: bgColor, borderRadius: BorderRadius.only( topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 7ee26c2f..97635790 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -61,7 +61,7 @@ class DoctorCard extends StatelessWidget { children: [ Expanded( child: AppText( - doctorName ?? "", + doctorName, fontSize: 15, bold: true, )), diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 76b7d515..056f2fd7 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -27,7 +27,7 @@ class ErrorMessage extends StatelessWidget { padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30), child: Center( child: AppText( - error ?? '', + error, textAlign: TextAlign.center, )), ), From 9a2ce62216430ebe711ff74cf8f13d65f0593a87 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 21 Jun 2021 17:50:40 +0300 Subject: [PATCH 054/199] first step from fixing Soap --- .../procedure/procedure_service.dart | 5 +---- lib/core/viewModel/PatientMedicalReportViewModel.dart | 2 +- .../shared_soap_widgets/SOAP_open_items.dart | 4 ++-- .../shared_soap_widgets/expandable_SOAP_widget.dart | 10 +++++----- .../subjective/medication/add_medication.dart | 8 ++++---- lib/screens/procedures/ProcedureType.dart | 6 +++--- .../master_key_checkbox_search_allergies_widget.dart | 2 +- 7 files changed, 17 insertions(+), 20 deletions(-) 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 51fdf98b..936eacd7 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -72,7 +72,7 @@ class ProcedureService extends BaseService { templateList.clear(); response['DAPP_TemplateGetList'].forEach((template) { ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); - if (categoryID != null) { + if (categoryID != null ) { if (categoryID == templateElement.categoryID) { templateList.add(templateElement); } @@ -80,9 +80,6 @@ class ProcedureService extends BaseService { templateList.add(templateElement); } }); - // response['HIS_ProcedureTemplateList'].forEach((template) { - // _templateList.add(ProcedureTempleteModel.fromJson(template)); - // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 8dbbc64d..31057317 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -48,7 +48,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { } Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _service.insertMedicalReport(patient, htmlText); if (_service.hasError) { error = _service.error!; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 2e185819..3bf15fb4 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -3,14 +3,14 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class SOAPOpenItems extends StatelessWidget { - final Function onTap; + final VoidCallback onTap; final String label; const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key); @override Widget build(BuildContext context) { return InkWell( - onTap: onTap(), + onTap: onTap, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0), margin: EdgeInsets.symmetric(vertical: 8), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 7205bfba..360cd518 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -8,7 +8,7 @@ import 'package:hexcolor/hexcolor.dart'; class ExpandableSOAPWidget extends StatelessWidget { final bool isExpanded; final Widget child; - final Function onTap; + final VoidCallback onTap; final headerTitle; final bool isRequired; @@ -16,7 +16,7 @@ class ExpandableSOAPWidget extends StatelessWidget { {Key? key, required this.isExpanded, required this.child, - required this.onTap, + required this.onTap, this.headerTitle, this.isRequired = true}) : super(key: key); @@ -34,12 +34,12 @@ class ExpandableSOAPWidget extends StatelessWidget { ), child: HeaderBodyExpandableNotifier( headerWidget: InkWell( - onTap: onTap(), + onTap: onTap, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - onTap: onTap(), + onTap: onTap, child: Row( children: [ AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: 15, color: Colors.black), @@ -52,7 +52,7 @@ class ExpandableSOAPWidget extends StatelessWidget { ), ), InkWell( - onTap: onTap(), + onTap: onTap, child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline), ) ], diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 1d9e7890..5397c622 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -41,7 +41,7 @@ class _AddMedicationState extends State { TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - late GetMedicationResponseModel _selectedMedication; + GetMedicationResponseModel? _selectedMedication; GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @@ -127,8 +127,8 @@ class _AddMedicationState extends State { ) : AppTextFieldCustom( hintText: _selectedMedication != null - ? _selectedMedication.description! + - (' (${_selectedMedication.genericName} )') + ? _selectedMedication!.description! + + (' (${_selectedMedication!.genericName} )') : TranslationBase.of(context).searchMedicineNameHere, minLines: 2, maxLines: 2, @@ -346,7 +346,7 @@ class _AddMedicationState extends State { _selectedMedicationRoute != null && _selectedMedicationFrequency != null) { widget.medicationController.text = widget.medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + '${_selectedMedication!.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; Navigator.of(context).pop(); } }, diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 39b52a28..47fe2a4b 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -58,10 +58,10 @@ extension procedureType on ProcedureType { } } - String getCategoryId() { + String ? getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: - return ''; + return null; case ProcedureType.LAB_RESULT: return "02"; case ProcedureType.RADIOLOGY: @@ -69,7 +69,7 @@ extension procedureType on ProcedureType { case ProcedureType.PRESCRIPTION: return "55"; default: - return ''; + return null; } } diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 135642b4..e5aa1f8c 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -47,7 +47,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { List items = []; - late MasterKeyModel _selectedAllergySeverity; + MasterKeyModel? _selectedAllergySeverity; bool isSubmitted = false; @override From 57178d363396eb96570e174fbc5dbce4015a3c79 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 22 Jun 2021 10:35:09 +0300 Subject: [PATCH 055/199] fix soap issue on flutter 2 --- .../objective/add_examination_widget.dart | 5 +++-- .../objective/examination_item_card.dart | 4 ++-- .../objective/update_objective_page.dart | 15 --------------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 17ce9c8c..98e86748 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -8,6 +8,7 @@ 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:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/shims/dart_ui.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -18,7 +19,7 @@ class AddExaminationWidget extends StatefulWidget { final Function(MySelectedExamination) addHistory; final bool Function(MasterKeyModel) isServiceSelected; bool isExpand; - final Function expandClick; + final VoidCallback expandClick; AddExaminationWidget({ required this.item, @@ -89,7 +90,7 @@ class _AddExaminationWidgetState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 8), child: InkWell( - onTap: widget.expandClick(), + onTap: widget.expandClick, child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), ), ], diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 8094fa2f..017ee300 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -8,7 +8,7 @@ import 'package:provider/provider.dart'; class ExaminationItemCard extends StatelessWidget { final MySelectedExamination examination; - final Function removeExamination; + final VoidCallback removeExamination; ExaminationItemCard(this.examination, this.removeExamination); @@ -49,7 +49,7 @@ class ExaminationItemCard extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.8, ), InkWell( - onTap: removeExamination(), + onTap: removeExamination, child: Icon( Icons.clear, size: 20, diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 3dd28b01..79fbb449 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -276,21 +276,6 @@ class _UpdateObjectivePageState extends State { removeExamination: (masterKey) => removeExamination(masterKey)), ), ); - /*showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return AddExaminationDailog( - mySelectedExamination: widget.mySelectedExamination, - addSelectedExamination: () { - setState(() { - Navigator.of(context).pop(); - }); - }, - removeExamination: (masterKey) => removeExamination(masterKey), - ); - });*/ } } From e5056c5d93a23fe5647e64606ef703fa9f752ab0 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 22 Jun 2021 11:59:33 +0300 Subject: [PATCH 056/199] fix flutter 2 migration --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 517 +++++---------------- lib/core/viewModel/project_view_model.dart | 2 +- lib/screens/patients/InPatientPage.dart | 122 +++-- 4 files changed, 166 insertions(+), 479 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/config/localized_values.dart b/lib/config/localized_values.dart index 270907be..e6ded47a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -12,24 +12,15 @@ const Map> localizedValues = { 'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'}, 'messagesScreenToolbarTitle': {'en': 'Messages', 'ar': 'الرسائل'}, 'mySchedule': {'en': 'Schedule', 'ar': 'جدولي'}, - 'errorNoSchedule': { - 'en': 'You don\'t have any Schedule', - 'ar': 'ليس لديك أي جدول زمني' - }, + 'errorNoSchedule': {'en': 'You don\'t have any Schedule', 'ar': 'ليس لديك أي جدول زمني'}, 'verify': {'en': 'VERIFY', 'ar': 'تحقق'}, 'referralDoctor': {'en': 'Referral Doctor', 'ar': 'الطبيب المُحول إليه'}, 'referringClinic': {'en': 'Referring Clinic', 'ar': 'العيادة المُحول إليها'}, 'frequency': {'en': 'Frequency', 'ar': 'نوع التحويلا'}, 'priority': {'en': 'Priority', 'ar': 'الأولوية'}, 'maxResponseTime': {'en': 'Max Response Time', 'ar': 'الوقت الأقصى للرد'}, - 'clinicDetailsandRemarks': { - 'en': 'Clinic Details and Remarks', - 'ar': 'ملاحضات وتفاصيل العيادة' - }, - 'answerSuggestions': { - 'en': 'Answer/Suggestions', - 'ar': 'ملاحضات وتفاصيل العيادة' - }, + 'clinicDetailsandRemarks': {'en': 'Clinic Details and Remarks', 'ar': 'ملاحضات وتفاصيل العيادة'}, + 'answerSuggestions': {'en': 'Answer/Suggestions', 'ar': 'ملاحضات وتفاصيل العيادة'}, 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'}, 'myOutPatient': {'en': 'My OutPatients', 'ar': 'المريض الخارجي'}, 'myOutPatient_2lines': {'en': 'My\nOutPatients', 'ar': 'المريض\nالخارجي'}, @@ -57,6 +48,7 @@ const Map> localizedValues = { 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicineDashboard': {'en': 'Search\nMedicines', 'ar': 'بحث\nعن الدواء'}, + 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحثعن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, @@ -71,20 +63,14 @@ const Map> localizedValues = { 'patientFile': {'en': 'Patient File', 'ar': 'ملف المريض'}, 'familyMedicine': {'en': 'Family Medicine Clinic', 'ar': 'عيادة طب الأسرة'}, 'search': {'en': 'Search', 'ar': 'بحث '}, - 'onlyArrivedPatient': { - 'en': 'Only Arrived Patient', - 'ar': 'المريض الذي حضر للموعد' - }, + 'onlyArrivedPatient': {'en': 'Only Arrived Patient', 'ar': 'المريض الذي حضر للموعد'}, 'searchMedicineNameHere': {'en': 'Search Medicine ', 'ar': 'ابحث هنا'}, 'youCanFind': {'en': 'You Can Find ', 'ar': 'تستطيع ان تجد '}, 'itemsInSearch': {'en': 'items in search', 'ar': 'عناصر في البحث'}, 'qr': {'en': 'QR', 'ar': 'QR'}, 'reader': {'en': 'Reader', 'ar': 'قارىء رمز ال'}, 'startScanning': {'en': 'Start Scanning', 'ar': 'بدء المسح'}, - 'scanQrCode': { - 'en': 'scan Qr code to retrieve patient profile', - 'ar': 'مسح رمزاال QR لاسترداد ملف تعريف المريض ' - }, + 'scanQrCode': {'en': 'scan Qr code to retrieve patient profile', 'ar': 'مسح رمزاال QR لاسترداد ملف تعريف المريض '}, 'scanQr': {'en': 'Scan Qr', 'ar': 'اقراء ال QR'}, 'profile': {'en': 'Profile', 'ar': 'ملفي الشخصي'}, 'gender': {'en': 'Gender', 'ar': 'الجنس'}, @@ -109,49 +95,28 @@ const Map> localizedValues = { 'bloodPressure': {'en': 'Blood Pressure', 'ar': 'ضغط الدم'}, 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, 'painScale': {'en': 'Pain Scale', 'ar': 'مقياس الألم'}, - 'errorNoVitalSign': { - 'en': 'You don\'t have any Vital Sign', - 'ar': 'ليس لديك اي اعراض حيوية' - }, + 'errorNoVitalSign': {'en': 'You don\'t have any Vital Sign', 'ar': 'ليس لديك اي اعراض حيوية'}, 'labOrders': {'en': 'Lab Orders', 'ar': 'الفحوصات الطبية'}, - 'errorNoLabOrders': { - 'en': 'You don\'t have any lab orders', - 'ar': 'ليس لديك اي فحوصات طبية' - }, + 'errorNoLabOrders': {'en': 'You don\'t have any lab orders', 'ar': 'ليس لديك اي فحوصات طبية'}, 'answerThePatient': {'en': 'answer the patient', 'ar': 'اجب المريض '}, - 'pleaseEnterAnswer': { - 'en': 'please enter answer', - 'ar': 'الرجاء ادخال اجابة ' - }, + 'pleaseEnterAnswer': {'en': 'please enter answer', 'ar': 'الرجاء ادخال اجابة '}, 'replay': {'en': 'Reply', 'ar': 'تاكيد'}, 'progressNote': {'en': 'Progress Note', 'ar': 'ملاحظة التقدم'}, 'progress': {'en': 'Progress', 'ar': 'التقدم'}, 'note': {'en': 'Note', 'ar': 'ملاحظة'}, 'searchNote': {'en': 'Search Note', 'ar': 'بحث عن ملاحظة'}, - 'errorNoProgressNote': { - 'en': 'You don\'t have any Progress Note', - 'ar': 'ليس لديك اي ملاحظة تقدم ' - }, + 'errorNoProgressNote': {'en': 'You don\'t have any Progress Note', 'ar': 'ليس لديك اي ملاحظة تقدم '}, 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, 'generalResult': {'en': 'General Result ', 'ar': 'النتيجة العامة'}, 'description': {'en': 'Description', 'ar': 'الوصف'}, 'value': {'en': 'Value', 'ar': 'القيمة'}, 'range': {'en': 'Range', 'ar': 'النطاق'}, 'enterId': {'en': 'User ID', 'ar': 'معرف المستخدم'}, - 'pleaseEnterYourID': { - 'en': 'Please enter your ID', - 'ar': 'الرجاء ادخال الهوية' - }, + 'pleaseEnterYourID': {'en': 'Please enter your ID', 'ar': 'الرجاء ادخال الهوية'}, 'enterPassword': {'en': 'Password', 'ar': 'كلمه السر'}, - 'pleaseEnterPassword': { - 'en': 'Please Enter Password', - 'ar': 'الرجاء ادخال الرقم السري' - }, + 'pleaseEnterPassword': {'en': 'Please Enter Password', 'ar': 'الرجاء ادخال الرقم السري'}, 'selectYourProject': {'en': 'Branch', 'ar': 'فرع'}, - 'pleaseEnterYourProject': { - 'en': 'Please Enter Your Project', - 'ar': 'الرجاء ادخال مستشفى' - }, + 'pleaseEnterYourProject': {'en': 'Please Enter Your Project', 'ar': 'الرجاء ادخال مستشفى'}, 'login': {'en': 'Login', 'ar': 'تسجيل دخول'}, 'drSulaimanAlHabib': {'en': 'Dr Sulaiman Al Habib', 'ar': 'د.سليمان الحبيب'}, 'welcomeTo': {'en': 'Welcome to', 'ar': 'مرحبا بك'}, @@ -178,10 +143,7 @@ const Map> localizedValues = { 'youWillReceiveA': {'en': 'You will receive a', 'ar': 'سوف تتلقى '}, 'loginCode': {'en': 'Login Code', 'ar': 'رمز تسجيل دخول'}, 'smsBy': {'en': 'By SMS', 'ar': 'عن طريق رسالة قصيرة'}, - 'pleaseEnterTheCode': { - 'en': 'Please enter the code', - 'ar': 'الرجاء ادخال الرمز' - }, + 'pleaseEnterTheCode': {'en': 'Please enter the code', 'ar': 'الرجاء ادخال الرمز'}, 'youDon\'tHaveAnyPatient': { 'en': 'No data found for the selected search criteria', 'ar': 'لا توجد بيانات لمعايير البحث المختارة' @@ -193,14 +155,8 @@ const Map> localizedValues = { 'tomorrow': {'en': 'Tomorrow', 'ar': 'الغد'}, 'nextWeek': {'en': 'Next Week', 'ar': 'الاسبوع القادم'}, 'all': {'en': 'All', 'ar': 'الجميع'}, - 'errorNoInsuranceApprovals': { - 'en': 'You don\'t have any Insurance Approvals', - 'ar': 'ليس لديك اي موفقات تأمين' - }, - 'searchInsuranceApprovals': { - 'en': 'Search InsuranceApprovals', - 'ar': 'بحث عن موافقات التأمين' - }, + 'errorNoInsuranceApprovals': {'en': 'You don\'t have any Insurance Approvals', 'ar': 'ليس لديك اي موفقات تأمين'}, + 'searchInsuranceApprovals': {'en': 'Search InsuranceApprovals', 'ar': 'بحث عن موافقات التأمين'}, 'status': {'en': 'STATUS', 'ar': 'الحالة'}, 'expiryDate': {'en': 'EXPIRY DATE', 'ar': 'تاريخ الانتهاء'}, 'producerName': {'en': 'PRODUCER NAME', 'ar': 'اسم المنتج'}, @@ -213,19 +169,10 @@ const Map> localizedValues = { 'routine': {'en': 'Routine', 'ar': 'روتيني'}, 'send': {'en': 'Send', 'ar': 'ارسال'}, 'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'}, - 'selectReferralFrequency': { - 'en': 'Select Referral Frequency:', - 'ar': 'اختار تواتر الحالة:' - }, - 'clinicalDetailsAndRemarks': { - 'en': 'Clinical Details and Remarks', - 'ar': 'التفاصيل السرسرية والملاحظات' - }, + 'selectReferralFrequency': {'en': 'Select Referral Frequency:', 'ar': 'اختار تواتر الحالة:'}, + 'clinicalDetailsAndRemarks': {'en': 'Clinical Details and Remarks', 'ar': 'التفاصيل السرسرية والملاحظات'}, 'remarks': {'en': 'Remarks', 'ar': 'ملاحظات'}, - 'pleaseFill': { - 'en': 'Please fill all fields..!', - 'ar': 'الرجاء ملأ جميع الحقول..!' - }, + 'pleaseFill': {'en': 'Please fill all fields..!', 'ar': 'الرجاء ملأ جميع الحقول..!'}, 'replay2': {'en': 'Reply', 'ar': 'رد الطبيب'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدليات'}, @@ -237,10 +184,7 @@ const Map> localizedValues = { 'searchOrders': {'en': 'Search Orders', 'ar': ' بحث عن الطلبات'}, 'prescriptionDetails': {'en': 'Prescription Details', 'ar': 'تفاصبل الوصفة'}, 'prescriptionInfo': {'en': 'Prescription Info', 'ar': 'معلومات الوصفة'}, - 'errorNoOrders': { - 'en': 'You don\'t have any Orders', - 'ar': 'لا يوجد لديك اي طلبات' - }, + 'errorNoOrders': {'en': 'You don\'t have any Orders', 'ar': 'لا يوجد لديك اي طلبات'}, 'livecare': {'en': 'Live Care', 'ar': 'Live Care'}, 'beingBad': {'en': 'being bad', 'ar': 'سيء'}, 'beingGreat': {'en': 'being great', 'ar': 'رائع'}, @@ -251,26 +195,14 @@ const Map> localizedValues = { 'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'}, 'endcall': {'en': 'End Call', 'ar': 'إنهاء المكالمة'}, 'transfertoadmin': {'en': 'Transfer to admin', 'ar': 'نقل إلى المسؤول'}, - "searchMedicineImageCaption": { - 'en': 'Type the medicine name to search', - 'ar': ' اكتب اسم الدواء للبحث' - }, + "searchMedicineImageCaption": {'en': 'Type the medicine name to search', 'ar': ' اكتب اسم الدواء للبحث'}, "type": {'en': 'Type ', 'ar': 'اكتب'}, "fromDate": {'en': 'From Date', 'ar': 'من تاريخ'}, "toDate": {'en': 'To Date', 'ar': 'الى تاريخ'}, - "searchPatientImageCaptionTitle": { - 'en': 'SEARCH PATIENT', - 'ar': 'البحث عن المريض' - }, - "searchPatientImageCaptionBody": { - 'en': 'Add Details Of Patient To search', - 'ar': ' أضف تفاصيل المريض للبحث' - }, + "searchPatientImageCaptionTitle": {'en': 'SEARCH PATIENT', 'ar': 'البحث عن المريض'}, + "searchPatientImageCaptionBody": {'en': 'Add Details Of Patient To search', 'ar': ' أضف تفاصيل المريض للبحث'}, "welcome": {'en': 'Welcome', 'ar': ' أهلا بك'}, - 'youDoNotHaveAnyItem': { - 'en': 'You don\'t have any Items', - 'ar': 'لا يوجد اي نتائج' - }, + 'youDoNotHaveAnyItem': {'en': 'You don\'t have any Items', 'ar': 'لا يوجد اي نتائج'}, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, 'moreThan3Letter': { 'en': 'Medicine Name Should Be More Than 3 letter', @@ -297,20 +229,14 @@ const Map> localizedValues = { 'bed': {'en': 'BED:', 'ar': 'السرير'}, 'next': {'en': 'Next', 'ar': 'التالي'}, 'previous': {'en': 'Previous', 'ar': 'السابق'}, - 'healthRecordInformation': { - 'en': 'HEALTH RECORD INFORMATION', - 'ar': 'معلومات السجل الصحي' - }, + 'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'}, "prevoius-sickleave-issed": { "en": "Total previous sick leave issued by the doctor", "ar": "مجموع الإجازات المرضية السابقة التي أصدرها الطبيب" }, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, - "empty-message": { - "en": "Please enter this field", - "ar": "يرجى ادخال هذا الحقل" - }, + "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"}, 'no-sickleve-applied': { 'en': "No sick leave available, apply Now", 'ar': 'لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن' @@ -325,19 +251,13 @@ const Map> localizedValues = { 'leave-start-date': {'en': "Leave start date", 'ar': 'تاريخ بدء المغادرة'}, 'days-sick-leave': {'en': "DAYS OF SICK LEAVE", 'ar': 'أيام الإجازة المرضية'}, 'extend': {'en': "Extend", 'ar': 'تمديد'}, - 'extend-sickleave': { - 'en': "EXTEND SICK LEAVE", - 'ar': 'قم بتمديد الإجازة المرضية' - }, + 'extend-sickleave': {'en': "EXTEND SICK LEAVE", 'ar': 'قم بتمديد الإجازة المرضية'}, "chiefComplaintLength": { "en": "Chief Complaint length should be greater than 25", "ar": "يجب أن يكون طول شكوى الرئيس أكبر من 25" }, 'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'}, - 'no-priscription-listed': { - 'en': 'No Prescription Listed', - 'ar': 'لا وصفة طبية مدرجة' - }, + 'no-priscription-listed': {'en': 'No Prescription Listed', 'ar': 'لا وصفة طبية مدرجة'}, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, 'referredFrom': {'en': "From : ", 'ar': ' : من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, @@ -352,15 +272,9 @@ const Map> localizedValues = { 'summaryReport': {'en': "Summary", 'ar': 'موجز'}, 'accept': {'en': "ACCEPT", 'ar': 'قبول'}, 'reject': {'en': "REJECT", 'ar': 'رفض'}, - 'noAppointmentsErrorMsg': { - 'en': "There is no appointments for at this date", - 'ar': 'لا توجد مواعيد في هذا التاريخ' - }, + 'noAppointmentsErrorMsg': {'en': "There is no appointments for at this date", 'ar': 'لا توجد مواعيد في هذا التاريخ'}, 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, - 'noPrescriptionListed': { - 'en': 'NO PRESCRIPTION LISTED', - 'ar': 'لم يتم سرد أي وصف' - }, + 'noPrescriptionListed': {'en': 'NO PRESCRIPTION LISTED', 'ar': 'لم يتم سرد أي وصف'}, 'addNow': {'en': 'ADD Now', 'ar': 'اضف الآن'}, 'orderType': {'en': 'Order Type', 'ar': 'نوع الطلب'}, 'strength': {'en': 'Strength', 'ar': 'شدة'}, @@ -370,14 +284,8 @@ const Map> localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, 'route': {'en': 'Route', 'ar': 'المسار'}, - 'reschedule-leave': { - 'en': 'Reschedule and leaves', - 'ar': 'إعادة الجدولة والأوراق' - }, - 'no-reschedule-leave': { - 'en': 'No Reschedule and leaves', - 'ar': 'لا إعادة جدولة ويغادر' - }, + 'reschedule-leave': {'en': 'Reschedule and leaves', 'ar': 'إعادة الجدولة والأوراق'}, + 'no-reschedule-leave': {'en': 'No Reschedule and leaves', 'ar': 'لا إعادة جدولة ويغادر'}, 'weight': {'en': "Weight", 'ar': 'الوزن'}, 'kg': {'en': "kg", 'ar': 'كغ'}, 'height': {'en': "Height", 'ar': 'الطول'}, @@ -399,10 +307,7 @@ const Map> localizedValues = { 'rhythm': {'en': "Rhythm", 'ar': 'الإيقاع'}, 'respBeats': {'en': 'RESP (beats/minute)', 'ar': ' (دقة/دقيقة)التنفس'}, 'patternOfRespiration': {'en': "Pattern Of Respiration", 'ar': 'نمط التنفس'}, - 'bloodPressureDiastoleAndSystole': { - 'en': 'Blood Pressure (Sys, Dias)', - 'ar': 'ضغط الدم (العظمى, الصغرى)' - }, + 'bloodPressureDiastoleAndSystole': {'en': 'Blood Pressure (Sys, Dias)', 'ar': 'ضغط الدم (العظمى, الصغرى)'}, 'cuffLocation': {'en': "Cuff Location", 'ar': 'موقع الكف'}, 'cuffSize': {'en': "Cuff Size", 'ar': 'حجم الكف'}, 'patientPosition': {'en': "Patient Position", 'ar': 'موقع المريض'}, @@ -413,73 +318,37 @@ const Map> localizedValues = { 'to': {'en': "To", 'ar': 'إلى'}, 'coveringDoctor': {'en': "Covering Doctor: ", 'ar': ' :تغطية دكتور'}, 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}, - 'pleaseEnterDate': { - 'en': 'Please enter leave start date', - 'ar': 'الرجاء إدخال تاريخ بدء الإجازة' - }, - 'pleaseEnterNoOfDays': { - 'en': 'Please enter sick leave days', - 'ar': 'الرجاء إدخال أيام الإجازة المرضية' - }, - 'pleaseEnterRemarks': { - 'en': 'Please enter remarks', - 'ar': 'الرجاء إدخال الملاحظات' - }, + 'pleaseEnterDate': {'en': 'Please enter leave start date', 'ar': 'الرجاء إدخال تاريخ بدء الإجازة'}, + 'pleaseEnterNoOfDays': {'en': 'Please enter sick leave days', 'ar': 'الرجاء إدخال أيام الإجازة المرضية'}, + 'pleaseEnterRemarks': {'en': 'Please enter remarks', 'ar': 'الرجاء إدخال الملاحظات'}, 'update': {'en': 'Update', 'ar': 'تحديث'}, 'admission': {'en': "Admission", 'ar': 'قبول'}, 'request': {'en': "Request", 'ar': 'طلب'}, 'admissionRequest': {'en': "Admission Request", 'ar': 'طلب قبول'}, 'patientDetails': {'en': "Patient Details", 'ar': 'تفاصيل المريض'}, - 'specialityAndDoctorDetail': { - 'en': "SPECIALITY AND DOCTOR DETAILS", - 'ar': 'تفاصيل التخصص والطبيب' - }, + 'specialityAndDoctorDetail': {'en': "SPECIALITY AND DOCTOR DETAILS", 'ar': 'تفاصيل التخصص والطبيب'}, 'referringDate': {'en': "Referring Date", 'ar': 'تاريخ الإحالة'}, 'referringDoctor': {'en': "Referring Doctor", 'ar': 'دكتور الإحالة'}, 'otherInformation': {'en': "Other Information", 'ar': 'معلومات أخرى'}, 'expectedDays': {'en': "Expected Days", 'ar': 'الأيام المتوقعة'}, - 'expectedAdmissionDate': { - 'en': "Expected Admission Date", - 'ar': 'تاريخ القبول المتوقع' - }, + 'expectedAdmissionDate': {'en': "Expected Admission Date", 'ar': 'تاريخ القبول المتوقع'}, 'admissionDate': {'en': "Admission Date", 'ar': 'تاريخ القبول'}, // 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, - 'isSickLeaveRequired': { - 'en': "Is Sick Leave Required", - 'ar': 'هل الإجازة المرضية مطلوبة' - }, + 'isSickLeaveRequired': {'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة'}, 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'المريض حامل'}, - 'treatmentLine': { - 'en': "Main line of treatment", - 'ar': 'الخط الرئيسي للعلاج' - }, + 'treatmentLine': {'en': "Main line of treatment", 'ar': 'الخط الرئيسي للعلاج'}, 'ward': {'en': "Ward", 'ar': 'رعاية'}, - 'preAnesthesiaReferred': { - 'en': "PRE ANESTHESIA REFERRED", - 'ar': 'الاحالة قبل التخدير' - }, + 'preAnesthesiaReferred': {'en': "PRE ANESTHESIA REFERRED", 'ar': 'الاحالة قبل التخدير'}, 'admissionType': {'en': "Admission Type", 'ar': 'نوع القبول'}, 'diagnosis': {'en': "Diagnosis", 'ar': 'التشخيص'}, 'allergies': {'en': "Allergies", 'ar': 'الحساسية'}, - 'preOperativeOrders': { - 'en': "Pre Operative Orders", - 'ar': 'أوامر ما قبل العملية' - }, - 'elementForImprovement': { - 'en': "Element For Improvement", - 'ar': 'عنصر للتحسين' - }, + 'preOperativeOrders': {'en': "Pre Operative Orders", 'ar': 'أوامر ما قبل العملية'}, + 'elementForImprovement': {'en': "Element For Improvement", 'ar': 'عنصر للتحسين'}, 'dischargeDate': {'en': "Discharge Date", 'ar': 'تاريخ التفريغ'}, 'dietType': {'en': "Diet Type", 'ar': 'نوع النظام الغذائي'}, - 'dietTypeRemarks': { - 'en': "Remarks on diet type", - 'ar': 'ملاحظات على نوع النظام الغذائي' - }, + 'dietTypeRemarks': {'en': "Remarks on diet type", 'ar': 'ملاحظات على نوع النظام الغذائي'}, 'save': {'en': "SAVE", 'ar': 'حفظ'}, - 'postPlansEstimatedCost': { - 'en': "POST PLANS & ESTIMATED COST", - 'ar': 'خطط البريد والتكلفة المقدرة' - }, + 'postPlansEstimatedCost': {'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة'}, 'postPlans': {'en': "POST PLANS", 'ar': 'خطط البريد'}, 'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, @@ -494,19 +363,13 @@ const Map> localizedValues = { 'en': "Patient Feels pain in his back and cough", 'ar': 'يشعر المريض بألم في ظهره ويسعل' }, - 'additionalTextComplaints': { - 'en': "Additional text to add about Complaints", - 'ar': 'نص إضافي لإضافته حول الشكاوى' - }, + 'additionalTextComplaints': {'en': "Additional text to add about Complaints", 'ar': 'نص إضافي لإضافته حول الشكاوى'}, 'otherConditions': {'en': "OTHER CONDITIONS", 'ar': 'شروط أخرى'}, 'other': {'en': "Other", 'ar': 'أخرى'}, 'how': {'en': "How", 'ar': 'كيف'}, 'when': {'en': "When", 'ar': 'متى'}, 'where': {'en': "Where", 'ar': 'أين'}, - 'specifyPossibleLineManagement': { - 'en': "Specify possible line of management", - 'ar': 'حدد خط الإدارة المحتمل' - }, + 'specifyPossibleLineManagement': {'en': "Specify possible line of management", 'ar': 'حدد خط الإدارة المحتمل'}, 'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'}, 'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'}, 'reasons': {'en': "Reasons", 'ar': 'الأسباب'}, @@ -516,20 +379,11 @@ const Map> localizedValues = { 'addChiefComplaints': {'en': "Add Chief Complaints", 'ar': ' اضافه الشكاوى'}, 'histories': {'en': "Histories", 'ar': 'التاريخ المرضي'}, 'allergiesSoap': {'en': "Allergies", 'ar': 'الحساسية'}, - 'historyOfPresentIllness': { - 'en': "History of Present Illness", - 'ar': 'تاريخ المرض الحالي' - }, - 'requiredMsg': { - 'en': "Please add required field correctly", - 'ar': "الرجاء إضافة الحقل المطلوب بشكل صحيح" - }, + 'historyOfPresentIllness': {'en': "History of Present Illness", 'ar': 'تاريخ المرض الحالي'}, + 'requiredMsg': {'en': "Please add required field correctly", 'ar': "الرجاء إضافة الحقل المطلوب بشكل صحيح"}, 'addHistory': {'en': "Add History", 'ar': "اضافه تاريخ مرضي"}, 'searchHistory': {'en': "Search History", 'ar': " البحث"}, - 'addSelectedHistories': { - 'en': "Add Selected Histories", - 'ar': " اضافه تاريخ مرضي" - }, + 'addSelectedHistories': {'en': "Add Selected Histories", 'ar': " اضافه تاريخ مرضي"}, 'addAllergies': {'en': "Add Allergies", 'ar': "أضف الحساسية"}, 'itemExist': {'en': "This item already exist", 'ar': "هذا العنصر موجود"}, 'selectAllergy': {'en': "Select Allergy", 'ar': "أختر الحساسية"}, @@ -537,18 +391,9 @@ const Map> localizedValues = { 'leaveCreated': {'en': "Leave has been created", 'ar': "تم إنشاء الإجازة"}, 'medications': {'en': "Medications", 'ar': "الأدوية"}, 'procedures': {'en': "Procedures", 'ar': "الإجراءات"}, - 'vitalSignEmptyMsg': { - 'en': "There is no vital signs for this patient", - 'ar': "لا توجد علامات حيوية لهذا المريض" - }, - 'referralEmptyMsg': { - 'en': "There is no referral data", - 'ar': "لا توجد بيانات إحالة" - }, - 'referralSuccessMsg': { - 'en': "You make referral successfully", - 'ar': "You make referral successfully" - }, + 'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar': "لا توجد علامات حيوية لهذا المريض"}, + 'referralEmptyMsg': {'en': "There is no referral data", 'ar': "لا توجد بيانات إحالة"}, + 'referralSuccessMsg': {'en': "You make referral successfully", 'ar': "You make referral successfully"}, 'fromTime': {'en': "From Time", 'ar': "من وقت"}, 'toTime': {'en': "To Time", 'ar': "الى وقت"}, 'diagnoseType': {'en': "Diagnose Type", 'ar': "نوع التشخيص"}, @@ -559,18 +404,9 @@ const Map> localizedValues = { 'codeNo': {'en': "Code #", 'ar': "# الرمز"}, 'covered': {'en': "Covered", 'ar': "مغطى"}, 'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"}, - 'uncoveredByDoctor': { - 'en': "Uncovered By Doctor", - 'ar': "غير مغطى من قبل الدكتور" - }, - 'chiefComplaintEmptyMsg': { - 'en': "There is no Chief Complaint", - 'ar': "ليس هناك شكوى رئيس" - }, - "more-verify": { - "en": "More Verification \n Options", - "ar": "المزيد من خيارات التحقق" - }, + 'uncoveredByDoctor': {'en': "Uncovered By Doctor", 'ar': "غير مغطى من قبل الدكتور"}, + 'chiefComplaintEmptyMsg': {'en': "There is no Chief Complaint", 'ar': "ليس هناك شكوى رئيس"}, + "more-verify": {"en": "More Verification \n Options", "ar": "المزيد من خيارات التحقق"}, "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"}, "account-info": { "en": "Would you like to login with current username?", @@ -587,38 +423,24 @@ const Map> localizedValues = { "verify-with-sms": {"en": " SMS", "ar": "الرسائل القصيرة"}, "verify-with-whatsapp": {"en": "WhatsApp", "ar": " الواتس اب"}, "verify-with": {"en": "Verify through ", "ar": " الواتس اب"}, - "last-login": { - "en": "Last login details:", - "ar": "تفاصيل تسجيل الدخول الأخير:" - }, + "last-login": {"en": "Last login details:", "ar": "تفاصيل تسجيل الدخول الأخير:"}, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { - "en": - "To activate the fingerprint login service, please verify data by using one of the following options.", - "ar": - "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" + "en": "To activate the fingerprint login service, please verify data by using one of the following options.", + "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" }, "verification_message": { "en": "Please enter the Verification Code sent to", "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" }, - "validation_message": { - "en": "The verification code expires in", - "ar": "تنتهي صلاحية رمز التحقق خلال" - }, + "validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"}, 'addAssessment': {'en': "Add Assessment", 'ar': "أضف التقييم"}, 'assessment': {'en': "Assessment", 'ar': " التقييم"}, - 'physicalSystemExamination': { - 'en': "Physical System / Examination", - 'ar': "الفحص البدني / النظام" - }, + 'physicalSystemExamination': {'en': "Physical System / Examination", 'ar': "الفحص البدني / النظام"}, 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, 'doc': {'en': "Doc : ", 'ar': " د : "}, - 'patientNoDetailErrMsg': { - 'en': "There is no detail for this patient", - 'ar': "لا توجد تفاصيل لهذا المريض" - }, + 'patientNoDetailErrMsg': {'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض"}, 'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"}, 'normal': {'en': "Normal", 'ar': "عادي"}, 'abnormal': {'en': "Abnormal", 'ar': " غير عادي"}, @@ -637,49 +459,25 @@ const Map> localizedValues = { 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, 'regular': {'en': "Regular", 'ar': "اعتيادي"}, - 'addMoreProcedure': { - 'en': "Add More Procedures", - 'ar': "اضف المزيد من العمليات" - }, + 'addMoreProcedure': {'en': "Add More Procedures", 'ar': "اضف المزيد من العمليات"}, 'searchProcedures': {'en': "Search Procedures", 'ar': "البحث في العمليات"}, 'selectProcedures': {'en': "Select procedure", 'ar': "اختر العملية"}, - 'procedureCategorise': { - 'en': "Select Procedure Category", - 'ar': "اختر صنف العمليات " - }, - 'addSelectedProcedures': { - 'en': "add Selected Procedures", - 'ar': "اضافة العمليات المختارة " - }, - 'addProcedures': { - 'en': "Add Procedure", - 'ar': "اضافة العمليات" - }, + 'procedureCategorise': {'en': "Select Procedure Category", 'ar': "اختر صنف العمليات "}, + 'addSelectedProcedures': {'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"}, 'dType': {'en': "Type", 'ar': "النوع"}, - 'addAssessmentDetails': { - 'en': "Add Assessment Details", - 'ar': "أضف تفاصيل التقييم" - }, + 'addAssessmentDetails': {'en': "Add Assessment Details", 'ar': "أضف تفاصيل التقييم"}, 'progressNoteSOAP': {'en': "Progress Note", 'ar': "ملاحظة التقدم"}, 'addProgressNote': {'en': "Add Progress Note", 'ar': "أضف ملاحظة التقدم"}, 'createdBy': {'en': "Created By :", 'ar': "أضيفت من قبل : "}, 'editedBy': {'en': "Edited By :", 'ar': "عدلت من قبل : "}, 'currentMedications': {'en': "Current Medications", 'ar': "الأدوية الحالية"}, - 'noItem': { - 'en': "No items exists in this list", - 'ar': "لا توجد عناصر في هذه القائمة" - }, - 'postUcafSuccessMsg': { - 'en': "UCAF request send successfully", - 'ar': "تم ارسال طلب UCAF بنجاح" - }, - 'vitalSignDetailEmpty': { - 'en': "There is no data for this vital sign", - 'ar': "لا توجد بيانات لهذه العلامة الحيوية" - }, + 'noItem': {'en': "No items exists in this list", 'ar': "لا توجد عناصر في هذه القائمة"}, + 'postUcafSuccessMsg': {'en': "UCAF request send successfully", 'ar': "تم ارسال طلب UCAF بنجاح"}, + 'vitalSignDetailEmpty': {'en': "There is no data for this vital sign", 'ar': "لا توجد بيانات لهذه العلامة الحيوية"}, 'onlyOfftimeHoliday': { 'en': "You can only apply holiday or offtime from mobile app", 'ar': "يمكنك فقط تطبيق عطلة أو إجازة من تطبيق الهاتف" @@ -695,10 +493,7 @@ const Map> localizedValues = { 'en': "You have to add at least one examination.", 'ar': "يجب عليك إضافة الفحص واحد على الأقل." }, - 'progressNoteErrorMsg': { - 'en': "You have to add progress Note.", - 'ar': "يجب عليك إضافة ملاحظة التقدم." - }, + 'progressNoteErrorMsg': {'en': "You have to add progress Note.", 'ar': "يجب عليك إضافة ملاحظة التقدم."}, 'chiefComplaintErrorMsg': { 'en': "You have to add chief complaint fields correctly .", 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" @@ -723,41 +518,20 @@ const Map> localizedValues = { 'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"}, 'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"}, - 'referralResponse': { - 'en': "Referral Response : ", - 'ar': " : استجابة الإحالة" - }, + 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'diagnosisDetail': {'en': "Diagnosis Details", 'ar': "تفاصيل التشخيص"}, - 'referralSuccessMsgAccept': { - 'en': "Referral Accepted Successfully", - 'ar': "تم قبول الإحالة بنجاح" - }, - 'referralSuccessMsgReject': { - 'en': "Referral Rejected Successfully", - 'ar': "تم رفض الإحالة بنجاح" - }, - 'sickLeaveComments': { - 'en': "Sick leave comments", - 'ar': "تعليقات إجازة مرضية" - }, + 'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"}, + 'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"}, + 'sickLeaveComments': {'en': "Sick leave comments", 'ar': "تعليقات إجازة مرضية"}, 'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"}, - 'pastSurgicalHistory': { - 'en': "Past surgical history", - 'ar': "التاريخ الجراحي" - }, + 'pastSurgicalHistory': {'en': "Past surgical history", 'ar': "التاريخ الجراحي"}, 'complications': {'en': "Complications", 'ar': "المضاعفات"}, 'floor': {'en': "Floor", 'ar': "الطابق"}, 'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"}, - 'otherDepartmentsInterventions': { - 'en': "Other departments interventions", - 'ar': "تدخلات الأقسام الأخرى" - }, + 'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"}, 'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"}, - 'admissionRequestSuccessMsg': { - 'en': "Admission Request Created Successfully", - 'ar': "تم إنشاء طلب القبول بنجاح" - }, + 'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"}, // 'icd': {'en': "ICD", 'ar': " "}, 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"}, 'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"}, @@ -771,10 +545,7 @@ const Map> localizedValues = { 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "إحالات المريض"}, 'myPatientsReferral': {'en': "Patient's\nReferrals", 'ar': "إحالات\nالمريض"}, 'arrivalpatient': {'en': "Arrival Patients", 'ar': "المرضى القادمون"}, - 'searchmedicinepatient': { - 'en': "Search patient or Medicines", - 'ar': "ابحث عن المريض أو الأدوية" - }, + 'searchmedicinepatient': {'en': "Search patient or Medicines", 'ar': "ابحث عن المريض أو الأدوية"}, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, @@ -782,30 +553,18 @@ const Map> localizedValues = { "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, - "sendSuc": { - "en": "A copy has been sent to the email", - "ar": "تم إرسال نسخة إلى البريد الإلكتروني" - }, + "sendSuc": {"en": "A copy has been sent to the email", "ar": "تم إرسال نسخة إلى البريد الإلكتروني"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, - "noDataAvailable": { - "en": "No data available", - "ar": " لا يوجد بيانات متاحة " - }, + "noDataAvailable": {"en": "No data available", "ar": " لا يوجد بيانات متاحة "}, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, 'fileNumber': {'en': "File Number: ", 'ar': "رقم الملف : "}, - 'searchPatient-name': { - 'en': 'Search Name, Medical File, Phone Number', - 'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف" - }, + 'searchPatient-name': {'en': 'Search Name, Medical File, Phone Number', 'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف"}, 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة الجدولة'}, 'leaves': {'en': 'Leaves', 'ar': 'يغادر'}, - "totalApproval": { - "en": "Total approval unused", - "ar": "اجمالي الموافقات الغير مستخدمة" - }, + "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, @@ -814,32 +573,17 @@ const Map> localizedValues = { "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, - "searchWithOther": { - "en": "Search With Other Criteria", - "ar": "البحث بمعايير أخرى" - }, - "hideOtherCriteria": { - "en": "Hide Other Criteria", - "ar": "إخفاء المعايير الأخرى" - }, - "applyForReschedule": { - "en": "Apply for leave or reschedule", - "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة" - }, + "searchWithOther": {"en": "Search With Other Criteria", "ar": "البحث بمعايير أخرى"}, + "hideOtherCriteria": {"en": "Hide Other Criteria", "ar": "إخفاء المعايير الأخرى"}, + "applyForReschedule": {"en": "Apply for leave or reschedule", "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة"}, "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"}, - "addSickLeaveRequest": { - "en": "Add Sick Leave Request", - "ar": "إضافة طلب إجازة مرضية" - }, - "extendSickLeaveRequest": { - "en": "Extend Sick Leave Request", - "ar": "تمديد طلب الإجازة المرضية" - }, + "addSickLeaveRequest": {"en": "Add Sick Leave Request", "ar": "إضافة طلب إجازة مرضية"}, + "extendSickLeaveRequest": {"en": "Extend Sick Leave Request", "ar": "تمديد طلب الإجازة المرضية"}, "accepted": {"en": "Accepted", "ar": "وافقت"}, "cancelled": {"en": "Cancelled", "ar": "ألغيت"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, @@ -849,16 +593,10 @@ const Map> localizedValues = { "remove": {"en": "Remove", "ar": "حذف"}, "changeOfSchedule": {"en": "Change of Schedule", "ar": "تغيير الجدول"}, "newSchedule": {"en": "New Schedule", "ar": "جدول جديد"}, - "enter_credentials": { - "en": "Enter the user credentials below", - "ar": "أدخل بيانات اعتماد المستخدم أدناه" - }, + "enter_credentials": {"en": "Enter the user credentials below", "ar": "أدخل بيانات اعتماد المستخدم أدناه"}, "step": {"en": "Step", "ar": "خطوة"}, "fieldRequired": {"en": "This field is required", "ar": "هذه الخانة مطلوبه"}, - "applyOrRescheduleLeave": { - "en": "Apply Reschedule Leave", - "ar": "التقدم بطلب أو إعادة جدولة الإجازة" - }, + "applyOrRescheduleLeave": {"en": "Apply Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة"}, "myQRCode": {"en": "My QR Code", "ar": " كود QR "}, "patientIDMobilenational": { "en": "Patient ID, National ID, Mobile Number", @@ -873,68 +611,35 @@ const Map> localizedValues = { "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, - "didntCatch": { - "en": "Didn't catch that. Try Speaking again", - "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" - }, + "didntCatch": {"en": "Didn't catch that. Try Speaking again", "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى"}, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, - "pleaseEnterProcedure": { - "en": "Please Enter Procedure", - "ar": "الرجاء إدخال الإجراء " - }, + "pleaseEnterProcedure": {"en": "Please Enter Procedure", "ar": "الرجاء إدخال الإجراء "}, "fillTheMandatoryProcedureDetails": { "en": "Fill The Mandatory Procedure Details", "ar": "املأ تفاصيل الإجراء الإلزامي" }, - "atLeastThreeCharacters": { - "en": "At least three Characters", - "ar": "ثلاثة أحرف على الأقل " - }, - "searchProcedureHere": { - "en": "Search Procedure here...", - "ar": "إجراء البحث هنا ... " - }, - "noInsuranceApprovalFound": { - "en": "No Insurance Approval Found", - "ar": "لم يتم العثور على موافقة التأمين" - }, + "atLeastThreeCharacters": {"en": "At least three Characters", "ar": "ثلاثة أحرف على الأقل "}, + "searchProcedureHere": {"en": "Search Procedure here...", "ar": "إجراء البحث هنا ... "}, + "noInsuranceApprovalFound": {"en": "No Insurance Approval Found", "ar": "لم يتم العثور على موافقة التأمين"}, "procedure": {"en": "Procedure", "ar": "عملية"}, "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, "processed": {"en": "processed", "ar": "معالجتها"}, "direction": {"en": "Direction", "ar": "إشراف"}, "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, - "medicationHasBeenAdded": { - "en": "Medication has been added", - "ar": "تمت إضافة الدواء" - }, - "newPrescriptionOrder": { - "en": "New Prescription Order", - "ar": "طلب وصفة طبية جديد " - }, - "pleaseFillAllFields": { - "en": "Please Fill All Fields", - "ar": "لو سمحت أملأ كل الحقول" - }, + "medicationHasBeenAdded": {"en": "Medication has been added", "ar": "تمت إضافة الدواء"}, + "newPrescriptionOrder": {"en": "New Prescription Order", "ar": "طلب وصفة طبية جديد "}, + "pleaseFillAllFields": {"en": "Please Fill All Fields", "ar": "لو سمحت أملأ كل الحقول"}, "narcoticMedicineCanOnlyBePrescribedFromVida": { "en": "Narcotic medicine can only be prescribed from VIDA", "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " }, - "only5DigitsAllowedForStrength": { - "en": "Only 5 Digits allowed for strength", - "ar": "يسمح فقط بـ 5 أرقام للقوة" - }, + "only5DigitsAllowedForStrength": {"en": "Only 5 Digits allowed for strength", "ar": "يسمح فقط بـ 5 أرقام للقوة"}, "unit": {"en": "Unit", "ar": "وحدة"}, "boxQuantity": {"en": "Box Quantity", "ar": "كمية الصندوق "}, "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, - "applyForRadiologyOrder": { - "en": "Apply for Radiology Order", - "ar": "التقدم بطلب للحصول على طلب الأشعة " - }, - "applyForNewLabOrder": { - "en": "Apply for New Lab Order", - "ar": "تقدم بطلب جديد للمختبر الأشعة" - }, + "applyForRadiologyOrder": {"en": "Apply for Radiology Order", "ar": "التقدم بطلب للحصول على طلب الأشعة "}, + "applyForNewLabOrder": {"en": "Apply for New Lab Order", "ar": "تقدم بطلب جديد للمختبر الأشعة"}, "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب معمل"}, "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشعة"}, "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, @@ -946,26 +651,14 @@ const Map> localizedValues = { "en": "Apply for New Prescriptions Order", "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " }, - "noPrescriptionsFound": { - "en": "No Prescriptions Found", - "ar": "لم يتم العثور على وصفات طبية" - }, - "noMedicalFileFound": { - "en": "No Medical File Found", - "ar": "لم يتم العثور على ملف طبي" - }, + "noPrescriptionsFound": {"en": "No Prescriptions Found", "ar": "لم يتم العثور على وصفات طبية"}, + "noMedicalFileFound": {"en": "No Medical File Found", "ar": "لم يتم العثور على ملف طبي"}, "insurance22": {"en": "Insurance", "ar": "موافقات"}, "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, - "addNewOrderSheet": { - "en": "Add a New Order Sheet", - "ar": "أضف ورقة طلب جديدة" - }, - "addNewProgressNote": { - "en": "Add a New Progress Note", - "ar": "أضف ملاحظة تقدم جديدة" - }, + "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف ورقة طلب جديدة"}, + "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة تقدم جديدة"}, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغيت"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index c1ca9bbb..e2e6bc06 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -18,7 +18,7 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); late Locale _appLocale = Locale(currentLanguage); - String currentLanguage = 'ar'; + String currentLanguage = 'en'; bool _isArabic = false; bool isInternetConnection = true; List doctorClinicsList = []; diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index b43ac22b..0a1bb65a 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -65,72 +65,66 @@ class _InPatientPageState extends State { model.state == ViewState.Idle ? model.filteredInPatientItems.length > 0 ? Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0), - child: SingleChildScrollView( - child: ListView.builder( - physics: const AlwaysScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: 70, - itemBuilder: (context, index) { - if (!widget.isMyInPatient) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: - model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + child: ListView.builder( + //physics: BouncingScrollPhysics(), + // scrollDirection: Axis.vertical, + //shrinkWrap: true, + itemCount: model.filteredInPatientItems.length, + itemBuilder: (context, index) { + if (!widget.isMyInPatient) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else if (model.filteredInPatientItems[index].doctorId == - model.doctorProfile!.doctorID && - widget.isMyInPatient) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: - model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if (model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID && + widget.isMyInPatient) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: + model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else - return SizedBox(); - }), - ), - ), + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else + return SizedBox(); + }), ) : Expanded( child: SingleChildScrollView( From 02307e8fac2b23bc6fa77518ad85a59fd995cf94 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 22 Jun 2021 12:03:02 +0300 Subject: [PATCH 057/199] fix header and verification method --- .../patient_profile_app_bar_model.dart | 7 +- .../auth/verification_methods_screen.dart | 1 - .../patient_profile_screen.dart | 29 +- .../auth/verification_methods_list.dart | 8 +- .../profile/patient-profile-app-bar.dart | 20 +- ...ent-profile-header-new-design-app-bar.dart | 365 ------------------ 6 files changed, 43 insertions(+), 387 deletions(-) delete mode 100644 lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.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 index ea576abc..97862aaa 100644 --- a/lib/models/patient/profile/patient_profile_app_bar_model.dart +++ b/lib/models/patient/profile/patient_profile_app_bar_model.dart @@ -19,6 +19,8 @@ class PatientProfileAppBarModel { String? clinic; bool? isAppointmentHeader; bool? isFromLabResult; + Stream ?videoCallDurationStream; + PatientProfileAppBarModel( {this.height = 0.0, @@ -38,7 +40,7 @@ class PatientProfileAppBarModel { this.visitDate, this.clinic, this.isAppointmentHeader = false, - this.isFromLabResult =false}); + this.isFromLabResult =false, this.videoCallDurationStream}); PatientProfileAppBarModel.fromJson(Map json) { height = json['height']; @@ -59,6 +61,8 @@ class PatientProfileAppBarModel { clinic = json['clinic']; isAppointmentHeader = json['isAppointmentHeader']; isFromLabResult = json['isFromLabResult']; + videoCallDurationStream = json['videoCallDurationStream']; + } Map toJson() { @@ -81,6 +85,7 @@ class PatientProfileAppBarModel { data['clinic'] = this.clinic; data['isAppointmentHeader'] = this.isAppointmentHeader; data['isFromLabResult'] = this.isFromLabResult; + data['videoCallDurationStream'] = this.videoCallDurationStream; return data; } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index d41c6e2b..cf4d7d78 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -52,7 +52,6 @@ class _VerificationMethodsScreenState extends State { return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - // baseViewModel: model, body: SingleChildScrollView( child: Center( child: FractionallySizedBox( 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 724bdb15..e5f858e7 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,12 +1,10 @@ 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'; -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'; @@ -15,12 +13,9 @@ import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profi 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'; 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'; @@ -134,16 +129,20 @@ class _PatientProfileScreenState extends State with Single children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient, arrivalType, patientType, - videoCallDurationStream: videoCallDurationStream, - isInpatient: isInpatient, - isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient: isDischargedPatient), + PatientProfileAppBar( + patientProfileAppBarModel: PatientProfileAppBarModel( + patient: patient, + videoCallDurationStream: videoCallDurationStream, + isInpatient: isInpatient, + isFromLiveCare: isFromLiveCare, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), + ), Container( height: !isSearchAndOut ? isDischargedPatient diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 0e7a61c7..cbd665ef 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -38,14 +38,14 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/verify-whtsapp.png', onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, - label: TranslationBase.of(context).verifyWith ?? "" +"\n"+ TranslationBase.of(context).verifyWhatsApp!, + label: TranslationBase.of(context).verifyWith! + "\n"+ TranslationBase.of(context).verifyWhatsApp!, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/verify-sms.png", onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, - label: TranslationBase.of(context).verifyWith ?? "" + "\n"+ TranslationBase.of(context).verifySMS!, + label: TranslationBase.of(context).verifyWith! + "\n"+ TranslationBase.of(context).verifySMS!, ); break; case AuthMethodTypes.Fingerprint: @@ -56,7 +56,7 @@ class _VerificationMethodsListState extends State { widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); } }, - label: TranslationBase.of(context).verifyWith ?? "" + "\n"+TranslationBase.of(context).verifyFingerprint!, + label: TranslationBase.of(context).verifyWith! + "\n"+TranslationBase.of(context).verifyFingerprint!, ); break; case AuthMethodTypes.FaceID: @@ -67,7 +67,7 @@ class _VerificationMethodsListState extends State { widget.authenticateUser!(AuthMethodTypes.FaceID, true); } }, - label: TranslationBase.of(context).verifyWith ?? "" + "\n"+TranslationBase.of(context).verifyFaceID!, + label: TranslationBase.of(context).verifyWith! + "\n"+TranslationBase.of(context).verifyFaceID!, ); break; diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index d6c12dc8..90e8d304 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -90,6 +90,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ), + if(patientProfileAppBarModel.videoCallDurationStream != null) + StreamBuilder( + stream: patientProfileAppBarModel.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: [ @@ -502,7 +520,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { : patientProfileAppBarModel.patient!.admissionDate != null ? patientProfileAppBarModel.isFromLabResult! ? 170 - : 150 + : 170 : patientProfileAppBarModel.isDischargedPatient! ? 240 : 130) 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 deleted file mode 100644 index d5ddd66c..00000000 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ /dev/null @@ -1,365 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -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:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final double height; - final bool isInpatient; - 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, required this.videoCallDurationStream}); - - @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 - ? isInpatient - ? 215 - : 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.fullName ?? patient.patientDetails!.fullName), - fontSize: SizeConfig.textMultiplier * 1.8, - 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, - ), - ), - ), - 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: [ - 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( - patient.arrivedOn != null - ? AppDateUtils.convertStringToDateFormat( - patient.arrivedOn ?? "", 'MM-dd-yyyy HH:mm') - : '', - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) - ], - )) - : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare) - 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 ?? ''), - 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 ?? patient.nationalityId ?? '', - fontWeight: FontWeight.bold, - fontSize: 12, - ), - 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() - ], - ) - ], - ), - 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, isServerFormat: !isFromLiveCare)}", - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)), - ], - ), - ), - ), - if (isInpatient) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: patient.admissionDate == null - ? "" - : TranslationBase.of(context).admissionDate! + " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: patient.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), - ]))), - if (patient.admissionDate != null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 15, - ), - if (isDischargedPatient && patient.dischargeDate != null) - AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate ?? "").difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate ?? "")).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700) - else - AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate ?? "")).inDays + 1}", - fontSize: 15, - 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 ?? ''; - } - - 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, 200); -} From b8c7ce2920109e1e8d062b54d20108cb1cd6daa8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 22 Jun 2021 12:32:22 +0300 Subject: [PATCH 058/199] fix header --- lib/widgets/patients/profile/patient-profile-app-bar.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 90e8d304..1ff7f1a3 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -515,11 +515,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? 270 : ((patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty) ? patientProfileAppBarModel.isFromLabResult! - ? 170 - : 150 + ? 190 + : 170 : patientProfileAppBarModel.patient!.admissionDate != null ? patientProfileAppBarModel.isFromLabResult! - ? 170 + ? 190 : 170 : patientProfileAppBarModel.isDischargedPatient! ? 240 From 6c6b0435718475fd98df9db43f3951887a38d99e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 23 Jun 2021 13:46:33 +0300 Subject: [PATCH 059/199] flutter 2 migration fix --- .../patient_search/patient_search_result_screen.dart | 10 +++++----- lib/screens/prescription/add_prescription_form.dart | 7 +------ .../profile/profile_medical_info_widget_search.dart | 1 - 3 files changed, 6 insertions(+), 12 deletions(-) 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 39b619c0..956c0d93 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -46,10 +46,10 @@ class _PatientsSearchResultScreenState extends State late int clinicId; late AuthenticationViewModel authenticationViewModel; - late String patientType; - late String patientTypeTitle; + String? patientType; + String? patientTypeTitle; var selectedFilter = 1; - late String arrivalType; + String? arrivalType; late ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); @@ -131,8 +131,8 @@ class _PatientsSearchResultScreenState extends State padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, + patientType: patientType ?? "", + arrivalType: arrivalType ?? "", isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 7fbefeb0..d0909a0d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/core/model/search_drug/get_medication_respons import 'package:doctor_app_flutter/core/provider/robot_provider.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/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -31,7 +30,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -603,10 +601,7 @@ class _PrescriptionFormWidgetState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).boxQuantity, isTextFieldHasSuffix: false, - dropDownText: box != null - ? TranslationBase.of(context).boxQuantity ?? - "" + ": " + model.boxQuintity.toString() - : null, + dropDownText: box != null ? model.boxQuintity.toString() : null, enabled: false, ), ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 3e457a8d..2cf57c01 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/routes.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/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; From 7d4f6d526457bb1eb22fd48f50c6f6455e4f1106 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 23 Sep 2021 11:14:04 +0300 Subject: [PATCH 060/199] adding slide up to prescription and procedure --- .../radiology/radiology_home_page.dart | 93 +++++++------------ .../prescription/prescriptions_page.dart | 15 +-- lib/screens/procedures/procedure_screen.dart | 15 +-- lib/widgets/transitions/slide_up_page.dart | 18 ++-- 4 files changed, 55 insertions(+), 86 deletions(-) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 46b5ad28..958301fd 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -12,6 +12,7 @@ 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'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -44,8 +45,7 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient, - patientType: patientType, isInPatient: false), + onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -63,8 +63,7 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -84,8 +83,7 @@ class _RadiologyHomePageState extends State { ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -105,20 +103,19 @@ class _RadiologyHomePageState extends State { ], ), ), - 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) => BaseAddProcedureTabPage( - patient: patient, - model: model, - procedureType: ProcedureType.RADIOLOGY, - ), settings: RouteSettings(name: 'AddProcedureTabPage') - ), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.RADIOLOGY, + ), + settingRoute: 'AddProcedureTabPage'), ); }, label: TranslationBase.of(context).applyForRadiologyOrder, @@ -143,43 +140,26 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index] - .isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment ? Colors.red[900] : !model.radiologyList[index].isInOutPatient ? 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, child: Center( child: Text( - model.radiologyList[index] - .isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -187,29 +167,21 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: - model.radiologyList[index].doctorName, - profileUrl: - model.radiologyList[index].doctorImageURL, - invoiceNO: - '${model.radiologyList[index].invoiceNo}', - branch: - '${model.radiologyList[index].projectName}', - clinic: model - .radiologyList[index].clinicDescription, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportDate, + model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: - model.radiologyList[index], - patient: patient, - isInpatient:isInpatient - ), + finalRadiology: model.radiologyList[index], + patient: patient, + isInpatient: isInpatient), ), ); }, @@ -218,8 +190,7 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 905ee09a..801669cb 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -95,13 +96,13 @@ class PrescriptionsPage extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient, - prescriptionModel: model, - procedureType: ProcedureType.PRESCRIPTION, - ), - settings: RouteSettings(name: 'AddProcedureTabPage')), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + prescriptionModel: model, + procedureType: ProcedureType.PRESCRIPTION, + ), + settingRoute: 'AddProcedureTabPage'), ); }, label: TranslationBase.of(context).applyForNewPrescriptionsOrder, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index de356935..79fb961c 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -11,6 +11,7 @@ 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/transitions/slide_up_page.dart'; import 'package:flutter/material.dart'; import 'ProcedureCard.dart'; @@ -99,13 +100,13 @@ class ProcedureScreen extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient, - model: model, - procedureType: ProcedureType.PROCEDURE, - ), - settings: RouteSettings(name: 'AddProcedureTabPage')), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.PROCEDURE, + ), + settingRoute: 'AddProcedureTabPage'), ); }, child: Container( diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index f534e2a3..ee0b7473 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; + final String settingRoute; - SlideUpPageRoute( - {this.widget, this.fullscreenDialog = false, this.opaque = true}) + SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, @@ -24,21 +24,17 @@ class SlideUpPageRoute extends PageRouteBuilder { opaque: opaque, barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierDismissible: true, - settings: RouteSettings(name: widget.runtimeType.toString()), + settings: RouteSettings(name: settingRoute ?? widget.runtimeType.toString()), transitionDuration: Duration(milliseconds: 800), - transitionsBuilder: ((BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child) { + transitionsBuilder: + ((BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { var begin = Offset(0.0, 1.0); var end = Offset.zero; var curve = Curves.easeInOutQuint; - var tween = - Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); + var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); - return SlideTransition( - position: animation.drive(tween), child: child); + return SlideTransition(position: animation.drive(tween), child: child); }), ); } From a4654e9bcea40f9cee72ab4a73a7d809e503cfe4 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 3 Oct 2021 09:42:09 +0300 Subject: [PATCH 061/199] add isCopyable on progress note --- lib/screens/patients/profile/note/progress_note_screen.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 054817c2..fb31511d 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -166,8 +166,10 @@ class _ProgressNoteState extends State { index] .createdBy) AppText( + TranslationBase.of(context) .notePending, + fontWeight: FontWeight.bold, color: Color(0xFFCC9B14), fontSize: 12, @@ -472,6 +474,7 @@ class _ProgressNoteState extends State { fontWeight: FontWeight.w600, fontSize: 12, + isCopyable:true, ), ), ], @@ -505,6 +508,7 @@ class _ProgressNoteState extends State { .isArabic), fontWeight: FontWeight.w600, fontSize: 14, + isCopyable:true, ), AppText( model @@ -522,6 +526,7 @@ class _ProgressNoteState extends State { DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, + isCopyable:true, ), ], crossAxisAlignment: @@ -543,6 +548,7 @@ class _ProgressNoteState extends State { index] .notes, fontSize: 10, + isCopyable:true, ), ), ]) From 2f65546ff64d1e98b6731a16928714dbc6ec2485 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 3 Oct 2021 12:10:38 +0300 Subject: [PATCH 062/199] fix in-patient prescription --- .../all_lab_special_result_page.dart | 71 ++++++++++++----- .../prescription/prescriptions_page.dart | 78 +++++++++++++------ 2 files changed, 105 insertions(+), 44 deletions(-) diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 443534ea..9a7ffd63 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -44,7 +44,8 @@ class _AllLabSpecialResultState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getAllSpecialLabResult(patientId: patient.patientMRN), + onModelReady: (model) => + model.getAllSpecialLabResult(patientId: patient.patientMRN), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -69,7 +70,9 @@ class _AllLabSpecialResultState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).special + " " + TranslationBase.of(context).lab, + TranslationBase.of(context).special + + " " + + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, @@ -105,26 +108,44 @@ class _AllLabSpecialResultState extends State { width: 20, height: 160, decoration: BoxDecoration( - color: model.allSpecialLabList[index].isLiveCareAppointment + color: model.allSpecialLabList[index] + .isLiveCareAppointment ? Colors.red[900] - : !model.allSpecialLabList[index].isInOutPatient + : !model.allSpecialLabList[index] + .isInOutPatient ? 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, child: Center( child: Text( - model.allSpecialLabList[index].isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !model.allSpecialLabList[index].isInOutPatient - ? TranslationBase.of(context).inPatientLabel.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), + model.allSpecialLabList[index] + .isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.allSpecialLabList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -136,17 +157,24 @@ class _AllLabSpecialResultState extends State { context, FadePage( page: SpecialLabResultDetailsPage( - resultData: model.allSpecialLabList[index].resultDataHTML, + resultData: model.allSpecialLabList[index] + .resultDataHTML, patient: patient, ), ), ), - doctorName: model.allSpecialLabList[index].doctorName, - invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', - profileUrl: model.allSpecialLabList[index].doctorImageURL, - branch: model.allSpecialLabList[index].projectName, - clinic: model.allSpecialLabList[index].clinicDescription, - appointmentDate: model.allSpecialLabList[index].orderDate, + doctorName: + model.allSpecialLabList[index].doctorName, + invoiceNO: + ' ${model.allSpecialLabList[index].invoiceNo}', + profileUrl: model + .allSpecialLabList[index].doctorImageURL, + branch: + model.allSpecialLabList[index].projectName, + clinic: model + .allSpecialLabList[index].clinicDescription, + appointmentDate: + model.allSpecialLabList[index].orderDate, orderNo: model.allSpecialLabList[index].orderNo, isShowTime: false, ), @@ -155,7 +183,8 @@ class _AllLabSpecialResultState extends State { ), ); }), - if (model.allSpecialLabList.isEmpty && patient.patientStatusType != 43) + if (model.allSpecialLabList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 801669cb..b3cb4ec0 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -50,7 +50,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 +71,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,7 +92,8 @@ class PrescriptionsPage extends StatelessWidget { ], ), ), - if ((patient.patientStatusType != null && patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { @@ -105,7 +108,8 @@ class PrescriptionsPage extends StatelessWidget { settingRoute: 'AddProcedureTabPage'), ); }, - label: TranslationBase.of(context).applyForNewPrescriptionsOrder, + label: TranslationBase.of(context) + .applyForNewPrescriptionsOrder, ), ...List.generate( model.prescriptionsList.length, @@ -114,7 +118,8 @@ class PrescriptionsPage extends StatelessWidget { context, FadePage( page: PrescriptionItemsPage( - prescriptions: model.prescriptionsList[index], + prescriptions: + model.prescriptionsList[index], patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -122,16 +127,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, @@ -142,7 +153,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), ) ], ), @@ -163,6 +175,7 @@ class PrescriptionsPage extends StatelessWidget { ListView.builder( scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), shrinkWrap: true, itemCount: model.medicationForInPatient.length, itemBuilder: (context, index) { @@ -171,31 +184,49 @@ class PrescriptionsPage extends StatelessWidget { onTap: () => Navigator.push( context, FadePage( - page: PrescriptionItemsInPatientPage( + page: + PrescriptionItemsInPatientPage( prescriptionIndex: index, - prescriptions: model.medicationForInPatient[index], + prescriptions: + model.medicationForInPatient[ + index], patient: patient, patientType: patientType, arrivalType: arrivalType, - startOn: AppDateUtils.getDateTimeFromServerFormat( - model.medicationForInPatient[index].startDatetime, + startOn: AppDateUtils + .getDateTimeFromServerFormat( + model + .medicationForInPatient[ + index] + .startDatetime, ), - stopOn: AppDateUtils.getDateTimeFromServerFormat( - model.medicationForInPatient[index].stopDatetime, + stopOn: AppDateUtils + .getDateTimeFromServerFormat( + model + .medicationForInPatient[ + index] + .stopDatetime, ), ), ), ), child: InPatientDoctorCard( - doctorName: model.medicationForInPatient[index].pHRItemDescription, + doctorName: model + .medicationForInPatient[index] + .pHRItemDescription, profileUrl: 'sss', branch: 'hamza', clinic: 'basheer', isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.medicationForInPatient[index].prescriptionDatetime, + appointmentDate: AppDateUtils + .getDateTimeFromServerFormat( + model.medicationForInPatient[index] + .prescriptionDatetime, ), - createdBy: model.medicationForInPatient[index].doctorName.toString(), + createdBy: model + .medicationForInPatient[index] + .doctorName + .toString(), )); }), if (model.medicationForInPatient.length == 0) @@ -209,7 +240,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), ) ], ), From 96cfc3d65910fdcd0355ac61a65caa37d4549256 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 3 Oct 2021 12:51:49 +0300 Subject: [PATCH 063/199] fix specialClinic it suppose to be fixed --- lib/screens/patients/In_patient/InPatientHeader.dart | 2 +- .../patients/In_patient/in_patient_screen.dart | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index 3bb2afa5..11cc4dcc 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -58,7 +58,7 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget { iconEnabledColor: Colors.black, isExpanded: true, value: selectedMapId == null - ? model.specialClinicalCareMappingList[0].nursingStationID + ? TranslationBase.of(context).all : selectedMapId, iconSize: 25, elevation: 16, diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index d7bd805a..9508a3cf 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -67,12 +67,12 @@ class _InPatientScreenState 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; - } + // if (widget.specialClinic != null) { + // await model + // .getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); + // requestModel.nursingStationID = + // model.specialClinicalCareMappingList[0].nursingStationID; + // } requestModel.clinicID = 0; await model.getInPatientList(requestModel); }, From bb8ffbf63b7bad808a6b0a15028cffe6dd5552e7 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 3 Oct 2021 13:10:50 +0300 Subject: [PATCH 064/199] refer inpatient hot fix --- .../refer-patient-screen-in-patient.dart | 213 +++++++++++------- 1 file changed, 137 insertions(+), 76 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 66fd22fd..41686ead 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,10 +25,12 @@ 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; @@ -66,7 +68,8 @@ class _PatientMakeInPatientReferralScreenState extends State 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; } @@ -123,8 +127,14 @@ class _PatientMakeInPatientReferralScreenState extends State 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; @@ -226,7 +245,9 @@ class _PatientMakeInPatientReferralScreenState extends State 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); } }); }, @@ -271,7 +297,9 @@ class _PatientMakeInPatientReferralScreenState extends State 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); } }); }, @@ -317,41 +353,49 @@ class _PatientMakeInPatientReferralScreenState extends State 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"); - } + 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"); + } + }, ), SizedBox( height: 10, @@ -379,8 +423,11 @@ class _PatientMakeInPatientReferralScreenState extends State {onVoiceText()}); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ), @@ -454,15 +504,14 @@ class _PatientMakeInPatientReferralScreenState extends State Date: Mon, 4 Oct 2021 11:23:56 +0300 Subject: [PATCH 065/199] fix special clinic issue --- .../patients/In_patient/InPatientHeader.dart | 130 +++++++++--------- .../In_patient/in_patient_screen.dart | 12 +- 2 files changed, 72 insertions(+), 70 deletions(-) diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index 11cc4dcc..f2d0f74e 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_Li 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:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { @@ -52,70 +53,71 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget { activeTab != 2) Container( width: MediaQuery.of(context).size.width * .3, - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedMapId == null - ? TranslationBase.of(context).all - : 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 { - onChangeFunc(newValue); - }, - items: model.specialClinicalCareMappingList.map((item) { - return DropdownMenuItem( - child: AppText( - item.description, - textAlign: TextAlign.left, - ), - value: item.nursingStationID, - ); - }).toList(), - )), + child + : DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedMapId??model.specialClinicalCareMappingList[0].nursingStationID, + 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(selectedMapId == null?TranslationBase.of(context).all:item.description, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + onChangeFunc(newValue); + }, + items: model.specialClinicalCareMappingList.map((item) { + return DropdownMenuItem( + child: AppText( + item.description, + textAlign: TextAlign.left, + ), + value: item.nursingStationID, + ); + }).toList(), + )), ), ]), ), diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 9508a3cf..ef9f8b03 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -67,12 +67,12 @@ class _InPatientScreenState 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; - // } + if (widget.specialClinic != null) { + await model + .getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); + // requestModel.nursingStationID = + // model.specialClinicalCareMappingList[0].nursingStationID; + } requestModel.clinicID = 0; await model.getInPatientList(requestModel); }, From efbe6ae76bc0c04dbb73b46fb793215fcf6251e7 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 20 Oct 2021 12:51:57 +0300 Subject: [PATCH 066/199] home page design fix --- lib/core/viewModel/dashboard_view_model.dart | 24 ++---- lib/screens/home/home_screen.dart | 89 ++++++++++++-------- 2 files changed, 59 insertions(+), 54 deletions(-) diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index afcec235..04e63dd9 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -37,7 +37,7 @@ class DashboardViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); final results = await Future.wait([ - projectsProvider.getDoctorClinicsList(), + projectsProvider.getDoctorClinicsList(), _dashboardService.getDashboard(), _dashboardService.checkDoctorHasLiveCare(), _specialClinicsService.getSpecialClinicalCareList(), @@ -45,7 +45,7 @@ class DashboardViewModel extends BaseViewModel { if (_dashboardService.hasError) { error = _dashboardService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -72,31 +72,21 @@ class DashboardViewModel extends BaseViewModel { Future getDashboard() async { setState(ViewState.Busy); await _dashboardService.getDashboard(); - if (_dashboardService.hasError) { - error = _dashboardService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); } Future checkDoctorHasLiveCare() async { setState(ViewState.Busy); await _dashboardService.checkDoctorHasLiveCare(); - if (_dashboardService.hasError) { - error = _dashboardService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); } Future getSpecialClinicalCareList() async { setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); - if (_specialClinicsService.hasError) { - error = _specialClinicsService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); + // if (_specialClinicsService.hasError) { + // error = _specialClinicsService.error; + // setState(ViewState.Error); + // } else + // setState(ViewState.Idle); } Future changeClinic( diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 93fe0a21..495a70b0 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -22,6 +22,7 @@ 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/errors/error_message.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'; @@ -66,7 +67,8 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { - model.startHomeScreenServices(projectsProvider, authenticationViewModel); + model.startHomeScreenServices( + projectsProvider, authenticationViewModel); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -211,37 +213,49 @@ class _HomeScreenState extends State { ])), 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(), + if (model.state != ViewState.ErrorLocal) + Column( + mainAxisSize: MainAxisSize.min, + 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(), + ], + ) + else + Container( + child: ErrorMessage( + error: model.error, + )), FractionallySizedBox( // widthFactor: 0.90, child: Container( @@ -299,6 +313,7 @@ class _HomeScreenState extends State { ), ) ]), + ]), ), ); @@ -397,11 +412,11 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => OutPatientsScreen( - patientSearchRequestModel: PatientSearchRequestModel( - from: date, - to: date, - doctorID: - authenticationViewModel.doctorProfile.doctorID),), + patientSearchRequestModel: PatientSearchRequestModel( + from: date, + to: date, + doctorID: authenticationViewModel.doctorProfile.doctorID), + ), settings: RouteSettings(name: 'OutPatientsScreen'), )); }, From 318560b1d7698cf48e80cde01a27b16dbec8a825 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Oct 2021 15:20:45 +0300 Subject: [PATCH 067/199] opertion report screen --- .../operation_report/operation_report.dart | 660 ++++++++++++++++++ .../update_operation_report.dart | 329 +++++++++ 2 files changed, 989 insertions(+) create mode 100644 lib/screens/patients/profile/operation_report/operation_report.dart create mode 100644 lib/screens/patients/profile/operation_report/update_operation_report.dart diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart new file mode 100644 index 00000000..23f9ed28 --- /dev/null +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -0,0 +1,660 @@ +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/service/AnalyticsService.dart'; +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/locator.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'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import '../../../../config/shared_pref_kay.dart'; +import '../../../../models/patient/patiant_info_model.dart'; +import '../../../../util/dr_app_shared_pref.dart'; +import '../../../../widgets/shared/app_scaffold_widget.dart'; +import '../../../../widgets/shared/app_texts_widget.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class OperationReportScreen extends StatefulWidget { + final int visitType; + + const OperationReportScreen({Key key, this.visitType}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + List notesList; + var filteredNotesList; + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + getProgressNoteList(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String token = await sharedPref.getString(TOKEN); + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + + print(type); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: int.parse(patient.admissionNo), + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + model + .getPatientProgressNote(progressNoteRequest.toJson(), + isLocalBusy: isLocalBusy) + .then((c) { + notesList = model.patientProgressNoteList; + }); + } + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String arrivalType = routeArgs['arrivalType']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => getProgressNoteList(context, model), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.patientProgressNoteList == null || + model.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Progress Note Screen", + eventAction: "Update Progress Note", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + ), + settings: RouteSettings(name: 'UpdateNoteOrder'), + ), + ); + }, + label: widget.visitType == 3 + ? TranslationBase.of(context).addNewOrderSheet + : TranslationBase.of(context).addProgressNote, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authenticationViewModel + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index] + .status == + 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index] + .status == + 2 + ? Colors.green[600] + : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authenticationViewModel + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( + TranslationBase.of(context) + .notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 4) + AppText( + TranslationBase.of(context) + .noteCanceled, + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 2) + AppText( + TranslationBase.of(context) + .noteVerified, + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model + .patientProgressNoteList[ + index] + .status != + 4 && + authenticationViewModel + .doctorProfile.doctorID == + model + .patientProgressNoteList[ + index] + .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: model + .patientProgressNoteList[ + index], + patientModel: + model, + patient: + patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of( + context) + .update, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: + false, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: true, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons + .check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of( + context) + .noteVerify, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: + TranslationBase.of( + context) + .cancel, + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context, + ); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: true, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: false, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons + .trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ) + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .doctorName ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientProgressNoteList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientProgressNoteList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .notes, + fontSize: 10, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } + + showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showDialog( + context: context, + builder: (ctx) => Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 200, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // SizedBox(height: 20,), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), + ], + ), + SizedBox( + height: 10, + ), + DividerWithSpacesAround(), + SizedBox( + height: 12, + ), + + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: AppText( + projectViewModel.isArabic + ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" + : 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), + + SizedBox( + height: 8, + ), + DividerWithSpacesAround(), + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + TranslationBase.of(context).cancel, + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), //Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + TranslationBase.of(context).noteConfirm, + fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16, + ), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) + ], + ), + ) + ], + ), + ), + ), + ), + ), + )); + } +} diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart new file mode 100644 index 00000000..768aaabf --- /dev/null +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -0,0 +1,329 @@ +import 'package:doctor_app_flutter/config/config.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/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/provider/robot_provider.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/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/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/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +class UpdateOperatiomReport extends StatefulWidget { + final NoteModel note; + final PatientViewModel patientModel; + final PatiantInformtion patient; + final int visitType; + final bool isUpdate; + + const UpdateOperatiomReport( + {Key key, + this.note, + this.patientModel, + this.patient, + this.visitType, + this.isUpdate}) + : super(key: key); + + @override + _UpdateOperatiomReportState createState() => _UpdateOperatiomReportState(); +} + +class _UpdateOperatiomReportState extends State { + int selectedType; + bool isSubmitted = false; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + ProjectViewModel projectViewModel; + + TextEditingController progressNoteController = TextEditingController(); + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + void initState() { + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + + if (widget.note != null) { + progressNoteController.text = widget.note.notes; + } + + return AppScaffold( + 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( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( + title: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Stack( + children: [ + AppTextFieldCustom( + hintText: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).progressNote, + //TranslationBase.of(context).addProgressNote, + controller: progressNoteController, + maxLines: 35, + minLines: 25, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + progressNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + Positioned( + top: + -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ], + )) + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + height: progressNoteController.text.isNotEmpty ? 130 : 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + if (progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + ), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, + color: Color(0xff359846), + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.trim().isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); + + if (widget.isUpdate) { + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(widget.patient.admissionNo), + cancelledNote: false, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, + notes: progressNoteController.text, + verifiedNote: false, + patientTypeID: widget.patient.patientType, + patientOutSA: false, + ); + await widget.patientModel + .updatePatientProgressNote(reqModel); + } else { + CreateNoteModel reqModel = CreateNoteModel( + admissionNo: + int.parse(widget.patient.admissionNo), + createdBy: doctorProfile.doctorID, + visitType: widget.visitType, + patientID: widget.patient.patientId, + nursingRemarks: ' ', + patientTypeID: widget.patient.patientType, + patientOutSA: false, + notes: progressNoteController.text); + + await widget.patientModel + .createPatientProgressNote(reqModel); + } + + if (widget.patientModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientModel.error); + } else { + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); + } + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } else { + Helpers.showErrorToast("You cant add only spaces"); + } + })), + ], + ), + ), + ); + } + + 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); + if (available) { + speech.listen( + onResult: resultListener, + listenMode: stt.ListenMode.confirmation, + localeId: lang == 'en' ? 'en-US' : 'ar-SA', + ); + } else { + print("The user has denied the use of speech recognition."); + } + } + + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + //SpeechToText.closeAlertDialog(context); + print(error); + } + + void statusListener(String status) { + reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + } + + void requestPermissions() async { + Map statuses = await [ + Permission.microphone, + ].request(); + } + + void resultListener(result) { + reconizedWord = result.recognizedWords; + event.setValue({"searchText": reconizedWord}); + + if (result.finalResult == true) { + setState(() { + SpeechToText.closeAlertDialog(context); + speech.stop(); + progressNoteController.text += reconizedWord + '\n'; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } +} From d4363aeefbd42ebedac8a7fc623c79bea7843287 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Oct 2021 15:35:53 +0300 Subject: [PATCH 068/199] opertion report screen --- lib/config/config.dart | 321 ++++++++++++------ .../service/operation_report_servive.dart | 6 + .../operation_report_view_model.dart | 3 + .../get_operation_report_model.dart | 152 +++++++++ .../get_operation_report_request_model.dart | 64 ++++ 5 files changed, 438 insertions(+), 108 deletions(-) create mode 100644 lib/core/service/operation_report_servive.dart create mode 100644 lib/core/viewModel/operation_report_view_model.dart create mode 100644 lib/models/operation_report/get_operation_report_model.dart create mode 100644 lib/models/operation_report/get_operation_report_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index b8e34330..98a8abd8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -9,85 +9,118 @@ 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"; -const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_ORDERS_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PATIENT_PROGRESS_NOTE_URL = + "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = + "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_ORDERS_URL = + "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_REFER_TO_DOCTOR_URL = + "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = + "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = + "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = + 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = + "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = + "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = + 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = + 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = + 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = + 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; -const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = + 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = + 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = + 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = + 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = + 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; +const GET_MY_REFERRED_OUT_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; -const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = + 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = + 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = + 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = + 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = + 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = + 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; @@ -95,153 +128,225 @@ 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'; -const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = + 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = + 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = + 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const UPDATE_RESCHDEULE = + 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = + 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/GetPrescription'; + +const POST_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_PATIENT_ARRIVAL_LIST = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; -const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = + 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = + 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_Patient_LAB_SPECIAL_RESULT = + 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = + 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; -const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const GET_MASTER_LOOKUP_LIST = + 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; -const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; +const POST_EPISODE_FOR_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = + '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = + 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const GET_ORDER_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; +const GET_LIST_CATEGORISE = + 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = + 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = + 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = + 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = + 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = + 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = + 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = + 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = + 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = + "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUT_PATIENT = "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"; +const GET_MY_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = + "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = + 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = + "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = + "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; -const GET_PRESCRIPTION_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const GET_INSURANCE_IN_PATIENT = + "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = + "Services/DoctorApplication.svc/REST/GetMyOutPatient"; -const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_LIST = + "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = + "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = + "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = + "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; -const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; +const GET_PROCEDURE_TEMPLETE = + 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; -const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; +const GET_PROCEDURE_TEMPLETE_DETAILS = + "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; -const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +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"; -const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; -const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; - -const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; - -const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; -const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; +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"; + +const INSERT_MEDICAL_REPORT = + "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; + +const UPDATE_MEDICAL_REPORT = + "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; +const GET_SICK_LEAVE_DOCTOR_APP = + "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor"; const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue"; -const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; -const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; -const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; -const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; -const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; +const CREATE_DOCTOR_RESPONSE = + "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; +const GET_DOCTOR_NOT_REPLIED_COUNTS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; +const ALL_SPECIAL_LAB_RESULT = + "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; +const GET_MEDICATION_FOR_IN_PATIENT = + "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; +const GET_EPISODE_FOR_INPATIENT = + "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; +const GET_OPERATION_REPORT = + "/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; var selectedPatientType = 1; diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart new file mode 100644 index 00000000..ea61c0fa --- /dev/null +++ b/lib/core/service/operation_report_servive.dart @@ -0,0 +1,6 @@ +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; + +class OperationReportService extends BaseService { + List get operationReportList => List(); +} diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/operation_report_view_model.dart new file mode 100644 index 00000000..a2ab680c --- /dev/null +++ b/lib/core/viewModel/operation_report_view_model.dart @@ -0,0 +1,3 @@ +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +class OperationReportViewModel extends BaseViewModel {} diff --git a/lib/models/operation_report/get_operation_report_model.dart b/lib/models/operation_report/get_operation_report_model.dart new file mode 100644 index 00000000..4a84620c --- /dev/null +++ b/lib/models/operation_report/get_operation_report_model.dart @@ -0,0 +1,152 @@ +class GetOperationReportModel { + String setupID; + int projectID; + int oTReservationID; + String oTReservationDate; + String oTReservationDateN; + int oTID; + int admissionRequestNo; + int admissionNo; + int primaryDoctorID; + int patientType; + int patientID; + int patientStatusType; + int clinicID; + int doctorID; + String operationDate; + int operationType; + String endDate; + String timeStart; + String timeEnd; + Null remarks; + int status; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String patientName; + Null patientNameN; + Null gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String doctorName; + Null doctorNameN; + String clinicDescription; + Null clinicDescriptionN; + + GetOperationReportModel( + {this.setupID, + this.projectID, + this.oTReservationID, + this.oTReservationDate, + this.oTReservationDateN, + this.oTID, + this.admissionRequestNo, + this.admissionNo, + this.primaryDoctorID, + this.patientType, + this.patientID, + this.patientStatusType, + this.clinicID, + this.doctorID, + this.operationDate, + this.operationType, + this.endDate, + this.timeStart, + this.timeEnd, + this.remarks, + this.status, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.patientName, + this.patientNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.doctorName, + this.doctorNameN, + this.clinicDescription, + this.clinicDescriptionN}); + + GetOperationReportModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + oTReservationID = json['OTReservationID']; + oTReservationDate = json['OTReservationDate']; + oTReservationDateN = json['OTReservationDateN']; + oTID = json['OTID']; + admissionRequestNo = json['AdmissionRequestNo']; + admissionNo = json['AdmissionNo']; + primaryDoctorID = json['PrimaryDoctorID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + patientStatusType = json['PatientStatusType']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + operationDate = json['OperationDate']; + operationType = json['OperationType']; + endDate = json['EndDate']; + timeStart = json['TimeStart']; + timeEnd = json['TimeEnd']; + remarks = json['Remarks']; + status = json['Status']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + patientName = json['PatientName']; + patientNameN = json['PatientNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['OTReservationID'] = this.oTReservationID; + data['OTReservationDate'] = this.oTReservationDate; + data['OTReservationDateN'] = this.oTReservationDateN; + data['OTID'] = this.oTID; + data['AdmissionRequestNo'] = this.admissionRequestNo; + data['AdmissionNo'] = this.admissionNo; + data['PrimaryDoctorID'] = this.primaryDoctorID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['PatientStatusType'] = this.patientStatusType; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['OperationDate'] = this.operationDate; + data['OperationType'] = this.operationType; + data['EndDate'] = this.endDate; + data['TimeStart'] = this.timeStart; + data['TimeEnd'] = this.timeEnd; + data['Remarks'] = this.remarks; + data['Status'] = this.status; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['PatientName'] = this.patientName; + data['PatientNameN'] = this.patientNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + return data; + } +} diff --git a/lib/models/operation_report/get_operation_report_request_model.dart b/lib/models/operation_report/get_operation_report_request_model.dart new file mode 100644 index 00000000..6fc969ee --- /dev/null +++ b/lib/models/operation_report/get_operation_report_request_model.dart @@ -0,0 +1,64 @@ +class GetOperationReportRequestModel { + int patientID; + int projectID; + String doctorID; + int clinicID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + bool patientOutSA; + int deviceTypeID; + String tokenID; + String sessionID; + + GetOperationReportRequestModel( + {this.patientID, + this.projectID, + this.doctorID, + this.clinicID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.deviceTypeID, + this.tokenID, + this.sessionID}); + + GetOperationReportRequestModel.fromJson(Map json) { + patientID = json['PatientID']; + projectID = json['ProjectID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + return data; + } +} From 7684b65e8a0526a3fb88c45370bad700e353a414 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 21 Oct 2021 16:08:28 +0300 Subject: [PATCH 069/199] first step from update_operation_report.dart --- lib/config/config.dart | 6 +- .../service/operation_report_servive.dart | 12 ++ .../operation_report_view_model.dart | 21 ++- ...update_operation_report_request_model.dart | 108 +++++++++++++ .../update_operation_report.dart | 149 +++++++----------- 5 files changed, 201 insertions(+), 95 deletions(-) create mode 100644 lib/models/operation_report/create_update_operation_report_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 98a8abd8..a8ff066a 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 = @@ -347,6 +347,8 @@ const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; const GET_OPERATION_REPORT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const UPDATE_OPERATION_REPORT = + "/Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; var selectedPatientType = 1; diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index ea61c0fa..24d006ce 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -1,6 +1,18 @@ +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/operation_report/create_update_operation_report_request_model.dart'; import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; class OperationReportService extends BaseService { List get operationReportList => List(); + + Future updateOperationReport(CreateUpdateOperationReportRequestModel createUpdateOperationReport) async { + await baseAppClient.post(UPDATE_OPERATION_REPORT, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: createUpdateOperationReport.toJson(),isFallLanguage: true); + } } diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/operation_report_view_model.dart index a2ab680c..edc6ba3e 100644 --- a/lib/core/viewModel/operation_report_view_model.dart +++ b/lib/core/viewModel/operation_report_view_model.dart @@ -1,3 +1,22 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/operation_report_servive.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -class OperationReportViewModel extends BaseViewModel {} +import '../../locator.dart'; + +class OperationReportViewModel extends BaseViewModel { + OperationReportService _operationReportService = + locator(); + + Future updateOperationReport( + CreateUpdateOperationReportRequestModel + createUpdateOperationReport) async { + setState(ViewState.BusyLocal); + if (_operationReportService.hasError) { + error = _operationReportService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/models/operation_report/create_update_operation_report_request_model.dart b/lib/models/operation_report/create_update_operation_report_request_model.dart new file mode 100644 index 00000000..f6d72b1b --- /dev/null +++ b/lib/models/operation_report/create_update_operation_report_request_model.dart @@ -0,0 +1,108 @@ +class CreateUpdateOperationReportRequestModel { + String setupID; + int patientID; + int reservationNo; + int admissionNo; + String preOpDiagmosis; + String postOpDiagmosis; + String surgeon; + String assistant; + String anasthetist; + String operation; + String inasion; + String finding; + String surgeryProcedure; + String postOpInstruction; + int createdBy; + int editedBy; + String complicationDetails; + String bloodLossDetail; + String histopathSpecimen; + String microbiologySpecimen; + String otherSpecimen; + String scrubNurse; + String circulatingNurse; + String bloodTransfusedDetail; + + CreateUpdateOperationReportRequestModel( + {this.setupID, + this.patientID, + this.reservationNo, + this.admissionNo, + this.preOpDiagmosis, + this.postOpDiagmosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.createdBy, + this.editedBy, + this.complicationDetails, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); + + CreateUpdateOperationReportRequestModel.fromJson(Map json) { + setupID = json['SetupID']; + patientID = json['PatientID']; + reservationNo = json['reservationNo']; + admissionNo = json['AdmissionNo']; + preOpDiagmosis = json['preOpDiagmosis']; + postOpDiagmosis = json['postOpDiagmosis']; + surgeon = json['surgeon']; + assistant = json['assistant']; + anasthetist = json['anasthetist']; + operation = json['operation']; + inasion = json['inasion']; + finding = json['finding']; + surgeryProcedure = json['surgeryProcedure']; + postOpInstruction = json['postOpInstruction']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + complicationDetails = json['complicationDetails']; + bloodLossDetail = json['bloodLossDetail']; + histopathSpecimen = json['histopathSpecimen']; + microbiologySpecimen = json['microbiologySpecimen']; + otherSpecimen = json['otherSpecimen']; + scrubNurse = json['scrubNurse']; + circulatingNurse = json['circulatingNurse']; + bloodTransfusedDetail = json['BloodTransfusedDetail']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['PatientID'] = this.patientID; + data['reservationNo'] = this.reservationNo; + data['AdmissionNo'] = this.admissionNo; + data['preOpDiagmosis'] = this.preOpDiagmosis; + data['postOpDiagmosis'] = this.postOpDiagmosis; + data['surgeon'] = this.surgeon; + data['assistant'] = this.assistant; + data['anasthetist'] = this.anasthetist; + data['operation'] = this.operation; + data['inasion'] = this.inasion; + data['finding'] = this.finding; + data['surgeryProcedure'] = this.surgeryProcedure; + data['postOpInstruction'] = this.postOpInstruction; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['complicationDetails'] = this.complicationDetails; + data['bloodLossDetail'] = this.bloodLossDetail; + data['histopathSpecimen'] = this.histopathSpecimen; + data['microbiologySpecimen'] = this.microbiologySpecimen; + data['otherSpecimen'] = this.otherSpecimen; + data['scrubNurse'] = this.scrubNurse; + data['circulatingNurse'] = this.circulatingNurse; + data['BloodTransfusedDetail'] = this.bloodTransfusedDetail; + return data; + } +} diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 768aaabf..d364291e 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -6,10 +6,12 @@ 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/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/operation_report_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/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -27,27 +29,27 @@ import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; -class UpdateOperatiomReport extends StatefulWidget { +class UpdateOperationReport extends StatefulWidget { final NoteModel note; - final PatientViewModel patientModel; + final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; - const UpdateOperatiomReport( + const UpdateOperationReport( {Key key, this.note, - this.patientModel, + this.operationReportViewModel, this.patient, this.visitType, this.isUpdate}) : super(key: key); @override - _UpdateOperatiomReportState createState() => _UpdateOperatiomReportState(); + _UpdateOperationReportState createState() => _UpdateOperationReportState(); } -class _UpdateOperatiomReportState extends State { +class _UpdateOperationReportState extends State { int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); @@ -55,7 +57,25 @@ class _UpdateOperatiomReportState extends State { var event = RobotProvider(); ProjectViewModel projectViewModel; - TextEditingController progressNoteController = TextEditingController(); + TextEditingController preOpDiagmosisController = TextEditingController(); + TextEditingController postOpDiagmosisNoteController = TextEditingController(); + TextEditingController surgeonController = TextEditingController(); + TextEditingController assistantNoteController = TextEditingController(); + TextEditingController operationController = TextEditingController(); + TextEditingController inasionController = TextEditingController(); + TextEditingController findingController = TextEditingController(); + TextEditingController surgeryProcedureController = TextEditingController(); + TextEditingController postOpInstructionController = TextEditingController(); + TextEditingController complicationDetailsController = TextEditingController(); + TextEditingController bloodLossDetailController = TextEditingController(); + TextEditingController histopathSpecimenController = TextEditingController(); + TextEditingController microbiologySpecimenController = + TextEditingController(); + TextEditingController otherSpecimenController = TextEditingController(); + TextEditingController scrubNurseController = TextEditingController(); + TextEditingController circulatingNurseController = TextEditingController(); + TextEditingController BloodTransfusedDetailController = + TextEditingController(); setSelectedType(int val) { setState(() { @@ -81,7 +101,7 @@ class _UpdateOperatiomReportState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note.notes; + preOpDiagmosisController.text = widget.note.notes; } return AppScaffold( @@ -96,15 +116,10 @@ class _UpdateOperatiomReportState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle( - title: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + title: (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -131,14 +146,14 @@ class _UpdateOperatiomReportState extends State { .noteAdd) + TranslationBase.of(context).progressNote, //TranslationBase.of(context).addProgressNote, - controller: progressNoteController, + controller: preOpDiagmosisController, maxLines: 35, minLines: 25, hasBorder: true, // isTextFieldHasSuffix: true, validationError: - progressNoteController.text.isEmpty && + preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, @@ -173,34 +188,17 @@ class _UpdateOperatiomReportState extends State { ), ), bottomSheet: Container( - height: progressNoteController.text.isNotEmpty ? 130 : 70, + height: preOpDiagmosisController.text.isNotEmpty ? 130 : 70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ - if (progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), Container( margin: EdgeInsets.all(5), child: AppButton( - title: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + title: (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -208,64 +206,31 @@ class _UpdateOperatiomReportState extends State { setState(() { isSubmitted = true; }); - if (progressNoteController.text.trim().isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - if (widget.isUpdate) { - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), - cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, - notes: progressNoteController.text, - verifiedNote: false, - patientTypeID: widget.patient.patientType, - patientOutSA: false, - ); - await widget.patientModel - .updatePatientProgressNote(reqModel); - } else { - CreateNoteModel reqModel = CreateNoteModel( - admissionNo: - int.parse(widget.patient.admissionNo), - createdBy: doctorProfile.doctorID, - visitType: widget.visitType, - patientID: widget.patient.patientId, - nursingRemarks: ' ', - patientTypeID: widget.patient.patientType, - patientOutSA: false, - notes: progressNoteController.text); - - await widget.patientModel - .createPatientProgressNote(reqModel); + CreateUpdateOperationReportRequestModel + createUpdateOperationReportRequestModel = + CreateUpdateOperationReportRequestModel(); + await widget.operationReportViewModel + .updateOperationReport(createUpdateOperationReportRequestModel); } - if (widget.patientModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientModel.error); + if (widget.operationReportViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.operationReportViewModel.error); } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: - int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, - patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel.getPatientProgressNote( - progressNoteRequest.toJson()); + // await widget.operationReportViewModel.( + // progressNoteRequest.toJson()); + + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); } GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } else { - Helpers.showErrorToast("You cant add only spaces"); - } + + })), ], ), @@ -313,7 +278,7 @@ class _UpdateOperatiomReportState extends State { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - progressNoteController.text += reconizedWord + '\n'; + preOpDiagmosisController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); From d035f1ba37e8cc531809f3e21d0354f895a37d11 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Oct 2021 16:17:59 +0300 Subject: [PATCH 070/199] opertion report screen --- lib/config/config.dart | 4 +- .../service/operation_report_servive.dart | 22 + .../operation_report_view_model.dart | 23 +- lib/locator.dart | 4 + lib/routes.dart | 6 +- .../operation_report/operation_report.dart | 420 +++++++++--------- .../update_operation_report.dart | 15 +- .../profile_gird_for_InPatient.dart | 91 +++- 8 files changed, 339 insertions(+), 246 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 98a8abd8..f17693e0 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 = diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index ea61c0fa..5094fbb1 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -1,6 +1,28 @@ +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/operation_report/get_operation_report_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; class OperationReportService extends BaseService { List get operationReportList => List(); + + Future getOperationReport( + {GetOperationReportRequestModel getOperationReportRequestModel, + int patientId}) async { + getOperationReportRequestModel = + GetOperationReportRequestModel(patientID: patientId); + + hasError = false; + await baseAppClient.post(GET_OPERATION_REPORT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + operationReportList.clear(); + response['List_OTReservationDetails'].forEach((v) { + operationReportList.add(GetOperationReportModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getOperationReportRequestModel.toJson()); + } } diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/operation_report_view_model.dart index a2ab680c..673d6522 100644 --- a/lib/core/viewModel/operation_report_view_model.dart +++ b/lib/core/viewModel/operation_report_view_model.dart @@ -1,3 +1,24 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/operation_report_servive.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; -class OperationReportViewModel extends BaseViewModel {} +class OperationReportViewModel extends BaseViewModel { + bool hasError = false; + OperationReportService _operationReportService = + locator(); + + get operationReportList => _operationReportService.operationReportList; + + Future getOperationReport(int patientId) async { + hasError = false; + setState(ViewState.Busy); + await _operationReportService.getOperationReport(patientId: patientId); + if (_operationReportService.hasError) { + error = _operationReportService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 3ee2650c..b5f651eb 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,8 +1,10 @@ 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/service/operation_report_servive.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/operation_report_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'; @@ -100,6 +102,7 @@ void setupLocator() { locator.registerLazySingleton(() => SpecialClinicsService()); locator.registerLazySingleton(() => VideoCallService()); locator.registerLazySingleton(() => AnalyticsService()); + locator.registerLazySingleton(() => OperationReportService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -128,4 +131,5 @@ void setupLocator() { locator.registerFactory(() => LiveCarePatientViewModel()); locator.registerFactory(() => PatientMedicalReportViewModel()); locator.registerFactory(() => ScanQrViewModel()); + locator.registerFactory(() => OperationReportViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index 47fccec3..9c8f35f8 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVe import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportDetailPage.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportPage.dart'; import 'package:doctor_app_flutter/screens/patients/profile/note/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/operation_report/operation_report.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart'; @@ -47,7 +48,8 @@ const String ORDER_NOTE = 'patients/order-note'; const String MY_REFERRAL_DETAIL = 'my_referral_detail'; const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor'; const String REFER_IN_PATIENT_TO_DOCTOR = 'patients/refer-in-patient-to-doctor'; -const String PATIENT_INSURANCE_APPROVALS_NEW = 'patients/patient_insurance_approvals_new'; +const String PATIENT_INSURANCE_APPROVALS_NEW = + 'patients/patient_insurance_approvals_new'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String CREATE_EPISODE = 'patients/create-episode'; const String UPDATE_EPISODE = 'patients/update-episode'; @@ -66,6 +68,7 @@ const String ORDER_PROCEDURE = 'procedure/procedure'; const String ADD_SICKLEAVE = 'add-sickleave'; const String RADIOLOGY_PATIENT = 'radiology-patient'; const String ALL_SPECIAL_LAB_RESULT = 'all-special_lab'; +const String GET_OPERATION_REPORT = 'operation-report'; //todo: change the routing way. var routes = { @@ -109,4 +112,5 @@ var routes = { // PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), PATIENT_ECG: (_) => ECGPage(), ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), + GET_OPERATION_REPORT: (_) => OperationReportScreen(), }; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 23f9ed28..427c6f7e 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -2,6 +2,7 @@ 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/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/operation_report_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'; @@ -9,6 +10,7 @@ import 'package:doctor_app_flutter/locator.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/screens/patients/profile/operation_report/update_operation_report.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'; @@ -78,8 +80,8 @@ class _ProgressNoteState extends State { String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; - return BaseView( - onModelReady: (model) => getProgressNoteList(context, model), + return BaseView( + onModelReady: (model) => model.getOperationReport(patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -88,8 +90,8 @@ class _ProgressNoteState extends State { patient, isInpatient: true, ), - body: model.patientProgressNoteList == null || - model.patientProgressNoteList.length == 0 + body: model.operationReportList == null || + model.operationReportList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).errorNoProgressNote) : Container( @@ -100,13 +102,13 @@ class _ProgressNoteState extends State { AddNewOrder( onTap: () async { await locator().logEvent( - eventCategory: "Progress Note Screen", - eventAction: "Update Progress Note", + eventCategory: "Operation Report Screen", + eventAction: "Update Operation Report ", ); Navigator.push( context, MaterialPageRoute( - builder: (context) => UpdateNoteOrder( + builder: (context) => UpdateOperatiomReport( patientModel: model, patient: patient, visitType: widget.visitType, @@ -123,27 +125,25 @@ class _ProgressNoteState extends State { Expanded( child: Container( child: ListView.builder( - itemCount: model.patientProgressNoteList.length, + itemCount: model.operationReportList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, - bgColor: model.patientProgressNoteList[index] + bgColor: model.operationReportList[index] .status == 1 && authenticationViewModel .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] + model.operationReportList[index] .createdBy ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index] + : model.operationReportList[index] .status == 4 ? Colors.red.shade700 - : model.patientProgressNoteList[index] + : model.operationReportList[index] .status == 2 ? Colors.green[600] @@ -154,15 +154,13 @@ class _ProgressNoteState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (model - .patientProgressNoteList[ - index] + if (model.operationReportList[index] .status == 1 && authenticationViewModel .doctorProfile.doctorID != model - .patientProgressNoteList[ + .operationReportList[ index] .createdBy) AppText( @@ -172,9 +170,7 @@ class _ProgressNoteState extends State { color: Color(0xFFCC9B14), fontSize: 12, ), - if (model - .patientProgressNoteList[ - index] + if (model.operationReportList[index] .status == 4) AppText( @@ -184,9 +180,7 @@ class _ProgressNoteState extends State { color: Colors.red.shade700, fontSize: 12, ), - if (model - .patientProgressNoteList[ - index] + if (model.operationReportList[index] .status == 2) AppText( @@ -196,16 +190,16 @@ class _ProgressNoteState extends State { color: Colors.green[600], fontSize: 12, ), - if (model.patientProgressNoteList[index].status != 2 && - model - .patientProgressNoteList[ - index] + if (model.operationReportList[index] + .status != + 2 && + model.operationReportList[index] .status != 4 && authenticationViewModel .doctorProfile.doctorID == model - .patientProgressNoteList[ + .operationReportList[ index] .createdBy) Row( @@ -213,25 +207,25 @@ class _ProgressNoteState extends State { CrossAxisAlignment.start, children: [ InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model - .patientProgressNoteList[ - index], - patientModel: - model, - patient: - patient, - visitType: widget - .visitType, - isUpdate: true, - )), - ); - }, + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // UpdateNoteOrder( + // note: model + // .operationReportList[ + // index], + // patientModel: + // model, + // patient: + // patient, + // visitType: widget + // .visitType, + // isUpdate: true, + // )), + // ); + // }, child: Container( decoration: BoxDecoration( color: Colors.grey[600], @@ -266,168 +260,168 @@ class _ProgressNoteState extends State { SizedBox( width: 10, ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "verify", - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: - false, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: true, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .noteVerify, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), - ), - ), + // InkWell( + // onTap: () async { + // showMyDialog( + // context: context, + // actionName: "verify", + // confirmFun: () async { + // GifLoaderDialogUtils + // .showMyDialog( + // context); + // UpdateNoteReqModel + // reqModel = + // UpdateNoteReqModel( + // admissionNo: int + // .parse(patient + // .admissionNo), + // cancelledNote: + // false, + // lineItemNo: model + // .patientProgressNoteList[ + // index] + // .lineItemNo, + // createdBy: model + // .patientProgressNoteList[ + // index] + // .createdBy, + // notes: model + // .patientProgressNoteList[ + // index] + // .notes, + // verifiedNote: true, + // patientTypeID: + // patient + // .patientType, + // patientOutSA: false, + // ); + // await model + // .updatePatientProgressNote( + // reqModel); + // await getProgressNoteList( + // context, model, + // isLocalBusy: + // true); + // GifLoaderDialogUtils + // .hideDialog( + // context); + // }); + // }, + // child: Container( + // decoration: BoxDecoration( + // color: Colors.green[600], + // borderRadius: + // BorderRadius.circular( + // 10), + // ), + // // color:Colors.red[600], + // + // child: Row( + // children: [ + // Icon( + // FontAwesomeIcons + // .check, + // size: 12, + // color: Colors.white, + // ), + // SizedBox( + // width: 2, + // ), + // AppText( + // TranslationBase.of( + // context) + // .noteVerify, + // fontSize: 10, + // color: Colors.white, + // ), + // ], + // ), + // padding: EdgeInsets.all(6), + // ), + // ), SizedBox( width: 10, ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: - TranslationBase.of( - context) - .cancel, - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context, - ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: true, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: false, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), - ), - ), + // InkWell( + // onTap: () async { + // showMyDialog( + // context: context, + // actionName: + // TranslationBase.of( + // context) + // .cancel, + // confirmFun: () async { + // GifLoaderDialogUtils + // .showMyDialog( + // context, + // ); + // UpdateNoteReqModel + // reqModel = + // UpdateNoteReqModel( + // admissionNo: int + // .parse(patient + // .admissionNo), + // cancelledNote: true, + // lineItemNo: model + // .patientProgressNoteList[ + // index] + // .lineItemNo, + // createdBy: model + // .patientProgressNoteList[ + // index] + // .createdBy, + // notes: model + // .patientProgressNoteList[ + // index] + // .notes, + // verifiedNote: false, + // patientTypeID: + // patient + // .patientType, + // patientOutSA: false, + // ); + // await model + // .updatePatientProgressNote( + // reqModel); + // await getProgressNoteList( + // context, model, + // isLocalBusy: + // true); + // GifLoaderDialogUtils + // .hideDialog( + // context); + // }); + // }, + // child: Container( + // decoration: BoxDecoration( + // color: Colors.red[600], + // borderRadius: + // BorderRadius.circular( + // 10), + // ), + // // color:Colors.red[600], + // + // child: Row( + // children: [ + // Icon( + // FontAwesomeIcons + // .trash, + // size: 12, + // color: Colors.white, + // ), + // SizedBox( + // width: 2, + // ), + // AppText( + // 'Cancel', + // fontSize: 10, + // color: Colors.white, + // ), + // ], + // ), + // padding: EdgeInsets.all(6), + // ), + // ), SizedBox( width: 10, ) @@ -465,7 +459,7 @@ class _ProgressNoteState extends State { Expanded( child: AppText( model - .patientProgressNoteList[ + .operationReportList[ index] .doctorName ?? '', @@ -483,14 +477,14 @@ class _ProgressNoteState extends State { children: [ AppText( model - .patientProgressNoteList[ + .operationReportList[ index] .createdOn != null ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils .getDateTimeFromServerFormat(model - .patientProgressNoteList[ + .operationReportList[ index] .createdOn), isArabic: @@ -508,14 +502,14 @@ class _ProgressNoteState extends State { ), AppText( model - .patientProgressNoteList[ + .operationReportList[ index] .createdOn != null ? AppDateUtils.getHour( AppDateUtils .getDateTimeFromServerFormat(model - .patientProgressNoteList[ + .operationReportList[ index] .createdOn)) : AppDateUtils.getHour( @@ -539,7 +533,7 @@ class _ProgressNoteState extends State { Expanded( child: AppText( model - .patientProgressNoteList[ + .operationReportList[ index] .notes, fontSize: 10, diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 768aaabf..8b46ffce 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -6,6 +6,7 @@ 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/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/operation_report_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'; @@ -29,7 +30,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateOperatiomReport extends StatefulWidget { final NoteModel note; - final PatientViewModel patientModel; + final OperationReportViewModel patientModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; @@ -226,8 +227,8 @@ class _UpdateOperatiomReportState extends State { patientTypeID: widget.patient.patientType, patientOutSA: false, ); - await widget.patientModel - .updatePatientProgressNote(reqModel); + // await widget.patientModel + // .updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( admissionNo: @@ -240,8 +241,8 @@ class _UpdateOperatiomReportState extends State { patientOutSA: false, notes: progressNoteController.text); - await widget.patientModel - .createPatientProgressNote(reqModel); + // await widget.patientModel + // .createPatientProgressNote(reqModel); } if (widget.patientModel.state == ViewState.ErrorLocal) { @@ -256,8 +257,8 @@ class _UpdateOperatiomReportState extends State { projectID: widget.patient.projectId, patientTypeID: widget.patient.patientType, languageID: 2); - await widget.patientModel.getPatientProgressNote( - progressNoteRequest.toJson()); + // await widget.patientModel.getPatientProgressNote( + // progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); DrAppToastMsg.showSuccesToast( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 5ac21f91..4c4fe12e 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -35,36 +35,69 @@ class ProfileGridForInPatient extends StatelessWidget { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, - ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).special, + ALL_SPECIAL_LAB_RESULT, + 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).result, - RADIOLOGY_PATIENT, 'patient/health_summary.png', + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).result, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).progress, TranslationBase.of(context).note, PROGRESS_NOTE, + PatientProfileCardModel( + TranslationBase.of(context).progress, + TranslationBase.of(context).note, + PROGRESS_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).order, TranslationBase.of(context).sheet, ORDER_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).order, + TranslationBase.of(context).sheet, + ORDER_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, - ORDER_PROCEDURE, 'patient/Order_Procedures.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).medical, TranslationBase.of(context).report, - PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', - isInPatient: isInpatient, isDisable: false), + PatientProfileCardModel( + TranslationBase.of(context).medical, + TranslationBase.of(context).report, + PATIENT_MEDICAL_REPORT, + 'patient/health_summary.png', + isInPatient: isInpatient, + isDisable: false), PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, @@ -73,12 +106,19 @@ class ProfileGridForInPatient extends StatelessWidget { isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), - PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).approvals, - PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).approvals, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).discharge, TranslationBase.of(context).report, null, + PatientProfileCardModel( + TranslationBase.of(context).discharge, + TranslationBase.of(context).report, + null, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, isDisable: true), + isInPatient: isInpatient, + isDisable: true), PatientProfileCardModel( TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, @@ -86,6 +126,13 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), + PatientProfileCardModel( + "Operation", + "Report", + GET_OPERATION_REPORT, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), ]; return Padding( From fbf1cd29ee5fd5ea4fd5e67134e584bff5435c79 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 21 Oct 2021 16:21:47 +0300 Subject: [PATCH 071/199] add some fiels --- .../update_operation_report.dart | 128 +++++++++++------- 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index d364291e..7b5ada79 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -76,6 +76,8 @@ class _UpdateOperationReportState extends State { TextEditingController circulatingNurseController = TextEditingController(); TextEditingController BloodTransfusedDetailController = TextEditingController(); + TextEditingController anasthetistController = + TextEditingController(); setSelectedType(int val) { setState(() { @@ -129,55 +131,66 @@ class _UpdateOperationReportState extends State { widthFactor: 0.9, child: Column( children: [ - Stack( - children: [ - AppTextFieldCustom( - hintText: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, - //TranslationBase.of(context).addProgressNote, - controller: preOpDiagmosisController, - maxLines: 35, - minLines: 25, - hasBorder: true, + AppTextFieldCustom( + hintText: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).progressNote, + //TranslationBase.of(context).addProgressNote, + controller: preOpDiagmosisController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + preOpDiagmosisController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox(height: 4,), + AppTextFieldCustom( + hintText: "Post Op Diagmosis", + //TranslationBase.of(context).addProgressNote, + controller: postOpDiagmosisNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + postOpDiagmosisNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox(height: 4,), + AppTextFieldCustom( + hintText: "Post Op Diagmosis", + //TranslationBase.of(context).addProgressNote, + controller: postOpDiagmosisNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, - // isTextFieldHasSuffix: true, - validationError: - preOpDiagmosisController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - Positioned( - top: - -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, - child: Column( - children: [ - IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), - onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); - }, - ), - ], - )) - ], + // isTextFieldHasSuffix: true, + validationError: + postOpDiagmosisNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), + SizedBox(height: 4,), ], ), ), @@ -211,7 +224,26 @@ class _UpdateOperationReportState extends State { if (widget.isUpdate) { CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = - CreateUpdateOperationReportRequestModel(); + CreateUpdateOperationReportRequestModel( + inasion: inasionController.text, + preOpDiagmosis: preOpDiagmosisController.text, + postOpDiagmosis: postOpDiagmosisNoteController.text, + surgeon: surgeonController.text, + assistant: assistantNoteController.text, + anasthetist:assistantNoteController.text, + operation: operationController.text, + finding: findingController.text, + surgeryProcedure: surgeonController.text, + postOpInstruction: postOpInstructionController.text, + complicationDetails: complicationDetailsController.text, + bloodLossDetail: bloodLossDetailController.text, + histopathSpecimen: histopathSpecimenController.text, + microbiologySpecimen: microbiologySpecimenController.text, + otherSpecimen: otherSpecimenController.text, + scrubNurse: surgeonController.text, + circulatingNurse: circulatingNurseController.text, + bloodTransfusedDetail: bloodLossDetailController.text + ); await widget.operationReportViewModel .updateOperationReport(createUpdateOperationReportRequestModel); } From ee3d207795daee70063a131121610de997f26487 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 24 Oct 2021 10:11:57 +0300 Subject: [PATCH 072/199] get operation report --- lib/core/service/operation_report_servive.dart | 13 ++++++++----- lib/core/viewModel/operation_report_view_model.dart | 4 +++- .../get_operation_report_model.dart | 2 +- .../profile/operation_report/operation_report.dart | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index 5094fbb1..30b76cc7 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -4,7 +4,8 @@ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; class OperationReportService extends BaseService { - List get operationReportList => List(); + List get _operationReportList => List(); + List get operationReportList => _operationReportList; Future getOperationReport( {GetOperationReportRequestModel getOperationReportRequestModel, @@ -16,10 +17,12 @@ class OperationReportService extends BaseService { await baseAppClient.post(GET_OPERATION_REPORT, onSuccess: (dynamic response, int statusCode) { print("Success"); - operationReportList.clear(); - response['List_OTReservationDetails'].forEach((v) { - operationReportList.add(GetOperationReportModel.fromJson(v)); - }); + _operationReportList.clear(); + response['List_OTReservationDetails'].forEach( + (v) { + _operationReportList.add(GetOperationReportModel.fromJson(v)); + }, + ); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/operation_report_view_model.dart index 673d6522..246eff87 100644 --- a/lib/core/viewModel/operation_report_view_model.dart +++ b/lib/core/viewModel/operation_report_view_model.dart @@ -2,13 +2,15 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/operation_report_servive.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/operation_report/get_operation_report_model.dart'; class OperationReportViewModel extends BaseViewModel { bool hasError = false; OperationReportService _operationReportService = locator(); - get operationReportList => _operationReportService.operationReportList; + List get operationReportList => + _operationReportService.operationReportList; Future getOperationReport(int patientId) async { hasError = false; diff --git a/lib/models/operation_report/get_operation_report_model.dart b/lib/models/operation_report/get_operation_report_model.dart index 4a84620c..29a0158c 100644 --- a/lib/models/operation_report/get_operation_report_model.dart +++ b/lib/models/operation_report/get_operation_report_model.dart @@ -18,7 +18,7 @@ class GetOperationReportModel { String endDate; String timeStart; String timeEnd; - Null remarks; + dynamic remarks; int status; int createdBy; String createdOn; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 427c6f7e..04b271b5 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -535,7 +535,7 @@ class _ProgressNoteState extends State { model .operationReportList[ index] - .notes, + .remarks, fontSize: 10, ), ), From a44a2071168fb3b67518979a71c1a6c0ba696d96 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 24 Oct 2021 11:36:25 +0300 Subject: [PATCH 073/199] finish the operation Reports from our side --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 3 +- .../operation_report_view_model.dart | 2 + .../operation_report/operation_report.dart | 114 +--- .../update_operation_report.dart | 646 ++++++++++++------ lib/util/translations_delegate_base.dart | 1 + 6 files changed, 463 insertions(+), 305 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a8ff066a..6332520f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -348,7 +348,7 @@ const GET_EPISODE_FOR_INPATIENT = const GET_OPERATION_REPORT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; const UPDATE_OPERATION_REPORT = - "/Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; + "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; var selectedPatientType = 1; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9b91015f..b711124f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -709,5 +709,6 @@ const Map> localizedValues = { "en":"Request Type", "ar":"نوع الطلب"}, "special": {"en": "Special", "ar": "خاص"}, - "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} + "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , + "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"} }; diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/operation_report_view_model.dart index 6e472125..dc5d80d7 100644 --- a/lib/core/viewModel/operation_report_view_model.dart +++ b/lib/core/viewModel/operation_report_view_model.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/operation_report_servive.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/operation_report/create_update_operation_report_request_model.dart'; class OperationReportViewModel extends BaseViewModel { bool hasError = false; @@ -28,6 +29,7 @@ class OperationReportViewModel extends BaseViewModel { CreateUpdateOperationReportRequestModel createUpdateOperationReport) async { setState(ViewState.BusyLocal); + await _operationReportService.updateOperationReport(createUpdateOperationReport); if (_operationReportService.hasError) { error = _operationReportService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 427c6f7e..2caaf964 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -90,15 +90,11 @@ class _ProgressNoteState extends State { patient, isInpatient: true, ), - body: model.operationReportList == null || - model.operationReportList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) - : Container( + body: + Container( color: Colors.grey[200], child: Column( children: [ - if (!isDischargedPatient) AddNewOrder( onTap: () async { await locator().logEvent( @@ -108,8 +104,8 @@ class _ProgressNoteState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => UpdateOperatiomReport( - patientModel: model, + builder: (context) => UpdateOperationReport( + operationReportViewModel: model, patient: patient, visitType: widget.visitType, isUpdate: false, @@ -118,11 +114,12 @@ class _ProgressNoteState extends State { ), ); }, - label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet - : TranslationBase.of(context).addProgressNote, + label: TranslationBase.of(context).operationReports, ), - Expanded( + model.operationReportList == null || + model.operationReportList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote):Expanded( child: Container( child: ListView.builder( itemCount: model.operationReportList.length, @@ -558,97 +555,4 @@ class _ProgressNoteState extends State { ), ); } - - showMyDialog({BuildContext context, Function confirmFun, String actionName}) { - showDialog( - context: context, - builder: (ctx) => Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.8, - height: 200, - child: AppScaffold( - isShowAppBar: false, - body: Container( - color: Colors.white, - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // SizedBox(height: 20,), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), - ], - ), - SizedBox( - height: 10, - ), - DividerWithSpacesAround(), - SizedBox( - height: 12, - ), - - Container( - padding: EdgeInsets.all(20), - color: Colors.white, - child: AppText( - projectViewModel.isArabic - ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" - : 'Are you sure you want $actionName this order?', - fontSize: 15, - textAlign: TextAlign.center, - ), - ), - - SizedBox( - height: 8, - ), - DividerWithSpacesAround(), - FractionallySizedBox( - widthFactor: 0.75, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - FlatButton( - child: AppText( - TranslationBase.of(context).cancel, - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), //Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }), - FlatButton( - child: AppText( - TranslationBase.of(context).noteConfirm, - fontWeight: FontWeight.w600, - color: Colors.red.shade700, - fontSize: 16, - ), //Text("Confirm", ), - onPressed: () async { - await confirmFun(); - Navigator.of(context).pop(); - }) - ], - ), - ) - ], - ), - ), - ), - ), - ), - )); - } } diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 7b5ada79..dc64acb5 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -76,8 +76,7 @@ class _UpdateOperationReportState extends State { TextEditingController circulatingNurseController = TextEditingController(); TextEditingController BloodTransfusedDetailController = TextEditingController(); - TextEditingController anasthetistController = - TextEditingController(); + TextEditingController anasthetistController = TextEditingController(); setSelectedType(int val) { setState(() { @@ -87,240 +86,491 @@ class _UpdateOperationReportState extends State { @override void initState() { - requestPermissions(); - event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { - if (this.mounted) { - initSpeechState().then((value) => {onVoiceText()}); - } - } - }); super.initState(); } @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - - if (widget.note != null) { - preOpDiagmosisController.text = widget.note.notes; - } - + //TODO Elham* add translation to hints return AppScaffold( - isShowAppBar: false, + isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: BottomSheetTitle( + title: (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).operationReports, + ), body: SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.0, child: Padding( padding: EdgeInsets.all(0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle( - title: (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, - ), - SizedBox( - height: 10.0, - ), - Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - AppTextFieldCustom( - hintText: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, - //TranslationBase.of(context).addProgressNote, - controller: preOpDiagmosisController, - maxLines: 1, - minLines: 1, - hasBorder: true, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.0, + ), + SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + AppTextFieldCustom( + hintText: "Pre Op Diagmosis", + //TranslationBase.of(context).addoperationReports, + controller: preOpDiagmosisController, + maxLines: 1, + minLines: 1, + hasBorder: true, - // isTextFieldHasSuffix: true, - validationError: - preOpDiagmosisController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox(height: 4,), - AppTextFieldCustom( - hintText: "Post Op Diagmosis", - //TranslationBase.of(context).addProgressNote, - controller: postOpDiagmosisNoteController, - maxLines: 1, - minLines: 1, - hasBorder: true, + // isTextFieldHasSuffix: true, + validationError: + preOpDiagmosisController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Post Op Diagmosis", + //TranslationBase.of(context).addoperationReports, + controller: postOpDiagmosisNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, - // isTextFieldHasSuffix: true, - validationError: - postOpDiagmosisNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox(height: 4,), - AppTextFieldCustom( - hintText: "Post Op Diagmosis", - //TranslationBase.of(context).addProgressNote, - controller: postOpDiagmosisNoteController, - maxLines: 1, - minLines: 1, - hasBorder: true, + // isTextFieldHasSuffix: true, + validationError: + postOpDiagmosisNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Surgeon", + //TranslationBase.of(context).addoperationReports, + controller: surgeonController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + surgeonController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "assistant", + //TranslationBase.of(context).addoperationReports, + controller: assistantNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + assistantNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Operation", + //TranslationBase.of(context).addoperationReports, + controller: operationController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + operationController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "inasion", + //TranslationBase.of(context).addoperationReports, + controller: inasionController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + inasionController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "finding", + //TranslationBase.of(context).addoperationReports, + controller: findingController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + findingController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Surgery Procedure", + //TranslationBase.of(context).addoperationReports, + controller: surgeryProcedureController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + surgeryProcedureController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Post Op Instruction", + //TranslationBase.of(context).addoperationReports, + controller: postOpInstructionController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + postOpInstructionController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Complication Details", + //TranslationBase.of(context).addoperationReports, + controller: complicationDetailsController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + complicationDetailsController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Blood Loss Detail", + //TranslationBase.of(context).addoperationReports, + controller: bloodLossDetailController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + bloodLossDetailController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "histopal the Specimen", + //TranslationBase.of(context).addoperationReports, + controller: histopathSpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + histopathSpecimenController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "microbiology Specimen ", + //TranslationBase.of(context).addoperationReports, + controller: microbiologySpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + microbiologySpecimenController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "other Specimen", + //TranslationBase.of(context).addoperationReports, + controller: otherSpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, - // isTextFieldHasSuffix: true, - validationError: - postOpDiagmosisNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + // isTextFieldHasSuffix: true, + validationError: + otherSpecimenController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "scrub Nurse", + //TranslationBase.of(context).addoperationReports, + controller: scrubNurseController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + scrubNurseController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "circulating Nurse", + //TranslationBase.of(context).addoperationReports, + controller: circulatingNurseController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + circulatingNurseController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Blood Transfused Detail", + //TranslationBase.of(context).addoperationReports, + controller: BloodTransfusedDetailController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: BloodTransfusedDetailController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Anasthetist", + //TranslationBase.of(context).addoperationReports, + controller: anasthetistController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + anasthetistController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 250, + ), + ], ), - SizedBox(height: 4,), - ], + ), ), ), - ), - ], + ], + ), ), ), ), ), bottomSheet: Container( - height: preOpDiagmosisController.text.isNotEmpty ? 130 : 70, + height: 70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, - color: Color(0xff359846), - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (widget.isUpdate) { - CreateUpdateOperationReportRequestModel - createUpdateOperationReportRequestModel = - CreateUpdateOperationReportRequestModel( - inasion: inasionController.text, - preOpDiagmosis: preOpDiagmosisController.text, - postOpDiagmosis: postOpDiagmosisNoteController.text, - surgeon: surgeonController.text, - assistant: assistantNoteController.text, - anasthetist:assistantNoteController.text, - operation: operationController.text, - finding: findingController.text, - surgeryProcedure: surgeonController.text, - postOpInstruction: postOpInstructionController.text, - complicationDetails: complicationDetailsController.text, - bloodLossDetail: bloodLossDetailController.text, - histopathSpecimen: histopathSpecimenController.text, - microbiologySpecimen: microbiologySpecimenController.text, - otherSpecimen: otherSpecimenController.text, - scrubNurse: surgeonController.text, - circulatingNurse: circulatingNurseController.text, - bloodTransfusedDetail: bloodLossDetailController.text - ); - await widget.operationReportViewModel - .updateOperationReport(createUpdateOperationReportRequestModel); - } - - if (widget.operationReportViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.operationReportViewModel.error); - } else { - // await widget.operationReportViewModel.( - // progressNoteRequest.toJson()); + margin: EdgeInsets.all(5), + child: AppButton( + title: (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).operationReports, + color: Color(0xff359846), + // disabled: operationReportsController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (isFormValid()) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.operationReportViewModel.getDoctorProfile(); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } - GifLoaderDialogUtils.hideDialog(context); + CreateUpdateOperationReportRequestModel + createUpdateOperationReportRequestModel = + CreateUpdateOperationReportRequestModel( + inasion: inasionController.text, + /// TODO Elham* Add dynamic reservation + reservationNo: 0, + preOpDiagmosis: preOpDiagmosisController.text, + postOpDiagmosis: postOpDiagmosisNoteController.text, + surgeon: surgeonController.text, + assistant: assistantNoteController.text, + anasthetist: assistantNoteController.text, + operation: operationController.text, + finding: findingController.text, + surgeryProcedure: surgeonController.text, + postOpInstruction: postOpInstructionController.text, + complicationDetails: + complicationDetailsController.text, + bloodLossDetail: bloodLossDetailController.text, + histopathSpecimen: histopathSpecimenController.text, + microbiologySpecimen: + microbiologySpecimenController.text, + otherSpecimen: otherSpecimenController.text, + scrubNurse: surgeonController.text, + circulatingNurse: circulatingNurseController.text, + bloodTransfusedDetail: + bloodLossDetailController.text, + patientID: widget.patient.patientId, + admissionNo: int.parse(widget.patient.admissionNo), + createdBy: widget.operationReportViewModel.doctorProfile.doctorID, + setupID: SETUP_ID); + await widget.operationReportViewModel.updateOperationReport( + createUpdateOperationReportRequestModel); + if (widget.operationReportViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.operationReportViewModel.error); + } else { + // await widget.operationReportViewModel.( + // operationReportsRequest.toJson()); - })), + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } + GifLoaderDialogUtils.hideDialog(context); + } + }, + ), + ), ], ), ), ); } - 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); - if (available) { - speech.listen( - onResult: resultListener, - listenMode: stt.ListenMode.confirmation, - localeId: lang == 'en' ? 'en-US' : 'ar-SA', - ); + isFormValid() { + if (preOpDiagmosisController.text != null && + preOpDiagmosisController.text.isNotEmpty && + postOpDiagmosisNoteController.text != null && + postOpDiagmosisNoteController.text.isNotEmpty && + surgeonController.text != null && + surgeonController.text.isNotEmpty && + assistantNoteController.text != null && + assistantNoteController.text.isNotEmpty && + operationController.text != null && + operationController.text.isNotEmpty && + inasionController.text != null && + inasionController.text.isNotEmpty && + findingController.text != null && + findingController.text.isNotEmpty && + surgeryProcedureController.text != null && + surgeryProcedureController.text.isNotEmpty && + postOpInstructionController.text != null && + postOpInstructionController.text.isNotEmpty && + complicationDetailsController.text != null && + complicationDetailsController.text.isNotEmpty && + bloodLossDetailController.text != null && + bloodLossDetailController.text.isNotEmpty && + histopathSpecimenController.text != null && + histopathSpecimenController.text.isNotEmpty && + microbiologySpecimenController.text != null && + microbiologySpecimenController.text.isNotEmpty && + otherSpecimenController.text != null && + otherSpecimenController.text.isNotEmpty && + scrubNurseController.text != null && + scrubNurseController.text.isNotEmpty && + circulatingNurseController.text != null && + circulatingNurseController.text.isNotEmpty && + BloodTransfusedDetailController.text != null && + BloodTransfusedDetailController.text.isNotEmpty && + anasthetistController.text != null && + anasthetistController.text.isNotEmpty) { + return true; } else { - print("The user has denied the use of speech recognition."); + return false; } } - - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - //SpeechToText.closeAlertDialog(context); - print(error); - } - - void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; - } - - void requestPermissions() async { - Map statuses = await [ - Permission.microphone, - ].request(); - } - - void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); - - if (result.finalResult == true) { - setState(() { - SpeechToText.closeAlertDialog(context); - speech.stop(); - preOpDiagmosisController.text += reconizedWord + '\n'; - }); - } else { - print(result.finalResult); - } - } - - Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; - } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 0297aa45..59f66811 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -212,6 +212,7 @@ class TranslationBase { String get replay => localizedValues['replay'][locale.languageCode]; String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get operationReports => localizedValues['operationReports'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode]; From 72c948371aeb0bbef634f23255f47058e4ee617c Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 24 Oct 2021 13:56:15 +0300 Subject: [PATCH 074/199] finish the nursing progress_note_screen --- lib/config/config.dart | 3 + .../GetNursingProgressNoteRequestModel.dart | 30 +++ .../GetNursingProgressNoteResposeModel.dart | 36 +++ lib/core/service/patient/patient_service.dart | 27 +- lib/core/viewModel/patient_view_model.dart | 16 ++ lib/routes.dart | 8 +- .../note/progress_note_screen.dart | 13 +- .../profile/{ => notes}/note/update_note.dart | 0 .../nursing_note/nursing_note_screen.dart | 240 ++++++++++++++++++ .../operation_report/operation_report.dart | 1 - .../profile_gird_for_InPatient.dart | 7 + 11 files changed, 370 insertions(+), 11 deletions(-) create mode 100644 lib/core/model/note/GetNursingProgressNoteRequestModel.dart create mode 100644 lib/core/model/note/GetNursingProgressNoteResposeModel.dart rename lib/screens/patients/profile/{ => notes}/note/progress_note_screen.dart (99%) rename lib/screens/patients/profile/{ => notes}/note/update_note.dart (100%) create mode 100644 lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index f17693e0..5bc953f2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -348,6 +348,9 @@ const GET_EPISODE_FOR_INPATIENT = const GET_OPERATION_REPORT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const NURSING_PROGRESS_NOTE = + "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart new file mode 100644 index 00000000..4335053c --- /dev/null +++ b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart @@ -0,0 +1,30 @@ +import 'package:doctor_app_flutter/config/config.dart'; + +class GetNursingProgressNoteRequestModel { + int patientID; + int admissionNo; + int patientTypeID; + int patientType; + String setupID; + + GetNursingProgressNoteRequestModel( + {this.patientID, this.admissionNo, this.patientTypeID = 1, this.patientType = 1, this.setupID }); + + GetNursingProgressNoteRequestModel.fromJson(Map json) { + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + setupID = json['SetupID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['SetupID'] = this.setupID; + return data; + } +} diff --git a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart new file mode 100644 index 00000000..55ede866 --- /dev/null +++ b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart @@ -0,0 +1,36 @@ +class GetNursingProgressNoteResposeModel { + String notes; + dynamic conditionType; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedOn; + + GetNursingProgressNoteResposeModel( + {this.notes, + this.conditionType, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); + + GetNursingProgressNoteResposeModel.fromJson(Map json) { + notes = json['Notes']; + conditionType = json['ConditionType']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['Notes'] = this.notes; + data['ConditionType'] = this.conditionType; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + return data; + } +} diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 25e9481b..26ec11ad 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/client/base_app_client.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/note/CreateNoteModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.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'; @@ -51,11 +53,14 @@ class PatientService extends BaseService { List get labResultList => _labResultList; - // TODO: replace var with model List _patientProgressNoteList = []; List get patientProgressNoteList => _patientProgressNoteList; + List _patientNursingProgressNoteList = []; + + List get patientNursingProgressNoteList => _patientNursingProgressNoteList; + // TODO: replace var with model var _insuranceApporvalsList = []; @@ -465,4 +470,24 @@ class PatientService extends BaseService { body: _doctorsByClinicIdRequest.toJson(), ); } + + + Future getNursingProgressNote(GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel) async { + hasError = false; + + await baseAppClient.post( + NURSING_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { + _patientNursingProgressNoteList = []; + response['List_NursingProgressNote'].forEach((v) { + _patientNursingProgressNoteList.add( GetNursingProgressNoteResposeModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: getNursingProgressNoteRequestModel.toJson(), + ); + } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 5bc6250f..24d1479d 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -1,5 +1,7 @@ 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/GetNursingProgressNoteRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.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'; @@ -41,6 +43,7 @@ class PatientViewModel extends BaseViewModel { get insuranceApporvalsList => _patientService.insuranceApporvalsList; List get patientProgressNoteList => _patientService.patientProgressNoteList; + List get patientNursingProgressNoteList => _patientService.patientNursingProgressNoteList; List get clinicsList => _patientService.clinicsList; @@ -284,4 +287,17 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future getNursingProgressNote(GetNursingProgressNoteRequestModel requestModel) async { + await getDoctorProfile(); + setState(ViewState.Busy); + + await _patientService.getNursingProgressNote(requestModel); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/routes.dart b/lib/routes.dart index 9c8f35f8..8e6d346d 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -9,7 +9,8 @@ import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportDetailPage.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportPage.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/note/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/notes/note/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/operation_report.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; @@ -27,7 +28,6 @@ import 'landing_page.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; -import 'screens/patients/profile/note/progress_note_screen.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; @@ -69,6 +69,7 @@ const String ADD_SICKLEAVE = 'add-sickleave'; const String RADIOLOGY_PATIENT = 'radiology-patient'; const String ALL_SPECIAL_LAB_RESULT = 'all-special_lab'; const String GET_OPERATION_REPORT = 'operation-report'; +const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; //todo: change the routing way. var routes = { @@ -112,5 +113,6 @@ var routes = { // PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), PATIENT_ECG: (_) => ECGPage(), ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), - GET_OPERATION_REPORT: (_) => OperationReportScreen(), + + NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), }; diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart similarity index 99% rename from lib/screens/patients/profile/note/progress_note_screen.dart rename to lib/screens/patients/profile/notes/note/progress_note_screen.dart index fb31511d..52a1b0e0 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.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/service/AnalyticsService.dart'; @@ -6,13 +7,17 @@ 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/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/patients/profile/notes/note/update_note.dart'; import 'package:doctor_app_flutter/util/date-utils.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/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/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'; @@ -21,11 +26,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; -import '../../../../config/shared_pref_kay.dart'; -import '../../../../models/patient/patiant_info_model.dart'; -import '../../../../util/dr_app_shared_pref.dart'; -import '../../../../widgets/shared/app_scaffold_widget.dart'; -import '../../../../widgets/shared/app_texts_widget.dart'; + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart similarity index 100% rename from lib/screens/patients/profile/note/update_note.dart rename to lib/screens/patients/profile/notes/note/update_note.dart diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart new file mode 100644 index 00000000..d00e1b54 --- /dev/null +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -0,0 +1,240 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.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/service/AnalyticsService.dart'; +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/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_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/notes/note/update_note.dart'; +import 'package:doctor_app_flutter/util/date-utils.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/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/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'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class NursingProgressNoteScreen extends StatefulWidget { + const NursingProgressNoteScreen({Key key}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + List notesList; + var filteredNotesList; + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + getProgressNoteList(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + + print(type); + GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = + GetNursingProgressNoteRequestModel( + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); + model.getNursingProgressNote(getNursingProgressNoteRequestModel); + } + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => getProgressNoteList(context, model), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.patientNursingProgressNoteList == null || + model.patientNursingProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: + model.patientNursingProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.black38, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .patientNursingProgressNoteList[ + index] + .createdBy + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .patientNursingProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientNursingProgressNoteList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .patientNursingProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientNursingProgressNoteList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + model + .patientNursingProgressNoteList[ + index] + .notes, + fontSize: 10, + isCopyable: true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 04b271b5..b00259e4 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -9,7 +9,6 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.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/screens/patients/profile/operation_report/update_operation_report.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 4c4fe12e..bc1deb07 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -133,6 +133,13 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), + PatientProfileCardModel( + "Nursing", + "Progress Note", + NURSING_PROGRESS_NOTE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), ]; return Padding( From 1a3567f917233fe009a2507ecb278b3bf327705d Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 24 Oct 2021 15:42:22 +0300 Subject: [PATCH 075/199] finish the nursing DiagnosisScreen --- lib/config/config.dart | 2 + .../GetDiagnosisForInPatientRequestModel.dart | 32 +++ ...GetDiagnosisForInPatientResponseModel.dart | 48 ++++ lib/core/service/patient/patient_service.dart | 25 ++ lib/core/viewModel/patient_view_model.dart | 15 ++ lib/routes.dart | 3 + .../profile/diagnosis/diagnosis_screen.dart | 238 ++++++++++++++++++ .../profile_gird_for_InPatient.dart | 7 + 8 files changed, 370 insertions(+) create mode 100644 lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart create mode 100644 lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart create mode 100644 lib/screens/patients/profile/diagnosis/diagnosis_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 5bc953f2..01a89033 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -350,6 +350,8 @@ const GET_OPERATION_REPORT = const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; +const GET_DIAGNOSIS_FOR_IN_PATIENT = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; var selectedPatientType = 1; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart new file mode 100644 index 00000000..310cfb50 --- /dev/null +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart @@ -0,0 +1,32 @@ +class GetDiagnosisForInPatientRequestModel { + int patientID; + int admissionNo; + String setupID; + int patientType; + int patientTypeID; + + GetDiagnosisForInPatientRequestModel( + {this.patientID, + this.admissionNo, + this.setupID, + this.patientType, + this.patientTypeID}); + + GetDiagnosisForInPatientRequestModel.fromJson(Map json) { + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + setupID = json['SetupID']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['SetupID'] = this.setupID; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart new file mode 100644 index 00000000..c4a4e528 --- /dev/null +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -0,0 +1,48 @@ +class GetDiagnosisForInPatientResponseModel { + String iCDCode10ID; + int diagnosisTypeID; + int conditionID; + bool complexDiagnosis; + String asciiDesc; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + + GetDiagnosisForInPatientResponseModel( + {this.iCDCode10ID, + this.diagnosisTypeID, + this.conditionID, + this.complexDiagnosis, + this.asciiDesc, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); + + GetDiagnosisForInPatientResponseModel.fromJson(Map json) { + iCDCode10ID = json['ICDCode10ID']; + diagnosisTypeID = json['DiagnosisTypeID']; + conditionID = json['ConditionID']; + complexDiagnosis = json['ComplexDiagnosis']; + asciiDesc = json['Ascii_Desc']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ICDCode10ID'] = this.iCDCode10ID; + data['DiagnosisTypeID'] = this.diagnosisTypeID; + data['ConditionID'] = this.conditionID; + data['ComplexDiagnosis'] = this.complexDiagnosis; + data['Ascii_Desc'] = this.asciiDesc; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + return data; + } +} diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 26ec11ad..a3272201 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/client/base_app_client.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/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; @@ -61,6 +63,10 @@ class PatientService extends BaseService { List get patientNursingProgressNoteList => _patientNursingProgressNoteList; + List _diagnosisForInPatientList = []; + + List get diagnosisForInPatientList => _diagnosisForInPatientList; + // TODO: replace var with model var _insuranceApporvalsList = []; @@ -490,4 +496,23 @@ class PatientService extends BaseService { body: getNursingProgressNoteRequestModel.toJson(), ); } + + Future getDiagnosisForInPatient(GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel) async { + hasError = false; + + await baseAppClient.post( + GET_DIAGNOSIS_FOR_IN_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _diagnosisForInPatientList = []; + response['List_DiagnosisForInPatient'].forEach((v) { + _diagnosisForInPatientList.add( GetDiagnosisForInPatientResponseModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: getDiagnosisForInPatientRequestModel.toJson(), + ); + } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 24d1479d..38d23df9 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -1,4 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; @@ -44,6 +46,7 @@ class PatientViewModel extends BaseViewModel { List get patientProgressNoteList => _patientService.patientProgressNoteList; List get patientNursingProgressNoteList => _patientService.patientNursingProgressNoteList; + List get diagnosisForInPatientList => _patientService.diagnosisForInPatientList; List get clinicsList => _patientService.clinicsList; @@ -300,4 +303,16 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } } + Future getDiagnosisForInPatient(GetDiagnosisForInPatientRequestModel requestModel) async { + await getDoctorProfile(); + setState(ViewState.Busy); + + await _patientService.getDiagnosisForInPatient(requestModel); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/routes.dart b/lib/routes.dart index 8e6d346d..c5048c56 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart import 'package:doctor_app_flutter/screens/patient-sick-leave/patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/diagnosis/diagnosis_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart'; @@ -70,6 +71,7 @@ const String RADIOLOGY_PATIENT = 'radiology-patient'; const String ALL_SPECIAL_LAB_RESULT = 'all-special_lab'; const String GET_OPERATION_REPORT = 'operation-report'; const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; +const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; //todo: change the routing way. var routes = { @@ -115,4 +117,5 @@ var routes = { ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), + DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), }; diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart new file mode 100644 index 00000000..3347beaf --- /dev/null +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -0,0 +1,238 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.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/service/AnalyticsService.dart'; +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/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_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/notes/note/update_note.dart'; +import 'package:doctor_app_flutter/util/date-utils.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/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/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'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class DiagnosisScreen extends StatefulWidget { + const DiagnosisScreen({Key key}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + getDiagnosisForInPatient(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + + print(type); + GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = + GetDiagnosisForInPatientRequestModel( + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); + model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); + } + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => getDiagnosisForInPatient(context, model), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.diagnosisForInPatientList == null || + model.diagnosisForInPatientList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: + model.diagnosisForInPatientList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.black38, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .diagnosisForInPatientList[ + index] + .createdBy + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .diagnosisForInPatientList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .diagnosisForInPatientList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .diagnosisForInPatientList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .diagnosisForInPatientList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + model + .diagnosisForInPatientList[ + index] + .iCDCode10ID, + fontSize: 10, + isCopyable: true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index bc1deb07..6e3d785e 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -140,6 +140,13 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), + PatientProfileCardModel( + "Diagnosis", + "", + DIAGNOSIS_FOR_IN_PATIENT, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), ]; return Padding( From 35acd1f21f417bcf071b8ddf2836f7809f1c01aa Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 24 Oct 2021 17:17:31 +0300 Subject: [PATCH 076/199] finish the nursing DiagnosisScreen --- .../profile/diagnosis/diagnosis_screen.dart | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 3347beaf..5751896e 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -77,7 +77,7 @@ class _ProgressNoteState extends State { body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).noItem) : Container( color: Colors.grey[200], child: Column( @@ -126,7 +126,7 @@ class _ProgressNoteState extends State { TranslationBase.of( context) .createdBy, - fontSize: 10, + fontSize: 12, ), Expanded( child: AppText( @@ -206,13 +206,40 @@ class _ProgressNoteState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ + AppText( + TranslationBase.of( + context) + .icd + " : ", + fontSize: 12, + ), Expanded( child: AppText( model .diagnosisForInPatientList[ index] .iCDCode10ID, - fontSize: 10, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText("Ascii Desc : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .diagnosisForInPatientList[ + index] + .asciiDesc, + fontSize: 12, isCopyable: true, ), ), From 64b5652c8dfeb8c53bc9657b69bc48ab5b9bdf3b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 25 Oct 2021 09:47:50 +0300 Subject: [PATCH 077/199] Pending Orders Service --- lib/config/config.dart | 3 + lib/core/service/pending_order_service.dart | 36 +++++++++ .../viewModel/pednding_orders_view_model.dart | 26 +++++++ lib/locator.dart | 4 + .../pending_order_request_model.dart | 76 +++++++++++++++++++ .../pending_orders/pending_orders_model.dart | 15 ++++ lib/routes.dart | 3 + .../operation_report/operation_report.dart | 2 +- .../pending_orders/pending_orders_screen.dart | 64 ++++++++++++++++ .../profile_gird_for_InPatient.dart | 7 ++ 10 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 lib/core/service/pending_order_service.dart create mode 100644 lib/core/viewModel/pednding_orders_view_model.dart create mode 100644 lib/models/pending_orders/pending_order_request_model.dart create mode 100644 lib/models/pending_orders/pending_orders_model.dart create mode 100644 lib/screens/patients/profile/pending_orders/pending_orders_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index f17693e0..53a8f55e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -348,6 +348,9 @@ const GET_EPISODE_FOR_INPATIENT = const GET_OPERATION_REPORT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const GET_PENDING_ORDERS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart new file mode 100644 index 00000000..3e6fa497 --- /dev/null +++ b/lib/core/service/pending_order_service.dart @@ -0,0 +1,36 @@ +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/pending_orders/pending_order_request_model.dart'; +import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; + +class PendingOrderService extends BaseService { + List get _pendingOrderList => List(); + List get pendingOrderList => _pendingOrderList; + + Future getPendingOrders( + {PendingOrderRequestModel pendingOrderRequestModel, + int patientId, + int admissionNo}) async { + pendingOrderRequestModel = PendingOrderRequestModel( + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + ); + + hasError = false; + await baseAppClient.post(GET_PENDING_ORDERS, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + _pendingOrderList.clear(); + response['List_PendingOrders'].forEach( + (v) { + _pendingOrderList.add(PendingOrderModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: pendingOrderRequestModel.toJson()); + } +} diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart new file mode 100644 index 00000000..fd66413b --- /dev/null +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -0,0 +1,26 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/pending_order_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/pending_orders/pending_orders_model.dart'; + +class PendingOrdersViewModel extends BaseViewModel { + bool hasError = false; + PendingOrderService _pendingOrderService = locator(); + + List get pendingOrdersList => + _pendingOrderService.pendingOrderList; + + Future getPendingOrders({int patientId, int admissionNo}) async { + hasError = false; + setState(ViewState.Busy); + await _pendingOrderService.getPendingOrders( + patientId: patientId, admissionNo: admissionNo); + if (_pendingOrderService.hasError) { + error = _pendingOrderService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index b5f651eb..4544f923 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,11 +1,13 @@ 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/service/operation_report_servive.dart'; +import 'package:doctor_app_flutter/core/service/pending_order_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/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/pednding_orders_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'; @@ -103,6 +105,7 @@ void setupLocator() { locator.registerLazySingleton(() => VideoCallService()); locator.registerLazySingleton(() => AnalyticsService()); locator.registerLazySingleton(() => OperationReportService()); + locator.registerLazySingleton(() => PendingOrderService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -132,4 +135,5 @@ void setupLocator() { locator.registerFactory(() => PatientMedicalReportViewModel()); locator.registerFactory(() => ScanQrViewModel()); locator.registerFactory(() => OperationReportViewModel()); + locator.registerFactory(() => PendingOrdersViewModel()); } diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/models/pending_orders/pending_order_request_model.dart new file mode 100644 index 00000000..c69cf780 --- /dev/null +++ b/lib/models/pending_orders/pending_order_request_model.dart @@ -0,0 +1,76 @@ +class PendingOrderRequestModel { + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; + + PendingOrderRequestModel( + {this.isDentalAllowedBackend, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.admissionNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); + + PendingOrderRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + sessionID = json['SessionID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['SessionID'] = this.sessionID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/pending_orders/pending_orders_model.dart b/lib/models/pending_orders/pending_orders_model.dart new file mode 100644 index 00000000..89525369 --- /dev/null +++ b/lib/models/pending_orders/pending_orders_model.dart @@ -0,0 +1,15 @@ +class PendingOrderModel { + String notes; + + PendingOrderModel({this.notes}); + + PendingOrderModel.fromJson(Map json) { + notes = json['Notes']; + } + + Map toJson() { + final Map data = new Map(); + data['Notes'] = this.notes; + return data; + } +} diff --git a/lib/routes.dart b/lib/routes.dart index 9c8f35f8..619dd9b6 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/medical_report/Medic import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportPage.dart'; import 'package:doctor_app_flutter/screens/patients/profile/note/progress_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/operation_report.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/pending_orders/pending_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart'; @@ -69,6 +70,7 @@ const String ADD_SICKLEAVE = 'add-sickleave'; const String RADIOLOGY_PATIENT = 'radiology-patient'; const String ALL_SPECIAL_LAB_RESULT = 'all-special_lab'; const String GET_OPERATION_REPORT = 'operation-report'; +const String PENDING_ORDERS = 'pending-orders'; //todo: change the routing way. var routes = { @@ -113,4 +115,5 @@ var routes = { PATIENT_ECG: (_) => ECGPage(), ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), GET_OPERATION_REPORT: (_) => OperationReportScreen(), + PENDING_ORDERS: (_) => PendingOrdersScreen(), }; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 04b271b5..9a9fd15f 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -93,7 +93,7 @@ class _ProgressNoteState extends State { body: model.operationReportList == null || model.operationReportList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).noDataAvailable) : Container( color: Colors.grey[200], child: Column( diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart new file mode 100644 index 00000000..a03ca3c5 --- /dev/null +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -0,0 +1,64 @@ +import 'package:doctor_app_flutter/core/viewModel/pednding_orders_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/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:flutter/material.dart'; + +class PendingOrdersScreen extends StatelessWidget { + const PendingOrdersScreen({Key key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + bool isInpatient = routeArgs['isInpatient']; + return BaseView( + onModelReady: (model) => model.getPendingOrders( + patientId: patient.patientMRN, + admissionNo: int.parse(patient.admissionNo)), + builder: + (BuildContext context, PendingOrdersViewModel model, Widget child) => + AppScaffold( + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Pending Orders", + body: model.pendingOrdersList == null || + model.pendingOrdersList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noDataAvailable) + : Container( + child: ListView.builder( + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: + AppText(model.pendingOrdersList[index].notes), + ), + ), + ); + })), + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 4c4fe12e..8b6fc6f2 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -133,6 +133,13 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), + PatientProfileCardModel( + "Pending", + "Orders", + PENDING_ORDERS, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), ]; return Padding( From b21acfd2c655d67e4ff0a4e6dbfafbfc2c12667e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 25 Oct 2021 10:56:25 +0300 Subject: [PATCH 078/199] fix route issues --- lib/routes.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes.dart b/lib/routes.dart index c5048c56..46602d53 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -115,7 +115,7 @@ var routes = { // PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), PATIENT_ECG: (_) => ECGPage(), ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), - + GET_OPERATION_REPORT: (_) => OperationReportScreen(), NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), }; From 45f4aa9a22404a78d3b579ebaca2e30c729c9962 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 25 Oct 2021 11:09:03 +0300 Subject: [PATCH 079/199] fix issues related to design --- .../profile/diagnosis/diagnosis_screen.dart | 2 +- .../nursing_note/nursing_note_screen.dart | 2 +- .../operation_report/operation_report.dart | 18 +----------------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 5751896e..2abc55ea 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -92,7 +92,7 @@ class _ProgressNoteState extends State { widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, - bgColor: Colors.black38, + bgColor: Colors.transparent, widget: Column( children: [ Column( diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index d00e1b54..d683bab4 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -94,7 +94,7 @@ class _ProgressNoteState extends State { widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, - bgColor: Colors.black38, + bgColor: Colors.transparent, widget: Column( children: [ Column( diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 14ebbc86..7ce54b7d 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -127,23 +127,7 @@ class _ProgressNoteState extends State { widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, - bgColor: model.operationReportList[index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model.operationReportList[index] - .createdBy - ? Color(0xFFCC9B14) - : model.operationReportList[index] - .status == - 4 - ? Colors.red.shade700 - : model.operationReportList[index] - .status == - 2 - ? Colors.green[600] - : Color(0xFFCC9B14), + bgColor: Colors.white, widget: Column( children: [ Column( From dd971ffddb2fd36f968820d357362e68aef46d05 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 25 Oct 2021 17:41:38 +0300 Subject: [PATCH 080/199] first step from get diabetic --- lib/config/config.dart | 3 + .../GetDiabeticChartValuesRequestModel.dart | 44 ++++ .../GetDiabeticChartValuesResponseModel.dart | 36 +++ lib/core/service/patient/patient_service.dart | 25 ++ lib/core/viewModel/patient_view_model.dart | 84 +++++-- lib/routes.dart | 3 + .../diabetic_chart/diabetic_chart.dart | 134 ++++++++++ ...iabetic_details_blood_pressurewideget.dart | 123 +++++++++ .../line_chart_for_diabetic.dart | 237 ++++++++++++++++++ .../profile_gird_for_InPatient.dart | 7 + ...al_sign_details_blood_pressurewideget.dart | 27 -- 11 files changed, 677 insertions(+), 46 deletions(-) create mode 100644 lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart create mode 100644 lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart create mode 100644 lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart create mode 100644 lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart create mode 100644 lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 616e862a..d5ecf52c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -355,6 +355,9 @@ const NURSING_PROGRESS_NOTE = const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; +const GET_DIABETIC_CHART_VALUES = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart new file mode 100644 index 00000000..7fad3106 --- /dev/null +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart @@ -0,0 +1,44 @@ +class GetDiabeticChartValuesRequestModel { + int deviceTypeID; + int patientID; + int resultType; + int admissionNo; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; + + GetDiabeticChartValuesRequestModel( + {this.deviceTypeID, + this.patientID, + this.resultType, + this.admissionNo, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); + + GetDiabeticChartValuesRequestModel.fromJson(Map json) { + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + resultType = json['ResultType']; + admissionNo = json['AdmissionNo']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['ResultType'] = this.resultType; + data['AdmissionNo'] = this.admissionNo; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart new file mode 100644 index 00000000..fa2c1ca2 --- /dev/null +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart @@ -0,0 +1,36 @@ +class GetDiabeticChartValuesResponseModel { + String resultType; + int admissionNo; + String dateChart; + int resultValue; + int createdBy; + String createdOn; + + GetDiabeticChartValuesResponseModel( + {this.resultType, + this.admissionNo, + this.dateChart, + this.resultValue, + this.createdBy, + this.createdOn}); + + GetDiabeticChartValuesResponseModel.fromJson(Map json) { + resultType = json['ResultType']; + admissionNo = json['AdmissionNo']; + dateChart = json['DateChart']; + resultValue = json['ResultValue']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ResultType'] = this.resultType; + data['AdmissionNo'] = this.admissionNo; + data['DateChart'] = this.dateChart; + data['ResultValue'] = this.resultValue; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + return data; + } +} diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index a3272201..f79e342c 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/client/base_app_client.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/diabetic_chart/GetDiabeticChartValuesRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; @@ -66,6 +68,9 @@ class PatientService extends BaseService { List _diagnosisForInPatientList = []; List get diagnosisForInPatientList => _diagnosisForInPatientList; + List _diabeticChartValuesList = []; + + List get diabeticChartValuesList => _diabeticChartValuesList; // TODO: replace var with model var _insuranceApporvalsList = []; @@ -515,4 +520,24 @@ class PatientService extends BaseService { body: getDiagnosisForInPatientRequestModel.toJson(), ); } + + + Future getDiabeticChartValues(GetDiabeticChartValuesRequestModel getDiabeticChartValuesRequestModel) async { + hasError = false; + + await baseAppClient.post( + GET_DIABETIC_CHART_VALUES, + onSuccess: (dynamic response, int statusCode) { + _diabeticChartValuesList = []; + response['List_DiabeticChartValues'].forEach((v) { + _diabeticChartValuesList.add( GetDiabeticChartValuesResponseModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: getDiabeticChartValuesRequestModel.toJson(), + ); + } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 38d23df9..ae52d07e 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -1,4 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; @@ -25,43 +27,59 @@ class PatientViewModel extends BaseViewModel { List get inPatientList => _patientService.inPatientList; - List get patientVitalSignList => _patientService.patientVitalSignList; + List get patientVitalSignList => + _patientService.patientVitalSignList; - List get patientVitalSignOrderdSubList => _patientService.patientVitalSignOrderdSubList; + List get patientVitalSignOrderdSubList => + _patientService.patientVitalSignOrderdSubList; - List get patientLabResultOrdersList => _patientService.patientLabResultOrdersList; + List get patientLabResultOrdersList => + _patientService.patientLabResultOrdersList; - List get patientPrescriptionsList => _patientService.patientPrescriptionsList; + 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 patientNursingProgressNoteList => _patientService.patientNursingProgressNoteList; - List get diagnosisForInPatientList => _patientService.diagnosisForInPatientList; + List get patientProgressNoteList => + _patientService.patientProgressNoteList; + + List get patientNursingProgressNoteList => + _patientService.patientNursingProgressNoteList; + + List get diagnosisForInPatientList => + _patientService.diagnosisForInPatientList; + List get diabeticChartValuesList => + _patientService.diabeticChartValuesList; 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,12 +228,16 @@ 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; } @@ -230,8 +252,9 @@ 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; } @@ -277,7 +300,8 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { + Future getInPatientList(PatientSearchRequestModel requestModel, + {bool isMyInpatient = false}) async { await getDoctorProfile(); setState(ViewState.Busy); @@ -291,7 +315,8 @@ class PatientViewModel extends BaseViewModel { } } - Future getNursingProgressNote(GetNursingProgressNoteRequestModel requestModel) async { + Future getNursingProgressNote( + GetNursingProgressNoteRequestModel requestModel) async { await getDoctorProfile(); setState(ViewState.Busy); @@ -303,7 +328,9 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } } - Future getDiagnosisForInPatient(GetDiagnosisForInPatientRequestModel requestModel) async { + + Future getDiagnosisForInPatient( + GetDiagnosisForInPatientRequestModel requestModel) async { await getDoctorProfile(); setState(ViewState.Busy); @@ -315,4 +342,23 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future getDiabeticChartValues(PatiantInformtion patient, int resultType) async { + await getDoctorProfile(); + setState(ViewState.Busy); + + GetDiabeticChartValuesRequestModel requestModel = + GetDiabeticChartValuesRequestModel( + patientID: patient.patientId, + admissionNo: int.parse(patient.admissionNo), + patientTypeID: 1, + patientType: 1, resultType: resultType, setupID: "010266"); + await _patientService.getDiabeticChartValues(requestModel); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/routes.dart b/lib/routes.dart index 46602d53..7c93fd0d 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart import 'package:doctor_app_flutter/screens/patient-sick-leave/patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/diabetic_chart.dart'; import 'package:doctor_app_flutter/screens/patients/profile/diagnosis/diagnosis_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; @@ -72,6 +73,7 @@ const String ALL_SPECIAL_LAB_RESULT = 'all-special_lab'; const String GET_OPERATION_REPORT = 'operation-report'; const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; +const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values'; //todo: change the routing way. var routes = { @@ -118,4 +120,5 @@ var routes = { GET_OPERATION_REPORT: (_) => OperationReportScreen(), NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), + DIABETIC_CHART_VALUES: (_) => DiabeticChart(), }; diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart new file mode 100644 index 00000000..ddecac97 --- /dev/null +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -0,0 +1,134 @@ +import 'package:doctor_app_flutter/config/size_config.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/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.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/charts/app_time_series_chart.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'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:flutter/material.dart'; + +import 'diabetic_details_blood_pressurewideget.dart'; + +class DiabeticChart extends StatelessWidget { + DiabeticChart({ + Key key, + }) : super(key: key); + + List timeSeriesData1 = []; + List timeSeriesData2 = []; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return BaseView( + onModelReady: (model) async { + await model.getDiabeticChartValues(patient, 3); + generateData(model); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: SingleChildScrollView( + child: Column(children: [ + timeSeriesData1.length != 0 || timeSeriesData2.length != 0 + ? Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: LineChartForDiabetic( + title: "Blood Glucose", + isOX: false, + timeSeries1: timeSeriesData1, + // timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: + EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.3, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + DiabeticDetails( + diabeticDetailsList: model.diabeticChartValuesList, + ), + ], + ), + ), + ], + ), + ) + : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + child: Center( + child: + AppText(TranslationBase.of(context).vitalSignDetailEmpty), + ), + ), + ],), + ) + ), + ); + } + + generateData(PatientViewModel model) { + if (model.diabeticChartValuesList.length > 0) { + model.diabeticChartValuesList.toList().forEach( + (element) { + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(element.dateChart); + if (element.resultValue.toInt() != 0) + timeSeriesData1.add( + TimeSeriesSales2( + new DateTime( + elementDate.year, elementDate.month, elementDate.day), + element.resultValue.toDouble(), + ), + ); + if (element.resultValue.toInt() != 0) + timeSeriesData2.add( + TimeSeriesSales2( + new DateTime( + elementDate.year, elementDate.month, elementDate.day), + element.resultValue.toDouble(), + ), + ); + }, + ); + } + } +} diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart new file mode 100644 index 00000000..b3b1b581 --- /dev/null +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -0,0 +1,123 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.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/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class DiabeticDetails extends StatefulWidget { + final List diabeticDetailsList; + + DiabeticDetails( + {Key key, this.diabeticDetailsList,}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(0), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Container( + child: Container( + padding: EdgeInsets.all(8), + child: AppText( + TranslationBase.of(context).date, + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + + fontFamily: 'Poppins', + ), + // height: 60, + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + child: AppText( + "Result", + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ), + ], + ), + const Divider( + height: 1, + thickness: 1, + color: Colors.black, + ), + Table( + border: TableBorder( + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + widget.diabeticDetailsList.forEach((diabetic) { + var data = diabetic.resultValue; + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart); + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: AppText( + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + + fontFamily: 'Poppins', + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: AppText( + '${diabetic.resultValue}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + + fontFamily: 'Poppins', + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart new file mode 100644 index 00000000..671230c2 --- /dev/null +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -0,0 +1,237 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartForDiabetic extends StatelessWidget { + final String title; + final List timeSeries1; + final int indexes; + final bool isOX; + + LineChartForDiabetic( + {this.title, this.timeSeries1, this.indexes, this.isOX= false}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Container( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textAlign: TextAlign.center, + ), + ], + ), + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle: -65, + //rotateAngle:-65, + interval: 100, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + // for (int index = 0; index < timeSeries2.length; index++) { + // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + // } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Colors.red], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Colors.red], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + List lineChartData = List(); + if(spots.isNotEmpty){ + lineChartData.add(lineChartBarData1); + } + if(spots2.isNotEmpty){ + lineChartData.add(lineChartBarData2); + } + return lineChartData; + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 6e3d785e..87e9a31b 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -147,6 +147,13 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), + PatientProfileCardModel( + "Diabetic", + "Chart", + DIABETIC_CHART_VALUES, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), ]; return Padding( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 1e593af7..69f45d6e 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -34,12 +34,6 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - /*decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), - border: Border.all(color: Colors.grey, width: 1), - ),*/ margin: EdgeInsets.all(0), child: Container( color: Colors.transparent, @@ -52,13 +46,6 @@ class _VitalSignDetailsWidgetState extends State { child: Container( child: Container( padding: EdgeInsets.all(8), - /*decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ),*/ child: AppText( TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, @@ -74,13 +61,6 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(8), child: Container( - /*decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ),*/ child: AppText( widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, @@ -96,13 +76,6 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(8), child: Container( - /*decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ),*/ child: AppText( widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, From ae0c588d3200786d543eb2a0f5c6f5843becc27c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 26 Oct 2021 08:51:42 +0300 Subject: [PATCH 081/199] get admission orders --- lib/config/config.dart | 3 + lib/core/service/pending_order_service.dart | 44 ++- .../viewModel/pednding_orders_view_model.dart | 17 + .../admission_orders_model.dart | 52 +++ .../admission_orders_request_model.dart | 76 ++++ lib/routes.dart | 3 + .../admission_orders_screen.dart | 351 ++++++++++++++++++ .../profile_gird_for_InPatient.dart | 7 + 8 files changed, 547 insertions(+), 6 deletions(-) create mode 100644 lib/models/admisson_orders/admission_orders_model.dart create mode 100644 lib/models/admisson_orders/admission_orders_request_model.dart create mode 100644 lib/screens/patients/profile/admission-orders/admission_orders_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 53a8f55e..dba66264 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -351,6 +351,9 @@ const GET_OPERATION_REPORT = const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; +const GET_ADMISSION_ORDERS = + "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index 3e6fa497..e6f35bb8 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -1,22 +1,27 @@ 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/admisson_orders/admission_orders_model.dart'; +import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_request_model.dart'; import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_model.dart'; import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; class PendingOrderService extends BaseService { - List get _pendingOrderList => List(); + List _pendingOrderList = List(); List get pendingOrderList => _pendingOrderList; + List _admissionOrderList = List(); + List get admissionOrderList => _admissionOrderList; + Future getPendingOrders( {PendingOrderRequestModel pendingOrderRequestModel, int patientId, int admissionNo}) async { pendingOrderRequestModel = PendingOrderRequestModel( - patientID: patientId, - admissionNo: admissionNo, - patientTypeID: 1, - patientType: 1, - ); + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + setupID: "010266"); hasError = false; await baseAppClient.post(GET_PENDING_ORDERS, @@ -33,4 +38,31 @@ class PendingOrderService extends BaseService { super.error = error; }, body: pendingOrderRequestModel.toJson()); } + + Future getAdmissionOrders( + {AdmissionOrdersRequestModel admissionOrdersRequestModel, + int patientId, + int admissionNo}) async { + admissionOrdersRequestModel = AdmissionOrdersRequestModel( + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + setupID: "010266"); + + hasError = false; + await baseAppClient.post(GET_ADMISSION_ORDERS, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + //admissionOrderList.clear(); + response['List_AdmissionOrders'].forEach( + (v) { + _admissionOrderList.add(AdmissionOrdersModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: admissionOrdersRequestModel.toJson()); + } } diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index fd66413b..3f3e92be 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/pending_order_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/admisson_orders/admission_orders_model.dart'; import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; class PendingOrdersViewModel extends BaseViewModel { @@ -11,6 +12,9 @@ class PendingOrdersViewModel extends BaseViewModel { List get pendingOrdersList => _pendingOrderService.pendingOrderList; + List get admissionOrderList => + _pendingOrderService.admissionOrderList; + Future getPendingOrders({int patientId, int admissionNo}) async { hasError = false; setState(ViewState.Busy); @@ -23,4 +27,17 @@ class PendingOrdersViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future getAdmissionOrders({int patientId, int admissionNo}) async { + hasError = false; + setState(ViewState.Busy); + await _pendingOrderService.getAdmissionOrders( + patientId: patientId, admissionNo: admissionNo); + if (_pendingOrderService.hasError) { + error = _pendingOrderService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/models/admisson_orders/admission_orders_model.dart new file mode 100644 index 00000000..caea4d15 --- /dev/null +++ b/lib/models/admisson_orders/admission_orders_model.dart @@ -0,0 +1,52 @@ +class AdmissionOrdersModel { + int procedureID; + String procedureName; + String procedureNameN; + int orderNo; + int doctorID; + int clinicID; + String createdOn; + int createdBy; + String editedOn; + int editedBy; + + AdmissionOrdersModel( + {this.procedureID, + this.procedureName, + this.procedureNameN, + this.orderNo, + this.doctorID, + this.clinicID, + this.createdOn, + this.createdBy, + this.editedOn, + this.editedBy}); + + AdmissionOrdersModel.fromJson(Map json) { + procedureID = json['ProcedureID']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + orderNo = json['OrderNo']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + createdOn = json['CreatedOn']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + } + + Map toJson() { + final Map data = new Map(); + data['ProcedureID'] = this.procedureID; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['OrderNo'] = this.orderNo; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + return data; + } +} diff --git a/lib/models/admisson_orders/admission_orders_request_model.dart b/lib/models/admisson_orders/admission_orders_request_model.dart new file mode 100644 index 00000000..897bb8f8 --- /dev/null +++ b/lib/models/admisson_orders/admission_orders_request_model.dart @@ -0,0 +1,76 @@ +class AdmissionOrdersRequestModel { + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; + + AdmissionOrdersRequestModel( + {this.isDentalAllowedBackend, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.admissionNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); + + AdmissionOrdersRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + sessionID = json['SessionID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['SessionID'] = this.sessionID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/routes.dart b/lib/routes.dart index 619dd9b6..03b35346 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart import 'package:doctor_app_flutter/screens/patient-sick-leave/patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/admission-orders/admission_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart'; @@ -71,6 +72,7 @@ const String RADIOLOGY_PATIENT = 'radiology-patient'; const String ALL_SPECIAL_LAB_RESULT = 'all-special_lab'; const String GET_OPERATION_REPORT = 'operation-report'; const String PENDING_ORDERS = 'pending-orders'; +const String ADMISSION_ORDERS = 'admission-orders'; //todo: change the routing way. var routes = { @@ -116,4 +118,5 @@ var routes = { ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), GET_OPERATION_REPORT: (_) => OperationReportScreen(), PENDING_ORDERS: (_) => PendingOrdersScreen(), + ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), }; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart new file mode 100644 index 00000000..b55aad9a --- /dev/null +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -0,0 +1,351 @@ +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/pednding_orders_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/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/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class AdmissionOrdersScreen extends StatefulWidget { + const AdmissionOrdersScreen({Key key}) : super(key: key); + + @override + _AdmissionOrdersScreenState createState() => _AdmissionOrdersScreenState(); +} + +class _AdmissionOrdersScreenState extends State { + bool isDischargedPatient = false; + + AuthenticationViewModel authenticationViewModel; + + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String arrivalType = routeArgs['arrivalType']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => model.getAdmissionOrders( + admissionNo: 2014005178, patientId: patient.patientMRN), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + //appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.admissionOrderList == null || + model.admissionOrderList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noDataAvailable) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).admission, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.admissionOrderList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + // bgColor: model.admissionOrderList[index] + // .status == + // 1 && + // authenticationViewModel + // .doctorProfile.doctorID != + // model + // .patientProgressNoteList[ + // index] + // .createdBy + // ? Color(0xFFCC9B14) + // : model.patientProgressNoteList[index] + // .status == + // 4 + // ? Colors.red.shade700 + // : model.patientProgressNoteList[index] + // .status == + // 2 + // ? Colors.green[600] + // : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + width: 10, + ), + SizedBox( + width: 10, + ) + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy + .toString(), + fontSize: 10, + ), + Expanded( + child: AppText( + model + .admissionOrderList[ + index] + .createdBy + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .procedureName + .toString(), + fontSize: 10, + ), + Expanded( + child: AppText( + model + .admissionOrderList[ + index] + .procedureName + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .orderNo + .toString(), + fontSize: 10, + ), + Expanded( + child: AppText( + model + .admissionOrderList[ + index] + .orderNo + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + // Row( + // crossAxisAlignment: + // CrossAxisAlignment + // .start, + // children: [ + // AppText( + // TranslationBase.of( + // context) + // .createdBy + // .toString(), + // fontSize: 10, + // ), + // Expanded( + // child: AppText( + // model + // .admissionOrderList[ + // index] + // .createdBy + // .toString() ?? + // '', + // fontWeight: + // FontWeight.w600, + // fontSize: 12, + // isCopyable: true, + // ), + // ), + // ], + // ), + ], + ), + ), + Column( + children: [ + AppText( + model + .admissionOrderList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .admissionOrderList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .admissionOrderList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .admissionOrderList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // Expanded( + // child: AppText( + // model + // .admissionOrderList[ + // index] + // .notes, + // fontSize: 10, + // isCopyable: true, + // ), + // ), + // ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 8b6fc6f2..598c8fc3 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -140,6 +140,13 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), + PatientProfileCardModel( + "Admission", + "Orders", + ADMISSION_ORDERS, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), ]; return Padding( From 9b87ea8c2289d5b8eb6fd26e63495c77423df6f4 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 26 Oct 2021 08:57:06 +0300 Subject: [PATCH 082/199] get admission orders --- lib/routes.dart | 2 +- .../operation_report/operation_report.dart | 64 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/routes.dart b/lib/routes.dart index 6dfc2b1f..489ed512 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -31,7 +31,7 @@ import 'landing_page.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; -import 'screens/patients/profile/note/progress_note_screen.dart'; + import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 7ce54b7d..5e41092d 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -89,36 +89,36 @@ class _ProgressNoteState extends State { patient, isInpatient: true, ), - body: - Container( - color: Colors.grey[200], - child: Column( - children: [ - AddNewOrder( - onTap: () async { - await locator().logEvent( - eventCategory: "Operation Report Screen", - eventAction: "Update Operation Report ", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateOperationReport( - operationReportViewModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - ), - settings: RouteSettings(name: 'UpdateNoteOrder'), - ), - ); - }, - label: TranslationBase.of(context).operationReports, + body: Container( + color: Colors.grey[200], + child: Column( + children: [ + AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Operation Report Screen", + eventAction: "Update Operation Report ", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateOperationReport( + operationReportViewModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, ), - model.operationReportList == null || - model.operationReportList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote):Expanded( + settings: RouteSettings(name: 'UpdateNoteOrder'), + ), + ); + }, + label: TranslationBase.of(context).operationReports, + ), + model.operationReportList == null || + model.operationReportList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) + : Expanded( child: Container( child: ListView.builder( itemCount: model.operationReportList.length, @@ -532,9 +532,9 @@ class _ProgressNoteState extends State { }), ), ), - ], - ), - ), + ], + ), + ), ), ); } From 056b0bbd78d6529840a9707758d24f8426ae35e6 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 26 Oct 2021 10:38:45 +0300 Subject: [PATCH 083/199] admission orders change --- lib/core/service/operation_report_servive.dart | 17 +++++++++-------- .../admission_orders_screen.dart | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index 4eb7ad8d..fc1333e5 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; class OperationReportService extends BaseService { - List get _operationReportList => List(); + List _operationReportList = List(); List get operationReportList => _operationReportList; Future getOperationReport( @@ -30,13 +30,14 @@ class OperationReportService extends BaseService { }, body: getOperationReportRequestModel.toJson()); } - Future updateOperationReport(CreateUpdateOperationReportRequestModel createUpdateOperationReport) async { + Future updateOperationReport( + CreateUpdateOperationReportRequestModel + createUpdateOperationReport) async { await baseAppClient.post(UPDATE_OPERATION_REPORT, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: createUpdateOperationReport.toJson(),isFallLanguage: true); + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: createUpdateOperationReport.toJson(), isFallLanguage: true); } } diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index b55aad9a..e73e02de 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -38,7 +38,8 @@ class _AdmissionOrdersScreenState extends State { isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: 2014005178, patientId: patient.patientMRN), + admissionNo: int.parse(patient.admissionNo), + patientId: patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, From 514e6c81c75d2b4a4e6bc459bb8aa00320adb56c Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 26 Oct 2021 11:14:22 +0300 Subject: [PATCH 084/199] finish diabetic --- .../model/diabetic_chart/DiabeticType.dart | 21 ++ lib/core/viewModel/patient_view_model.dart | 18 +- .../diabetic_chart/diabetic_chart.dart | 255 +++++++++++++----- 3 files changed, 223 insertions(+), 71 deletions(-) create mode 100644 lib/core/model/diabetic_chart/DiabeticType.dart diff --git a/lib/core/model/diabetic_chart/DiabeticType.dart b/lib/core/model/diabetic_chart/DiabeticType.dart new file mode 100644 index 00000000..26641e61 --- /dev/null +++ b/lib/core/model/diabetic_chart/DiabeticType.dart @@ -0,0 +1,21 @@ +class DiabeticType { + int value; + String nameEn; + String nameAr; + + DiabeticType({this.value, this.nameEn, this.nameAr}); + + DiabeticType.fromJson(Map json) { + value = json['value']; + nameEn = json['nameEn']; + nameAr = json['nameAr']; + } + + Map toJson() { + final Map data = new Map(); + data['value'] = this.value; + data['nameEn'] = this.nameEn; + data['nameAr'] = this.nameAr; + return data; + } +} diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index ae52d07e..1d5f087a 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -60,6 +60,7 @@ class PatientViewModel extends BaseViewModel { List get diagnosisForInPatientList => _patientService.diagnosisForInPatientList; + List get diabeticChartValuesList => _patientService.diabeticChartValuesList; @@ -343,20 +344,29 @@ class PatientViewModel extends BaseViewModel { } } - Future getDiabeticChartValues(PatiantInformtion patient, int resultType) async { + Future getDiabeticChartValues(PatiantInformtion patient, int resultType, + {bool isLocalBusy = false}) async { await getDoctorProfile(); - setState(ViewState.Busy); + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); GetDiabeticChartValuesRequestModel requestModel = GetDiabeticChartValuesRequestModel( patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1, - patientType: 1, resultType: resultType, setupID: "010266"); + patientType: 1, + resultType: resultType, + setupID: "010266"); await _patientService.getDiabeticChartValues(requestModel); if (_patientService.hasError) { error = _patientService.error; - setState(ViewState.ErrorLocal); + if (isLocalBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index ddecac97..1aea89c2 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -1,11 +1,15 @@ 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/diabetic_chart/DiabeticType.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/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.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/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; @@ -13,95 +17,192 @@ 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'; 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:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'diabetic_details_blood_pressurewideget.dart'; -class DiabeticChart extends StatelessWidget { +class DiabeticChart extends StatefulWidget { DiabeticChart({ Key key, }) : super(key: key); + @override + _DiabeticChartState createState() => _DiabeticChartState(); +} + +class _DiabeticChartState extends State { List timeSeriesData1 = []; + List timeSeriesData2 = []; + List diabeticType = [ + DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1), + DiabeticType(nameAr: "Urine Acet", nameEn: "Urine Acet", value: 2), + DiabeticType(nameAr: "Blood Glucose", nameEn: "Blood Glucose", value: 3), + DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) + ]; + + DiabeticType selectedDiabeticType; + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + ProjectViewModel projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) async { - await model.getDiabeticChartValues(patient, 3); + selectedDiabeticType = diabeticType[2]; + + await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false); generateData(model); }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileAppBar( - patient, - isInpatient: true, - ), - body: SingleChildScrollView( - child: Column(children: [ - timeSeriesData1.length != 0 || timeSeriesData2.length != 0 - ? Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12)), - child: LineChartForDiabetic( - title: "Blood Glucose", - isOX: false, - timeSeries1: timeSeriesData1, - // timeSeries2: timeSeriesData2, - indexes: timeSeriesData1.length ~/ 5.5, - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: - EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).graphDetails, - fontSize: SizeConfig.textMultiplier * 2.3, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - SizedBox( - height: 8, - ), - DiabeticDetails( - diabeticDetailsList: model.diabeticChartValuesList, + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: SingleChildScrollView( + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.7, + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedDiabeticType.value, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return diabeticType + .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( + diabeticType + .length + .toString(), + color: Colors.white, + fontSize: projectsProvider + .isArabic + ? 10 + : 11, + textAlign: + TextAlign.center, + ), + )), + ], + ), + AppText( + selectedDiabeticType.nameEn, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + await onChangeFunc(newValue, model, patient); + setState(() { + + }); + }, + items: diabeticType + .map((item) { + return DropdownMenuItem( + child: AppText( + item.nameEn, + textAlign: TextAlign.left, + ), + value: item.value, + ); + }).toList(), + )), + ), + timeSeriesData1.length != 0 || timeSeriesData2.length != 0 + ? Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: LineChartForDiabetic( + title: selectedDiabeticType.nameEn, + isOX: false, + timeSeries1: timeSeriesData1, + // timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + ), + Container( + margin: EdgeInsets.symmetric( + horizontal: 8, vertical: 16), + padding: EdgeInsets.only( + top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.3, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + DiabeticDetails( + diabeticDetailsList: + model.diabeticChartValuesList, + ), + ], + ), + ), + ], ), - ], - ), - ), - ], - ), - ) - : Container( - width: double.infinity, - height: MediaQuery.of(context).size.height, - child: Center( - child: - AppText(TranslationBase.of(context).vitalSignDetailEmpty), - ), + ) + : ErrorMessage(error: TranslationBase.of(context).noItem), + ], ), - ],), - ) - ), + )), ); } @@ -130,5 +231,25 @@ class DiabeticChart extends StatelessWidget { }, ); } + } + + onChangeFunc(newValue, PatientViewModel model, patient) async { + GifLoaderDialogUtils.showMyDialog(context); + setState(() { + selectedDiabeticType = diabeticType[newValue-1]; + timeSeriesData1.clear(); + timeSeriesData2.clear(); + }); + + await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true); + if(model.state == ViewState.ErrorLocal){ + Helpers.showErrorToast(model.error); + } + generateData(model); + GifLoaderDialogUtils.hideDialog(context); + + + + } } From 7b8312fe260a1ad8205bdf55e47c06c51363e383 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 26 Oct 2021 11:57:19 +0300 Subject: [PATCH 085/199] make register patient feature --- assets/images/patient_register.png | Bin 0 -> 969 bytes lib/config/localized_values.dart | 4 +- .../patient/PatientRegisterService.dart | 5 + .../viewModel/PatientRegisterViewModel.dart | 8 + lib/locator.dart | 4 + lib/screens/home/home_patient_card.dart | 47 ++-- lib/screens/home/home_screen.dart | 23 +- .../profile/UCAF/page-stepper-widget.dart | 12 +- .../register_patient/RegisterPatientPage.dart | 212 ++++++++++++++++++ .../RegisterSearchPatientPage.dart | 201 +++++++++++++++++ lib/util/translations_delegate_base.dart | 2 + .../text_fields/app-textfield-custom.dart | 1 + 12 files changed, 496 insertions(+), 23 deletions(-) create mode 100644 assets/images/patient_register.png create mode 100644 lib/core/service/patient/PatientRegisterService.dart create mode 100644 lib/core/viewModel/PatientRegisterViewModel.dart create mode 100644 lib/screens/patients/register_patient/RegisterPatientPage.dart create mode 100644 lib/screens/patients/register_patient/RegisterSearchPatientPage.dart diff --git a/assets/images/patient_register.png b/assets/images/patient_register.png new file mode 100644 index 0000000000000000000000000000000000000000..c55935bc90aff3c7976a51d5cb5d7dcaa8a4df60 GIT binary patch literal 969 zcmb`GUr19?9LK-sp1ZMocjxZi3=GFwYlJToO^ArVayVH9)wIwgVw-ah>0EP>FFgoJ zF9m}L@=b&&iLxU4_cX#FLNsedX%A7o1U+a}2$8qnQO1mn2>Kq*IUj!i&hMPdHD8%; zq3;ey!e9(wG+@4yY9gV~(f!eV;mF?RWrtJ+lB5H@>0CD2(&TIJIP4R)l46PeOo`Xn zsqVLzqB`(AxQ734CZ#LcpP-<5nz<|;PR(`^SEg2YKyZA8&kD}AMMD%bLR^zt#qm{q zGMC9w%wrLs$Yce-A>Ps3b3&XYBs$iT>4UAbx6|~XA5pZRiTJ;&{GNTIz_zad&zEiS zVc_l%P&He&1x5hpY2eOuCYFsYHzU(3b$0`wF9VJa!2J|ZJ4=n0bIaf24|nxZj)(5q zMl!cGwD&U&n40SwJLbRc zI#b=gZhCw&9>SBh`R1Kh7H{8MTsqG;^Wo49b>hqR?+;mZ@PquoS-jdh7WlNM^3=r* G=Ifu<+MR^} literal 0 HcmV?d00001 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b711124f..93c3a2de 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -710,5 +710,7 @@ const Map> localizedValues = { "ar":"نوع الطلب"}, "special": {"en": "Special", "ar": "خاص"}, "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , - "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"} + "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, + "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, + "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, }; diff --git a/lib/core/service/patient/PatientRegisterService.dart b/lib/core/service/patient/PatientRegisterService.dart new file mode 100644 index 00000000..a7013a3c --- /dev/null +++ b/lib/core/service/patient/PatientRegisterService.dart @@ -0,0 +1,5 @@ +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class PatientRegisterService extends BaseService{ + +} \ No newline at end of file diff --git a/lib/core/viewModel/PatientRegisterViewModel.dart b/lib/core/viewModel/PatientRegisterViewModel.dart new file mode 100644 index 00000000..43aa7500 --- /dev/null +++ b/lib/core/viewModel/PatientRegisterViewModel.dart @@ -0,0 +1,8 @@ +import 'package:doctor_app_flutter/core/service/patient/PatientRegisterService.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class PatientRegisterViewModel extends BaseViewModel { + PatientRegisterService _service = locator(); +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index b5f651eb..04266041 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -23,6 +23,7 @@ import 'core/service/patient/DischargedPatientService.dart'; import 'core/service/patient/LiveCarePatientServices.dart'; import 'core/service/patient/MyReferralPatientService.dart'; import 'core/service/patient/PatientMuseService.dart'; +import 'core/service/patient/PatientRegisterService.dart'; import 'core/service/patient/ReferralService.dart'; import 'core/service/patient/out_patient_service.dart'; import 'core/service/patient/patient-doctor-referral-service.dart'; @@ -49,6 +50,7 @@ import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart'; import 'core/viewModel/PatientMedicalReportViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; +import 'core/viewModel/PatientRegisterViewModel.dart'; import 'core/viewModel/PatientSearchViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; @@ -103,6 +105,7 @@ void setupLocator() { locator.registerLazySingleton(() => VideoCallService()); locator.registerLazySingleton(() => AnalyticsService()); locator.registerLazySingleton(() => OperationReportService()); + locator.registerLazySingleton(() => PatientRegisterService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -132,4 +135,5 @@ void setupLocator() { locator.registerFactory(() => PatientMedicalReportViewModel()); locator.registerFactory(() => ScanQrViewModel()); locator.registerFactory(() => OperationReportViewModel()); + locator.registerFactory(() => PatientRegisterViewModel()); } diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index b388a7e2..a0d0bce7 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { final Color backgroundColor; final IconData cardIcon; + final String cardIconImage; final Color backgroundIconColor; final String text; final Color textColor; @@ -15,11 +16,12 @@ class HomePatientCard extends StatelessWidget { HomePatientCard({ @required this.backgroundColor, @required this.backgroundIconColor, - @required this.cardIcon, + this.cardIcon, + this.cardIconImage, @required this.text, @required this.textColor, @required this.onTap, - this.iconSize = 30, + this.iconSize = 30, }); @override @@ -38,24 +40,41 @@ class HomePatientCard extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(top: 18, left: 10), - color:Colors.transparent, - - child: Icon( - cardIcon, - size: iconSize * 2, - color: backgroundIconColor, - ), + color: Colors.transparent, + child: cardIcon != null + ? Icon( + cardIcon, + size: iconSize * 2, + color: backgroundIconColor, + ) + : IconButton( + icon: Image.asset( + 'assets/images/patient_register.png', + width: iconSize * 2, + height: iconSize * 2, + fit: BoxFit.fill, + ), + iconSize: iconSize * 2, + color: backgroundIconColor, + onPressed: () => null, + ), ), Container( child: Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - cardIcon, - size: iconSize, - color: textColor, - ), + cardIcon != null + ? Icon( + cardIcon, + size: iconSize, + color: textColor, + ) + : Image.asset( + cardIconImage, + height: iconSize, + width: iconSize, + ), SizedBox( height: 4, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 495a70b0..1ab61717 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/screens/patients/In_patient/in_patient_screen import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; 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/screens/patients/register_patient/RegisterPatientPage.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'; @@ -254,8 +255,8 @@ class _HomeScreenState extends State { else Container( child: ErrorMessage( - error: model.error, - )), + error: model.error, + )), FractionallySizedBox( // widthFactor: 0.90, child: Container( @@ -313,7 +314,6 @@ class _HomeScreenState extends State { ), ) ]), - ]), ), ); @@ -396,6 +396,23 @@ class _HomeScreenState extends State { )); changeColorIndex(); + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + cardIconImage: 'assets/images/patient_register.png', + textColor: textColors[colorIndex], + text: TranslationBase.of(context).registerNewPatient, + onTap: () { + Navigator.push( + context, + FadePage( + page: RegisterPatientPage(), + ), + ); + }, + )); + changeColorIndex(); + patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index da0381ed..6d9838f4 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -16,8 +16,9 @@ class PageStepperWidget extends StatelessWidget { final int stepsCount; final int currentStepIndex; final Size screenSize; + final List stepsTitles; - PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize}); + PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize, this.stepsTitles}); @override Widget build(BuildContext context) { @@ -33,10 +34,10 @@ class PageStepperWidget extends StatelessWidget { for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) StepWidget(i, true, i == stepsCount, i < currentStepIndex, - dividerWidth) + dividerWidth, stepsTitles: stepsTitles,) else StepWidget(i, false, i == stepsCount, i < currentStepIndex, - dividerWidth) + dividerWidth, stepsTitles: stepsTitles,) ], ) ], @@ -52,9 +53,10 @@ class StepWidget extends StatelessWidget { final bool isFinalStep; final bool isStepFinish; final double dividerWidth; + final List stepsTitles; StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, - this.dividerWidth); + this.dividerWidth, {this.stepsTitles}); @override Widget build(BuildContext context) { @@ -106,7 +108,7 @@ class StepWidget extends StatelessWidget { height: 8, ), AppText( - "${TranslationBase.of(context).step} $index", + stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles[index - 1]}", fontWeight: FontWeight.bold, color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, fontFamily: 'Poppins', diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart new file mode 100644 index 00000000..ab85d820 --- /dev/null +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -0,0 +1,212 @@ +import 'package:doctor_app_flutter/core/viewModel/PatientRegisterViewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.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/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; + +import 'RegisterSearchPatientPage.dart'; + +class RegisterPatientPage extends StatefulWidget { + const RegisterPatientPage({Key key}) : super(key: key); + + @override + _RegisterPatientPageState createState() => _RegisterPatientPageState(); +} + +class _RegisterPatientPageState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 0; + bool _isLoading = false; + + changePageViewIndex(pageIndex, {isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); + _controller.jumpToPage(pageIndex); + setState(() { + _currentIndex = pageIndex; + }); + } + + void changeLoadingState(bool isLoading) { + setState(() { + _isLoading = isLoading; + }); + } + + @override + void initState() { + _controller = new PageController(); + super.initState(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + isLoading: _isLoading, + appBar: PatientSearchHeader( + title: TranslationBase.of(context).registeraPatient, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + PageStepperWidget( + stepsCount: 3, + currentStepIndex: _currentIndex + 1, + screenSize: screenSize, + stepsTitles: [ + "Search", + "Activation", + "Confirmation", + ], + ), + SizedBox( + height: 10, + ), + Expanded( + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + RegisterSearchPatientPage(), + ]), + ), + ), + ], + ), + )), + _isLoading + ? Container( + height: 0, + ) + : pagerButtons(model), + ], + ), + ), + ); + } + + Widget pagerButtons(PatientRegisterViewModel model) { + switch (_currentIndex) { + case 2: + return Container( + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).noteConfirm, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFF359846), + color: Color(0xFF359846), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () {}, + ), + ), + ), + ], + ), + ); + default: + return Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () { + changePageViewIndex(_currentIndex + 1); + }, + ), + ), + ), + ], + ), + ); + } + } +} diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart new file mode 100644 index 00000000..3aafe5bd --- /dev/null +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -0,0 +1,201 @@ +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/PatientRegisterViewModel.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/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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'; + +class RegisterSearchPatientPage extends StatefulWidget { + const RegisterSearchPatientPage({Key key}) : super(key: key); + + @override + _RegisterSearchPatientPageState createState() => + _RegisterSearchPatientPageState(); +} + +class _RegisterSearchPatientPageState extends State { + String countryError; + dynamic _selectedCountry; + + final _phoneController = TextEditingController(); + String phoneError; + + final _idController = TextEditingController(); + String idError; + + DateTime _birthDate; + String birthdateError; + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + children: [ + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please enter mobile number or Identification number", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Country", + isTextFieldHasSuffix: true, + validationError: countryError, + dropDownText: _selectedCountry != null + ? _selectedCountry['nameEn'] + : null, + enabled: false, + /*onClick: model.dietTypesList != null && model.dietTypesList.length > 0 + ? () { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { + setState(() { + _selectedCountry = selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog(context); + await model + .getDietTypes(patient.patientId) + .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.dietTypesList.length > 0) { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { + setState(() { + _selectedCountry = selectedValue; + }); + }); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showErrorToast("Empty List"); + } + },*/ + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Phone Number", + inputType: TextInputType.phone, + controller: _phoneController, + validationError: phoneError, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "ID Number", + inputType: TextInputType.phone, + controller: _idController, + validationError: idError, + ), + SizedBox( + height: 12, + ), + AppText( + "Calender", + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w800, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Birthdate", + dropDownText: _birthDate != null + ? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy-MM-dd")}" + : null, + enabled: false, + isTextFieldHasSuffix: true, + validationError: birthdateError, + suffixIcon: IconButton( + icon: Icon( + Icons.calendar_today, + color: Colors.black, + ), + onPressed: null, + ), + onClick: () { + if (_birthDate == null) { + _birthDate = DateTime.now(); + } + _selectDate(context, _birthDate, (picked) { + setState(() { + _birthDate = picked; + }); + }); + }, + ), + ], + ), + ), + ), + ), + ], + ), + ), + ); + } + + Future _selectDate(BuildContext context, DateTime dateTime, + Function(DateTime picked) updateDate) async { + final DateTime picked = await showDatePicker( + context: context, + initialDate: dateTime, + firstDate: DateTime.now(), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != dateTime) { + updateDate(picked); + } + } + + void openListDialogField(String attributeName, String attributeValueId, + List list, Function(dynamic selectedValue) okFunction) { + ListSelectDialog dialog = ListSelectDialog( + list: list, + attributeName: attributeName, + attributeValueId: attributeValueId, + usingSearch: true, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + okFunction(selectedValue); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 59f66811..58e17a94 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1106,6 +1106,8 @@ class TranslationBase { String get requestType => localizedValues['requestType'][locale.languageCode]; String get allClinic => localizedValues['allClinic'][locale.languageCode]; String get notReplied => localizedValues['notReplied'][locale.languageCode]; + String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; + String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; } diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index cd97c8d4..086375bb 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -146,6 +146,7 @@ class _AppTextFieldCustomState extends State { ? TextAlign.right : TextAlign.left, focusNode: _focusNode, + textAlignVertical: TextAlignVertical.center, decoration: TextFieldsUtils .textFieldSelectorDecoration( widget.hintText, null, true), From 9689044be791dcd9e6570c246a2610f11adff8cd Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 26 Oct 2021 12:14:39 +0300 Subject: [PATCH 086/199] Add models and create vm, services for patient registration --- android/app/src/main/AndroidManifest.xml | 2 +- lib/config/config.dart | 11 +- .../CheckActivationCodeModel.dart | 112 +++++++++++ .../CheckPatientForRegistrationModel.dart | 80 ++++++++ .../PatientRegistrationModel.dart | 185 ++++++++++++++++++ ...PNotificationTypeForRegistrationModel.dart | 109 +++++++++++ .../service/PatientRegistrationService.dart | 51 +++++ lib/core/service/base/base_service.dart | 34 ---- .../PatientRegistrationViewModel.dart | 59 ++++++ .../viewModel/patient-referral-viewmodel.dart | 10 - lib/locator.dart | 4 + 11 files changed, 610 insertions(+), 47 deletions(-) create mode 100644 lib/core/model/PatientRegistration/CheckActivationCodeModel.dart create mode 100644 lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart create mode 100644 lib/core/model/PatientRegistration/PatientRegistrationModel.dart create mode 100644 lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart create mode 100644 lib/core/service/PatientRegistrationService.dart create mode 100644 lib/core/viewModel/PatientRegistrationViewModel.dart diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 82805ecc..9cd98ee3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -30,7 +30,7 @@ json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + forRegisteration = json['ForRegisteration']; + activationCode = json['activationCode']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + healthId = json['HealthId']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['ForRegisteration'] = this.forRegisteration; + data['activationCode'] = this.activationCode; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['HealthId'] = this.healthId; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart new file mode 100644 index 00000000..3465cf8d --- /dev/null +++ b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart @@ -0,0 +1,80 @@ +class CheckPatientForRegistrationModel { + int patientIdentificationID; + int patientMobileNumber; + String zipCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + int patientID; + bool isRegister; + String dOB; + int isHijri; + + CheckPatientForRegistrationModel( + {this.patientIdentificationID, + this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.isRegister, + this.dOB, + this.isHijri}); + + CheckPatientForRegistrationModel.fromJson(Map json) { + patientIdentificationID = json['PatientIdentificationID']; + patientMobileNumber = json['PatientMobileNumber']; + zipCode = json['ZipCode']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + isRegister = json['isRegister']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['ZipCode'] = this.zipCode; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['isRegister'] = this.isRegister; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart new file mode 100644 index 00000000..83ff53d7 --- /dev/null +++ b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart @@ -0,0 +1,185 @@ +class PatientRegistrationModel { + Patientobject patientobject; + String patientIdentificationID; + String patientMobileNumber; + String logInTokenID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + String dOB; + int isHijri; + String healthId; + String zipCode; + + PatientRegistrationModel( + {this.patientobject, + this.patientIdentificationID, + this.patientMobileNumber, + this.logInTokenID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.dOB, + this.isHijri, + this.healthId, + this.zipCode}); + + PatientRegistrationModel.fromJson(Map json) { + patientobject = json['Patientobject'] != null + ? new Patientobject.fromJson(json['Patientobject']) + : null; + patientIdentificationID = json['PatientIdentificationID']; + patientMobileNumber = json['PatientMobileNumber']; + logInTokenID = json['LogInTokenID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + healthId = json['HealthId']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + if (this.patientobject != null) { + data['Patientobject'] = this.patientobject.toJson(); + } + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['LogInTokenID'] = this.logInTokenID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['HealthId'] = this.healthId; + data['ZipCode'] = this.zipCode; + return data; + } +} + +class Patientobject { + bool tempValue; + int patientIdentificationType; + String patientIdentificationNo; + int mobileNumber; + int patientOutSA; + String firstNameN; + String middleNameN; + String lastNameN; + String firstName; + String middleName; + String lastName; + String strDateofBirth; + String dateofBirth; + int gender; + String nationalityID; + String dateofBirthN; + String emailAddress; + String sourceType; + String preferredLanguage; + String marital; + String eHealthIDField; + + Patientobject( + {this.tempValue, + this.patientIdentificationType, + this.patientIdentificationNo, + this.mobileNumber, + this.patientOutSA, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.firstName, + this.middleName, + this.lastName, + this.strDateofBirth, + this.dateofBirth, + this.gender, + this.nationalityID, + this.dateofBirthN, + this.emailAddress, + this.sourceType, + this.preferredLanguage, + this.marital, + this.eHealthIDField}); + + Patientobject.fromJson(Map json) { + tempValue = json['TempValue']; + patientIdentificationType = json['PatientIdentificationType']; + patientIdentificationNo = json['PatientIdentificationNo']; + mobileNumber = json['MobileNumber']; + patientOutSA = json['PatientOutSA']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + strDateofBirth = json['StrDateofBirth']; + dateofBirth = json['DateofBirth']; + gender = json['Gender']; + nationalityID = json['NationalityID']; + dateofBirthN = json['DateofBirthN']; + emailAddress = json['EmailAddress']; + sourceType = json['SourceType']; + preferredLanguage = json['PreferredLanguage']; + marital = json['Marital']; + eHealthIDField = json['eHealthIDField']; + } + + Map toJson() { + final Map data = new Map(); + data['TempValue'] = this.tempValue; + data['PatientIdentificationType'] = this.patientIdentificationType; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['MobileNumber'] = this.mobileNumber; + data['PatientOutSA'] = this.patientOutSA; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['StrDateofBirth'] = this.strDateofBirth; + data['DateofBirth'] = this.dateofBirth; + data['Gender'] = this.gender; + data['NationalityID'] = this.nationalityID; + data['DateofBirthN'] = this.dateofBirthN; + data['EmailAddress'] = this.emailAddress; + data['SourceType'] = this.sourceType; + data['PreferredLanguage'] = this.preferredLanguage; + data['Marital'] = this.marital; + data['eHealthIDField'] = this.eHealthIDField; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart new file mode 100644 index 00000000..8244a95f --- /dev/null +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -0,0 +1,109 @@ +class SendActivationCodeByOTPNotificationTypeForRegistrationModel { + int patientMobileNumber; + String mobileNo; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + int nationalID; + int patientIdentificationID; + int oTPSendType; + int languageID; + double versionID; + int channel; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String dOB; + int isHijri; + String healthId; + + SendActivationCodeByOTPNotificationTypeForRegistrationModel( + {this.patientMobileNumber, + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); + + SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( + Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + oTPSendType = json['OTP_SendType']; + languageID = json['LanguageID']; + versionID = json['VersionID']; + channel = json['Channel']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + healthId = json['HealthId']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['OTP_SendType'] = this.oTPSendType; + data['LanguageID'] = this.languageID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['HealthId'] = this.healthId; + return data; + } +} diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart new file mode 100644 index 00000000..fefa9021 --- /dev/null +++ b/lib/core/service/PatientRegistrationService.dart @@ -0,0 +1,51 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class PatientRegistrationService extends BaseService { + checkPatientForRegistration( + CheckPatientForRegistrationModel registrationModel) async { + hasError = false; + await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } + + sendActivationCodeByOTPNotificationType( + SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel) async { + hasError = false; + await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } + + checkActivationCode(CheckActivationCodeModel registrationModel) async { + hasError = false; + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_PATIENT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } + + registrationPatient(PatientRegistrationModel registrationModel) async { + hasError = false; + await baseAppClient.post(PATIENT_REGISTRATION, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } +} diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index ade01d9b..58526da7 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -44,38 +43,5 @@ class BaseService { } } - Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ - hasError = false; - Map body = Map(); - body['From'] = fromDate == null ? date : fromDate; - body['To'] = date; - body['PageIndex'] = 0; - body['PageSize'] = 0; - if(patientMrn != -1){ - body['PatientMRN'] = patientMrn; - } - if(appointmentNo != -1){ - body['AppointmentNo'] = appointmentNo; - } - - await baseAppClient.post( - ARRIVED_PATIENT_URL, - onSuccess: (dynamic response, int statusCode) { - patientArrivalList.clear(); - - if(response['patientArrivalList']['entityList'] != null){ - response['patientArrivalList']['entityList'].forEach((v) { - PatiantInformtion item = PatiantInformtion.fromJson(v); - patientArrivalList.add(item); - }); - } - }, - onFailure: (String error, int statusCode) { - hasError = true; - this.error = error; - }, - body: body, - ); - } } diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart new file mode 100644 index 00000000..6dddffcd --- /dev/null +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -0,0 +1,59 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/service/PatientRegistrationService.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class PatientRegistrationViewModel extends BaseViewModel { + PatientRegistrationService _patientRegistrationService = + locator(); + + Future checkPatientForRegistration( + CheckPatientForRegistrationModel registrationModel) async { + setState(ViewState.Busy); + await _patientRegistrationService + .checkPatientForRegistration(registrationModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future sendActivationCodeByOTPNotificationType( + SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel) async { + setState(ViewState.Busy); + await _patientRegistrationService + .sendActivationCodeByOTPNotificationType(registrationModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future checkActivationCode(CheckActivationCodeModel registrationModel) async { + setState(ViewState.Busy); + await _patientRegistrationService.checkActivationCode(registrationModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future registrationPatient(PatientRegistrationModel registrationModel) async { + setState(ViewState.Busy); + await _patientRegistrationService.registrationPatient(registrationModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 4240e848..93635629 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -256,17 +256,7 @@ class PatientReferralViewModel extends BaseViewModel { } } - Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { - setState(ViewState.Busy); - await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn); - if (_referralPatientService.hasError) { - error = _referralPatientService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } Future getReferralFrequencyList() async { setState(ViewState.Busy); diff --git a/lib/locator.dart b/lib/locator.dart index b5f651eb..08efa5e4 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,6 +14,7 @@ import 'package:get_it/get_it.dart'; import 'core/service/AnalyticsService.dart'; import 'core/service/NavigationService.dart'; +import 'core/service/PatientRegistrationService.dart'; import 'core/service/VideoCallService.dart'; import 'core/service/home/dasboard_service.dart'; import 'core/service/home/doctor_reply_service.dart'; @@ -49,6 +50,7 @@ import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart'; import 'core/viewModel/PatientMedicalReportViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; +import 'core/viewModel/PatientRegistrationViewModel.dart'; import 'core/viewModel/PatientSearchViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; @@ -103,6 +105,7 @@ void setupLocator() { locator.registerLazySingleton(() => VideoCallService()); locator.registerLazySingleton(() => AnalyticsService()); locator.registerLazySingleton(() => OperationReportService()); + locator.registerLazySingleton(() => PatientRegistrationService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -132,4 +135,5 @@ void setupLocator() { locator.registerFactory(() => PatientMedicalReportViewModel()); locator.registerFactory(() => ScanQrViewModel()); locator.registerFactory(() => OperationReportViewModel()); + locator.registerFactory(() => PatientRegistrationViewModel()); } From 331b27c3ec164b8d7659e3e65c60ed983133cb0a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 26 Oct 2021 12:19:35 +0300 Subject: [PATCH 087/199] fix merge issue --- lib/core/service/patient/PatientRegisterService.dart | 5 ----- lib/core/viewModel/PatientRegisterViewModel.dart | 8 -------- lib/locator.dart | 5 +---- .../register_patient/RegisterPatientPage.dart | 7 +++---- .../register_patient/RegisterSearchPatientPage.dart | 11 ++++++----- 5 files changed, 10 insertions(+), 26 deletions(-) delete mode 100644 lib/core/service/patient/PatientRegisterService.dart delete mode 100644 lib/core/viewModel/PatientRegisterViewModel.dart diff --git a/lib/core/service/patient/PatientRegisterService.dart b/lib/core/service/patient/PatientRegisterService.dart deleted file mode 100644 index a7013a3c..00000000 --- a/lib/core/service/patient/PatientRegisterService.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; - -class PatientRegisterService extends BaseService{ - -} \ No newline at end of file diff --git a/lib/core/viewModel/PatientRegisterViewModel.dart b/lib/core/viewModel/PatientRegisterViewModel.dart deleted file mode 100644 index 43aa7500..00000000 --- a/lib/core/viewModel/PatientRegisterViewModel.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:doctor_app_flutter/core/service/patient/PatientRegisterService.dart'; -import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; - -import '../../locator.dart'; - -class PatientRegisterViewModel extends BaseViewModel { - PatientRegisterService _service = locator(); -} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 4e1d52fd..243905d8 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -26,7 +26,6 @@ import 'core/service/patient/DischargedPatientService.dart'; import 'core/service/patient/LiveCarePatientServices.dart'; import 'core/service/patient/MyReferralPatientService.dart'; import 'core/service/patient/PatientMuseService.dart'; -import 'core/service/patient/PatientRegisterService.dart'; import 'core/service/patient/ReferralService.dart'; import 'core/service/patient/out_patient_service.dart'; import 'core/service/patient/patient-doctor-referral-service.dart'; @@ -54,7 +53,6 @@ import 'core/viewModel/LiveCarePatientViewModel.dart'; import 'core/viewModel/PatientMedicalReportViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; import 'core/viewModel/PatientRegistrationViewModel.dart'; -import 'core/viewModel/PatientRegisterViewModel.dart'; import 'core/viewModel/PatientSearchViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; @@ -110,7 +108,6 @@ void setupLocator() { locator.registerLazySingleton(() => AnalyticsService()); locator.registerLazySingleton(() => OperationReportService()); locator.registerLazySingleton(() => PendingOrderService()); - locator.registerLazySingleton(() => PatientRegisterService()); locator.registerLazySingleton(() => PatientRegistrationService()); /// View Model @@ -143,5 +140,5 @@ void setupLocator() { locator.registerFactory(() => OperationReportViewModel()); locator.registerFactory(() => PatientRegistrationViewModel()); locator.registerFactory(() => PendingOrdersViewModel()); - locator.registerFactory(() => PatientRegisterViewModel()); + } diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index ab85d820..8b79225d 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -1,6 +1,5 @@ -import 'package:doctor_app_flutter/core/viewModel/PatientRegisterViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -53,7 +52,7 @@ class _RegisterPatientPageState extends State Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return BaseView( + return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -116,7 +115,7 @@ class _RegisterPatientPageState extends State ); } - Widget pagerButtons(PatientRegisterViewModel model) { + Widget pagerButtons(PatientRegistrationViewModel model) { switch (_currentIndex) { case 2: return Container( diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 3aafe5bd..5260cc3b 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -1,14 +1,15 @@ 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/PatientRegisterViewModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.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/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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'; @@ -37,7 +38,7 @@ class _RegisterSearchPatientPageState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return BaseView( + return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, From 93bcfff7a0b5527331e133b1c3d1847d2254ea49 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 26 Oct 2021 15:26:10 +0300 Subject: [PATCH 088/199] fix doctors name --- lib/config/config.dart | 2 +- ...GetDiagnosisForInPatientResponseModel.dart | 6 +- .../GetNursingProgressNoteResposeModel.dart | 18 +- .../service/operation_report_servive.dart | 5 +- lib/routes.dart | 2 + .../profile/diagnosis/diagnosis_screen.dart | 2 +- .../nursing_note/nursing_note_screen.dart | 2 +- .../operation_report/operation_report.dart | 455 ++++++------------ .../update_operation_report.dart | 30 +- 9 files changed, 192 insertions(+), 330 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index fd14ecc6..078cfdc0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -346,7 +346,7 @@ const GET_MEDICATION_FOR_IN_PATIENT = const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; const GET_OPERATION_REPORT = - "/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; + "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart index c4a4e528..1ec48964 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -8,6 +8,8 @@ class GetDiagnosisForInPatientResponseModel { String createdOn; int editedBy; String editedOn; + String createdByName; + String editedByName; GetDiagnosisForInPatientResponseModel( {this.iCDCode10ID, @@ -18,7 +20,7 @@ class GetDiagnosisForInPatientResponseModel { this.createdBy, this.createdOn, this.editedBy, - this.editedOn}); + this.editedOn, this.createdByName}); GetDiagnosisForInPatientResponseModel.fromJson(Map json) { iCDCode10ID = json['ICDCode10ID']; @@ -30,6 +32,8 @@ class GetDiagnosisForInPatientResponseModel { createdOn = json['CreatedOn']; editedBy = json['EditedBy']; editedOn = json['EditedOn']; + createdByName = json['CreatedByName']; + editedByName = json['EditedByName']; } Map toJson() { diff --git a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart index 55ede866..fb7fbcec 100644 --- a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart @@ -6,13 +6,19 @@ class GetNursingProgressNoteResposeModel { dynamic editedBy; dynamic editedOn; + String createdByName; + + String editedByName; + GetNursingProgressNoteResposeModel( {this.notes, - this.conditionType, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn}); + this.conditionType, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.editedByName, + this.createdByName}); GetNursingProgressNoteResposeModel.fromJson(Map json) { notes = json['Notes']; @@ -21,6 +27,8 @@ class GetNursingProgressNoteResposeModel { createdOn = json['CreatedOn']; editedBy = json['EditedBy']; editedOn = json['EditedOn']; + createdByName = json['CreatedByName']; + editedByName = json['EditedByName']; } Map toJson() { diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index 4eb7ad8d..16a6ccec 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -5,14 +5,15 @@ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; class OperationReportService extends BaseService { - List get _operationReportList => List(); + + List _operationReportList = []; List get operationReportList => _operationReportList; Future getOperationReport( {GetOperationReportRequestModel getOperationReportRequestModel, int patientId}) async { getOperationReportRequestModel = - GetOperationReportRequestModel(patientID: patientId); + GetOperationReportRequestModel(patientID: patientId, doctorID: ""); hasError = false; await baseAppClient.post(GET_OPERATION_REPORT, diff --git a/lib/routes.dart b/lib/routes.dart index 4e6cd2e2..da56ce33 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -124,6 +124,8 @@ var routes = { ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), GET_OPERATION_REPORT: (_) => OperationReportScreen(), PENDING_ORDERS: (_) => PendingOrdersScreen(), + NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), + DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), DIABETIC_CHART_VALUES: (_) => DiabeticChart(), }; diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 2abc55ea..65e483b5 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -133,7 +133,7 @@ class _ProgressNoteState extends State { model .diagnosisForInPatientList[ index] - .createdBy + .createdByName .toString() ?? '', fontWeight: diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index d683bab4..0fbac8bf 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -135,7 +135,7 @@ class _ProgressNoteState extends State { model .patientNursingProgressNoteList[ index] - .createdBy + .createdByName .toString() ?? '', fontWeight: diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 5e41092d..e02bb191 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -46,37 +46,12 @@ class _ProgressNoteState extends State { AuthenticationViewModel authenticationViewModel; ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - - print(type); - ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo), - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - languageID: 2); - model - .getPatientProgressNote(progressNoteRequest.toJson(), - isLocalBusy: isLocalBusy) - .then((c) { - notesList = model.patientProgressNoteList; - }); - } - @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( @@ -133,283 +108,9 @@ class _ProgressNoteState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ - if (model.operationReportList[index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .operationReportList[ - index] - .createdBy) - AppText( - TranslationBase.of(context) - .notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model.operationReportList[index] - .status == - 4) - AppText( - TranslationBase.of(context) - .noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model.operationReportList[index] - .status == - 2) - AppText( - TranslationBase.of(context) - .noteVerified, - fontWeight: FontWeight.bold, - color: Colors.green[600], - fontSize: 12, - ), - if (model.operationReportList[index] - .status != - 2 && - model.operationReportList[index] - .status != - 4 && - authenticationViewModel - .doctorProfile.doctorID == - model - .operationReportList[ - index] - .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // UpdateNoteOrder( - // note: model - // .operationReportList[ - // index], - // patientModel: - // model, - // patient: - // patient, - // visitType: widget - // .visitType, - // isUpdate: true, - // )), - // ); - // }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .update, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), - ), - ), - SizedBox( - width: 10, - ), - // InkWell( - // onTap: () async { - // showMyDialog( - // context: context, - // actionName: "verify", - // confirmFun: () async { - // GifLoaderDialogUtils - // .showMyDialog( - // context); - // UpdateNoteReqModel - // reqModel = - // UpdateNoteReqModel( - // admissionNo: int - // .parse(patient - // .admissionNo), - // cancelledNote: - // false, - // lineItemNo: model - // .patientProgressNoteList[ - // index] - // .lineItemNo, - // createdBy: model - // .patientProgressNoteList[ - // index] - // .createdBy, - // notes: model - // .patientProgressNoteList[ - // index] - // .notes, - // verifiedNote: true, - // patientTypeID: - // patient - // .patientType, - // patientOutSA: false, - // ); - // await model - // .updatePatientProgressNote( - // reqModel); - // await getProgressNoteList( - // context, model, - // isLocalBusy: - // true); - // GifLoaderDialogUtils - // .hideDialog( - // context); - // }); - // }, - // child: Container( - // decoration: BoxDecoration( - // color: Colors.green[600], - // borderRadius: - // BorderRadius.circular( - // 10), - // ), - // // color:Colors.red[600], - // - // child: Row( - // children: [ - // Icon( - // FontAwesomeIcons - // .check, - // size: 12, - // color: Colors.white, - // ), - // SizedBox( - // width: 2, - // ), - // AppText( - // TranslationBase.of( - // context) - // .noteVerify, - // fontSize: 10, - // color: Colors.white, - // ), - // ], - // ), - // padding: EdgeInsets.all(6), - // ), - // ), - SizedBox( - width: 10, - ), - // InkWell( - // onTap: () async { - // showMyDialog( - // context: context, - // actionName: - // TranslationBase.of( - // context) - // .cancel, - // confirmFun: () async { - // GifLoaderDialogUtils - // .showMyDialog( - // context, - // ); - // UpdateNoteReqModel - // reqModel = - // UpdateNoteReqModel( - // admissionNo: int - // .parse(patient - // .admissionNo), - // cancelledNote: true, - // lineItemNo: model - // .patientProgressNoteList[ - // index] - // .lineItemNo, - // createdBy: model - // .patientProgressNoteList[ - // index] - // .createdBy, - // notes: model - // .patientProgressNoteList[ - // index] - // .notes, - // verifiedNote: false, - // patientTypeID: - // patient - // .patientType, - // patientOutSA: false, - // ); - // await model - // .updatePatientProgressNote( - // reqModel); - // await getProgressNoteList( - // context, model, - // isLocalBusy: - // true); - // GifLoaderDialogUtils - // .hideDialog( - // context); - // }); - // }, - // child: Container( - // decoration: BoxDecoration( - // color: Colors.red[600], - // borderRadius: - // BorderRadius.circular( - // 10), - // ), - // // color:Colors.red[600], - // - // child: Row( - // children: [ - // Icon( - // FontAwesomeIcons - // .trash, - // size: 12, - // color: Colors.white, - // ), - // SizedBox( - // width: 2, - // ), - // AppText( - // 'Cancel', - // fontSize: 10, - // color: Colors.white, - // ), - // ], - // ), - // padding: EdgeInsets.all(6), - // ), - // ), - SizedBox( - width: 10, - ) - ], - ), - SizedBox( - height: 10, - ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -506,25 +207,153 @@ class _ProgressNoteState extends State { SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .operationReportList[ - index] - .remarks, + if (model.operationReportList[index] + .operationDate != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Date : ", fontSize: 10, ), - ), - ]) + Expanded( + child: AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .operationReportList[ + index] + .operationDate), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontSize: 10, + ), + ) + ]), + + if (model.operationReportList[index] + .timeStart != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Time Start : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model.operationReportList[index] + .timeStart, + fontSize: 10, + ), + ) + ]), + if (model.operationReportList[index] + .remarks != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Remarks : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model + .operationReportList[ + index] + .remarks ?? + '', + fontSize: 10, + ), + ), + ]) ], ), + SizedBox( height: 20, ), + + // if ( + // authenticationViewModel + // .doctorProfile.doctorID == + // model + // .operationReportList[ + // index] + // .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateOperationReport( + operationReport: model + .operationReportList[ + index], + operationReportViewModel: + model, + patient: patient, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .update, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + SizedBox( + width: 10, + ), + ], + ), + + SizedBox( + height: 10, + ), ], ), ), diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index dc64acb5..a60c0cab 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -12,6 +12,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/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -30,7 +31,7 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateOperationReport extends StatefulWidget { - final NoteModel note; + final GetOperationReportModel operationReport; final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; final int visitType; @@ -38,11 +39,11 @@ class UpdateOperationReport extends StatefulWidget { const UpdateOperationReport( {Key key, - this.note, this.operationReportViewModel, this.patient, this.visitType, - this.isUpdate}) + this.isUpdate, + this.operationReport}) : super(key: key); @override @@ -77,6 +78,7 @@ class _UpdateOperationReportState extends State { TextEditingController BloodTransfusedDetailController = TextEditingController(); TextEditingController anasthetistController = TextEditingController(); + TextEditingController OTReservationID = TextEditingController(); setSelectedType(int val) { setState(() { @@ -92,6 +94,8 @@ class _UpdateOperationReportState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + if(widget.isUpdate) + OTReservationID.text = widget.operationReport.oTReservationID.toString(); //TODO Elham* add translation to hints return AppScaffold( isShowAppBar: true, @@ -120,6 +124,18 @@ class _UpdateOperationReportState extends State { widthFactor: 0.9, child: Column( children: [ + AppTextFieldCustom( + hintText: "Reservation No", + //TranslationBase.of(context).addoperationReports, + controller: OTReservationID, + maxLines: 1, + minLines: 1, + enabled: false, + hasBorder: true, + ), + SizedBox( + height: 4, + ), AppTextFieldCustom( hintText: "Pre Op Diagmosis", //TranslationBase.of(context).addoperationReports, @@ -473,14 +489,15 @@ class _UpdateOperationReportState extends State { }); if (isFormValid()) { GifLoaderDialogUtils.showMyDialog(context); - await widget.operationReportViewModel.getDoctorProfile(); + await widget.operationReportViewModel.getDoctorProfile(); CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel( inasion: inasionController.text, + /// TODO Elham* Add dynamic reservation - reservationNo: 0, + reservationNo:widget.operationReport.oTReservationID , preOpDiagmosis: preOpDiagmosisController.text, postOpDiagmosis: postOpDiagmosisNoteController.text, surgeon: surgeonController.text, @@ -503,7 +520,8 @@ class _UpdateOperationReportState extends State { bloodLossDetailController.text, patientID: widget.patient.patientId, admissionNo: int.parse(widget.patient.admissionNo), - createdBy: widget.operationReportViewModel.doctorProfile.doctorID, + createdBy: widget.operationReportViewModel + .doctorProfile.doctorID, setupID: SETUP_ID); await widget.operationReportViewModel.updateOperationReport( createUpdateOperationReportRequestModel); From 230ebaf445657d47aaa8bff9b3bdd6add49dd511 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 26 Oct 2021 15:30:06 +0300 Subject: [PATCH 089/199] operation report --- .../operation_report/operation_report.dart | 42 +++++++------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index e02bb191..0db74f42 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -68,27 +68,6 @@ class _ProgressNoteState extends State { color: Colors.grey[200], child: Column( children: [ - AddNewOrder( - onTap: () async { - await locator().logEvent( - eventCategory: "Operation Report Screen", - eventAction: "Update Operation Report ", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateOperationReport( - operationReportViewModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - ), - settings: RouteSettings(name: 'UpdateNoteOrder'), - ), - ); - }, - label: TranslationBase.of(context).operationReports, - ), model.operationReportList == null || model.operationReportList.length == 0 ? DrAppEmbeddedError( @@ -234,13 +213,12 @@ class _ProgressNoteState extends State { ), ) ]), - if (model.operationReportList[index] - .timeStart != + .timeStart != null) Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( "Operation Time Start : ", @@ -248,7 +226,9 @@ class _ProgressNoteState extends State { ), Expanded( child: AppText( - model.operationReportList[index] + model + .operationReportList[ + index] .timeStart, fontSize: 10, ), @@ -297,7 +277,14 @@ class _ProgressNoteState extends State { MainAxisAlignment.end, children: [ InkWell( - onTap: () { + onTap: () async { + await locator() + .logEvent( + eventCategory: + "Operation Report Screen", + eventAction: + "Update Operation Report ", + ); Navigator.push( context, MaterialPageRoute( @@ -332,8 +319,7 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - TranslationBase.of(context) - .update, + "Operation Reports", fontSize: 10, color: Colors.white, ), From 2fe475d98a8c488126436f07b927e998527a6b20 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 27 Oct 2021 08:33:45 +0300 Subject: [PATCH 090/199] admission orders change --- lib/core/service/operation_report_servive.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index 3189d6c6..4c2a1a37 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -5,8 +5,6 @@ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; class OperationReportService extends BaseService { - List _operationReportList = List(); - List _operationReportList = []; List get operationReportList => _operationReportList; From 97a15bfb35b5273de5c61fa6fc2051c9095ebaa2 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 27 Oct 2021 11:02:39 +0300 Subject: [PATCH 091/199] first step form confirmation page --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 4 + .../register_patient/CustomEditableText.dart | 87 +++++ .../RegisterConfirmationPatientPage.dart | 345 ++++++++++++++++++ .../register_patient/RegisterPatientPage.dart | 3 + lib/util/translations_delegate_base.dart | 4 + 6 files changed, 445 insertions(+), 2 deletions(-) create mode 100644 lib/screens/patients/register_patient/CustomEditableText.dart create mode 100644 lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 36be5e92..599f072f 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 = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 93c3a2de..a4eb5dbc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -713,4 +713,8 @@ const Map> localizedValues = { "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, + "occupation": {"en": "Occupation", "ar": "مهنة"}, + "healthID": {"en": "Health ID", "ar": "معرف الصحة"}, + "identityNumber": {"en": "Identity Number", "ar": "رقم الهوية"}, + "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, }; diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart new file mode 100644 index 00000000..e4de6aae --- /dev/null +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -0,0 +1,87 @@ +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; + +class CustomEditableText extends StatefulWidget { + CustomEditableText({ + Key key, + @required this.controller, + this.hint, + this.isEditable = false, + }) : super(key: key); + + final TextEditingController controller; + + final String hint; + bool isEditable; + + @override + _CustomEditableTextState createState() => _CustomEditableTextState(); +} + +class _CustomEditableTextState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + if(!widget.isEditable) + Container( + height: 60, + decoration: BoxDecoration( + color: Colors.grey[300], + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(20)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.grey[300], + width: 2, + ), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(widget.hint, fontSize: 12, color: Colors.black), + AppText( + widget.controller.text, + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + InkWell( + child: Icon( + DoctorApp.edit_1, + size: 20, + + ), + onTap: () { + setState(() { + widget.isEditable = true; + }); + }, + ) + ], + ), + ), + ), + if(widget.isEditable) + AppTextFieldCustom( + hintText: widget.hint, + //TranslationBase.of(context).addoperationReports, + controller: widget.controller, + maxLines: 1, + minLines: 1, + hasBorder: true, + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart new file mode 100644 index 00000000..153670c4 --- /dev/null +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -0,0 +1,345 @@ +import 'package:doctor_app_flutter/config/config.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/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/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/operation_report_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/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/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/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +import 'CustomEditableText.dart'; + +class RegisterConfirmationPatientPage extends StatefulWidget { + final GetOperationReportModel operationReport; + final OperationReportViewModel operationReportViewModel; + final PatiantInformtion patient; + final int visitType; + final bool isUpdate; + + const RegisterConfirmationPatientPage( + {Key key, + this.operationReportViewModel, + this.patient, + this.visitType, + this.isUpdate, + this.operationReport}) + : super(key: key); + + @override + _RegisterConfirmationPatientPageState createState() => + _RegisterConfirmationPatientPageState(); +} + +class _RegisterConfirmationPatientPageState + extends State { + int selectedType; + bool isSubmitted = false; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + ProjectViewModel projectViewModel; + TextEditingController firstName = TextEditingController(text: "Elham"); + TextEditingController middleName = TextEditingController(text: "Ali"); + TextEditingController lastName = TextEditingController(text: "Rababah"); + TextEditingController emailAddressController = TextEditingController(text: "Elham@Rababah.com"); + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: false, + backgroundColor: Color(0xFFF8F8F8), + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.0, + ), + SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + CustomEditableText( + controller: firstName, hint: TranslationBase.of(context).firstName), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: middleName, hint: TranslationBase.of(context).middleName), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: lastName, hint: TranslationBase.of(context).lastName), + SizedBox( + height: 20, + ), + + FractionallySizedBox( + widthFactor: .9, + child: Center( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).healthID, fontSize: 12, color: Colors.black), + AppText( + "123456", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).identityNumber, fontSize: 12, color: Colors.black), + AppText( + "ss", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox(width: 20,) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).nationality, fontSize: 12, color: Colors.black), + AppText( + "Jordanian", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).occupation, fontSize: 12, color: Colors.black), + AppText( + "--", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox(width: 20,) + ], + ), + SizedBox( + height: 20, + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(TranslationBase.of(context).mobileNo, fontSize: 12, color: Colors.black), + AppText( + "075XXXXXX", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox(width: 20,) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ), + + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: () { + // MasterKeyDailog dialog = + // MasterKeyDailog( + // list: + // model.medicationDoseTimeList, + // okText: + // TranslationBase.of(context) + // .ok, + // selectedValue: + // _selectedMedicationDose, + // okFunction: (selectedValue) { + // setState(() { + // _selectedMedicationDose = + // selectedValue; + // + // doseController + // .text = projectViewModel + // .isArabic + // ? _selectedMedicationDose + // .nameAr + // : _selectedMedicationDose + // .nameEn; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + }, + hintText: + TranslationBase.of(context).maritalStatus, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + // controller: doseController, + // validationError: isFormSubmitted && + // _selectedMedicationDose == null + // ? TranslationBase.of(context) + // .emptyMessage + // : null, + ), + SizedBox( + height: 20, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: () { + // MasterKeyDailog dialog = + // MasterKeyDailog( + // list: + // model.medicationDoseTimeList, + // okText: + // TranslationBase.of(context) + // .ok, + // selectedValue: + // _selectedMedicationDose, + // okFunction: (selectedValue) { + // setState(() { + // _selectedMedicationDose = + // selectedValue; + // + // doseController + // .text = projectViewModel + // .isArabic + // ? _selectedMedicationDose + // .nameAr + // : _selectedMedicationDose + // .nameEn; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + }, + hintText: + TranslationBase.of(context).lanEnglish, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + // controller: doseController, + // validationError: isFormSubmitted && + // _selectedMedicationDose == null + // ? TranslationBase.of(context) + // .emptyMessage + // : null, + ), + SizedBox( + height: 20, + ), + AppTextFieldCustom( + hintText: "Email Address", + //TranslationBase.of(context).addoperationReports, + controller: emailAddressController, + maxLines: 1, + minLines: 1, + hasBorder: true, + ), + + SizedBox( + height: 400, + ), + ], + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 8b79225d..3604a943 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.d 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/screens/patients/profile/UCAF/page-stepper-widget.dart'; +import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.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/buttons/app_buttons_widget.dart'; @@ -98,6 +99,8 @@ class _RegisterPatientPageState extends State scrollDirection: Axis.horizontal, children: [ RegisterSearchPatientPage(), + RegisterConfirmationPatientPage(), + ]), ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 58e17a94..397f8b36 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -294,6 +294,10 @@ class TranslationBase { String get age => localizedValues['age'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; + String get occupation => localizedValues['occupation'][locale.languageCode]; + String get healthID => localizedValues['healthID'][locale.languageCode]; + String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; String get today => localizedValues['today'][locale.languageCode]; From 22b424515ca1dbff6a9a1c1044acd283142be8e0 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 27 Oct 2021 14:33:59 +0300 Subject: [PATCH 092/199] finish operation details report --- lib/config/config.dart | 12 +- .../service/operation_report_servive.dart | 47 +- lib/core/viewModel/base_view_model.dart | 2 +- .../operation_report_view_model.dart | 28 +- .../get_operation_details_request_modle.dart | 68 ++ .../get_operation_details_response_modle.dart | 148 +++ ...rt => get_reservations_request_model.dart} | 6 +- ...t => get_reservations_response_model.dart} | 6 +- .../operation_report/operation_report.dart | 54 +- .../update_operation_report.dart | 976 ++++++++++-------- 10 files changed, 850 insertions(+), 497 deletions(-) create mode 100644 lib/models/operation_report/get_operation_details_request_modle.dart create mode 100644 lib/models/operation_report/get_operation_details_response_modle.dart rename lib/models/operation_report/{get_operation_report_request_model.dart => get_reservations_request_model.dart} (91%) rename lib/models/operation_report/{get_operation_report_model.dart => get_reservations_response_model.dart} (97%) diff --git a/lib/config/config.dart b/lib/config/config.dart index 36be5e92..8caead72 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 = @@ -345,8 +345,14 @@ const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; -const GET_OPERATION_REPORT = + + +///Operation Details Services + +const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const GET_OPERATION_DETAILS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index 16a6ccec..91f4f15c 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -1,28 +1,53 @@ 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/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart'; class OperationReportService extends BaseService { - List _operationReportList = []; - List get operationReportList => _operationReportList; + List _reservationList = []; + List get reservationList => _reservationList; - Future getOperationReport( - {GetOperationReportRequestModel getOperationReportRequestModel, + List _operationDetailsList = []; + List get operationDetailsList => _operationDetailsList; + + Future getReservations( + {GetReservationsRequestModel getReservationsRequestModel, int patientId}) async { - getOperationReportRequestModel = - GetOperationReportRequestModel(patientID: patientId, doctorID: ""); + getReservationsRequestModel = + GetReservationsRequestModel(patientID: patientId, doctorID: ""); hasError = false; - await baseAppClient.post(GET_OPERATION_REPORT, + await baseAppClient.post(GET_RESERVATIONS, onSuccess: (dynamic response, int statusCode) { print("Success"); - _operationReportList.clear(); + _reservationList.clear(); response['List_OTReservationDetails'].forEach( (v) { - _operationReportList.add(GetOperationReportModel.fromJson(v)); + _reservationList.add(GetReservationsResponseModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getReservationsRequestModel.toJson()); + } + + Future getOperationReportDetails( + {GetOperationDetailsRequestModel getOperationReportRequestModel, + }) async { + + hasError = false; + await baseAppClient.post(GET_OPERATION_DETAILS, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + _operationDetailsList.clear(); + response['List_OperationDetails'].forEach( + (v) { + _operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index 03f6e84a..d50a8d5a 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -22,7 +22,7 @@ class BaseViewModel extends ChangeNotifier { void setState(ViewState viewState) { _state = viewState; - notifyListeners(); + notifyListeners(); } Future getDoctorProfile({bool isGetProfile = false}) async { diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/operation_report_view_model.dart index 77867d95..2bfdebce 100644 --- a/lib/core/viewModel/operation_report_view_model.dart +++ b/lib/core/viewModel/operation_report_view_model.dart @@ -3,20 +3,38 @@ import 'package:doctor_app_flutter/core/service/operation_report_servive.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/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; class OperationReportViewModel extends BaseViewModel { bool hasError = false; OperationReportService _operationReportService = locator(); - List get operationReportList => - _operationReportService.operationReportList; + List get reservationList => + _operationReportService.reservationList; - Future getOperationReport(int patientId) async { + List get operationDetailsList => + _operationReportService.operationDetailsList; + + Future getReservations(int patientId) async { + hasError = false; + setState(ViewState.Busy); + await _operationReportService.getReservations(patientId: patientId); + if (_operationReportService.hasError) { + error = _operationReportService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getOperationReportDetails(GetReservationsResponseModel reservation) async { hasError = false; setState(ViewState.Busy); - await _operationReportService.getOperationReport(patientId: patientId); + GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" ); + await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel); if (_operationReportService.hasError) { error = _operationReportService.error; setState(ViewState.ErrorLocal); diff --git a/lib/models/operation_report/get_operation_details_request_modle.dart b/lib/models/operation_report/get_operation_details_request_modle.dart new file mode 100644 index 00000000..7e23b503 --- /dev/null +++ b/lib/models/operation_report/get_operation_details_request_modle.dart @@ -0,0 +1,68 @@ +class GetOperationDetailsRequestModel { + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int reservationNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + + GetOperationDetailsRequestModel( + {this.isDentalAllowedBackend = false, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.reservationNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA}); + + GetOperationDetailsRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + reservationNo = json['reservationNo']; + sessionID = json['SessionID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['reservationNo'] = this.reservationNo; + data['SessionID'] = this.sessionID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/models/operation_report/get_operation_details_response_modle.dart new file mode 100644 index 00000000..689f0ec1 --- /dev/null +++ b/lib/models/operation_report/get_operation_details_response_modle.dart @@ -0,0 +1,148 @@ +class GetOperationDetailsResponseModel { + String setupID; + int projectID; + int reservationNo; + int patientID; + int admissionID; + Null surgeryDate; + String preOpDiagnosis; + String postOpDiagnosis; + String surgeon; + String assistant; + String anasthetist; + String operation; + String inasion; + String finding; + String surgeryProcedure; + String postOpInstruction; + bool isActive; + int createdBy; + String createdName; + Null createdNameN; + String createdOn; + Null editedBy; + Null editedByName; + Null editedByNameN; + Null editedOn; + Null oRBookStatus; + String complicationDetail; + String bloodLossDetail; + String histopathSpecimen; + String microbiologySpecimen; + String otherSpecimen; + Null scrubNurse; + Null circulatingNurse; + Null bloodTransfusedDetail; + + GetOperationDetailsResponseModel( + {this.setupID, + this.projectID, + this.reservationNo, + this.patientID, + this.admissionID, + this.surgeryDate, + this.preOpDiagnosis, + this.postOpDiagnosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.isActive, + this.createdBy, + this.createdName, + this.createdNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn, + this.oRBookStatus, + this.complicationDetail, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); + + GetOperationDetailsResponseModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + reservationNo = json['ReservationNo']; + patientID = json['PatientID']; + admissionID = json['AdmissionID']; + surgeryDate = json['SurgeryDate']; + preOpDiagnosis = json['PreOpDiagnosis']; + postOpDiagnosis = json['PostOpDiagnosis']; + surgeon = json['Surgeon']; + assistant = json['Assistant']; + anasthetist = json['Anasthetist']; + operation = json['Operation']; + inasion = json['Inasion']; + finding = json['Finding']; + surgeryProcedure = json['SurgeryProcedure']; + postOpInstruction = json['PostOpInstruction']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdName = json['CreatedName']; + createdNameN = json['CreatedNameN']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedByName = json['EditedByName']; + editedByNameN = json['EditedByNameN']; + editedOn = json['EditedOn']; + oRBookStatus = json['ORBookStatus']; + complicationDetail = json['ComplicationDetail']; + bloodLossDetail = json['BloodLossDetail']; + histopathSpecimen = json['HistopathSpecimen']; + microbiologySpecimen = json['MicrobiologySpecimen']; + otherSpecimen = json['OtherSpecimen']; + scrubNurse = json['ScrubNurse']; + circulatingNurse = json['CirculatingNurse']; + bloodTransfusedDetail = json['BloodTransfusedDetail']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ReservationNo'] = this.reservationNo; + data['PatientID'] = this.patientID; + data['AdmissionID'] = this.admissionID; + data['SurgeryDate'] = this.surgeryDate; + data['PreOpDiagnosis'] = this.preOpDiagnosis; + data['PostOpDiagnosis'] = this.postOpDiagnosis; + data['Surgeon'] = this.surgeon; + data['Assistant'] = this.assistant; + data['Anasthetist'] = this.anasthetist; + data['Operation'] = this.operation; + data['Inasion'] = this.inasion; + data['Finding'] = this.finding; + data['SurgeryProcedure'] = this.surgeryProcedure; + data['PostOpInstruction'] = this.postOpInstruction; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedName'] = this.createdName; + data['CreatedNameN'] = this.createdNameN; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedByName'] = this.editedByName; + data['EditedByNameN'] = this.editedByNameN; + data['EditedOn'] = this.editedOn; + data['ORBookStatus'] = this.oRBookStatus; + data['ComplicationDetail'] = this.complicationDetail; + data['BloodLossDetail'] = this.bloodLossDetail; + data['HistopathSpecimen'] = this.histopathSpecimen; + data['MicrobiologySpecimen'] = this.microbiologySpecimen; + data['OtherSpecimen'] = this.otherSpecimen; + data['ScrubNurse'] = this.scrubNurse; + data['CirculatingNurse'] = this.circulatingNurse; + data['BloodTransfusedDetail'] = this.bloodTransfusedDetail; + return data; + } +} diff --git a/lib/models/operation_report/get_operation_report_request_model.dart b/lib/models/operation_report/get_reservations_request_model.dart similarity index 91% rename from lib/models/operation_report/get_operation_report_request_model.dart rename to lib/models/operation_report/get_reservations_request_model.dart index 6fc969ee..06425254 100644 --- a/lib/models/operation_report/get_operation_report_request_model.dart +++ b/lib/models/operation_report/get_reservations_request_model.dart @@ -1,4 +1,4 @@ -class GetOperationReportRequestModel { +class GetReservationsRequestModel { int patientID; int projectID; String doctorID; @@ -13,7 +13,7 @@ class GetOperationReportRequestModel { String tokenID; String sessionID; - GetOperationReportRequestModel( + GetReservationsRequestModel( {this.patientID, this.projectID, this.doctorID, @@ -28,7 +28,7 @@ class GetOperationReportRequestModel { this.tokenID, this.sessionID}); - GetOperationReportRequestModel.fromJson(Map json) { + GetReservationsRequestModel.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; doctorID = json['DoctorID']; diff --git a/lib/models/operation_report/get_operation_report_model.dart b/lib/models/operation_report/get_reservations_response_model.dart similarity index 97% rename from lib/models/operation_report/get_operation_report_model.dart rename to lib/models/operation_report/get_reservations_response_model.dart index 29a0158c..3bebdc8b 100644 --- a/lib/models/operation_report/get_operation_report_model.dart +++ b/lib/models/operation_report/get_reservations_response_model.dart @@ -1,4 +1,4 @@ -class GetOperationReportModel { +class GetReservationsResponseModel { String setupID; int projectID; int oTReservationID; @@ -35,7 +35,7 @@ class GetOperationReportModel { String clinicDescription; Null clinicDescriptionN; - GetOperationReportModel( + GetReservationsResponseModel( {this.setupID, this.projectID, this.oTReservationID, @@ -72,7 +72,7 @@ class GetOperationReportModel { this.clinicDescription, this.clinicDescriptionN}); - GetOperationReportModel.fromJson(Map json) { + GetReservationsResponseModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; oTReservationID = json['OTReservationID']; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 0db74f42..a445309e 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -55,7 +55,7 @@ class _ProgressNoteState extends State { if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( - onModelReady: (model) => model.getOperationReport(patient.patientMRN), + onModelReady: (model) => model.getReservations(patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -68,14 +68,14 @@ class _ProgressNoteState extends State { color: Colors.grey[200], child: Column( children: [ - model.operationReportList == null || - model.operationReportList.length == 0 + model.reservationList == null || + model.reservationList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).errorNoProgressNote) : Expanded( child: Container( child: ListView.builder( - itemCount: model.operationReportList.length, + itemCount: model.reservationList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, @@ -119,7 +119,7 @@ class _ProgressNoteState extends State { Expanded( child: AppText( model - .operationReportList[ + .reservationList[ index] .doctorName ?? '', @@ -137,14 +137,14 @@ class _ProgressNoteState extends State { children: [ AppText( model - .operationReportList[ + .reservationList[ index] .createdOn != null ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils .getDateTimeFromServerFormat(model - .operationReportList[ + .reservationList[ index] .createdOn), isArabic: @@ -162,14 +162,14 @@ class _ProgressNoteState extends State { ), AppText( model - .operationReportList[ + .reservationList[ index] .createdOn != null ? AppDateUtils.getHour( AppDateUtils .getDateTimeFromServerFormat(model - .operationReportList[ + .reservationList[ index] .createdOn)) : AppDateUtils.getHour( @@ -186,7 +186,25 @@ class _ProgressNoteState extends State { SizedBox( height: 8, ), - if (model.operationReportList[index] + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Reservation: ", + fontSize: 10, + ), + Expanded( + child: AppText( + model.reservationList[index].oTReservationID.toString(), + fontSize: 10, + ), + ) + ]), + SizedBox( + height: 8, + ), + if (model.reservationList[index] .operationDate != null) Row( @@ -202,7 +220,7 @@ class _ProgressNoteState extends State { AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils .getDateTimeFromServerFormat(model - .operationReportList[ + .reservationList[ index] .operationDate), isArabic: @@ -213,7 +231,7 @@ class _ProgressNoteState extends State { ), ) ]), - if (model.operationReportList[index] + if (model.reservationList[index] .timeStart != null) Row( @@ -227,14 +245,14 @@ class _ProgressNoteState extends State { Expanded( child: AppText( model - .operationReportList[ + .reservationList[ index] .timeStart, fontSize: 10, ), ) ]), - if (model.operationReportList[index] + if (model.reservationList[index] .remarks != null) Row( @@ -248,7 +266,7 @@ class _ProgressNoteState extends State { Expanded( child: AppText( model - .operationReportList[ + .reservationList[ index] .remarks ?? '', @@ -290,11 +308,9 @@ class _ProgressNoteState extends State { MaterialPageRoute( builder: (context) => UpdateOperationReport( - operationReport: model - .operationReportList[ + reservation: model + .reservationList[ index], - operationReportViewModel: - model, patient: patient, isUpdate: true, )), diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index a60c0cab..ff924dd2 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -12,9 +12,11 @@ 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/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -31,19 +33,19 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateOperationReport extends StatefulWidget { - final GetOperationReportModel operationReport; - final OperationReportViewModel operationReportViewModel; + final GetReservationsResponseModel reservation; + // final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; const UpdateOperationReport( {Key key, - this.operationReportViewModel, + // this.operationReportViewModel, this.patient, this.visitType, this.isUpdate, - this.operationReport}) + this.reservation}) : super(key: key); @override @@ -94,459 +96,529 @@ class _UpdateOperationReportState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - if(widget.isUpdate) - OTReservationID.text = widget.operationReport.oTReservationID.toString(); //TODO Elham* add translation to hints - return AppScaffold( - isShowAppBar: true, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: BottomSheetTitle( - title: (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).operationReports, - ), - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Padding( - padding: EdgeInsets.all(0.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10.0, - ), - SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - AppTextFieldCustom( - hintText: "Reservation No", - //TranslationBase.of(context).addoperationReports, - controller: OTReservationID, - maxLines: 1, - minLines: 1, - enabled: false, - hasBorder: true, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Pre Op Diagmosis", - //TranslationBase.of(context).addoperationReports, - controller: preOpDiagmosisController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - preOpDiagmosisController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Post Op Diagmosis", - //TranslationBase.of(context).addoperationReports, - controller: postOpDiagmosisNoteController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - postOpDiagmosisNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Surgeon", - //TranslationBase.of(context).addoperationReports, - controller: surgeonController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - surgeonController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "assistant", - //TranslationBase.of(context).addoperationReports, - controller: assistantNoteController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - assistantNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Operation", - //TranslationBase.of(context).addoperationReports, - controller: operationController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - operationController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "inasion", - //TranslationBase.of(context).addoperationReports, - controller: inasionController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - inasionController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "finding", - //TranslationBase.of(context).addoperationReports, - controller: findingController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - findingController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Surgery Procedure", - //TranslationBase.of(context).addoperationReports, - controller: surgeryProcedureController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - surgeryProcedureController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Post Op Instruction", - //TranslationBase.of(context).addoperationReports, - controller: postOpInstructionController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - postOpInstructionController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Complication Details", - //TranslationBase.of(context).addoperationReports, - controller: complicationDetailsController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - complicationDetailsController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Blood Loss Detail", - //TranslationBase.of(context).addoperationReports, - controller: bloodLossDetailController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - bloodLossDetailController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "histopal the Specimen", - //TranslationBase.of(context).addoperationReports, - controller: histopathSpecimenController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - histopathSpecimenController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "microbiology Specimen ", - //TranslationBase.of(context).addoperationReports, - controller: microbiologySpecimenController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - microbiologySpecimenController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "other Specimen", - //TranslationBase.of(context).addoperationReports, - controller: otherSpecimenController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - otherSpecimenController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "scrub Nurse", - //TranslationBase.of(context).addoperationReports, - controller: scrubNurseController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - scrubNurseController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "circulating Nurse", - //TranslationBase.of(context).addoperationReports, - controller: circulatingNurseController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - circulatingNurseController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Blood Transfused Detail", - //TranslationBase.of(context).addoperationReports, - controller: BloodTransfusedDetailController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: BloodTransfusedDetailController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 4, - ), - AppTextFieldCustom( - hintText: "Anasthetist", - //TranslationBase.of(context).addoperationReports, - controller: anasthetistController, - maxLines: 1, - minLines: 1, - hasBorder: true, - - // isTextFieldHasSuffix: true, - validationError: - anasthetistController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 250, - ), - ], - ), + + return BaseView( + onModelReady: (model) async { + await model + .getOperationReportDetails(widget.reservation); + OTReservationID.text = widget.reservation.oTReservationID.toString(); + + if (model.operationDetailsList.isNotEmpty) { + GetOperationDetailsResponseModel oldDetails = + model.operationDetailsList[0]; + + postOpDiagmosisNoteController.text = oldDetails.postOpInstruction; + preOpDiagmosisController.text = oldDetails.preOpDiagnosis; + surgeonController.text = oldDetails.surgeon; + assistantNoteController.text = oldDetails.assistant; + operationController.text = oldDetails.operation; + inasionController.text = oldDetails.inasion; + findingController.text = oldDetails.finding; + surgeryProcedureController.text = oldDetails.surgeryProcedure; + postOpInstructionController.text = oldDetails.postOpInstruction; + complicationDetailsController.text = oldDetails.complicationDetail; + bloodLossDetailController.text = oldDetails.bloodLossDetail; + histopathSpecimenController.text = oldDetails.histopathSpecimen; + microbiologySpecimenController.text = + oldDetails.microbiologySpecimen; + otherSpecimenController.text = oldDetails.otherSpecimen; + scrubNurseController.text = oldDetails.scrubNurse; + circulatingNurseController.text = oldDetails.circulatingNurse; + BloodTransfusedDetailController.text = + oldDetails.bloodTransfusedDetail; + anasthetistController.text = oldDetails.anasthetist; + } + }, + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).operationReports, + ), + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.0, + ), + SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + AppTextFieldCustom( + hintText: "Reservation No", + //TranslationBase.of(context).addoperationReports, + controller: OTReservationID, + maxLines: 1, + minLines: 1, + enabled: false, + hasBorder: true, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Pre Op Diagmosis", + //TranslationBase.of(context).addoperationReports, + controller: preOpDiagmosisController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: preOpDiagmosisController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Post Op Diagmosis", + //TranslationBase.of(context).addoperationReports, + controller: postOpDiagmosisNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + postOpDiagmosisNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Surgeon", + //TranslationBase.of(context).addoperationReports, + controller: surgeonController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + surgeonController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "assistant", + //TranslationBase.of(context).addoperationReports, + controller: assistantNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: assistantNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Operation", + //TranslationBase.of(context).addoperationReports, + controller: operationController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + operationController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "inasion", + //TranslationBase.of(context).addoperationReports, + controller: inasionController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + inasionController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "finding", + //TranslationBase.of(context).addoperationReports, + controller: findingController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + findingController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Surgery Procedure", + //TranslationBase.of(context).addoperationReports, + controller: surgeryProcedureController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + surgeryProcedureController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Post Op Instruction", + //TranslationBase.of(context).addoperationReports, + controller: postOpInstructionController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + postOpInstructionController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Complication Details", + //TranslationBase.of(context).addoperationReports, + controller: complicationDetailsController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + complicationDetailsController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Blood Loss Detail", + //TranslationBase.of(context).addoperationReports, + controller: bloodLossDetailController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: bloodLossDetailController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "histopal the Specimen", + //TranslationBase.of(context).addoperationReports, + controller: histopathSpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + histopathSpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "microbiology Specimen ", + //TranslationBase.of(context).addoperationReports, + controller: + microbiologySpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + microbiologySpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "other Specimen", + //TranslationBase.of(context).addoperationReports, + controller: otherSpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: otherSpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "scrub Nurse", + //TranslationBase.of(context).addoperationReports, + controller: scrubNurseController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + scrubNurseController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "circulating Nurse", + //TranslationBase.of(context).addoperationReports, + controller: circulatingNurseController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + circulatingNurseController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Blood Transfused Detail", + //TranslationBase.of(context).addoperationReports, + controller: + BloodTransfusedDetailController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + BloodTransfusedDetailController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Anasthetist", + //TranslationBase.of(context).addoperationReports, + controller: anasthetistController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + anasthetistController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 250, + ), + ], + ), + ), + ), + ), + ], ), ), ), - ], + ), ), - ), - ), - ), - ), - bottomSheet: Container( - height: 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Column( - children: [ - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).operationReports, - color: Color(0xff359846), - // disabled: operationReportsController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (isFormValid()) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.operationReportViewModel.getDoctorProfile(); - - CreateUpdateOperationReportRequestModel - createUpdateOperationReportRequestModel = - CreateUpdateOperationReportRequestModel( - inasion: inasionController.text, - - /// TODO Elham* Add dynamic reservation - reservationNo:widget.operationReport.oTReservationID , - preOpDiagmosis: preOpDiagmosisController.text, - postOpDiagmosis: postOpDiagmosisNoteController.text, - surgeon: surgeonController.text, - assistant: assistantNoteController.text, - anasthetist: assistantNoteController.text, - operation: operationController.text, - finding: findingController.text, - surgeryProcedure: surgeonController.text, - postOpInstruction: postOpInstructionController.text, - complicationDetails: - complicationDetailsController.text, - bloodLossDetail: bloodLossDetailController.text, - histopathSpecimen: histopathSpecimenController.text, - microbiologySpecimen: - microbiologySpecimenController.text, - otherSpecimen: otherSpecimenController.text, - scrubNurse: surgeonController.text, - circulatingNurse: circulatingNurseController.text, - bloodTransfusedDetail: - bloodLossDetailController.text, - patientID: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), - createdBy: widget.operationReportViewModel - .doctorProfile.doctorID, - setupID: SETUP_ID); - await widget.operationReportViewModel.updateOperationReport( - createUpdateOperationReportRequestModel); - - if (widget.operationReportViewModel.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - widget.operationReportViewModel.error); - } else { - // await widget.operationReportViewModel.( - // operationReportsRequest.toJson()); - - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } - GifLoaderDialogUtils.hideDialog(context); - } - }, + bottomSheet: model.state == ViewState.Idle?Container(height: 0,): Container( + height: 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).operationReports, + color: Color(0xff359846), + // disabled: operationReportsController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (isFormValid()) { + GifLoaderDialogUtils.showMyDialog(context); + await model + .getDoctorProfile(); + + CreateUpdateOperationReportRequestModel + createUpdateOperationReportRequestModel = + CreateUpdateOperationReportRequestModel( + inasion: inasionController.text, + + /// TODO Elham* Add dynamic reservation + reservationNo: + widget.reservation.oTReservationID, + preOpDiagmosis: + preOpDiagmosisController.text, + postOpDiagmosis: + postOpDiagmosisNoteController.text, + surgeon: surgeonController.text, + assistant: assistantNoteController.text, + anasthetist: assistantNoteController.text, + operation: operationController.text, + finding: findingController.text, + surgeryProcedure: surgeonController.text, + postOpInstruction: + postOpInstructionController.text, + complicationDetails: + complicationDetailsController.text, + bloodLossDetail: + bloodLossDetailController.text, + histopathSpecimen: + histopathSpecimenController.text, + microbiologySpecimen: + microbiologySpecimenController.text, + otherSpecimen: otherSpecimenController.text, + scrubNurse: surgeonController.text, + circulatingNurse: + circulatingNurseController.text, + bloodTransfusedDetail: + bloodLossDetailController.text, + patientID: widget.patient.patientId, + admissionNo: + int.parse(widget.patient.admissionNo), + createdBy: model + .doctorProfile.doctorID, + setupID: SETUP_ID); + await model + .updateOperationReport( + createUpdateOperationReportRequestModel); + + if (model.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + model.error); + } else { + // await model.( + // operationReportsRequest.toJson()); + + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } + GifLoaderDialogUtils.hideDialog(context); + } + }, + ), + ), + ], + ), ), - ), - ], - ), - ), - ); + )); } isFormValid() { From 04583d8c42b6b9b1dd5fc50933df7f53e4b59be7 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 27 Oct 2021 16:26:59 +0300 Subject: [PATCH 093/199] finish operation details report --- .../get_operation_details_response_modle.dart | 20 +++++++++---------- .../update_operation_report.dart | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/models/operation_report/get_operation_details_response_modle.dart index 689f0ec1..04540ea6 100644 --- a/lib/models/operation_report/get_operation_details_response_modle.dart +++ b/lib/models/operation_report/get_operation_details_response_modle.dart @@ -4,7 +4,7 @@ class GetOperationDetailsResponseModel { int reservationNo; int patientID; int admissionID; - Null surgeryDate; + dynamic surgeryDate; String preOpDiagnosis; String postOpDiagnosis; String surgeon; @@ -18,21 +18,21 @@ class GetOperationDetailsResponseModel { bool isActive; int createdBy; String createdName; - Null createdNameN; + dynamic createdNameN; String createdOn; - Null editedBy; - Null editedByName; - Null editedByNameN; - Null editedOn; - Null oRBookStatus; + dynamic editedBy; + dynamic editedByName; + dynamic editedByNameN; + dynamic editedOn; + dynamic oRBookStatus; String complicationDetail; String bloodLossDetail; String histopathSpecimen; String microbiologySpecimen; String otherSpecimen; - Null scrubNurse; - Null circulatingNurse; - Null bloodTransfusedDetail; + dynamic scrubNurse; + dynamic circulatingNurse; + dynamic bloodTransfusedDetail; GetOperationDetailsResponseModel( {this.setupID, diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index ff924dd2..0800bc16 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -530,7 +530,7 @@ class _UpdateOperationReportState extends State { ), ), ), - bottomSheet: model.state == ViewState.Idle?Container(height: 0,): Container( + bottomSheet: model.state != ViewState.Idle?Container(height: 0,): Container( height: 70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( @@ -593,7 +593,7 @@ class _UpdateOperationReportState extends State { int.parse(widget.patient.admissionNo), createdBy: model .doctorProfile.doctorID, - setupID: SETUP_ID); + setupID: "010266"); await model .updateOperationReport( createUpdateOperationReportRequestModel); From a9d097da5453da9b72c50bb076ad3794bd9f2d7a Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 28 Oct 2021 11:27:24 +0300 Subject: [PATCH 094/199] fix merge conflict --- .../register_patient/RegisterConfirmationPatientPage.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 153670c4..d51e57f3 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -12,7 +12,6 @@ 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/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -35,7 +34,6 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import 'CustomEditableText.dart'; class RegisterConfirmationPatientPage extends StatefulWidget { - final GetOperationReportModel operationReport; final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; final int visitType; @@ -46,8 +44,7 @@ class RegisterConfirmationPatientPage extends StatefulWidget { this.operationReportViewModel, this.patient, this.visitType, - this.isUpdate, - this.operationReport}) + this.isUpdate}) : super(key: key); @override From d0e6532814274d1c8f16a3b30cff513020cc449e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 28 Oct 2021 14:33:03 +0300 Subject: [PATCH 095/199] admission orders changes --- lib/config/config.dart | 16 ++-- .../admission_orders_model.dart | 7 +- .../admission_orders_screen.dart | 77 +++---------------- 3 files changed, 24 insertions(+), 76 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 36be5e92..69be3d09 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 = @@ -365,11 +365,13 @@ const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; ///Patient Registration Services -const CHECK_PATIENT_FOR_REGISTRATION = "Authentication.svc/REST/CheckPatientForRegisteration"; -const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE = "Authentication.svc/REST/SendActivationCodebyOTPNotificationType"; -const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = "Authentication.svc/REST/PatientRegistration"; - +const CHECK_PATIENT_FOR_REGISTRATION = + "Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE = + "Authentication.svc/REST/SendActivationCodebyOTPNotificationType"; +const CHECK_ACTIVATION_CODE_FOR_PATIENT = + "Authentication.svc/REST/CheckActivationCode"; +const PATIENT_REGISTRATION = "Authentication.svc/REST/PatientRegistration"; var selectedPatientType = 1; diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/models/admisson_orders/admission_orders_model.dart index caea4d15..a0891a02 100644 --- a/lib/models/admisson_orders/admission_orders_model.dart +++ b/lib/models/admisson_orders/admission_orders_model.dart @@ -9,6 +9,7 @@ class AdmissionOrdersModel { int createdBy; String editedOn; int editedBy; + String createdByName; AdmissionOrdersModel( {this.procedureID, @@ -20,7 +21,8 @@ class AdmissionOrdersModel { this.createdOn, this.createdBy, this.editedOn, - this.editedBy}); + this.editedBy, + this.createdByName}); AdmissionOrdersModel.fromJson(Map json) { procedureID = json['ProcedureID']; @@ -33,6 +35,7 @@ class AdmissionOrdersModel { createdBy = json['CreatedBy']; editedOn = json['EditedOn']; editedBy = json['EditedBy']; + createdByName = json['CreatedByName']; } Map toJson() { @@ -47,6 +50,8 @@ class AdmissionOrdersModel { data['CreatedBy'] = this.createdBy; data['EditedOn'] = this.editedOn; data['EditedBy'] = this.editedBy; + data['CreatedByName'] = this.createdByName; + return data; } } diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index e73e02de..f83117e2 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -38,8 +38,7 @@ class _AdmissionOrdersScreenState extends State { isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: int.parse(patient.admissionNo), - patientId: patient.patientMRN), + admissionNo: 2014005178, patientId: patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -91,43 +90,12 @@ class _AdmissionOrdersScreenState extends State { widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, - // bgColor: model.admissionOrderList[index] - // .status == - // 1 && - // authenticationViewModel - // .doctorProfile.doctorID != - // model - // .patientProgressNoteList[ - // index] - // .createdBy - // ? Color(0xFFCC9B14) - // : model.patientProgressNoteList[index] - // .status == - // 4 - // ? Colors.red.shade700 - // : model.patientProgressNoteList[index] - // .status == - // 2 - // ? Colors.green[600] - // : Color(0xFFCC9B14), widget: Column( children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - width: 10, - ), - SizedBox( - width: 10, - ) - ], - ), SizedBox( height: 10, ), @@ -156,14 +124,14 @@ class _AdmissionOrdersScreenState extends State { context) .createdBy .toString(), - fontSize: 10, + fontSize: 13, ), Expanded( child: AppText( model .admissionOrderList[ index] - .createdBy + .createdByName .toString() ?? '', fontWeight: @@ -181,10 +149,11 @@ class _AdmissionOrdersScreenState extends State { children: [ AppText( TranslationBase.of( - context) - .procedureName - .toString(), - fontSize: 10, + context) + .procedureName + .toString() + + ": ", + fontSize: 13, ), Expanded( child: AppText( @@ -212,7 +181,7 @@ class _AdmissionOrdersScreenState extends State { context) .orderNo .toString(), - fontSize: 10, + fontSize: 13, ), Expanded( child: AppText( @@ -230,34 +199,6 @@ class _AdmissionOrdersScreenState extends State { ), ], ), - // Row( - // crossAxisAlignment: - // CrossAxisAlignment - // .start, - // children: [ - // AppText( - // TranslationBase.of( - // context) - // .createdBy - // .toString(), - // fontSize: 10, - // ), - // Expanded( - // child: AppText( - // model - // .admissionOrderList[ - // index] - // .createdBy - // .toString() ?? - // '', - // fontWeight: - // FontWeight.w600, - // fontSize: 12, - // isCopyable: true, - // ), - // ), - // ], - // ), ], ), ), From 5e4b2d82028a925420fda4aa29ddf6c68a744099 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 1 Nov 2021 10:01:54 +0200 Subject: [PATCH 096/199] showModalBottomSheet in confirmation page --- .../RegisterConfirmationPatientPage.dart | 354 +++++++++++++----- .../register_patient/RegisterPatientPage.dart | 2 +- 2 files changed, 263 insertions(+), 93 deletions(-) diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index d51e57f3..d6d07a6f 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -63,7 +63,8 @@ class _RegisterConfirmationPatientPageState TextEditingController firstName = TextEditingController(text: "Elham"); TextEditingController middleName = TextEditingController(text: "Ali"); TextEditingController lastName = TextEditingController(text: "Rababah"); - TextEditingController emailAddressController = TextEditingController(text: "Elham@Rababah.com"); + TextEditingController emailAddressController = + TextEditingController(text: "Elham@Rababah.com"); setSelectedType(int val) { setState(() { @@ -101,34 +102,41 @@ class _RegisterConfirmationPatientPageState child: Column( children: [ CustomEditableText( - controller: firstName, hint: TranslationBase.of(context).firstName), + controller: firstName, + hint: TranslationBase.of(context).firstName), SizedBox( height: 4, ), CustomEditableText( - controller: middleName, hint: TranslationBase.of(context).middleName), + controller: middleName, + hint: TranslationBase.of(context).middleName), SizedBox( height: 4, ), CustomEditableText( - controller: lastName, hint: TranslationBase.of(context).lastName), + controller: lastName, + hint: TranslationBase.of(context).lastName), SizedBox( height: 20, ), - FractionallySizedBox( widthFactor: .9, child: Center( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText(TranslationBase.of(context).healthID, fontSize: 12, color: Colors.black), + AppText( + TranslationBase.of(context) + .healthID, + fontSize: 12, + color: Colors.black), AppText( "123456", fontSize: 12, @@ -137,9 +145,14 @@ class _RegisterConfirmationPatientPageState ], ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText(TranslationBase.of(context).identityNumber, fontSize: 12, color: Colors.black), + AppText( + TranslationBase.of(context) + .identityNumber, + fontSize: 12, + color: Colors.black), AppText( "ss", fontSize: 12, @@ -147,20 +160,27 @@ class _RegisterConfirmationPatientPageState ), ], ), - SizedBox(width: 20,) + SizedBox( + width: 20, + ) ], ), SizedBox( height: 20, ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText(TranslationBase.of(context).nationality, fontSize: 12, color: Colors.black), + AppText( + TranslationBase.of(context) + .nationality, + fontSize: 12, + color: Colors.black), AppText( "Jordanian", fontSize: 12, @@ -169,9 +189,14 @@ class _RegisterConfirmationPatientPageState ], ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText(TranslationBase.of(context).occupation, fontSize: 12, color: Colors.black), + AppText( + TranslationBase.of(context) + .occupation, + fontSize: 12, + color: Colors.black), AppText( "--", fontSize: 12, @@ -179,21 +204,27 @@ class _RegisterConfirmationPatientPageState ), ], ), - SizedBox(width: 20,) + SizedBox( + width: 20, + ) ], ), SizedBox( height: 20, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText(TranslationBase.of(context).mobileNo, fontSize: 12, color: Colors.black), + AppText( + TranslationBase.of(context) + .mobileNo, + fontSize: 12, + color: Colors.black), AppText( "075XXXXXX", fontSize: 12, @@ -201,7 +232,9 @@ class _RegisterConfirmationPatientPageState ), ], ), - SizedBox(width: 20,) + SizedBox( + width: 20, + ) ], ), SizedBox( @@ -211,48 +244,18 @@ class _RegisterConfirmationPatientPageState ), ), ), - AppTextFieldCustom( height: Helpers.getTextFieldHeight(), enabled: false, onClick: () { - // MasterKeyDailog dialog = - // MasterKeyDailog( - // list: - // model.medicationDoseTimeList, - // okText: - // TranslationBase.of(context) - // .ok, - // selectedValue: - // _selectedMedicationDose, - // okFunction: (selectedValue) { - // setState(() { - // _selectedMedicationDose = - // selectedValue; - // - // doseController - // .text = projectViewModel - // .isArabic - // ? _selectedMedicationDose - // .nameAr - // : _selectedMedicationDose - // .nameEn; - // }); - // }, - // ); - // showDialog( - // barrierDismissible: false, - // context: context, - // builder: (BuildContext context) { - // return dialog; - // }, - // ); + openMaritalStatusList(context); }, hintText: - TranslationBase.of(context).maritalStatus, + TranslationBase.of(context).maritalStatus, maxLines: 1, minLines: 1, isTextFieldHasSuffix: true, + // controller: doseController, // validationError: isFormSubmitted && // _selectedMedicationDose == null @@ -267,40 +270,9 @@ class _RegisterConfirmationPatientPageState height: Helpers.getTextFieldHeight(), enabled: false, onClick: () { - // MasterKeyDailog dialog = - // MasterKeyDailog( - // list: - // model.medicationDoseTimeList, - // okText: - // TranslationBase.of(context) - // .ok, - // selectedValue: - // _selectedMedicationDose, - // okFunction: (selectedValue) { - // setState(() { - // _selectedMedicationDose = - // selectedValue; - // - // doseController - // .text = projectViewModel - // .isArabic - // ? _selectedMedicationDose - // .nameAr - // : _selectedMedicationDose - // .nameEn; - // }); - // }, - // ); - // showDialog( - // barrierDismissible: false, - // context: context, - // builder: (BuildContext context) { - // return dialog; - // }, - // ); + openLangList(context); }, - hintText: - TranslationBase.of(context).lanEnglish, + hintText: TranslationBase.of(context).lanEnglish, maxLines: 1, minLines: 1, isTextFieldHasSuffix: true, @@ -322,7 +294,6 @@ class _RegisterConfirmationPatientPageState minLines: 1, hasBorder: true, ), - SizedBox( height: 400, ), @@ -339,4 +310,203 @@ class _RegisterConfirmationPatientPageState ), ); } + + openMaritalStatusList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isDismissible: true, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: .3, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + "${TranslationBase.of(context).maritalStatus} :", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 18, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon(DoctorApp.close_1, + size: SizeConfig.getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2B353E))), + ), + ], + ), + + SizedBox( + height: 10, + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + "Single", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + "Married", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + "Divorce", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + ], + ), + ); + }); + } + + openLangList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isDismissible: true, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: .3, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + "language:", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 18, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon(DoctorApp.close_1, + size: SizeConfig.getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2B353E))), + ), + ], + ), + + SizedBox( + height: 10, + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + TranslationBase.of(context).lanEnglish, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + TranslationBase.of(context).lanArabic, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + + ], + ), + ); + }); + } + } diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 3604a943..d9ede01a 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -98,7 +98,7 @@ class _RegisterPatientPageState extends State }, scrollDirection: Axis.horizontal, children: [ - RegisterSearchPatientPage(), + // RegisterSearchPatientPage(), RegisterConfirmationPatientPage(), ]), From cb223be8b3dfc6c21488f5f037e299ef575f27ac Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 2 Nov 2021 08:51:48 +0200 Subject: [PATCH 097/199] fix issue in Register Patient Page --- .../register_patient/RegisterPatientPage.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index d9ede01a..85e46185 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -98,7 +98,7 @@ class _RegisterPatientPageState extends State }, scrollDirection: Axis.horizontal, children: [ - // RegisterSearchPatientPage(), + RegisterSearchPatientPage(), RegisterConfirmationPatientPage(), ]), @@ -107,11 +107,7 @@ class _RegisterPatientPageState extends State ], ), )), - _isLoading - ? Container( - height: 0, - ) - : pagerButtons(model), + pagerButtons(model), ], ), ), @@ -165,7 +161,8 @@ class _RegisterPatientPageState extends State ); default: return Container( - color: Colors.white, + // height: 100, + color: Colors.red, padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Row( children: [ From 3229a1ff99647fae33556cef27ddfbdf877b8f18 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 2 Nov 2021 09:57:27 +0200 Subject: [PATCH 098/199] remove red color --- lib/screens/patients/register_patient/RegisterPatientPage.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 85e46185..abd74d9c 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -161,8 +161,6 @@ class _RegisterPatientPageState extends State ); default: return Container( - // height: 100, - color: Colors.red, padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Row( children: [ From 1a35201f276b4b74ace29856bd089effa0a40e3c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Nov 2021 16:41:42 +0200 Subject: [PATCH 099/199] regstration activtion code --- ...PNotificationTypeForRegistrationModel.dart | 48 +++--- .../service/PatientRegistrationService.dart | 23 ++- .../PatientRegistrationViewModel.dart | 9 +- .../register_patient/RegisterPatientPage.dart | 3 +- .../VerifyActivationCodePage.dart | 48 ++++++ .../register_patient/VerifyMethodPage.dart | 147 ++++++++++++++++++ 6 files changed, 245 insertions(+), 33 deletions(-) create mode 100644 lib/screens/patients/register_patient/VerifyActivationCodePage.dart create mode 100644 lib/screens/patients/register_patient/VerifyMethodPage.dart diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart index 8244a95f..8aaf2c6c 100644 --- a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -16,7 +16,7 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { int channel; String iPAdress; String generalid; - int patientOutSA; + bool patientOutSA; Null sessionID; bool isDentalAllowedBackend; int deviceTypeID; @@ -26,29 +26,29 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { SendActivationCodeByOTPNotificationTypeForRegistrationModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.oTPSendType, - this.languageID, - this.versionID, - this.channel, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( Map json) { diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index fefa9021..4f084142 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -18,12 +18,27 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - SendActivationCodeByOTPNotificationTypeForRegistrationModel - registrationModel) async { + {SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel, + int otpType}) async { + registrationModel = + SendActivationCodeByOTPNotificationTypeForRegistrationModel( + oTPSendType: otpType, + patientIdentificationID: 1062938285, + patientMobileNumber: 785228065, + zipCode: "966", + patientOutSA: false, + mobileNo: "785228065", + healthId: "30000018540264", + dOB: "31/07/1988", + ); hasError = false; await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE, - onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) { + onSuccess: (dynamic response, int statusCode) { + registrationModel = + SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( + response); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: registrationModel.toJson()); diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 6dddffcd..416925bb 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -25,11 +25,12 @@ class PatientRegistrationViewModel extends BaseViewModel { } Future sendActivationCodeByOTPNotificationType( - SendActivationCodeByOTPNotificationTypeForRegistrationModel - registrationModel) async { + {SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel, + int otpType}) async { setState(ViewState.Busy); - await _patientRegistrationService - .sendActivationCodeByOTPNotificationType(registrationModel); + await _patientRegistrationService.sendActivationCodeByOTPNotificationType( + otpType: otpType); if (_patientRegistrationService.hasError) { error = _patientRegistrationService.error; setState(ViewState.Error); diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 85e46185..daef5eda 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -3,6 +3,7 @@ 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/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/register_patient/VerifyMethodPage.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/buttons/app_buttons_widget.dart'; @@ -99,8 +100,8 @@ class _RegisterPatientPageState extends State scrollDirection: Axis.horizontal, children: [ RegisterSearchPatientPage(), + ActivationPage(), RegisterConfirmationPatientPage(), - ]), ), ), diff --git a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart new file mode 100644 index 00000000..d58e5a3b --- /dev/null +++ b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart @@ -0,0 +1,48 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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'; + +class VerifyActivationCodePage extends StatefulWidget { + const VerifyActivationCodePage({Key key}) : super(key: key); + + @override + _VerifyActivationCodePageState createState() => + _VerifyActivationCodePageState(); +} + +class _VerifyActivationCodePageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please enter the verification code sent to 02221552", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + ], + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart new file mode 100644 index 00000000..885b2701 --- /dev/null +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -0,0 +1,147 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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'; +import 'package:hexcolor/hexcolor.dart'; + +class ActivationPage extends StatefulWidget { + const ActivationPage({Key key}) : super(key: key); + + @override + _ActivationPageState createState() => _ActivationPageState(); +} + +class _ActivationPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please select how you want to be verified", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () { + model.sendActivationCodeByOTPNotificationType( + otpType: 1); + }, + child: Container( + height: + MediaQuery.of(context).size.height * 0.233, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), width: 0.1), + ), + child: Column( + children: [ + Row( + children: [ + Image.asset( + "assets/images/verify-sms.png", + height: + MediaQuery.of(context).size.height * + 0.15, + width: + MediaQuery.of(context).size.width * + 0.15, + ), + ], + ), + SizedBox( + height: 20, + ), + AppText( + "Verify through SMS", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ) + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + model.sendActivationCodeByOTPNotificationType( + otpType: 1); + }, + child: Container( + height: + MediaQuery.of(context).size.height * 0.233, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), width: 0.1), + ), + child: Column( + children: [ + Row( + children: [ + Image.asset( + "assets/images/verify-whtsapp.png", + height: + MediaQuery.of(context).size.height * + 0.15, + width: + MediaQuery.of(context).size.width * + 0.15, + ), + ], + ), + SizedBox( + height: 20, + ), + AppText( + "Verify through WhatsApp", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ) + ], + ), + ), + ), + ), + ], + ), + ], + ), + ), + ) + ], + ), + ), + ); + } +} From 4f123b0af2770e8b6e7a36393365a87aaac5378f Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 2 Nov 2021 17:19:48 +0200 Subject: [PATCH 100/199] first step form register patient service --- lib/config/config.dart | 9 +- .../GetPatientInfoRequestModel.dart | 60 +++ .../GetPatientInfoResponseModel.dart | 374 ++++++++++++++++++ .../service/PatientRegistrationService.dart | 17 + .../PatientRegistrationViewModel.dart | 25 +- .../RegisterConfirmationPatientPage.dart | 89 ++++- .../register_patient/RegisterPatientPage.dart | 6 +- .../RegisterSearchPatientPage.dart | 140 ++++++- 8 files changed, 684 insertions(+), 36 deletions(-) create mode 100644 lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart create mode 100644 lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index a1e8d2ca..04a6d7bc 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -372,12 +372,13 @@ const GET_ADMISSION_ORDERS = ///Patient Registration Services const CHECK_PATIENT_FOR_REGISTRATION = - "Authentication.svc/REST/CheckPatientForRegisteration"; + "Services/Authentication.svc/REST/CheckPatientForRegisteration"; const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE = - "Authentication.svc/REST/SendActivationCodebyOTPNotificationType"; + "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType"; const CHECK_ACTIVATION_CODE_FOR_PATIENT = - "Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = "Authentication.svc/REST/PatientRegistration"; + "Services/Authentication.svc/REST/CheckActivationCode"; +const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; +const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo"; var selectedPatientType = 1; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart new file mode 100644 index 00000000..f05131ef --- /dev/null +++ b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart @@ -0,0 +1,60 @@ +class GetPatientInfoRequestModel { + String patientIdentificationID; + String dOB; + int isHijri; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + GetPatientInfoRequestModel( + {this.patientIdentificationID, + this.dOB, + this.isHijri, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + GetPatientInfoRequestModel.fromJson(Map json) { + patientIdentificationID = json['PatientIdentificationID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientIdentificationID'] = this.patientIdentificationID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart new file mode 100644 index 00000000..158bd1e2 --- /dev/null +++ b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart @@ -0,0 +1,374 @@ +class GetPatientInfoResponseModel { + dynamic date; + int languageID; + int serviceName; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; + bool dataw; + int dietType; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; + int errorType; + int foodCategory; + dynamic iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic vidaUpdatedResponse; + dynamic accessTokenObject; + int age; + dynamic clientIdentifierId; + int createdBy; + String dateOfBirth; + String firstNameAr; + String firstNameEn; + String gender; + dynamic genderAr; + dynamic genderEn; + String healthId; + String idNumber; + String idType; + bool isHijri; + int isInstertedOrUpdated; + int isNull; + int isPatientExistNHIC; + bool isRecordLockedByCurrentUser; + String lastNameAr; + String lastNameEn; + dynamic listActiveAccessToken; + String maritalStatus; + String maritalStatusCode; + String nationalDateOfBirth; + String nationality; + String nationalityCode; + String occupation; + dynamic pCDTransactionDataResultList; + dynamic pCDGetVidaPatientForManualVerificationList; + dynamic pCDNHICHMGPatientDetailsMatchCalulationList; + int pCDReturnValue; + String patientStatus; + String placeofBirth; + dynamic practitionerStatusCode; + dynamic practitionerStatusDescAr; + dynamic practitionerStatusDescEn; + int rowCount; + String secondNameAr; + String secondNameEn; + String thirdNameAr; + String thirdNameEn; + dynamic yakeenVidaPatientDataStatisticsByPatientIdList; + dynamic yakeenVidaPatientDataStatisticsList; + dynamic yakeenVidaPatientDataStatisticsPrefferedList; + dynamic accessToken; + int categoryCode; + dynamic categoryNameAr; + dynamic categoryNameEn; + int constraintCode; + dynamic constraintNameAr; + dynamic constraintNameEn; + dynamic content; + dynamic errorList; + dynamic licenseExpiryDate; + dynamic licenseIssuedDate; + dynamic licenseStatusCode; + dynamic licenseStatusDescAr; + dynamic licenseStatusDescEn; + dynamic organizations; + dynamic registrationNumber; + int specialtyCode; + dynamic specialtyNameAr; + dynamic specialtyNameEn; + + GetPatientInfoResponseModel( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.vidaUpdatedResponse, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.isRecordLockedByCurrentUser, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationalDateOfBirth, + this.nationality, + this.nationalityCode, + this.occupation, + this.pCDTransactionDataResultList, + this.pCDGetVidaPatientForManualVerificationList, + this.pCDNHICHMGPatientDetailsMatchCalulationList, + this.pCDReturnValue, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.rowCount, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.yakeenVidaPatientDataStatisticsByPatientIdList, + this.yakeenVidaPatientDataStatisticsList, + this.yakeenVidaPatientDataStatisticsPrefferedList, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.errorList, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); + + GetPatientInfoResponseModel.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + vidaUpdatedResponse = json['VidaUpdatedResponse']; + accessTokenObject = json['AccessTokenObject']; + age = json['Age']; + clientIdentifierId = json['ClientIdentifierId']; + createdBy = json['CreatedBy']; + dateOfBirth = json['DateOfBirth']; + firstNameAr = json['FirstNameAr']; + firstNameEn = json['FirstNameEn']; + gender = json['Gender']; + genderAr = json['GenderAr']; + genderEn = json['GenderEn']; + healthId = json['HealthId']; + idNumber = json['IdNumber']; + idType = json['IdType']; + isHijri = json['IsHijri']; + isInstertedOrUpdated = json['IsInstertedOrUpdated']; + isNull = json['IsNull']; + isPatientExistNHIC = json['IsPatientExistNHIC']; + isRecordLockedByCurrentUser = json['IsRecordLockedByCurrentUser']; + lastNameAr = json['LastNameAr']; + lastNameEn = json['LastNameEn']; + listActiveAccessToken = json['List_ActiveAccessToken']; + maritalStatus = json['MaritalStatus']; + maritalStatusCode = json['MaritalStatusCode']; + nationalDateOfBirth = json['NationalDateOfBirth']; + nationality = json['Nationality']; + nationalityCode = json['NationalityCode']; + occupation = json['Occupation']; + pCDTransactionDataResultList = json['PCDTransactionDataResultList']; + pCDGetVidaPatientForManualVerificationList = + json['PCD_GetVidaPatientForManualVerificationList']; + pCDNHICHMGPatientDetailsMatchCalulationList = + json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; + pCDReturnValue = json['PCD_ReturnValue']; + patientStatus = json['PatientStatus']; + placeofBirth = json['PlaceofBirth']; + practitionerStatusCode = json['PractitionerStatusCode']; + practitionerStatusDescAr = json['PractitionerStatusDescAr']; + practitionerStatusDescEn = json['PractitionerStatusDescEn']; + rowCount = json['RowCount']; + secondNameAr = json['SecondNameAr']; + secondNameEn = json['SecondNameEn']; + thirdNameAr = json['ThirdNameAr']; + thirdNameEn = json['ThirdNameEn']; + yakeenVidaPatientDataStatisticsByPatientIdList = + json['YakeenVidaPatientDataStatisticsByPatientIdList']; + yakeenVidaPatientDataStatisticsList = + json['YakeenVidaPatientDataStatisticsList']; + yakeenVidaPatientDataStatisticsPrefferedList = + json['YakeenVidaPatientDataStatisticsPrefferedList']; + accessToken = json['accessToken']; + categoryCode = json['categoryCode']; + categoryNameAr = json['categoryNameAr']; + categoryNameEn = json['categoryNameEn']; + constraintCode = json['constraintCode']; + constraintNameAr = json['constraintNameAr']; + constraintNameEn = json['constraintNameEn']; + content = json['content']; + errorList = json['errorList']; + licenseExpiryDate = json['licenseExpiryDate']; + licenseIssuedDate = json['licenseIssuedDate']; + licenseStatusCode = json['licenseStatusCode']; + licenseStatusDescAr = json['licenseStatusDescAr']; + licenseStatusDescEn = json['licenseStatusDescEn']; + organizations = json['organizations']; + registrationNumber = json['registrationNumber']; + specialtyCode = json['specialtyCode']; + specialtyNameAr = json['specialtyNameAr']; + specialtyNameEn = json['specialtyNameEn']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['VidaUpdatedResponse'] = this.vidaUpdatedResponse; + data['AccessTokenObject'] = this.accessTokenObject; + data['Age'] = this.age; + data['ClientIdentifierId'] = this.clientIdentifierId; + data['CreatedBy'] = this.createdBy; + data['DateOfBirth'] = this.dateOfBirth; + data['FirstNameAr'] = this.firstNameAr; + data['FirstNameEn'] = this.firstNameEn; + data['Gender'] = this.gender; + data['GenderAr'] = this.genderAr; + data['GenderEn'] = this.genderEn; + data['HealthId'] = this.healthId; + data['IdNumber'] = this.idNumber; + data['IdType'] = this.idType; + data['IsHijri'] = this.isHijri; + data['IsInstertedOrUpdated'] = this.isInstertedOrUpdated; + data['IsNull'] = this.isNull; + data['IsPatientExistNHIC'] = this.isPatientExistNHIC; + data['IsRecordLockedByCurrentUser'] = this.isRecordLockedByCurrentUser; + data['LastNameAr'] = this.lastNameAr; + data['LastNameEn'] = this.lastNameEn; + data['List_ActiveAccessToken'] = this.listActiveAccessToken; + data['MaritalStatus'] = this.maritalStatus; + data['MaritalStatusCode'] = this.maritalStatusCode; + data['NationalDateOfBirth'] = this.nationalDateOfBirth; + data['Nationality'] = this.nationality; + data['NationalityCode'] = this.nationalityCode; + data['Occupation'] = this.occupation; + data['PCDTransactionDataResultList'] = this.pCDTransactionDataResultList; + data['PCD_GetVidaPatientForManualVerificationList'] = + this.pCDGetVidaPatientForManualVerificationList; + data['PCD_NHIC_HMG_PatientDetailsMatchCalulationList'] = + this.pCDNHICHMGPatientDetailsMatchCalulationList; + data['PCD_ReturnValue'] = this.pCDReturnValue; + data['PatientStatus'] = this.patientStatus; + data['PlaceofBirth'] = this.placeofBirth; + data['PractitionerStatusCode'] = this.practitionerStatusCode; + data['PractitionerStatusDescAr'] = this.practitionerStatusDescAr; + data['PractitionerStatusDescEn'] = this.practitionerStatusDescEn; + data['RowCount'] = this.rowCount; + data['SecondNameAr'] = this.secondNameAr; + data['SecondNameEn'] = this.secondNameEn; + data['ThirdNameAr'] = this.thirdNameAr; + data['ThirdNameEn'] = this.thirdNameEn; + data['YakeenVidaPatientDataStatisticsByPatientIdList'] = + this.yakeenVidaPatientDataStatisticsByPatientIdList; + data['YakeenVidaPatientDataStatisticsList'] = + this.yakeenVidaPatientDataStatisticsList; + data['YakeenVidaPatientDataStatisticsPrefferedList'] = + this.yakeenVidaPatientDataStatisticsPrefferedList; + data['accessToken'] = this.accessToken; + data['categoryCode'] = this.categoryCode; + data['categoryNameAr'] = this.categoryNameAr; + data['categoryNameEn'] = this.categoryNameEn; + data['constraintCode'] = this.constraintCode; + data['constraintNameAr'] = this.constraintNameAr; + data['constraintNameEn'] = this.constraintNameEn; + data['content'] = this.content; + data['errorList'] = this.errorList; + data['licenseExpiryDate'] = this.licenseExpiryDate; + data['licenseIssuedDate'] = this.licenseIssuedDate; + data['licenseStatusCode'] = this.licenseStatusCode; + data['licenseStatusDescAr'] = this.licenseStatusDescAr; + data['licenseStatusDescEn'] = this.licenseStatusDescEn; + data['organizations'] = this.organizations; + data['registrationNumber'] = this.registrationNumber; + data['specialtyCode'] = this.specialtyCode; + data['specialtyNameAr'] = this.specialtyNameAr; + data['specialtyNameEn'] = this.specialtyNameEn; + return data; + } +} diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index fefa9021..c168494d 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -1,11 +1,15 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoResponseModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientRegistrationService extends BaseService { + GetPatientInfoResponseModel getPatientInfoResponseModel; + checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { hasError = false; @@ -17,6 +21,19 @@ class PatientRegistrationService extends BaseService { }, body: registrationModel.toJson()); } + getPatientInfo(GetPatientInfoRequestModel getPatientInfoRequestMode) async { + hasError = false; + await baseAppClient.post(GET_PATIENT_INFO, + onSuccess: (dynamic response, int statusCode) { + getPatientInfoResponseModel = + GetPatientInfoResponseModel.fromJson(response); + print("ddd"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientInfoRequestMode.toJson()); + } + sendActivationCodeByOTPNotificationType( SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel) async { diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 6dddffcd..93442120 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoResponseModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/service/PatientRegistrationService.dart'; @@ -12,14 +14,33 @@ class PatientRegistrationViewModel extends BaseViewModel { PatientRegistrationService _patientRegistrationService = locator(); + + GetPatientInfoResponseModel get getPatientInfoResponseModel =>_patientRegistrationService.getPatientInfoResponseModel; + + + CheckPatientForRegistrationModel checkPatientForRegistrationModel ; Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { - setState(ViewState.Busy); + + checkPatientForRegistrationModel =registrationModel; + setState(ViewState.BusyLocal); await _patientRegistrationService .checkPatientForRegistration(registrationModel); if (_patientRegistrationService.hasError) { error = _patientRegistrationService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getPatientInfo( + GetPatientInfoRequestModel getPatientInfoRequestModel) async { + setState(ViewState.BusyLocal); + await _patientRegistrationService. + getPatientInfo(getPatientInfoRequestModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index d6d07a6f..92587f46 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -2,10 +2,12 @@ import 'package:doctor_app_flutter/config/config.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/PatientRegistration/PatientRegistrationModel.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/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/operation_report_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'; @@ -36,15 +38,13 @@ import 'CustomEditableText.dart'; class RegisterConfirmationPatientPage extends StatefulWidget { final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; - final int visitType; - final bool isUpdate; + final PatientRegistrationViewModel model; + const RegisterConfirmationPatientPage( {Key key, this.operationReportViewModel, - this.patient, - this.visitType, - this.isUpdate}) + this.patient, this.model}) : super(key: key); @override @@ -54,11 +54,7 @@ class RegisterConfirmationPatientPage extends StatefulWidget { class _RegisterConfirmationPatientPageState extends State { - int selectedType; bool isSubmitted = false; - stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; - var event = RobotProvider(); ProjectViewModel projectViewModel; TextEditingController firstName = TextEditingController(text: "Elham"); TextEditingController middleName = TextEditingController(text: "Ali"); @@ -66,11 +62,6 @@ class _RegisterConfirmationPatientPageState TextEditingController emailAddressController = TextEditingController(text: "Elham@Rababah.com"); - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } @override void initState() { @@ -308,6 +299,76 @@ class _RegisterConfirmationPatientPageState ), ), ), + bottomSheet: Container( + height: 60, + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { + GifLoaderDialogUtils.showMyDialog(context); + PatientRegistrationModel + patientRegistrationModel = + PatientRegistrationModel( + // patientIdentificationID: + // int.parse(_idController.text), + // patientMobileNumber: + // int.parse(_phoneController.text), + // zipCode: _phoneCode.text, + isHijri: 0, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + // dOB: + // "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}" + ); + await widget.model.registrationPatient( + patientRegistrationModel); + if(widget.model.state == ViewState.ErrorLocal){ + Helpers.showErrorToast(widget.model.error); + } else { + Navigator.of(context).pop(); + } + + GifLoaderDialogUtils.hideDialog(context); + + }, + ), + ), + ), + ], + ), + ), ); } diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index abd74d9c..a2c5d788 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -98,8 +98,8 @@ class _RegisterPatientPageState extends State }, scrollDirection: Axis.horizontal, children: [ - RegisterSearchPatientPage(), - RegisterConfirmationPatientPage(), + // RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,), + RegisterConfirmationPatientPage(model: model,), ]), ), @@ -107,7 +107,7 @@ class _RegisterPatientPageState extends State ], ), )), - pagerButtons(model), + // pagerButtons(model), ], ), ), diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 5260cc3b..756970f9 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -1,20 +1,30 @@ +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/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.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:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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'; class RegisterSearchPatientPage extends StatefulWidget { - const RegisterSearchPatientPage({Key key}) : super(key: key); + final Function changePageViewIndex; + + const RegisterSearchPatientPage({Key key, this.changePageViewIndex}) + : super(key: key); @override _RegisterSearchPatientPageState createState() => @@ -25,10 +35,12 @@ class _RegisterSearchPatientPageState extends State { String countryError; dynamic _selectedCountry; - final _phoneController = TextEditingController(); + TextEditingController _phoneController = TextEditingController(); + TextEditingController _phoneCode = TextEditingController(text: "966"); + String phoneError; - final _idController = TextEditingController(); + TextEditingController _idController = TextEditingController(); String idError; DateTime _birthDate; @@ -68,7 +80,7 @@ class _RegisterSearchPatientPageState extends State { validationError: countryError, dropDownText: _selectedCountry != null ? _selectedCountry['nameEn'] - : null, + : "Saudi Arabia", enabled: false, /*onClick: model.dietTypesList != null && model.dietTypesList.length > 0 ? () { @@ -99,12 +111,31 @@ class _RegisterSearchPatientPageState extends State { SizedBox( height: 10, ), - AppTextFieldCustom( - height: screenSize.height * 0.075, - hintText: "Phone Number", - inputType: TextInputType.phone, - controller: _phoneController, - validationError: phoneError, + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.3, + child: AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Code", + inputType: TextInputType.phone, + controller: _phoneCode, + validationError: phoneError, + ), + ), + Expanded( + child: Container( + // width: MediaQuery.of(context).size.width*0.7, + child: AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Phone Number", + inputType: TextInputType.phone, + controller: _phoneController, + validationError: phoneError, + ), + ), + ), + ], ), SizedBox( height: 10, @@ -131,7 +162,7 @@ class _RegisterSearchPatientPageState extends State { height: screenSize.height * 0.075, hintText: "Birthdate", dropDownText: _birthDate != null - ? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy-MM-dd")}" + ? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}" : null, enabled: false, isTextFieldHasSuffix: true, @@ -161,6 +192,89 @@ class _RegisterSearchPatientPageState extends State { ), ], ), + bottomSheet: Container( + height: 60, + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { + GifLoaderDialogUtils.showMyDialog(context); + CheckPatientForRegistrationModel + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel( + patientIdentificationID: + int.parse(_idController.text), + patientMobileNumber: + int.parse(_phoneController.text), + zipCode: _phoneCode.text, + isHijri: 0, + patientID: 0, + isRegister: false, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + dOB: + "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); + await model.checkPatientForRegistration( + checkPatientForRegistrationModel); + GetPatientInfoRequestModel getPatientInfoRequestModel = + GetPatientInfoRequestModel( + //TODO Elham* this return the static to dynamic + patientIdentificationID:"1062938285", //_idController.text, + isHijri: 0, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + sessionID: null, + dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" + + ); + await model.getPatientInfo(getPatientInfoRequestModel); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + + GifLoaderDialogUtils.hideDialog(context); + }, + ), + ), + ), + ], + ), + ), ), ); } @@ -170,8 +284,8 @@ class _RegisterSearchPatientPageState extends State { final DateTime picked = await showDatePicker( context: context, initialDate: dateTime, - firstDate: DateTime.now(), - lastDate: DateTime(2040), + firstDate: DateTime(DateTime.now().year - 150), + lastDate: DateTime(DateTime.now().year + 150), initialEntryMode: DatePickerEntryMode.calendar, ); if (picked != null && picked != dateTime) { From f4311b410635e9a4a1a4937da0478cccf039366a Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 2 Nov 2021 17:31:39 +0200 Subject: [PATCH 101/199] first step form register patient service --- .../register_patient/RegisterConfirmationPatientPage.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 92587f46..9fb9aeec 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -65,6 +65,9 @@ class _RegisterConfirmationPatientPageState @override void initState() { + firstName = TextEditingController(text: widget.model.getPatientInfoResponseModel.firstNameEn); + middleName = TextEditingController(text: ""); + lastName = TextEditingController(text: widget.model.getPatientInfoResponseModel.lastNameEn); super.initState(); } From 324f515253a2d28e682ab1948aec709893665490 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 2 Nov 2021 17:32:46 +0200 Subject: [PATCH 102/199] first step form register patient service --- lib/screens/patients/register_patient/RegisterPatientPage.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index a2c5d788..687b231d 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -98,7 +98,7 @@ class _RegisterPatientPageState extends State }, scrollDirection: Axis.horizontal, children: [ - // RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,), + RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,), RegisterConfirmationPatientPage(model: model,), ]), From d4927873d51b4b53b43cf7edee03a9fff9bbb68f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 3 Nov 2021 09:20:32 +0200 Subject: [PATCH 103/199] fix lap result special --- lib/core/model/labs/all_special_lab_result_model.dart | 2 +- .../profile/lab_result/all_lab_special_result_page.dart | 5 ++++- pubspec.lock | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/core/model/labs/all_special_lab_result_model.dart b/lib/core/model/labs/all_special_lab_result_model.dart index ffea88de..ffdc5ee5 100644 --- a/lib/core/model/labs/all_special_lab_result_model.dart +++ b/lib/core/model/labs/all_special_lab_result_model.dart @@ -1,5 +1,5 @@ class AllSpecialLabResultModel { - int actualDoctorRate; + dynamic actualDoctorRate; dynamic admissionDate; dynamic admissionNumber; dynamic appointmentDate; diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 9a7ffd63..545b4378 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -3,6 +3,7 @@ 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/special_lab_result_details_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/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -174,7 +175,9 @@ class _AllLabSpecialResultState extends State { clinic: model .allSpecialLabList[index].clinicDescription, appointmentDate: - model.allSpecialLabList[index].orderDate, + AppDateUtils.getDateTimeFromServerFormat( + model.allSpecialLabList[index].createdOn, + ), orderNo: model.allSpecialLabList[index].orderNo, isShowTime: false, ), diff --git a/pubspec.lock b/pubspec.lock index 43aefcb2..53035a4a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -692,7 +692,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: @@ -1026,7 +1026,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: @@ -1231,5 +1231,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <2.11.0" + dart: ">=2.10.2 <=2.11.0-213.1.beta" flutter: ">=1.22.2 <2.0.0" From 514fb71c5140f4f3e9d4573c0c5cebb2a82ec7c5 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 3 Nov 2021 09:33:28 +0200 Subject: [PATCH 104/199] mock the calling the second service --- .../PatientRegistrationViewModel.dart | 108 ++++- .../RegisterConfirmationPatientPage.dart | 22 +- .../register_patient/RegisterPatientPage.dart | 2 +- .../RegisterSearchPatientPage.dart | 378 +++++++++--------- 4 files changed, 301 insertions(+), 209 deletions(-) diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 93442120..03f2413b 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -17,12 +17,11 @@ class PatientRegistrationViewModel extends BaseViewModel { GetPatientInfoResponseModel get getPatientInfoResponseModel =>_patientRegistrationService.getPatientInfoResponseModel; - CheckPatientForRegistrationModel checkPatientForRegistrationModel ; Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { - checkPatientForRegistrationModel =registrationModel; + checkPatientForRegistrationModel =CheckPatientForRegistrationModel.fromJson(registrationModel.toJson()); setState(ViewState.BusyLocal); await _patientRegistrationService .checkPatientForRegistration(registrationModel); @@ -36,13 +35,104 @@ class PatientRegistrationViewModel extends BaseViewModel { Future getPatientInfo( GetPatientInfoRequestModel getPatientInfoRequestModel) async { setState(ViewState.BusyLocal); - await _patientRegistrationService. - getPatientInfo(getPatientInfoRequestModel); - if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); + /// TODO Elham* return call service when it working + _patientRegistrationService.getPatientInfoResponseModel = GetPatientInfoResponseModel.fromJson({ + "Date": null, + "LanguageID": 0, + "ServiceName": 0, + "Time": null, + "AndroidLink": null, + "AuthenticationTokenID": null, + "Data": null, + "Dataw": false, + "DietType": 0, + "ErrorCode": null, + "ErrorEndUserMessage": null, + "ErrorEndUserMessageN": null, + "ErrorMessage": null, + "ErrorType": 0, + "FoodCategory": 0, + "IOSLink": null, + "IsAuthenticated": false, + "MealOrderStatus": 0, + "MealType": 0, + "MessageStatus": 1, + "NumberOfResultRecords": 0, + "PatientBlodType": null, + "SuccessMsg": null, + "SuccessMsgN": null, + "VidaUpdatedResponse": null, + "AccessTokenObject": null, + "Age": 33, + "ClientIdentifierId": null, + "CreatedBy": 0, + "DateOfBirth": "07/31/1988", + "FirstNameAr": "سفيان", + "FirstNameEn": "SUFIAN", + "Gender": "M", + "GenderAr": null, + "GenderEn": null, + "HealthId": "30000018540264", + "IdNumber": "1062938285", + "IdType": "NationalId", + "IsHijri": false, + "IsInstertedOrUpdated": 0, + "IsNull": 0, + "IsPatientExistNHIC": 0, + "IsRecordLockedByCurrentUser": false, + "LastNameAr": "عثمان", + "LastNameEn": "OTHMAN", + "List_ActiveAccessToken": null, + "MaritalStatus": "غير معروف", + "MaritalStatusCode": "U", + "NationalDateOfBirth": "18/12/1408", + "Nationality": "السعودية", + "NationalityCode": "SAU", + "Occupation": "طالب", + "PCDTransactionDataResultList": null, + "PCD_GetVidaPatientForManualVerificationList": null, + "PCD_NHIC_HMG_PatientDetailsMatchCalulationList": null, + "PCD_ReturnValue": 0, + "PatientStatus": "-", + "PlaceofBirth": "فينا", + "PractitionerStatusCode": null, + "PractitionerStatusDescAr": null, + "PractitionerStatusDescEn": null, + "RowCount": 0, + "SecondNameAr": "عبدالهادي", + "SecondNameEn": "ABDULHADI", + "ThirdNameAr": "احمد", + "ThirdNameEn": "A", + "YakeenVidaPatientDataStatisticsByPatientIdList": null, + "YakeenVidaPatientDataStatisticsList": null, + "YakeenVidaPatientDataStatisticsPrefferedList": null, + "accessToken": null, + "categoryCode": 0, + "categoryNameAr": null, + "categoryNameEn": null, + "constraintCode": 0, + "constraintNameAr": null, + "constraintNameEn": null, + "content": null, + "errorList": null, + "licenseExpiryDate": null, + "licenseIssuedDate": null, + "licenseStatusCode": null, + "licenseStatusDescAr": null, + "licenseStatusDescEn": null, + "organizations": null, + "registrationNumber": null, + "specialtyCode": 0, + "specialtyNameAr": null, + "specialtyNameEn": null + }); + // await _patientRegistrationService. + // getPatientInfo(getPatientInfoRequestModel); + // if (_patientRegistrationService.hasError) { + // error = _patientRegistrationService.error; + // setState(ViewState.ErrorLocal); + // } else + // setState(ViewState.Idle); } Future sendActivationCodeByOTPNotificationType( diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 9fb9aeec..afc3e5bd 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -56,11 +56,10 @@ class _RegisterConfirmationPatientPageState extends State { bool isSubmitted = false; ProjectViewModel projectViewModel; - TextEditingController firstName = TextEditingController(text: "Elham"); - TextEditingController middleName = TextEditingController(text: "Ali"); - TextEditingController lastName = TextEditingController(text: "Rababah"); - TextEditingController emailAddressController = - TextEditingController(text: "Elham@Rababah.com"); + TextEditingController firstName; + TextEditingController middleName ; + TextEditingController lastName; + TextEditingController emailAddressController; @override @@ -132,7 +131,7 @@ class _RegisterConfirmationPatientPageState fontSize: 12, color: Colors.black), AppText( - "123456", + "${widget.model.getPatientInfoResponseModel.healthId}", fontSize: 12, color: Colors.grey[600], ), @@ -148,7 +147,8 @@ class _RegisterConfirmationPatientPageState fontSize: 12, color: Colors.black), AppText( - "ss", + "${widget.model.getPatientInfoResponseModel.idNumber}", + fontSize: 12, color: Colors.grey[600], ), @@ -176,7 +176,7 @@ class _RegisterConfirmationPatientPageState fontSize: 12, color: Colors.black), AppText( - "Jordanian", + "${widget.model.getPatientInfoResponseModel.nationality}", fontSize: 12, color: Colors.grey[600], ), @@ -192,7 +192,8 @@ class _RegisterConfirmationPatientPageState fontSize: 12, color: Colors.black), AppText( - "--", + "${widget.model.getPatientInfoResponseModel.occupation}", + fontSize: 12, color: Colors.grey[600], ), @@ -220,7 +221,8 @@ class _RegisterConfirmationPatientPageState fontSize: 12, color: Colors.black), AppText( - "075XXXXXX", + "${widget.model.checkPatientForRegistrationModel.patientMobileNumber}", + fontSize: 12, color: Colors.grey[600], ), diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 687b231d..55c27fb4 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -98,7 +98,7 @@ class _RegisterPatientPageState extends State }, scrollDirection: Axis.horizontal, children: [ - RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,), + RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,model: model), RegisterConfirmationPatientPage(model: model,), ]), diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 756970f9..98ac704e 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -22,8 +22,10 @@ import 'package:flutter/material.dart'; class RegisterSearchPatientPage extends StatefulWidget { final Function changePageViewIndex; + final PatientRegistrationViewModel model; - const RegisterSearchPatientPage({Key key, this.changePageViewIndex}) + + const RegisterSearchPatientPage({Key key, this.changePageViewIndex, this.model}) : super(key: key); @override @@ -50,41 +52,40 @@ class _RegisterSearchPatientPageState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Column( - children: [ - Expanded( - child: Container( - width: double.infinity, - margin: EdgeInsets.all(16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "Please enter mobile number or Identification number", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.w800, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: screenSize.height * 0.075, - hintText: "Country", - isTextFieldHasSuffix: true, - validationError: countryError, - dropDownText: _selectedCountry != null - ? _selectedCountry['nameEn'] - : "Saudi Arabia", - enabled: false, - /*onClick: model.dietTypesList != null && model.dietTypesList.length > 0 + return AppScaffold( + baseViewModel: widget.model, + isShowAppBar: false, + body: Column( + children: [ + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please enter mobile number or Identification number", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Country", + isTextFieldHasSuffix: true, + validationError: countryError, + dropDownText: _selectedCountry != null + ? _selectedCountry['nameEn'] + : "Saudi Arabia", + enabled: false, + /*onClick: widget.model.dietTypesList != null && widget.model.dietTypesList.length > 0 ? () { - openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { + openListDialogField('nameEn', 'id', widget.model.dietTypesList, (selectedValue) { setState(() { _selectedCountry = selectedValue; }); @@ -95,185 +96,184 @@ class _RegisterSearchPatientPageState extends State { await model .getDietTypes(patient.patientId) .then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.dietTypesList.length > 0) { - openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { + if (widget.model.state == ViewState.Idle && widget.model.dietTypesList.length > 0) { + openListDialogField('nameEn', 'id', widget.model.dietTypesList, (selectedValue) { setState(() { _selectedCountry = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (widget.model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(widget.model.error); } else { DrAppToastMsg.showErrorToast("Empty List"); } },*/ - ), - SizedBox( - height: 10, - ), - Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.3, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.3, + child: AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Code", + inputType: TextInputType.phone, + controller: _phoneCode, + validationError: phoneError, + ), + ), + Expanded( + child: Container( + // width: MediaQuery.of(context).size.width*0.7, child: AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: "Code", + hintText: "Phone Number", inputType: TextInputType.phone, - controller: _phoneCode, + controller: _phoneController, validationError: phoneError, ), ), - Expanded( - child: Container( - // width: MediaQuery.of(context).size.width*0.7, - child: AppTextFieldCustom( - height: screenSize.height * 0.075, - hintText: "Phone Number", - inputType: TextInputType.phone, - controller: _phoneController, - validationError: phoneError, - ), - ), - ), - ], - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: screenSize.height * 0.075, - hintText: "ID Number", - inputType: TextInputType.phone, - controller: _idController, - validationError: idError, - ), - SizedBox( - height: 12, - ), - AppText( - "Calender", - fontSize: SizeConfig.textMultiplier * 1.8, - fontWeight: FontWeight.w800, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: screenSize.height * 0.075, - hintText: "Birthdate", - dropDownText: _birthDate != null - ? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}" - : null, - enabled: false, - isTextFieldHasSuffix: true, - validationError: birthdateError, - suffixIcon: IconButton( - icon: Icon( - Icons.calendar_today, - color: Colors.black, - ), - onPressed: null, ), - onClick: () { - if (_birthDate == null) { - _birthDate = DateTime.now(); - } - _selectDate(context, _birthDate, (picked) { - setState(() { - _birthDate = picked; - }); - }); - }, + ], + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "ID Number", + inputType: TextInputType.phone, + controller: _idController, + validationError: idError, + ), + SizedBox( + height: 12, + ), + AppText( + "Calender", + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w800, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Birthdate", + dropDownText: _birthDate != null + ? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}" + : null, + enabled: false, + isTextFieldHasSuffix: true, + validationError: birthdateError, + suffixIcon: IconButton( + icon: Icon( + Icons.calendar_today, + color: Colors.black, + ), + onPressed: null, ), - ], - ), + onClick: () { + if (_birthDate == null) { + _birthDate = DateTime.now(); + } + _selectDate(context, _birthDate, (picked) { + setState(() { + _birthDate = picked; + }); + }); + }, + ), + ], ), ), ), - ], - ), - bottomSheet: Container( - height: 60, - margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), - child: Row( - children: [ - Expanded( - child: Container( - child: AppButton( - title: TranslationBase.of(context).cancel, - hasBorder: true, - vPadding: 12, - hPadding: 8, - borderColor: Color(0xFFeaeaea), - color: Color(0xFFeaeaea), - fontColor: Colors.black, - fontSize: 2.2, - onPressed: () { - Navigator.of(context).pop(); - }, - ), + ), + ], + ), + bottomSheet: Container( + height: 60, + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, ), ), - SizedBox( - width: 8, - ), - Expanded( - child: Container( - child: AppButton( - title: TranslationBase.of(context).next, - hasBorder: true, - vPadding: 12, - hPadding: 8, - borderColor: Color(0xFFB8382B), - color: Color(0xFFB8382B), - fontColor: Colors.white, - fontSize: 2.0, - onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); - CheckPatientForRegistrationModel - checkPatientForRegistrationModel = - CheckPatientForRegistrationModel( - patientIdentificationID: - int.parse(_idController.text), - patientMobileNumber: - int.parse(_phoneController.text), - zipCode: _phoneCode.text, - isHijri: 0, - patientID: 0, - isRegister: false, - isDentalAllowedBackend: false, - patientOutSA: 0, - generalid: GENERAL_ID, - dOB: - "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); - await model.checkPatientForRegistration( - checkPatientForRegistrationModel); - GetPatientInfoRequestModel getPatientInfoRequestModel = - GetPatientInfoRequestModel( - //TODO Elham* this return the static to dynamic - patientIdentificationID:"1062938285", //_idController.text, - isHijri: 0, - isDentalAllowedBackend: false, - patientOutSA: 0, - generalid: GENERAL_ID, - sessionID: null, - dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { + GifLoaderDialogUtils.showMyDialog(context); + CheckPatientForRegistrationModel + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel( + patientIdentificationID: + int.parse(_idController.text), + patientMobileNumber: + int.parse(_phoneController.text), + zipCode: _phoneCode.text, + isHijri: 0, + patientID: 0, + isRegister: false, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + dOB: + "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); + await widget.model.checkPatientForRegistration( + checkPatientForRegistrationModel); + GetPatientInfoRequestModel getPatientInfoRequestModel = + GetPatientInfoRequestModel( + //TODO Elham* this return the static to dynamic + patientIdentificationID:"1062938285", //_idController.text, + isHijri: 0, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + sessionID: null, + dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" - ); - await model.getPatientInfo(getPatientInfoRequestModel); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(1); - } + ); + await widget.model.getPatientInfo(getPatientInfoRequestModel); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + } else { + widget.changePageViewIndex(1); + } - GifLoaderDialogUtils.hideDialog(context); - }, - ), + GifLoaderDialogUtils.hideDialog(context); + }, ), ), - ], - ), + ), + ], ), ), ); From fd9e8ddb2814fb822adb5386f816a608d63a5052 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 3 Nov 2021 09:43:43 +0200 Subject: [PATCH 105/199] actaivation code page --- .../service/PatientRegistrationService.dart | 17 +++++++++++------ .../viewModel/PatientRegistrationViewModel.dart | 17 ++++++++--------- .../register_patient/RegisterPatientPage.dart | 8 ++++++-- .../register_patient/VerifyMethodPage.dart | 4 +++- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 2ca70aea..084bde69 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfo import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; class PatientRegistrationService extends BaseService { GetPatientInfoResponseModel getPatientInfoResponseModel; @@ -37,17 +38,21 @@ class PatientRegistrationService extends BaseService { sendActivationCodeByOTPNotificationType( {SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - int otpType}) async { + int otpType, + PatientRegistrationViewModel user}) async { registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( oTPSendType: otpType, - patientIdentificationID: 1062938285, - patientMobileNumber: 785228065, - zipCode: "966", + patientIdentificationID: + user.checkPatientForRegistrationModel.patientIdentificationID, + patientMobileNumber: + user.checkPatientForRegistrationModel.patientMobileNumber, + zipCode: user.checkPatientForRegistrationModel.zipCode, patientOutSA: false, - mobileNo: "785228065", healthId: "30000018540264", - dOB: "31/07/1988", + dOB: user.checkPatientForRegistrationModel.dOB, + isRegister: user.checkPatientForRegistrationModel.isRegister, + isHijri: user.checkPatientForRegistrationModel.isHijri, ); hasError = false; await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE, diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index d8a4ea2c..f7461054 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -14,15 +14,13 @@ class PatientRegistrationViewModel extends BaseViewModel { PatientRegistrationService _patientRegistrationService = locator(); + GetPatientInfoResponseModel get getPatientInfoResponseModel => + _patientRegistrationService.getPatientInfoResponseModel; - GetPatientInfoResponseModel get getPatientInfoResponseModel =>_patientRegistrationService.getPatientInfoResponseModel; - - - CheckPatientForRegistrationModel checkPatientForRegistrationModel ; + CheckPatientForRegistrationModel checkPatientForRegistrationModel; Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { - - checkPatientForRegistrationModel =registrationModel; + checkPatientForRegistrationModel = registrationModel; setState(ViewState.BusyLocal); await _patientRegistrationService .checkPatientForRegistration(registrationModel); @@ -36,8 +34,8 @@ class PatientRegistrationViewModel extends BaseViewModel { Future getPatientInfo( GetPatientInfoRequestModel getPatientInfoRequestModel) async { setState(ViewState.BusyLocal); - await _patientRegistrationService. - getPatientInfo(getPatientInfoRequestModel); + await _patientRegistrationService + .getPatientInfo(getPatientInfoRequestModel); if (_patientRegistrationService.hasError) { error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); @@ -48,7 +46,8 @@ class PatientRegistrationViewModel extends BaseViewModel { Future sendActivationCodeByOTPNotificationType( {SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - int otpType}) async { + int otpType, + PatientRegistrationViewModel user}) async { setState(ViewState.Busy); await _patientRegistrationService.sendActivationCodeByOTPNotificationType( otpType: otpType); diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 382dd501..efe816cf 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -99,8 +99,12 @@ class _RegisterPatientPageState extends State }, scrollDirection: Axis.horizontal, children: [ - RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,), - ActivationPage(model: model,), + RegisterSearchPatientPage( + changePageViewIndex: changePageViewIndex, + ), + ActivationPage( + user: model, + ), RegisterConfirmationPatientPage(), ]), ), diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 885b2701..21286014 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -7,7 +8,8 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class ActivationPage extends StatefulWidget { - const ActivationPage({Key key}) : super(key: key); + PatientRegistrationViewModel user = PatientRegistrationViewModel(); + ActivationPage({this.user}); @override _ActivationPageState createState() => _ActivationPageState(); From 13c42b297a6621586580c1ad3ee77460568d9449 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 3 Nov 2021 17:08:47 +0200 Subject: [PATCH 106/199] check activation code --- .../service/PatientRegistrationService.dart | 22 +- .../PatientRegistrationViewModel.dart | 205 ++++--- .../register_patient/RegisterPatientPage.dart | 12 +- .../register_patient/VerifyMethodPage.dart | 552 ++++++++++++++---- 4 files changed, 559 insertions(+), 232 deletions(-) diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 084bde69..ed3db005 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -39,20 +39,21 @@ class PatientRegistrationService extends BaseService { {SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, int otpType, - PatientRegistrationViewModel user}) async { + PatientRegistrationViewModel user, + CheckPatientForRegistrationModel + checkPatientForRegistrationModel}) async { registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( oTPSendType: otpType, patientIdentificationID: - user.checkPatientForRegistrationModel.patientIdentificationID, - patientMobileNumber: - user.checkPatientForRegistrationModel.patientMobileNumber, - zipCode: user.checkPatientForRegistrationModel.zipCode, + checkPatientForRegistrationModel.patientIdentificationID, + patientMobileNumber: checkPatientForRegistrationModel.patientMobileNumber, + zipCode: checkPatientForRegistrationModel.zipCode, patientOutSA: false, healthId: "30000018540264", - dOB: user.checkPatientForRegistrationModel.dOB, - isRegister: user.checkPatientForRegistrationModel.isRegister, - isHijri: user.checkPatientForRegistrationModel.isHijri, + dOB: checkPatientForRegistrationModel.dOB, + isRegister: checkPatientForRegistrationModel.isRegister, + isHijri: checkPatientForRegistrationModel.isHijri, ); hasError = false; await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE, @@ -69,8 +70,9 @@ class PatientRegistrationService extends BaseService { checkActivationCode(CheckActivationCodeModel registrationModel) async { hasError = false; await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_PATIENT, - onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) { + onSuccess: (dynamic response, int statusCode) { + registrationModel = CheckActivationCodeModel.fromJson(response); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: registrationModel.toJson()); diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 12c57ff0..aee62cad 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -14,19 +14,17 @@ class PatientRegistrationViewModel extends BaseViewModel { PatientRegistrationService _patientRegistrationService = locator(); - - GetPatientInfoResponseModel get getPatientInfoResponseModel =>_patientRegistrationService.getPatientInfoResponseModel; - - CheckPatientForRegistrationModel checkPatientForRegistrationModel ; GetPatientInfoResponseModel get getPatientInfoResponseModel => _patientRegistrationService.getPatientInfoResponseModel; CheckPatientForRegistrationModel checkPatientForRegistrationModel; + Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { checkPatientForRegistrationModel = registrationModel; - checkPatientForRegistrationModel =CheckPatientForRegistrationModel.fromJson(registrationModel.toJson()); + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel.fromJson(registrationModel.toJson()); setState(ViewState.BusyLocal); await _patientRegistrationService .checkPatientForRegistration(registrationModel); @@ -40,111 +38,106 @@ class PatientRegistrationViewModel extends BaseViewModel { Future getPatientInfo( GetPatientInfoRequestModel getPatientInfoRequestModel) async { setState(ViewState.BusyLocal); + /// TODO Elham* return call service when it working - _patientRegistrationService.getPatientInfoResponseModel = GetPatientInfoResponseModel.fromJson({ - "Date": null, - "LanguageID": 0, - "ServiceName": 0, - "Time": null, - "AndroidLink": null, - "AuthenticationTokenID": null, - "Data": null, - "Dataw": false, - "DietType": 0, - "ErrorCode": null, - "ErrorEndUserMessage": null, - "ErrorEndUserMessageN": null, - "ErrorMessage": null, - "ErrorType": 0, - "FoodCategory": 0, - "IOSLink": null, - "IsAuthenticated": false, - "MealOrderStatus": 0, - "MealType": 0, - "MessageStatus": 1, - "NumberOfResultRecords": 0, - "PatientBlodType": null, - "SuccessMsg": null, - "SuccessMsgN": null, - "VidaUpdatedResponse": null, - "AccessTokenObject": null, - "Age": 33, - "ClientIdentifierId": null, - "CreatedBy": 0, - "DateOfBirth": "07/31/1988", - "FirstNameAr": "سفيان", - "FirstNameEn": "SUFIAN", - "Gender": "M", - "GenderAr": null, - "GenderEn": null, - "HealthId": "30000018540264", - "IdNumber": "1062938285", - "IdType": "NationalId", - "IsHijri": false, - "IsInstertedOrUpdated": 0, - "IsNull": 0, - "IsPatientExistNHIC": 0, - "IsRecordLockedByCurrentUser": false, - "LastNameAr": "عثمان", - "LastNameEn": "OTHMAN", - "List_ActiveAccessToken": null, - "MaritalStatus": "غير معروف", - "MaritalStatusCode": "U", - "NationalDateOfBirth": "18/12/1408", - "Nationality": "السعودية", - "NationalityCode": "SAU", - "Occupation": "طالب", - "PCDTransactionDataResultList": null, - "PCD_GetVidaPatientForManualVerificationList": null, - "PCD_NHIC_HMG_PatientDetailsMatchCalulationList": null, - "PCD_ReturnValue": 0, - "PatientStatus": "-", - "PlaceofBirth": "فينا", - "PractitionerStatusCode": null, - "PractitionerStatusDescAr": null, - "PractitionerStatusDescEn": null, - "RowCount": 0, - "SecondNameAr": "عبدالهادي", - "SecondNameEn": "ABDULHADI", - "ThirdNameAr": "احمد", - "ThirdNameEn": "A", - "YakeenVidaPatientDataStatisticsByPatientIdList": null, - "YakeenVidaPatientDataStatisticsList": null, - "YakeenVidaPatientDataStatisticsPrefferedList": null, - "accessToken": null, - "categoryCode": 0, - "categoryNameAr": null, - "categoryNameEn": null, - "constraintCode": 0, - "constraintNameAr": null, - "constraintNameEn": null, - "content": null, - "errorList": null, - "licenseExpiryDate": null, - "licenseIssuedDate": null, - "licenseStatusCode": null, - "licenseStatusDescAr": null, - "licenseStatusDescEn": null, - "organizations": null, - "registrationNumber": null, - "specialtyCode": 0, - "specialtyNameAr": null, - "specialtyNameEn": null - }); + _patientRegistrationService.getPatientInfoResponseModel = + GetPatientInfoResponseModel.fromJson({ + "Date": null, + "LanguageID": 0, + "ServiceName": 0, + "Time": null, + "AndroidLink": null, + "AuthenticationTokenID": null, + "Data": null, + "Dataw": false, + "DietType": 0, + "ErrorCode": null, + "ErrorEndUserMessage": null, + "ErrorEndUserMessageN": null, + "ErrorMessage": null, + "ErrorType": 0, + "FoodCategory": 0, + "IOSLink": null, + "IsAuthenticated": false, + "MealOrderStatus": 0, + "MealType": 0, + "MessageStatus": 1, + "NumberOfResultRecords": 0, + "PatientBlodType": null, + "SuccessMsg": null, + "SuccessMsgN": null, + "VidaUpdatedResponse": null, + "AccessTokenObject": null, + "Age": 33, + "ClientIdentifierId": null, + "CreatedBy": 0, + "DateOfBirth": "07/31/1988", + "FirstNameAr": "سفيان", + "FirstNameEn": "SUFIAN", + "Gender": "M", + "GenderAr": null, + "GenderEn": null, + "HealthId": "30000018540264", + "IdNumber": "1062938285", + "IdType": "NationalId", + "IsHijri": false, + "IsInstertedOrUpdated": 0, + "IsNull": 0, + "IsPatientExistNHIC": 0, + "IsRecordLockedByCurrentUser": false, + "LastNameAr": "عثمان", + "LastNameEn": "OTHMAN", + "List_ActiveAccessToken": null, + "MaritalStatus": "غير معروف", + "MaritalStatusCode": "U", + "NationalDateOfBirth": "18/12/1408", + "Nationality": "السعودية", + "NationalityCode": "SAU", + "Occupation": "طالب", + "PCDTransactionDataResultList": null, + "PCD_GetVidaPatientForManualVerificationList": null, + "PCD_NHIC_HMG_PatientDetailsMatchCalulationList": null, + "PCD_ReturnValue": 0, + "PatientStatus": "-", + "PlaceofBirth": "فينا", + "PractitionerStatusCode": null, + "PractitionerStatusDescAr": null, + "PractitionerStatusDescEn": null, + "RowCount": 0, + "SecondNameAr": "عبدالهادي", + "SecondNameEn": "ABDULHADI", + "ThirdNameAr": "احمد", + "ThirdNameEn": "A", + "YakeenVidaPatientDataStatisticsByPatientIdList": null, + "YakeenVidaPatientDataStatisticsList": null, + "YakeenVidaPatientDataStatisticsPrefferedList": null, + "accessToken": null, + "categoryCode": 0, + "categoryNameAr": null, + "categoryNameEn": null, + "constraintCode": 0, + "constraintNameAr": null, + "constraintNameEn": null, + "content": null, + "errorList": null, + "licenseExpiryDate": null, + "licenseIssuedDate": null, + "licenseStatusCode": null, + "licenseStatusDescAr": null, + "licenseStatusDescEn": null, + "organizations": null, + "registrationNumber": null, + "specialtyCode": 0, + "specialtyNameAr": null, + "specialtyNameEn": null + }); // await _patientRegistrationService. // getPatientInfo(getPatientInfoRequestModel); // if (_patientRegistrationService.hasError) { // error = _patientRegistrationService.error; // setState(ViewState.ErrorLocal); // } else - // setState(ViewState.Idle); - await _patientRegistrationService - .getPatientInfo(getPatientInfoRequestModel); - if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); + setState(ViewState.Idle); } Future sendActivationCodeByOTPNotificationType( @@ -153,8 +146,12 @@ class PatientRegistrationViewModel extends BaseViewModel { int otpType, PatientRegistrationViewModel user}) async { setState(ViewState.Busy); + print(checkPatientForRegistrationModel); + print(checkPatientForRegistrationModel); + await _patientRegistrationService.sendActivationCodeByOTPNotificationType( - otpType: otpType); + otpType: otpType, + checkPatientForRegistrationModel: checkPatientForRegistrationModel); if (_patientRegistrationService.hasError) { error = _patientRegistrationService.error; setState(ViewState.Error); diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 52e3b0c9..f9d6d5d3 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -99,16 +99,16 @@ class _RegisterPatientPageState extends State }, scrollDirection: Axis.horizontal, children: [ - RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,model: model), - RegisterConfirmationPatientPage(model: model,), - RegisterSearchPatientPage( + changePageViewIndex: changePageViewIndex, + model: model), + ActivationPage( + model: model, changePageViewIndex: changePageViewIndex, ), - ActivationPage( - user: model, + RegisterConfirmationPatientPage( + model: model, ), - RegisterConfirmationPatientPage(), ]), ), ), diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 21286014..b959e0a8 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -2,147 +2,475 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.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:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class ActivationPage extends StatefulWidget { - PatientRegistrationViewModel user = PatientRegistrationViewModel(); - ActivationPage({this.user}); + final PatientRegistrationViewModel model; + final Function changePageViewIndex; + ActivationPage({this.model, this.changePageViewIndex}); @override _ActivationPageState createState() => _ActivationPageState(); } class _ActivationPageState extends State { + bool isSendOtp = false; + final verifyAccountForm = GlobalKey(); + TextStyle buildTextStyle() { + return TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ); + } + + Map verifyAccountFormValue = { + 'digit1': '', + 'digit2': '', + 'digit3': '', + 'digit4': '', + }; + final focusD1 = FocusNode(); + final focusD2 = FocusNode(); + final focusD3 = FocusNode(); + final focusD4 = FocusNode(); + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + @override Widget build(BuildContext context) { - return BaseView( - builder: (_, model, w) => AppScaffold( - baseViewModel: model, + return AppScaffold( + baseViewModel: widget.model, isShowAppBar: false, body: Column( children: [ - Container( - width: double.infinity, - margin: EdgeInsets.all(16.0), - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "Please select how you want to be verified", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.w800, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: InkWell( - onTap: () { - model.sendActivationCodeByOTPNotificationType( - otpType: 1); - }, - child: Container( - height: - MediaQuery.of(context).size.height * 0.233, - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10), - ), - border: Border.all( - color: HexColor('#707070'), width: 0.1), - ), - child: Column( - children: [ - Row( - children: [ - Image.asset( - "assets/images/verify-sms.png", - height: - MediaQuery.of(context).size.height * - 0.15, - width: - MediaQuery.of(context).size.width * - 0.15, + Visibility( + //visible: isSendOtp, + child: !isSendOtp + ? Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please select how you want to be verified", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () async { + setState(() { + isSendOtp = true; + }); + + await widget.model + .sendActivationCodeByOTPNotificationType( + otpType: 1); + }, + child: Container( + height: + MediaQuery.of(context).size.height * + 0.233, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), + ), + child: Column( + children: [ + Row( + children: [ + Image.asset( + "assets/images/verify-sms.png", + height: MediaQuery.of(context) + .size + .height * + 0.15, + width: MediaQuery.of(context) + .size + .width * + 0.15, + ), + ], + ), + SizedBox( + height: 20, + ), + AppText( + "Verify through SMS", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ) + ], ), - ], + ), ), - SizedBox( - height: 20, + ), + Expanded( + child: InkWell( + onTap: () async { + isSendOtp = false; + await widget.model + .sendActivationCodeByOTPNotificationType( + otpType: 1, user: widget.model); + }, + child: Container( + height: + MediaQuery.of(context).size.height * + 0.233, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), + ), + child: Column( + children: [ + Row( + children: [ + Image.asset( + "assets/images/verify-whtsapp.png", + height: MediaQuery.of(context) + .size + .height * + 0.15, + width: MediaQuery.of(context) + .size + .width * + 0.15, + ), + ], + ), + SizedBox( + height: 20, + ), + AppText( + "Verify through WhatsApp", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ) + ], + ), + ), ), - AppText( - "Verify through SMS", - fontSize: 14, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - ) - ], - ), + ), + ], ), - ), + ], ), - Expanded( - child: InkWell( - onTap: () { - model.sendActivationCodeByOTPNotificationType( - otpType: 1); - }, - child: Container( - height: - MediaQuery.of(context).size.height * 0.233, - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10), - ), - border: Border.all( - color: HexColor('#707070'), width: 0.1), - ), - child: Column( - children: [ - Row( - children: [ - Image.asset( - "assets/images/verify-whtsapp.png", - height: - MediaQuery.of(context).size.height * - 0.15, - width: - MediaQuery.of(context).size.width * - 0.15, + ), + ) + : Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please enter the verification code sent to 02221552", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + Row( + children: [ + Center( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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, + )), + ], + )), ), - ], - ), - SizedBox( - height: 20, - ), - AppText( - "Verify through WhatsApp", - fontSize: 14, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - ) - ], - ), + ), + 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, + // ) + ]), + ) + ], + ))), + ], ), - ), + ], ), - ], + ), ), - ], - ), - ), ) ], ), + bottomSheet: isSendOtp + ? Container( + height: 60, + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { + //widget.model.checkActivationCode(), + }, + ), + ), + ), + ], + ), + ) + : null); + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + counterText: " ", + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10)), + borderSide: BorderSide(color: Colors.grey[300]), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Colors.grey[300]), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Colors.grey[300]), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), ), ); } From 3eddf2eab57eeb01b87ef7baa82f48338067f90e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 3 Nov 2021 17:13:59 +0200 Subject: [PATCH 107/199] first step from service part --- .../PatientRegistrationViewModel.dart | 4 +- .../RegisterConfirmationPatientPage.dart | 148 +++++++++++++----- lib/util/date-utils.dart | 4 + 3 files changed, 113 insertions(+), 43 deletions(-) diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 03f2413b..8f7ff521 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -159,11 +159,11 @@ class PatientRegistrationViewModel extends BaseViewModel { } Future registrationPatient(PatientRegistrationModel registrationModel) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _patientRegistrationService.registrationPatient(registrationModel); if (_patientRegistrationService.hasError) { error = _patientRegistrationService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index afc3e5bd..6f60ad5d 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/models/operation_report/create_update_operati import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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'; @@ -28,6 +29,7 @@ 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/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; @@ -38,13 +40,10 @@ import 'CustomEditableText.dart'; class RegisterConfirmationPatientPage extends StatefulWidget { final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; - final PatientRegistrationViewModel model; - + final PatientRegistrationViewModel model; const RegisterConfirmationPatientPage( - {Key key, - this.operationReportViewModel, - this.patient, this.model}) + {Key key, this.operationReportViewModel, this.patient, this.model}) : super(key: key); @override @@ -56,17 +55,28 @@ class _RegisterConfirmationPatientPageState extends State { bool isSubmitted = false; ProjectViewModel projectViewModel; - TextEditingController firstName; - TextEditingController middleName ; - TextEditingController lastName; + TextEditingController firstNameN; + TextEditingController middleNameN; + TextEditingController lastNameN; + TextEditingController firstNameAr; + TextEditingController middleNameAr; + TextEditingController lastNameAr; TextEditingController emailAddressController; - @override void initState() { - firstName = TextEditingController(text: widget.model.getPatientInfoResponseModel.firstNameEn); - middleName = TextEditingController(text: ""); - lastName = TextEditingController(text: widget.model.getPatientInfoResponseModel.lastNameEn); + firstNameN = TextEditingController( + text: widget.model.getPatientInfoResponseModel.firstNameEn); + middleNameN = TextEditingController(text: ""); + lastNameN = TextEditingController( + text: widget.model.getPatientInfoResponseModel.lastNameEn); + + firstNameAr = TextEditingController( + text: widget.model.getPatientInfoResponseModel.firstNameAr); + middleNameAr = TextEditingController(text: ""); + lastNameAr = TextEditingController( + text: widget.model.getPatientInfoResponseModel.lastNameAr); + emailAddressController = TextEditingController(text: ""); super.initState(); } @@ -95,23 +105,41 @@ class _RegisterConfirmationPatientPageState child: Column( children: [ CustomEditableText( - controller: firstName, + controller: firstNameN, hint: TranslationBase.of(context).firstName), SizedBox( height: 4, ), CustomEditableText( - controller: middleName, + controller: middleNameN, hint: TranslationBase.of(context).middleName), SizedBox( height: 4, ), CustomEditableText( - controller: lastName, + controller: lastNameN, hint: TranslationBase.of(context).lastName), SizedBox( height: 20, ), + CustomEditableText( + controller: firstNameAr, + hint: "First Name Arabic"), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: middleNameAr, + hint: "Middle Name Arabic"), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: lastNameAr, + hint: "Last Name Arabic"), + SizedBox( + height: 20, + ), FractionallySizedBox( widthFactor: .9, child: Center( @@ -148,7 +176,6 @@ class _RegisterConfirmationPatientPageState color: Colors.black), AppText( "${widget.model.getPatientInfoResponseModel.idNumber}", - fontSize: 12, color: Colors.grey[600], ), @@ -193,7 +220,6 @@ class _RegisterConfirmationPatientPageState color: Colors.black), AppText( "${widget.model.getPatientInfoResponseModel.occupation}", - fontSize: 12, color: Colors.grey[600], ), @@ -222,7 +248,6 @@ class _RegisterConfirmationPatientPageState color: Colors.black), AppText( "${widget.model.checkPatientForRegistrationModel.patientMobileNumber}", - fontSize: 12, color: Colors.grey[600], ), @@ -341,32 +366,77 @@ class _RegisterConfirmationPatientPageState fontColor: Colors.white, fontSize: 2.0, onPressed: () async { + print(widget.model + .getPatientInfoResponseModel.dateOfBirth); + + + + var dateFormat = DateFormat('MM/dd/yyyy').parse(widget.model + .getPatientInfoResponseModel.dateOfBirth); + String wellFormat = "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; + print (dateFormat.toUtc().toString()); + // return ; + GifLoaderDialogUtils.showMyDialog(context); - PatientRegistrationModel - patientRegistrationModel = - PatientRegistrationModel( - // patientIdentificationID: - // int.parse(_idController.text), - // patientMobileNumber: - // int.parse(_phoneController.text), - // zipCode: _phoneCode.text, - isHijri: 0, - isDentalAllowedBackend: false, - patientOutSA: 0, - generalid: GENERAL_ID, - // dOB: - // "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}" - ); - await widget.model.registrationPatient( - patientRegistrationModel); - if(widget.model.state == ViewState.ErrorLocal){ + PatientRegistrationModel patientRegistrationModel = + PatientRegistrationModel( + patientobject: Patientobject( + tempValue: true, + patientIdentificationNo: widget + .model + .checkPatientForRegistrationModel + .patientIdentificationID + .toString(), + patientIdentificationType: 1, + firstName: firstNameAr.text, + firstNameN: firstNameN.text, + lastName: lastNameAr.text, + lastNameN: lastNameN.text, + middleName: middleNameAr.text, + middleNameN: middleNameN.text, + strDateofBirth: dateFormat.toUtc().toString(), + dateofBirth: AppDateUtils.convertToServerFormat(widget.model.getPatientInfoResponseModel.dateOfBirth, 'MM/dd/yyyy'), + dateofBirthN: wellFormat, + gender: (widget.model.getPatientInfoResponseModel.gender == "M") + ? 1 + : 2, + sourceType: "1", + patientOutSA: 0, + nationalityID: widget + .model + .getPatientInfoResponseModel + .nationalityCode, + //todo Elham* change static value to dynamic + preferredLanguage: "1", + marital: "0", + eHealthIDField: widget + .model.getPatientInfoResponseModel.healthId, + emailAddress: emailAddressController.text, + mobileNumber: widget + .model + .checkPatientForRegistrationModel + .patientMobileNumber), + isHijri: 0, + logInTokenID: "zjgvKtLC/EK+saznJ/OkiA==", + isDentalAllowedBackend: false, + patientOutSA: 0, + sessionID: null, + patientMobileNumber: + widget.model.checkPatientForRegistrationModel.patientMobileNumber.toString(), + healthId: widget.model.getPatientInfoResponseModel.healthId, + generalid: GENERAL_ID, + patientIdentificationID: widget.model.checkPatientForRegistrationModel.patientIdentificationID.toString(), + dOB:wellFormat, + zipCode: widget.model.checkPatientForRegistrationModel.zipCode); + await widget.model + .registrationPatient(patientRegistrationModel); + if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); } else { Navigator.of(context).pop(); } GifLoaderDialogUtils.hideDialog(context); - }, ), ), @@ -413,7 +483,6 @@ class _RegisterConfirmationPatientPageState ), ], ), - SizedBox( height: 10, ), @@ -522,7 +591,6 @@ class _RegisterConfirmationPatientPageState ), ], ), - SizedBox( height: 10, ), @@ -568,11 +636,9 @@ class _RegisterConfirmationPatientPageState ], ), ), - ], ), ); }); } - } diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 89564833..a10a18e3 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -24,6 +24,10 @@ class AppDateUtils { return convertDateToFormat(dateTime, dateFormat); } + static String convertToServerFormat(String date, String dateFormat){ + return '/Date(${DateFormat(dateFormat).parse(date).millisecondsSinceEpoch})/'; + } + static convertDateFromServerFormat(String str, dateFormat) { var date = getDateTimeFromServerFormat(str); From 4fe53ef71e29a9ef42fd9a8f0152339d1d1f0930 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 3 Nov 2021 17:28:18 +0200 Subject: [PATCH 108/199] add hijri converter --- .../register_patient/RegisterConfirmationPatientPage.dart | 5 ++++- pubspec.lock | 7 +++++++ pubspec.yaml | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 6f60ad5d..024d65d0 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -29,6 +29,7 @@ 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/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; +import 'package:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -375,6 +376,7 @@ class _RegisterConfirmationPatientPageState .getPatientInfoResponseModel.dateOfBirth); String wellFormat = "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; print (dateFormat.toUtc().toString()); + HijriCalendar hijriDate = HijriCalendar.fromDate(new DateTime(dateFormat.year, dateFormat.month, dateFormat.day)); // return ; GifLoaderDialogUtils.showMyDialog(context); @@ -396,7 +398,7 @@ class _RegisterConfirmationPatientPageState middleNameN: middleNameN.text, strDateofBirth: dateFormat.toUtc().toString(), dateofBirth: AppDateUtils.convertToServerFormat(widget.model.getPatientInfoResponseModel.dateOfBirth, 'MM/dd/yyyy'), - dateofBirthN: wellFormat, + dateofBirthN: '$hijriDate', gender: (widget.model.getPatientInfoResponseModel.gender == "M") ? 1 : 2, @@ -433,6 +435,7 @@ class _RegisterConfirmationPatientPageState if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); } else { + DrAppToastMsg.showSuccesToast("Patient added Successfully"); Navigator.of(context).pop(); } diff --git a/pubspec.lock b/pubspec.lock index 43aefcb2..19f658ed 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -574,6 +574,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.6" + hijri: + dependency: "direct main" + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" html: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 66f0df91..485e8ae6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -103,6 +103,11 @@ dependencies: # Badges badges: ^1.1.4 + # Hijri + hijri: ^2.0.0 + + + dev_dependencies: flutter_test: sdk: flutter From ad845b882c8765d6c1b75245152f45b5b0145761 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 4 Nov 2021 10:44:49 +0200 Subject: [PATCH 109/199] finish confirmation page --- .../register_patient/CustomEditableText.dart | 10 +- .../RegisterConfirmationPatientPage.dart | 209 +++++++++++------- .../register_patient/RegisterPatientPage.dart | 3 +- .../RegisterSearchPatientPage.dart | 157 +++++++------ 4 files changed, 232 insertions(+), 147 deletions(-) diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index e4de6aae..17405829 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -1,4 +1,5 @@ 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_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; @@ -8,13 +9,14 @@ class CustomEditableText extends StatefulWidget { Key key, @required this.controller, this.hint, - this.isEditable = false, + this.isEditable = false, this.isSubmitted, }) : super(key: key); final TextEditingController controller; final String hint; bool isEditable; + final bool isSubmitted; @override _CustomEditableTextState createState() => _CustomEditableTextState(); @@ -77,6 +79,12 @@ class _CustomEditableTextState extends State { hintText: widget.hint, //TranslationBase.of(context).addoperationReports, controller: widget.controller, + validationError: widget.controller + .text.isEmpty && + widget.isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, maxLines: 1, minLines: 1, hasBorder: true, diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 024d65d0..af861294 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -63,6 +63,9 @@ class _RegisterConfirmationPatientPageState TextEditingController middleNameAr; TextEditingController lastNameAr; TextEditingController emailAddressController; + TextEditingController langController = TextEditingController( + text: "English"); + int selectedLang = 1; @override void initState() { @@ -84,6 +87,8 @@ class _RegisterConfirmationPatientPageState @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + + ///TODO Elham* add translation return AppScaffold( isShowAppBar: false, backgroundColor: Color(0xFFF8F8F8), @@ -107,36 +112,44 @@ class _RegisterConfirmationPatientPageState children: [ CustomEditableText( controller: firstNameN, + isSubmitted: isSubmitted, hint: TranslationBase.of(context).firstName), SizedBox( height: 4, ), CustomEditableText( controller: middleNameN, + isEditable: middleNameN.text.isEmpty, + isSubmitted: isSubmitted, hint: TranslationBase.of(context).middleName), SizedBox( height: 4, ), CustomEditableText( controller: lastNameN, + isSubmitted: isSubmitted, hint: TranslationBase.of(context).lastName), SizedBox( height: 20, ), CustomEditableText( controller: firstNameAr, + isSubmitted: isSubmitted, hint: "First Name Arabic"), SizedBox( height: 4, ), CustomEditableText( controller: middleNameAr, + isEditable: middleNameN.text.isEmpty, + isSubmitted: isSubmitted, hint: "Middle Name Arabic"), SizedBox( height: 4, ), CustomEditableText( controller: lastNameAr, + isSubmitted: isSubmitted, hint: "Last Name Arabic"), SizedBox( height: 20, @@ -294,6 +307,7 @@ class _RegisterConfirmationPatientPageState onClick: () { openLangList(context); }, + controller: langController, hintText: TranslationBase.of(context).lanEnglish, maxLines: 1, minLines: 1, @@ -315,6 +329,11 @@ class _RegisterConfirmationPatientPageState maxLines: 1, minLines: 1, hasBorder: true, + validationError: + emailAddressController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), SizedBox( height: 400, @@ -367,79 +386,93 @@ class _RegisterConfirmationPatientPageState fontColor: Colors.white, fontSize: 2.0, onPressed: () async { - print(widget.model - .getPatientInfoResponseModel.dateOfBirth); + setState(() { + isSubmitted = true; + }); + if (isFormValid()) { + print( + widget.model.getPatientInfoResponseModel.dateOfBirth); + var dateFormat = DateFormat('MM/dd/yyyy').parse( + widget.model.getPatientInfoResponseModel.dateOfBirth); + String wellFormat = + "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; + print(dateFormat.toUtc().toString()); + HijriCalendar hijriDate = HijriCalendar.fromDate( + new DateTime(dateFormat.year, dateFormat.month, + dateFormat.day)); + // return ; - - var dateFormat = DateFormat('MM/dd/yyyy').parse(widget.model - .getPatientInfoResponseModel.dateOfBirth); - String wellFormat = "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; - print (dateFormat.toUtc().toString()); - HijriCalendar hijriDate = HijriCalendar.fromDate(new DateTime(dateFormat.year, dateFormat.month, dateFormat.day)); - // return ; + GifLoaderDialogUtils.showMyDialog(context); + PatientRegistrationModel patientRegistrationModel = + PatientRegistrationModel( + patientobject: Patientobject( + tempValue: true, + patientIdentificationNo: widget + .model + .checkPatientForRegistrationModel + .patientIdentificationID + .toString(), + patientIdentificationType: 1, + firstName: firstNameAr.text, + firstNameN: firstNameN.text, + lastName: lastNameAr.text, + lastNameN: lastNameN.text, + middleName: middleNameAr.text, + middleNameN: middleNameN.text, + strDateofBirth: dateFormat.toUtc().toString(), + dateofBirth: AppDateUtils.convertToServerFormat( + widget.model.getPatientInfoResponseModel + .dateOfBirth, + 'MM/dd/yyyy'), + dateofBirthN: '$hijriDate', + gender: (widget.model.getPatientInfoResponseModel.gender == "M") + ? 1 + : 2, + sourceType: "1", + patientOutSA: 0, + nationalityID: widget + .model + .getPatientInfoResponseModel + .nationalityCode, + //todo Elham* change static value to dynamic + preferredLanguage: selectedLang.toString(), + marital: "0", + eHealthIDField: widget.model + .getPatientInfoResponseModel.healthId, + emailAddress: emailAddressController.text, + mobileNumber: widget + .model + .checkPatientForRegistrationModel + .patientMobileNumber), + isHijri: 0, + logInTokenID: "zjgvKtLC/EK+saznJ/OkiA==", + isDentalAllowedBackend: false, + patientOutSA: 0, + sessionID: null, + patientMobileNumber: widget + .model + .checkPatientForRegistrationModel + .patientMobileNumber + .toString(), + healthId: + widget.model.getPatientInfoResponseModel.healthId, + generalid: GENERAL_ID, + patientIdentificationID: widget.model.checkPatientForRegistrationModel.patientIdentificationID.toString(), + dOB: wellFormat, + zipCode: widget.model.checkPatientForRegistrationModel.zipCode); + await widget.model + .registrationPatient(patientRegistrationModel); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + } else { + DrAppToastMsg.showSuccesToast( + "Patient added Successfully"); + Navigator.of(context).pop(); + } - GifLoaderDialogUtils.showMyDialog(context); - PatientRegistrationModel patientRegistrationModel = - PatientRegistrationModel( - patientobject: Patientobject( - tempValue: true, - patientIdentificationNo: widget - .model - .checkPatientForRegistrationModel - .patientIdentificationID - .toString(), - patientIdentificationType: 1, - firstName: firstNameAr.text, - firstNameN: firstNameN.text, - lastName: lastNameAr.text, - lastNameN: lastNameN.text, - middleName: middleNameAr.text, - middleNameN: middleNameN.text, - strDateofBirth: dateFormat.toUtc().toString(), - dateofBirth: AppDateUtils.convertToServerFormat(widget.model.getPatientInfoResponseModel.dateOfBirth, 'MM/dd/yyyy'), - dateofBirthN: '$hijriDate', - gender: (widget.model.getPatientInfoResponseModel.gender == "M") - ? 1 - : 2, - sourceType: "1", - patientOutSA: 0, - nationalityID: widget - .model - .getPatientInfoResponseModel - .nationalityCode, - //todo Elham* change static value to dynamic - preferredLanguage: "1", - marital: "0", - eHealthIDField: widget - .model.getPatientInfoResponseModel.healthId, - emailAddress: emailAddressController.text, - mobileNumber: widget - .model - .checkPatientForRegistrationModel - .patientMobileNumber), - isHijri: 0, - logInTokenID: "zjgvKtLC/EK+saznJ/OkiA==", - isDentalAllowedBackend: false, - patientOutSA: 0, - sessionID: null, - patientMobileNumber: - widget.model.checkPatientForRegistrationModel.patientMobileNumber.toString(), - healthId: widget.model.getPatientInfoResponseModel.healthId, - generalid: GENERAL_ID, - patientIdentificationID: widget.model.checkPatientForRegistrationModel.patientIdentificationID.toString(), - dOB:wellFormat, - zipCode: widget.model.checkPatientForRegistrationModel.zipCode); - await widget.model - .registrationPatient(patientRegistrationModel); - if (widget.model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.model.error); - } else { - DrAppToastMsg.showSuccesToast("Patient added Successfully"); - Navigator.of(context).pop(); + GifLoaderDialogUtils.hideDialog(context); } - - GifLoaderDialogUtils.hideDialog(context); }, ), ), @@ -598,14 +631,16 @@ class _RegisterConfirmationPatientPageState height: 10, ), InkWell( - onTap: () {}, + onTap: () { + setSelectedLang(1); + }, child: Row( children: [ Radio( value: 1, - groupValue: 1, + groupValue: selectedLang, onChanged: (value) { - setState(() {}); + setSelectedLang(value); }, activeColor: Colors.red, ), @@ -619,14 +654,17 @@ class _RegisterConfirmationPatientPageState ), ), InkWell( - onTap: () {}, + onTap: () { + setSelectedLang(2); + }, child: Row( children: [ Radio( - value: 1, - groupValue: 1, + value: 2, + groupValue: selectedLang, onChanged: (value) { - setState(() {}); + setSelectedLang(value); + }, activeColor: Colors.red, ), @@ -644,4 +682,23 @@ class _RegisterConfirmationPatientPageState ); }); } + setSelectedLang(lang){ + setState(() { + selectedLang = lang; + langController.text = lang==1?"English": "العربيه"; + }); + Navigator.of(context).pop(); + } + + bool isFormValid() { + if (middleNameAr.text != null && + middleNameAr.text.isNotEmpty && + middleNameN.text != null && + middleNameN.text.isNotEmpty && + emailAddressController.text != null && + emailAddressController.text.isNotEmpty) { + return true; + } + return false; + } } diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 55c27fb4..810d5cf7 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -52,7 +52,7 @@ class _RegisterPatientPageState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - + ///TODO Elham* Add Translation return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -72,6 +72,7 @@ class _RegisterPatientPageState extends State SizedBox( height: 10, ), + //TODO Elham* Fix overflow PageStepperWidget( stepsCount: 3, currentStepIndex: _currentIndex + 1, diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 98ac704e..09ece413 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -36,6 +36,8 @@ class RegisterSearchPatientPage extends StatefulWidget { class _RegisterSearchPatientPageState extends State { String countryError; dynamic _selectedCountry; + bool isSubmitted = false; + TextEditingController _phoneController = TextEditingController(); TextEditingController _phoneCode = TextEditingController(text: "966"); @@ -51,6 +53,7 @@ class _RegisterSearchPatientPageState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + /// TODO Elham* add transaltion return AppScaffold( baseViewModel: widget.model, @@ -83,47 +86,32 @@ class _RegisterSearchPatientPageState extends State { ? _selectedCountry['nameEn'] : "Saudi Arabia", enabled: false, - /*onClick: widget.model.dietTypesList != null && widget.model.dietTypesList.length > 0 - ? () { - openListDialogField('nameEn', 'id', widget.model.dietTypesList, (selectedValue) { - setState(() { - _selectedCountry = selectedValue; - }); - }); - } - : () async { - GifLoaderDialogUtils.showMyDialog(context); - await model - .getDietTypes(patient.patientId) - .then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (widget.model.state == ViewState.Idle && widget.model.dietTypesList.length > 0) { - openListDialogField('nameEn', 'id', widget.model.dietTypesList, (selectedValue) { - setState(() { - _selectedCountry = selectedValue; - }); - }); - } else if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); - } else { - DrAppToastMsg.showErrorToast("Empty List"); - } - },*/ ), SizedBox( height: 10, ), Row( children: [ - Container( - width: MediaQuery.of(context).size.width * 0.3, - child: AppTextFieldCustom( - height: screenSize.height * 0.075, - hintText: "Code", - inputType: TextInputType.phone, - controller: _phoneCode, - validationError: phoneError, - ), + Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Code", + inputType: TextInputType.phone, + controller: _phoneCode, + validationError: phoneError, + ), + ), + if(_phoneController + .text.isEmpty && + isSubmitted + ) + SizedBox(height: 35,) + ], ), + SizedBox(width: 10,), Expanded( child: Container( // width: MediaQuery.of(context).size.width*0.7, @@ -132,7 +120,12 @@ class _RegisterSearchPatientPageState extends State { hintText: "Phone Number", inputType: TextInputType.phone, controller: _phoneController, - validationError: phoneError, + validationError: _phoneController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), ), ), @@ -146,7 +139,12 @@ class _RegisterSearchPatientPageState extends State { hintText: "ID Number", inputType: TextInputType.phone, controller: _idController, - validationError: idError, + validationError: _idController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 12, @@ -167,7 +165,11 @@ class _RegisterSearchPatientPageState extends State { : null, enabled: false, isTextFieldHasSuffix: true, - validationError: birthdateError, + validationError: _birthDate == null && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, suffixIcon: IconButton( icon: Icon( Icons.calendar_today, @@ -230,45 +232,54 @@ class _RegisterSearchPatientPageState extends State { fontColor: Colors.white, fontSize: 2.0, onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); - CheckPatientForRegistrationModel - checkPatientForRegistrationModel = - CheckPatientForRegistrationModel( - patientIdentificationID: - int.parse(_idController.text), - patientMobileNumber: - int.parse(_phoneController.text), - zipCode: _phoneCode.text, + setState(() { + isSubmitted = true; + }); + if(isFormValid()) { + GifLoaderDialogUtils.showMyDialog(context); + CheckPatientForRegistrationModel + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel( + patientIdentificationID: + int.parse(_idController.text), + patientMobileNumber: + int.parse(_phoneController.text), + zipCode: _phoneCode.text, + isHijri: 0, + patientID: 0, + isRegister: false, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + dOB: + "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); + await widget.model.checkPatientForRegistration( + checkPatientForRegistrationModel); + GetPatientInfoRequestModel getPatientInfoRequestModel = + GetPatientInfoRequestModel( + //TODO Elham* this return the static to dynamic + patientIdentificationID:"1062938285", //_idController.text, isHijri: 0, - patientID: 0, - isRegister: false, isDentalAllowedBackend: false, patientOutSA: 0, generalid: GENERAL_ID, - dOB: - "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); - await widget.model.checkPatientForRegistration( - checkPatientForRegistrationModel); - GetPatientInfoRequestModel getPatientInfoRequestModel = - GetPatientInfoRequestModel( - //TODO Elham* this return the static to dynamic - patientIdentificationID:"1062938285", //_idController.text, - isHijri: 0, - isDentalAllowedBackend: false, - patientOutSA: 0, - generalid: GENERAL_ID, - sessionID: null, - dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" + sessionID: null, + dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" - ); - await widget.model.getPatientInfo(getPatientInfoRequestModel); - if (widget.model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.model.error); - } else { - widget.changePageViewIndex(1); + ); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + } else { + await widget.model.getPatientInfo(getPatientInfoRequestModel); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + } else { + widget.changePageViewIndex(1); + } + } + GifLoaderDialogUtils.hideDialog(context); } - GifLoaderDialogUtils.hideDialog(context); }, ), ), @@ -279,6 +290,14 @@ class _RegisterSearchPatientPageState extends State { ); } + + isFormValid() { + if(_phoneController.text!=null &&_phoneController.text.isNotEmpty&& _idController.text!=null &&_idController.text.isNotEmpty) { + return true; + } + return false; + + } Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async { final DateTime picked = await showDatePicker( From cf498de70f1426c23859809078b31752728ee764 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 4 Nov 2021 16:27:43 +0200 Subject: [PATCH 110/199] finish confirmation page --- lib/client/base_app_client.dart | 105 ++++++++++++------ lib/config/config.dart | 4 +- ...PNotificationTypeForRegistrationModel.dart | 48 ++++---- .../service/PatientRegistrationService.dart | 48 +++++--- lib/screens/home/home_screen.dart | 3 +- .../RegisterSearchPatientPage.dart | 6 +- .../register_patient/VerifyMethodPage.dart | 51 +++++++-- 7 files changed, 176 insertions(+), 89 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 7e787b90..af4e6e97 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -27,7 +27,7 @@ class BaseAppClient { Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isLiveCare = false, - bool isFallLanguage=false}) async { + bool isFallLanguage = false}) async { String url; if (isLiveCare) url = BASE_URL_LIVE_CARE + endPoint; @@ -40,14 +40,17 @@ class BaseAppClient { String token = await sharedPref.getString(TOKEN); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; + if (body['DoctorID'] == null) + body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; + if (body['EditedBy'] == null) + body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; } - if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; + if (body['ClinicID'] == null) + body['ClinicID'] = doctorProfile?.clinicID; } if (body['DoctorID'] == '') { body['DoctorID'] = null; @@ -59,7 +62,7 @@ class BaseAppClient { body['TokenID'] = token ?? ''; } // body['TokenID'] = "@dm!n" ?? ''; - if(!isFallLanguage) { + if (!isFallLanguage) { String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; @@ -69,22 +72,29 @@ class BaseAppClient { body['stamp'] = DateTime.now().toIso8601String(); // if(!body.containsKey("IPAdress")) body['IPAdress'] = IP_ADDRESS; - body['VersionID'] = VERSION_ID; - body['Channel'] = CHANNEL; + if (body['VersionID'] == null) { + body['VersionID'] = VERSION_ID; + } + if (body['Channel'] == null) { + body['Channel'] = CHANNEL; + } body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { - body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaAuthTokenID'] = + await sharedPref.getString(VIDA_AUTH_TOKEN_ID); } if (body['VidaRefreshTokenID'] == null) { - body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaRefreshTokenID'] = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) body['PatientOutSA'] = true; - else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || + else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || + body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3) body['PatientOutSA'] = true; @@ -98,21 +108,28 @@ class BaseAppClient { var asd2; if (await Helpers.checkConnection()) { final response = await http.post(url, - body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); + body: json.encode(body), + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await Provider.of(AppGlobal.CONTEX, listen: false).logout(); + await Provider.of(AppGlobal.CONTEX, + listen: false) + .logout(); Helpers.showErrorToast('Your session expired Please login again'); locator().pushNamedAndRemoveUntil(ROOT); @@ -147,10 +164,14 @@ class BaseAppClient { String url = BASE_URL + endPoint; try { - Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; + Map headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }; String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] @@ -170,11 +191,12 @@ class BaseAppClient { : PATIENT_OUT_SA_PATIENT_REQ; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -196,7 +218,9 @@ class BaseAppClient { : PATIENT_TYPE_ID; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token; - body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN; + body['PatientID'] = body['PatientID'] != null + ? body['PatientID'] + : patient.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -209,9 +233,11 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - + var asd = json.encode(body); + var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(url.trim(), body: json.encode(body), headers: headers); + final response = await http.post(url.trim(), + body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -223,7 +249,8 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -239,20 +266,28 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", statusCode); + onFailure("Server Error found with no available message", + statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } } else { @@ -262,7 +297,9 @@ class BaseAppClient { if (parsed['message'] != null) { onFailure(parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -285,8 +322,12 @@ class BaseAppClient { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { - error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; + for (var i = 0; + i < parsed["ValidationErrors"]["ValidationErrors"].length; + i++) { + error = error + + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + + "\n"; } } } diff --git a/lib/config/config.dart b/lib/config/config.dart index 04a6d7bc..c01434ce 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -373,8 +373,8 @@ const GET_ADMISSION_ORDERS = ///Patient Registration Services const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; -const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE = - "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType"; +const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = + "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode"; const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart index 8aaf2c6c..8244a95f 100644 --- a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -16,7 +16,7 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { int channel; String iPAdress; String generalid; - bool patientOutSA; + int patientOutSA; Null sessionID; bool isDentalAllowedBackend; int deviceTypeID; @@ -26,29 +26,29 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { SendActivationCodeByOTPNotificationTypeForRegistrationModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.oTPSendType, - this.languageID, - this.versionID, - this.channel, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( Map json) { diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index ed3db005..236bcd42 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -10,13 +10,16 @@ import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.d class PatientRegistrationService extends BaseService { GetPatientInfoResponseModel getPatientInfoResponseModel; + String logInTokenID; checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { hasError = false; await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION, - onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) { + onSuccess: (dynamic response, int statusCode) { + //TODO Elham* fix it + logInTokenID = "OjEi/qgRekGICZm5/a4jbQ=="; //response["LogInTokenID"]; + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: registrationModel.toJson()); @@ -39,24 +42,39 @@ class PatientRegistrationService extends BaseService { {SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, int otpType, - PatientRegistrationViewModel user, + PatientRegistrationViewModel model, CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( - oTPSendType: otpType, - patientIdentificationID: - checkPatientForRegistrationModel.patientIdentificationID, - patientMobileNumber: checkPatientForRegistrationModel.patientMobileNumber, - zipCode: checkPatientForRegistrationModel.zipCode, - patientOutSA: false, - healthId: "30000018540264", - dOB: checkPatientForRegistrationModel.dOB, - isRegister: checkPatientForRegistrationModel.isRegister, - isHijri: checkPatientForRegistrationModel.isHijri, - ); + oTPSendType: otpType, + patientIdentificationID: checkPatientForRegistrationModel + .patientIdentificationID, + patientMobileNumber: checkPatientForRegistrationModel + .patientMobileNumber, + zipCode: checkPatientForRegistrationModel.zipCode, + patientOutSA: 0, + healthId: model.getPatientInfoResponseModel.healthId, + dOB: checkPatientForRegistrationModel.dOB, + isRegister: checkPatientForRegistrationModel.isRegister, + isHijri: checkPatientForRegistrationModel.isHijri, + sessionID: null, + generalid: GENERAL_ID, + isDentalAllowedBackend: false, + projectOutSA: 0, + searchType: 1, + versionID: 7.1, + channel: 3, + nationalID: + model.checkPatientForRegistrationModel.patientIdentificationID, + patientID: 0, + mobileNo: model.checkPatientForRegistrationModel.patientMobileNumber + .toString(), + loginType: otpType, + logInTokenID: logInTokenID); + hasError = false; - await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE, + await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION, onSuccess: (dynamic response, int statusCode) { registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 1ab61717..62988caa 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -399,7 +399,8 @@ class _HomeScreenState extends State { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], - cardIconImage: 'assets/images/patient_register.png', + //TODO Elham* match the of the icon + cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], text: TranslationBase.of(context).registerNewPatient, onTap: () { diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 09ece413..ee8caa90 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -39,12 +39,12 @@ class _RegisterSearchPatientPageState extends State { bool isSubmitted = false; - TextEditingController _phoneController = TextEditingController(); + TextEditingController _phoneController = TextEditingController(text: "508079569"); TextEditingController _phoneCode = TextEditingController(text: "966"); String phoneError; - TextEditingController _idController = TextEditingController(); + TextEditingController _idController = TextEditingController(text: "1062938285"); String idError; DateTime _birthDate; @@ -292,7 +292,7 @@ class _RegisterSearchPatientPageState extends State { isFormValid() { - if(_phoneController.text!=null &&_phoneController.text.isNotEmpty&& _idController.text!=null &&_idController.text.isNotEmpty) { + if(_phoneController.text!=null &&_phoneController.text.isNotEmpty&& _idController.text!=null &&_idController.text.isNotEmpty &&_birthDate!=null) { return true; } return false; diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index b959e0a8..6426c382 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -1,7 +1,9 @@ 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/PatientRegistration/CheckPatientForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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'; @@ -13,6 +15,7 @@ import 'package:hexcolor/hexcolor.dart'; class ActivationPage extends StatefulWidget { final PatientRegistrationViewModel model; final Function changePageViewIndex; + ActivationPage({this.model, this.changePageViewIndex}); @override @@ -22,6 +25,7 @@ class ActivationPage extends StatefulWidget { class _ActivationPageState extends State { bool isSendOtp = false; final verifyAccountForm = GlobalKey(); + TextStyle buildTextStyle() { return TextStyle( fontSize: SizeConfig.textMultiplier * 3, @@ -74,13 +78,14 @@ class _ActivationPageState extends State { Expanded( child: InkWell( onTap: () async { - setState(() { - isSendOtp = true; - }); - - await widget.model - .sendActivationCodeByOTPNotificationType( - otpType: 1); + // setState(() { + // isSendOtp = true; + // }); + // + // await widget.model + // .sendActivationCodeByOTPNotificationType( + // otpType: 1); + await sendActivationCode(1); }, child: Container( height: @@ -130,10 +135,7 @@ class _ActivationPageState extends State { Expanded( child: InkWell( onTap: () async { - isSendOtp = false; - await widget.model - .sendActivationCodeByOTPNotificationType( - otpType: 1, user: widget.model); + await sendActivationCode(2); }, child: Container( height: @@ -442,7 +444,17 @@ class _ActivationPageState extends State { fontColor: Colors.white, fontSize: 2.0, onPressed: () async { - //widget.model.checkActivationCode(), + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.checkActivationCode("${digit1.text}${digit2.text}${digit3.text}${digit4.text}"); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + //TODO Elham* remove this + widget.changePageViewIndex(2); + GifLoaderDialogUtils.hideDialog(context); + } else { + GifLoaderDialogUtils.hideDialog(context); + widget.changePageViewIndex(2); + } }, ), ), @@ -453,6 +465,21 @@ class _ActivationPageState extends State { : null); } + sendActivationCode(type) async { + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.sendActivationCodeByOTPNotificationType(otpType: type); + + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + GifLoaderDialogUtils.hideDialog(context); + // TODO Elham* retuen the else + // } else { + setState(() { + isSendOtp = true; + }); + } + } + InputDecoration buildInputDecoration(BuildContext context) { return InputDecoration( counterText: " ", From 515297ebf67e93335172bc8816f1aba4ade6d267 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 4 Nov 2021 16:27:58 +0200 Subject: [PATCH 111/199] finish confirmation page --- .../PatientRegistrationViewModel.dart | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 82b43baa..866f99a8 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; @@ -145,26 +146,53 @@ class PatientRegistrationViewModel extends BaseViewModel { registrationModel, int otpType, PatientRegistrationViewModel user}) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel); await _patientRegistrationService.sendActivationCodeByOTPNotificationType( otpType: otpType, + model: this, checkPatientForRegistrationModel: checkPatientForRegistrationModel); if (_patientRegistrationService.hasError) { error = _patientRegistrationService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future checkActivationCode(CheckActivationCodeModel registrationModel) async { - setState(ViewState.Busy); - await _patientRegistrationService.checkActivationCode(registrationModel); + Future checkActivationCode(String code) async { + CheckActivationCodeModel model = CheckActivationCodeModel( + activationCode: code, + patientIdentificationID: + checkPatientForRegistrationModel.patientIdentificationID, + patientMobileNumber: checkPatientForRegistrationModel.patientMobileNumber, + zipCode: checkPatientForRegistrationModel.zipCode, + patientOutSA: 0, + healthId: getPatientInfoResponseModel.healthId, + dOB: checkPatientForRegistrationModel.dOB, + isRegister: checkPatientForRegistrationModel.isRegister, + isHijri: checkPatientForRegistrationModel.isHijri, + sessionID: null, + generalid: GENERAL_ID, + forRegisteration: true, + isDentalAllowedBackend: false, + projectOutSA: 0, + searchType: 1, + versionID: 7.1, + channel: 3, + // TODO Elham* loginType + loginType: 4, + logInTokenID:_patientRegistrationService.logInTokenID , + nationalID: checkPatientForRegistrationModel.patientIdentificationID, + patientID: 0, + mobileNo: checkPatientForRegistrationModel.patientMobileNumber.toString(), + ); + setState(ViewState.BusyLocal); + await _patientRegistrationService.checkActivationCode(model); if (_patientRegistrationService.hasError) { error = _patientRegistrationService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } From 03acd233cfb0514cb34dab1494c828c0f22eceeb Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 7 Nov 2021 10:03:54 +0200 Subject: [PATCH 112/199] fix version id --- lib/models/doctor/profile_req_Model.dart | 1 - lib/models/patient/vital_sign/vital_sign_req_model.dart | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 8f2ef985..fbcce8b6 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -29,7 +29,6 @@ class ProfileReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.tokenID, diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index 2cfd24c2..8f5be6ba 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -31,7 +31,6 @@ class VitalSignReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', - this.versionID=5.8, this.channel=9, this.sessionID='E2bsEeYEJo', this.isLoginForDoctorApp=true, From 52ec3fc0e37253e01475bd525f122f45d074893f Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 7 Nov 2021 12:59:09 +0200 Subject: [PATCH 113/199] fix navigator issues --- lib/core/service/NavigationService.dart | 8 ++++ lib/models/doctor/profile_req_Model.dart | 1 + lib/util/helpers.dart | 40 ++++++++++++++----- .../loader/gif_loader_dialog_utils.dart | 1 + 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 26191ffc..5690c01e 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -15,4 +15,12 @@ class NavigationService { Future pushNamedAndRemoveUntil(String routeName) { return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); } + + Future pushAndRemoveUntil(Route newRoute) { + return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); + } + + pop() { + return navigatorKey.currentState.pop(); + } } \ No newline at end of file diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index fbcce8b6..f1f71010 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -29,6 +29,7 @@ class ProfileReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress='11.11.11.11', + // this.versionID=5.5, this.channel=9, this.sessionID='E2bsEeYEJo', this.tokenID, diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index f8f0fbd3..169ad81c 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -2,6 +2,7 @@ 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/service/NavigationService.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'; @@ -17,6 +18,7 @@ import 'package:html/parser.dart'; import '../UpdatePage.dart'; import '../config/size_config.dart'; +import '../locator.dart'; import '../util/dr_app_toast_msg.dart'; import 'dr_app_shared_pref.dart'; @@ -188,16 +190,26 @@ class Helpers { } navigateToUpdatePage(String message, String androidLink, iosLink) { - Navigator.pushAndRemoveUntil( - AppGlobal.CONTEX, - FadePage( - page: UpdatePage( - message: message, - androidLink: androidLink, - iosLink: iosLink, - ), + locator().pushAndRemoveUntil( + FadePage( + page: UpdatePage( + message: message, + androidLink: androidLink, + iosLink: iosLink, ), - (r) => false); + ), + ); + + // Navigator.pushAndRemoveUntil( + // AppGlobal.CONTEX, + // FadePage( + // page: UpdatePage( + // message: message, + // androidLink: androidLink, + // iosLink: iosLink, + // ), + // ), + // (r) => false); } static String parseHtmlString(String htmlString) { @@ -277,7 +289,13 @@ class Helpers { String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } - static double getTextFieldHeight(){ - return SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?10:SizeConfig.isHeightShort?8:6); + + static double getTextFieldHeight() { + return SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 10 + : SizeConfig.isHeightShort + ? 8 + : 6); } } diff --git a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart index bf383fff..264e1a66 100644 --- a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart +++ b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart @@ -9,6 +9,7 @@ class GifLoaderDialogUtils { } static hideDialog(BuildContext context) { + if(Navigator.canPop(context)) Navigator.of(context).pop(); } } From eb89dc3395a99668dca031e39a109631d66a7d9e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 7 Nov 2021 14:08:35 +0200 Subject: [PATCH 114/199] fix navigator issues --- lib/screens/auth/verification_methods_screen.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 85c5090a..fc85db8f 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -550,10 +550,15 @@ class _VerificationMethodsScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { await authenticationViewModel.onCheckActivationCodeSuccess(); - if(value !=null) - Navigator.pop(context); - Navigator.pop(context); - navigateToLandingPage(); + if(value !=null){ + if(Navigator.canPop(context)) + Navigator.pop(context); + } + if(Navigator.canPop(context)) + Navigator.pop(context); + navigateToLandingPage(); + + } } From 25f65802a55a45a57f61afb68e30eaed1c0e8030 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 7 Nov 2021 16:55:03 +0200 Subject: [PATCH 115/199] register search page change --- lib/models/doctor/profile_req_Model.dart | 10 +- .../RegisterSearchPatientPage.dart | 143 ++++++++++-------- .../register_patient/VerifyMethodPage.dart | 82 ++++++---- .../text_fields/country_textfield_custom.dart | 77 ++++++++++ 4 files changed, 214 insertions(+), 98 deletions(-) create mode 100644 lib/widgets/shared/text_fields/country_textfield_custom.dart diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 8f2ef985..647de385 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -24,14 +24,14 @@ class ProfileReqModel { {this.projectID, this.clinicID, this.doctorID, - this.isRegistered =true, + this.isRegistered = true, this.license, this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.5, - this.channel=9, - this.sessionID='E2bsEeYEJo', + this.iPAdress = '11.11.11.11', + this.versionID = 6.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', this.tokenID, this.isLoginForDoctorApp = true}); diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index ee8caa90..91ee7dd9 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -18,14 +18,15 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar 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/country_textfield_custom.dart'; import 'package:flutter/material.dart'; class RegisterSearchPatientPage extends StatefulWidget { final Function changePageViewIndex; - final PatientRegistrationViewModel model; + final PatientRegistrationViewModel model; - - const RegisterSearchPatientPage({Key key, this.changePageViewIndex, this.model}) + const RegisterSearchPatientPage( + {Key key, this.changePageViewIndex, this.model}) : super(key: key); @override @@ -36,23 +37,43 @@ class RegisterSearchPatientPage extends StatefulWidget { class _RegisterSearchPatientPageState extends State { String countryError; dynamic _selectedCountry; - bool isSubmitted = false; + List countryList; + + dynamic country; - TextEditingController _phoneController = TextEditingController(text: "508079569"); + //var countryName = ["Saudi Arabia", "UAE"]; + bool isSubmitted = false; + + TextEditingController _phoneController = + TextEditingController(text: "508079569"); TextEditingController _phoneCode = TextEditingController(text: "966"); String phoneError; - TextEditingController _idController = TextEditingController(text: "1062938285"); + TextEditingController _idController = + TextEditingController(text: "1062938285"); String idError; DateTime _birthDate; String birthdateError; + @override + void initState() { + _phoneCode.text = ""; + countryList = List(); + + dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"}; + dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"}; + + countryList.add(ksaCountry); + countryList.add(uaeCountry); + } + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + /// TODO Elham* add transaltion return AppScaffold( @@ -77,15 +98,19 @@ class _RegisterSearchPatientPageState extends State { SizedBox( height: 10, ), - AppTextFieldCustom( - height: screenSize.height * 0.075, + CountryTextField( + elementList: countryList, + element: country, + elementError: countryError, + keyName: 'name', + keyId: 'id', + okFunction: (selectedValue) { + setState(() { + country = selectedValue; + _phoneCode.text = selectedValue['id'].toString(); + }); + }, hintText: "Country", - isTextFieldHasSuffix: true, - validationError: countryError, - dropDownText: _selectedCountry != null - ? _selectedCountry['nameEn'] - : "Saudi Arabia", - enabled: false, ), SizedBox( height: 10, @@ -102,16 +127,18 @@ class _RegisterSearchPatientPageState extends State { inputType: TextInputType.phone, controller: _phoneCode, validationError: phoneError, + enabled: false, ), ), - if(_phoneController - .text.isEmpty && - isSubmitted - ) - SizedBox(height: 35,) + if (_phoneController.text.isEmpty && isSubmitted) + SizedBox( + height: 35, + ) ], ), - SizedBox(width: 10,), + SizedBox( + width: 10, + ), Expanded( child: Container( // width: MediaQuery.of(context).size.width*0.7, @@ -120,12 +147,10 @@ class _RegisterSearchPatientPageState extends State { hintText: "Phone Number", inputType: TextInputType.phone, controller: _phoneController, - validationError: _phoneController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: + _phoneController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), ), ), @@ -139,11 +164,8 @@ class _RegisterSearchPatientPageState extends State { hintText: "ID Number", inputType: TextInputType.phone, controller: _idController, - validationError: _idController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage + validationError: _idController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( @@ -165,10 +187,8 @@ class _RegisterSearchPatientPageState extends State { : null, enabled: false, isTextFieldHasSuffix: true, - validationError: _birthDate == null && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage + validationError: _birthDate == null && isSubmitted + ? TranslationBase.of(context).emptyMessage : null, suffixIcon: IconButton( icon: Icon( @@ -235,42 +255,43 @@ class _RegisterSearchPatientPageState extends State { setState(() { isSubmitted = true; }); - if(isFormValid()) { + if (isFormValid()) { GifLoaderDialogUtils.showMyDialog(context); CheckPatientForRegistrationModel - checkPatientForRegistrationModel = - CheckPatientForRegistrationModel( - patientIdentificationID: - int.parse(_idController.text), - patientMobileNumber: - int.parse(_phoneController.text), - zipCode: _phoneCode.text, - isHijri: 0, - patientID: 0, - isRegister: false, - isDentalAllowedBackend: false, - patientOutSA: 0, - generalid: GENERAL_ID, - dOB: - "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel( + patientIdentificationID: + int.parse(_idController.text), + patientMobileNumber: + int.parse(_phoneController.text), + zipCode: _phoneCode.text, + isHijri: 0, + patientID: 0, + isRegister: false, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + dOB: + "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); await widget.model.checkPatientForRegistration( checkPatientForRegistrationModel); GetPatientInfoRequestModel getPatientInfoRequestModel = - GetPatientInfoRequestModel( + GetPatientInfoRequestModel( //TODO Elham* this return the static to dynamic - patientIdentificationID:"1062938285", //_idController.text, + //patientIdentificationID:"1062938285", _idController.text, isHijri: 0, isDentalAllowedBackend: false, patientOutSA: 0, generalid: GENERAL_ID, sessionID: null, - dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" - + dOB: + "31/07/1988", //"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" ); if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); } else { - await widget.model.getPatientInfo(getPatientInfoRequestModel); + await widget.model + .getPatientInfo(getPatientInfoRequestModel); if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); } else { @@ -279,7 +300,6 @@ class _RegisterSearchPatientPageState extends State { } GifLoaderDialogUtils.hideDialog(context); } - }, ), ), @@ -290,14 +310,17 @@ class _RegisterSearchPatientPageState extends State { ); } - isFormValid() { - if(_phoneController.text!=null &&_phoneController.text.isNotEmpty&& _idController.text!=null &&_idController.text.isNotEmpty &&_birthDate!=null) { + if (_phoneController.text != null && + _phoneController.text.isNotEmpty && + _idController.text != null && + _idController.text.isNotEmpty && + _birthDate != null) { return true; } return false; - } + Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async { final DateTime picked = await showDatePicker( diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 6426c382..8634e76e 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -105,27 +105,33 @@ class _ActivationPageState extends State { children: [ Row( children: [ - Image.asset( - "assets/images/verify-sms.png", - height: MediaQuery.of(context) - .size - .height * - 0.15, - width: MediaQuery.of(context) - .size - .width * - 0.15, + Padding( + padding: EdgeInsets.symmetric( + horizontal: 10), + child: Image.asset( + "assets/images/verify-sms.png", + height: MediaQuery.of(context) + .size + .height * + 0.15, + width: MediaQuery.of(context) + .size + .width * + 0.15, + ), ), ], ), SizedBox( height: 20, ), - AppText( - "Verify through SMS", - fontSize: 14, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, + Center( + child: AppText( + "Verify through SMS", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ), ) ], ), @@ -155,27 +161,33 @@ class _ActivationPageState extends State { children: [ Row( children: [ - Image.asset( - "assets/images/verify-whtsapp.png", - height: MediaQuery.of(context) - .size - .height * - 0.15, - width: MediaQuery.of(context) - .size - .width * - 0.15, + Padding( + padding: EdgeInsets.symmetric( + horizontal: 10.0), + child: Image.asset( + "assets/images/verify-whtsapp.png", + height: MediaQuery.of(context) + .size + .height * + 0.15, + width: MediaQuery.of(context) + .size + .width * + 0.15, + ), ), ], ), SizedBox( height: 20, ), - AppText( - "Verify through WhatsApp", - fontSize: 14, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, + Center( + child: AppText( + "Verify through WhatsApp", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ), ) ], ), @@ -445,11 +457,12 @@ class _ActivationPageState extends State { fontSize: 2.0, onPressed: () async { GifLoaderDialogUtils.showMyDialog(context); - await widget.model.checkActivationCode("${digit1.text}${digit2.text}${digit3.text}${digit4.text}"); + await widget.model.checkActivationCode( + "${digit1.text}${digit2.text}${digit3.text}${digit4.text}"); if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); //TODO Elham* remove this - widget.changePageViewIndex(2); + //widget.changePageViewIndex(2); GifLoaderDialogUtils.hideDialog(context); } else { GifLoaderDialogUtils.hideDialog(context); @@ -473,7 +486,10 @@ class _ActivationPageState extends State { Helpers.showErrorToast(widget.model.error); GifLoaderDialogUtils.hideDialog(context); // TODO Elham* retuen the else - // } else { + setState(() { + isSendOtp = false; + }); + } else { setState(() { isSendOtp = true; }); diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart new file mode 100644 index 00000000..baed4995 --- /dev/null +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -0,0 +1,77 @@ +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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class CountryTextField extends StatefulWidget { + final dynamic element; + final String elementError; + final List elementList; + final String keyName; + final String keyId; + final String hintText; + final double width; + final Function(dynamic) okFunction; + + CountryTextField( + {Key key, + @required this.element, + @required this.elementError, + this.width, + this.elementList, + this.keyName, + this.keyId, + this.hintText, + this.okFunction}) + : super(key: key); + + @override + _CountryTextfieldState createState() => _CountryTextfieldState(); +} + +class _CountryTextfieldState extends State { + @override + Widget build(BuildContext context) { + return Container( + width: widget.width ?? null, + child: InkWell( + onTap: widget.elementList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: widget.elementList, + attributeName: '${widget.keyName}', + attributeValueId: widget.elementList.length == 1 + ? widget.elementList[0]['${widget.keyId}'] + : '${widget.keyId}', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) => + widget.okFunction(selectedValue), + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: AppTextFieldCustom( + hintText: widget.hintText, + dropDownText: widget.elementList.length == 1 + ? widget.elementList[0]['${widget.keyName}'] + : widget.element != null + ? widget.element['${widget.keyName}'] + : null, + isTextFieldHasSuffix: true, + validationError: + widget.elementList.length != 1 ? widget.elementError : null, + enabled: false, + ), + ), + ); + } +} From 8e85bb239e95912992b40e343d6606ca454c91e8 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 7 Nov 2021 17:30:02 +0200 Subject: [PATCH 116/199] first step from hijri Calender --- lib/core/enum/CalenderType.dart | 4 + .../RegisterSearchPatientPage.dart | 80 ++++++++++++++++--- pubspec.lock | 13 ++- pubspec.yaml | 1 + 4 files changed, 86 insertions(+), 12 deletions(-) create mode 100644 lib/core/enum/CalenderType.dart diff --git a/lib/core/enum/CalenderType.dart b/lib/core/enum/CalenderType.dart new file mode 100644 index 00000000..51f98512 --- /dev/null +++ b/lib/core/enum/CalenderType.dart @@ -0,0 +1,4 @@ +enum CalenderType{ + Gregorian, + Hijri, +} \ No newline at end of file diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index ee8caa90..4b7f59be 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -19,6 +19,10 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:hijri/hijri_calendar.dart'; +import 'package:hijri_picker/hijri_picker.dart'; +import 'package:doctor_app_flutter/core/enum/CalenderType.dart'; + class RegisterSearchPatientPage extends StatefulWidget { final Function changePageViewIndex; @@ -49,6 +53,10 @@ class _RegisterSearchPatientPageState extends State { DateTime _birthDate; String birthdateError; + var selectedHijriDate = new HijriCalendar.now(); + CalenderType calenderType = CalenderType.Gregorian; + + @override Widget build(BuildContext context) { @@ -157,6 +165,37 @@ class _RegisterSearchPatientPageState extends State { SizedBox( height: 10, ), + Row( + children: [ + Expanded( + child: RadioListTile( + title: AppText("Gregorian"), + value: CalenderType.Gregorian, + groupValue: calenderType, + onChanged: (CalenderType value) { + setState(() { + calenderType = value; + }); + }, + ), + ), + Expanded( + child: RadioListTile( + title: AppText("Hijri"), + value: CalenderType.Hijri, + groupValue: calenderType, + onChanged: (CalenderType value) { + setState(() { + calenderType = value; + }); + }, + ), + ), + ], + ), + SizedBox( + height: 10, + ), AppTextFieldCustom( height: screenSize.height * 0.075, hintText: "Birthdate", @@ -300,16 +339,39 @@ class _RegisterSearchPatientPageState extends State { } Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async { - final DateTime picked = await showDatePicker( - context: context, - initialDate: dateTime, - firstDate: DateTime(DateTime.now().year - 150), - lastDate: DateTime(DateTime.now().year + 150), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != dateTime) { - updateDate(picked); + if(calenderType == CalenderType.Hijri) { + final HijriCalendar picked = await showHijriDatePicker( + context: context, + initialDate: selectedHijriDate, + + lastDate: new HijriCalendar() + ..hYear = 1445 + ..hMonth = 9 + ..hDay = 25, + firstDate: new HijriCalendar() + ..hYear = 1438 + ..hMonth = 12 + ..hDay = 25, + initialDatePickerMode: DatePickerMode.day, + ); + if (picked != null && selectedHijriDate != picked) + setState(() { + selectedHijriDate = picked; + }); + } else { + final DateTime picked = await showDatePicker( + context: context, + initialDate: dateTime, + firstDate: DateTime(DateTime.now().year - 150), + lastDate: DateTime(DateTime.now().year + 150), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != dateTime) { + updateDate(picked); + } } + + } void openListDialogField(String attributeName, String attributeValueId, diff --git a/pubspec.lock b/pubspec.lock index 3080216d..2c6e7702 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -581,6 +581,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.3" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" html: dependency: "direct main" description: @@ -699,7 +706,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: @@ -1033,7 +1040,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: @@ -1238,5 +1245,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" + dart: ">=2.10.2 <2.11.0" flutter: ">=1.22.2 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 485e8ae6..341e5ee9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,6 +105,7 @@ dependencies: # Hijri hijri: ^2.0.0 + hijri_picker: ^2.0.0 From 92d81700e17b4478be8b51ade03944be45169438 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 8 Nov 2021 12:29:57 +0200 Subject: [PATCH 117/199] adding country option to register page --- .../patients/register_patient/RegisterPatientPage.dart | 1 + .../register_patient/RegisterSearchPatientPage.dart | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 740906ba..231ff3d1 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -53,6 +53,7 @@ class _RegisterPatientPageState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ///TODO Elham* Add Translation return BaseView( builder: (_, model, w) => AppScaffold( diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 91ee7dd9..432842d3 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -42,7 +42,6 @@ class _RegisterSearchPatientPageState extends State { dynamic country; - //var countryName = ["Saudi Arabia", "UAE"]; bool isSubmitted = false; TextEditingController _phoneController = @@ -255,6 +254,11 @@ class _RegisterSearchPatientPageState extends State { setState(() { isSubmitted = true; }); + if (country == null) { + countryError = TranslationBase.of(context).fieldRequired; + } else { + countryError = null; + } if (isFormValid()) { GifLoaderDialogUtils.showMyDialog(context); CheckPatientForRegistrationModel From 132d781eb525763e96522fa847e1f091b0a59d18 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 9 Nov 2021 08:45:31 +0200 Subject: [PATCH 118/199] conflect resorved --- lib/models/doctor/profile_req_Model.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index f1f71010..115f389d 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -24,14 +24,14 @@ class ProfileReqModel { {this.projectID, this.clinicID, this.doctorID, - this.isRegistered =true, + this.isRegistered = true, this.license, this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', + this.iPAdress = '11.11.11.11', // this.versionID=5.5, - this.channel=9, - this.sessionID='E2bsEeYEJo', + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', this.tokenID, this.isLoginForDoctorApp = true}); From 8d2b6e9b0872fb93d7fc8b4464f61222c94d155b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 9 Nov 2021 10:19:32 +0200 Subject: [PATCH 119/199] finish hijri calender --- .../RegisterConfirmationPatientPage.dart | 18 +- .../RegisterSearchPatientPage.dart | 184 ++++++++++-------- pubspec.lock | 2 +- pubspec.yaml | 2 +- 4 files changed, 115 insertions(+), 91 deletions(-) diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index af861294..1f0a743f 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -63,8 +63,7 @@ class _RegisterConfirmationPatientPageState TextEditingController middleNameAr; TextEditingController lastNameAr; TextEditingController emailAddressController; - TextEditingController langController = TextEditingController( - text: "English"); + TextEditingController langController = TextEditingController(text: "English"); int selectedLang = 1; @override @@ -397,10 +396,13 @@ class _RegisterConfirmationPatientPageState widget.model.getPatientInfoResponseModel.dateOfBirth); String wellFormat = "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; - print(dateFormat.toUtc().toString()); + print( + dateFormat.toUtc().toString(), + ); HijriCalendar hijriDate = HijriCalendar.fromDate( - new DateTime(dateFormat.year, dateFormat.month, - dateFormat.day)); + new DateTime( + dateFormat.year, dateFormat.month, dateFormat.day), + ); // return ; GifLoaderDialogUtils.showMyDialog(context); @@ -664,7 +666,6 @@ class _RegisterConfirmationPatientPageState groupValue: selectedLang, onChanged: (value) { setSelectedLang(value); - }, activeColor: Colors.red, ), @@ -682,10 +683,11 @@ class _RegisterConfirmationPatientPageState ); }); } - setSelectedLang(lang){ + + setSelectedLang(lang) { setState(() { selectedLang = lang; - langController.text = lang==1?"English": "العربيه"; + langController.text = lang == 1 ? "English" : "العربيه"; }); Navigator.of(context).pop(); } diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 4b7f59be..5a3382c0 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -22,14 +22,14 @@ import 'package:flutter/material.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:hijri_picker/hijri_picker.dart'; import 'package:doctor_app_flutter/core/enum/CalenderType.dart'; - +import 'package:intl/intl.dart'; class RegisterSearchPatientPage extends StatefulWidget { final Function changePageViewIndex; - final PatientRegistrationViewModel model; - + final PatientRegistrationViewModel model; - const RegisterSearchPatientPage({Key key, this.changePageViewIndex, this.model}) + const RegisterSearchPatientPage( + {Key key, this.changePageViewIndex, this.model}) : super(key: key); @override @@ -42,25 +42,25 @@ class _RegisterSearchPatientPageState extends State { dynamic _selectedCountry; bool isSubmitted = false; - - TextEditingController _phoneController = TextEditingController(text: "508079569"); + TextEditingController _phoneController = + TextEditingController(text: "508079569"); TextEditingController _phoneCode = TextEditingController(text: "966"); String phoneError; - TextEditingController _idController = TextEditingController(text: "1062938285"); + TextEditingController _idController = + TextEditingController(text: "1062938285"); String idError; - DateTime _birthDate; + DateTime _birthDateInGregorian; String birthdateError; - var selectedHijriDate = new HijriCalendar.now(); + var birthDateInHijri = new HijriCalendar.now(); CalenderType calenderType = CalenderType.Gregorian; - - @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + /// TODO Elham* add transaltion return AppScaffold( @@ -112,14 +112,15 @@ class _RegisterSearchPatientPageState extends State { validationError: phoneError, ), ), - if(_phoneController - .text.isEmpty && - isSubmitted - ) - SizedBox(height: 35,) + if (_phoneController.text.isEmpty && isSubmitted) + SizedBox( + height: 35, + ) ], ), - SizedBox(width: 10,), + SizedBox( + width: 10, + ), Expanded( child: Container( // width: MediaQuery.of(context).size.width*0.7, @@ -128,12 +129,10 @@ class _RegisterSearchPatientPageState extends State { hintText: "Phone Number", inputType: TextInputType.phone, controller: _phoneController, - validationError: _phoneController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: + _phoneController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), ), ), @@ -147,11 +146,8 @@ class _RegisterSearchPatientPageState extends State { hintText: "ID Number", inputType: TextInputType.phone, controller: _idController, - validationError: _idController - .text.isEmpty && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage + validationError: _idController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( @@ -199,15 +195,11 @@ class _RegisterSearchPatientPageState extends State { AppTextFieldCustom( height: screenSize.height * 0.075, hintText: "Birthdate", - dropDownText: _birthDate != null - ? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}" - : null, + dropDownText: getBirthdate(), enabled: false, isTextFieldHasSuffix: true, - validationError: _birthDate == null && - isSubmitted - ? TranslationBase.of(context) - .emptyMessage + validationError: _birthDateInGregorian == null && isSubmitted + ? TranslationBase.of(context).emptyMessage : null, suffixIcon: IconButton( icon: Icon( @@ -217,12 +209,29 @@ class _RegisterSearchPatientPageState extends State { onPressed: null, ), onClick: () { - if (_birthDate == null) { - _birthDate = DateTime.now(); + if (_birthDateInGregorian == null) { + _birthDateInGregorian = DateTime.now(); } - _selectDate(context, _birthDate, (picked) { + _selectDate(context, _birthDateInGregorian, + (dynamic selectedDate) { setState(() { - _birthDate = picked; + if (calenderType == CalenderType.Hijri) { + birthDateInHijri = selectedDate; + _birthDateInGregorian = HijriCalendar().hijriToGregorian( + birthDateInHijri.hYear, + birthDateInHijri.hMonth, + birthDateInHijri.hDay); + print(_birthDateInGregorian); + print(birthDateInHijri); + } else { + _birthDateInGregorian = selectedDate; + birthDateInHijri = HijriCalendar() + .gregorianToHijri( + selectedDate.year, selectedDate.month, selectedDate.day); + + print(_birthDateInGregorian); + print(birthDateInHijri); + } }); }); }, @@ -274,42 +283,44 @@ class _RegisterSearchPatientPageState extends State { setState(() { isSubmitted = true; }); - if(isFormValid()) { + if (isFormValid()) { GifLoaderDialogUtils.showMyDialog(context); CheckPatientForRegistrationModel - checkPatientForRegistrationModel = - CheckPatientForRegistrationModel( - patientIdentificationID: - int.parse(_idController.text), - patientMobileNumber: - int.parse(_phoneController.text), - zipCode: _phoneCode.text, - isHijri: 0, - patientID: 0, - isRegister: false, - isDentalAllowedBackend: false, - patientOutSA: 0, - generalid: GENERAL_ID, - dOB: - "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy/MM/dd")}"); + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel( + patientIdentificationID: + int.parse(_idController.text), + patientMobileNumber: + int.parse(_phoneController.text), + zipCode: _phoneCode.text, + isHijri: 0, + patientID: 0, + isRegister: false, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + dOB: + "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}"); await widget.model.checkPatientForRegistration( checkPatientForRegistrationModel); GetPatientInfoRequestModel getPatientInfoRequestModel = - GetPatientInfoRequestModel( + GetPatientInfoRequestModel( //TODO Elham* this return the static to dynamic - patientIdentificationID:"1062938285", //_idController.text, + patientIdentificationID: "1062938285", + //_idController.text, isHijri: 0, isDentalAllowedBackend: false, patientOutSA: 0, generalid: GENERAL_ID, sessionID: null, - dOB:"31/07/1988",//"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" - + dOB: + "31/07/1988", //"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" ); if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); } else { - await widget.model.getPatientInfo(getPatientInfoRequestModel); + await widget.model + .getPatientInfo(getPatientInfoRequestModel); if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); } else { @@ -318,7 +329,6 @@ class _RegisterSearchPatientPageState extends State { } GifLoaderDialogUtils.hideDialog(context); } - }, ), ), @@ -329,49 +339,47 @@ class _RegisterSearchPatientPageState extends State { ); } - isFormValid() { - if(_phoneController.text!=null &&_phoneController.text.isNotEmpty&& _idController.text!=null &&_idController.text.isNotEmpty &&_birthDate!=null) { + if (_phoneController.text != null && + _phoneController.text.isNotEmpty && + _idController.text != null && + _idController.text.isNotEmpty && + _birthDateInGregorian != null) { return true; } return false; - } + Future _selectDate(BuildContext context, DateTime dateTime, - Function(DateTime picked) updateDate) async { - if(calenderType == CalenderType.Hijri) { - final HijriCalendar picked = await showHijriDatePicker( + Function(dynamic) updateDate) async { + if (calenderType == CalenderType.Hijri) { + HijriCalendar hijriDate = HijriCalendar.fromDate(DateTime.now()); + final HijriCalendar pickedH = await showHijriDatePicker( context: context, - initialDate: selectedHijriDate, - + initialDate: birthDateInHijri ?? hijriDate, lastDate: new HijriCalendar() - ..hYear = 1445 - ..hMonth = 9 - ..hDay = 25, + ..hYear = hijriDate.hYear + ..hMonth = hijriDate.hMonth + ..hDay = hijriDate.hDay, firstDate: new HijriCalendar() ..hYear = 1438 ..hMonth = 12 ..hDay = 25, initialDatePickerMode: DatePickerMode.day, ); - if (picked != null && selectedHijriDate != picked) - setState(() { - selectedHijriDate = picked; - }); - } else { + if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH); + } else { final DateTime picked = await showDatePicker( context: context, - initialDate: dateTime, + initialDate: dateTime ?? DateTime.now(), firstDate: DateTime(DateTime.now().year - 150), - lastDate: DateTime(DateTime.now().year + 150), + lastDate: DateTime.now(), initialEntryMode: DatePickerEntryMode.calendar, ); if (picked != null && picked != dateTime) { updateDate(picked); } } - - } void openListDialogField(String attributeName, String attributeValueId, @@ -394,4 +402,18 @@ class _RegisterSearchPatientPageState extends State { }, ); } + + getBirthdate() { + + if (calenderType == CalenderType.Hijri) { + return birthDateInHijri != null + ? "$birthDateInHijri" + : null; + }else{ + return _birthDateInGregorian != null + ? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}" + : null; + } + + } } diff --git a/pubspec.lock b/pubspec.lock index 2c6e7702..3e9968d3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -575,7 +575,7 @@ packages: source: hosted version: "1.0.6" hijri: - dependency: "direct main" + dependency: transitive description: name: hijri url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index 341e5ee9..23d6a2aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -104,7 +104,7 @@ dependencies: badges: ^1.1.4 # Hijri - hijri: ^2.0.0 +# hijri: ^2.0.3 hijri_picker: ^2.0.0 From ca854638e5d5c10761544c0cfefe6cdbb33f2a6e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 9 Nov 2021 10:34:55 +0200 Subject: [PATCH 120/199] fix merge issue --- .../patients/register_patient/RegisterSearchPatientPage.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 517e433b..2afc593e 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -334,8 +334,8 @@ class _RegisterSearchPatientPageState extends State { GetPatientInfoRequestModel getPatientInfoRequestModel = GetPatientInfoRequestModel( //TODO Elham* this return the static to dynamic - //patientIdentificationID: "1062938285", - _idController.text, + patientIdentificationID: "1062938285", + // _idController.text, isHijri: 0, isDentalAllowedBackend: false, patientOutSA: 0, From 2e884c4a35253563a31879e0d82ecb0375bc08a9 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 14 Nov 2021 15:11:54 +0200 Subject: [PATCH 121/199] fix issues inside diff pages --- .../patient/get_list_stp_referral_frequency_request.dart | 1 - lib/models/patient/progress_note_request.dart | 5 ----- lib/models/pharmacies/pharmacies_List_request_model.dart | 1 - lib/models/pharmacies/pharmacies_items_request_model.dart | 4 ---- 4 files changed, 11 deletions(-) diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index 7f466deb..edae9f18 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -37,7 +37,6 @@ class STPReferralFrequencyRequest { {this.languageID = 2, this.stamp = "2020-06-03T11:18:19.986Z", this.iPAdress = "11.11.11.11", - this.versionID = 5.8, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index fe0add5f..13e1b571 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -35,8 +35,6 @@ class ProgressNoteRequest { bool isLoginForDoctorApp; bool patientOutSA; int patientTypeID; - double versionID; - ProgressNoteRequest( {this.visitType , this.admissionNo, @@ -49,7 +47,6 @@ class ProgressNoteRequest { this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, - this.versionID = 5.5, this.patientOutSA = false}); ProgressNoteRequest.fromJson(Map json) { @@ -65,7 +62,6 @@ class ProgressNoteRequest { isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; patientTypeID = json['PatientTypeID']; - versionID = json['VersionID']; } Map toJson() { @@ -82,7 +78,6 @@ class ProgressNoteRequest { data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; data['PatientTypeID'] = this.patientTypeID; - data['VersionID'] = this.versionID; return data; } } \ No newline at end of file diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 90b5c378..a00e217a 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -26,7 +26,6 @@ class PharmaciesListRequestModel { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 5.5, this.tokenID, this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 4f2e947a..e81ce9b3 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -10,7 +10,6 @@ class PharmaciesItemsRequestModel { String pHRItemName; int pageIndex = 0; int pageSize = 20; - double versionID = 5.5; int channel = 3; int languageID = 2; String iPAdress = "10.20.10.20"; @@ -24,7 +23,6 @@ class PharmaciesItemsRequestModel { {this.pHRItemName, this.pageIndex = 0, this.pageSize = 20, - this.versionID = 5.8, this.channel = 3, this.languageID = 2, this.iPAdress = "10.20.10.20", @@ -38,7 +36,6 @@ class PharmaciesItemsRequestModel { pHRItemName = json['PHR_itemName']; pageIndex = json['PageIndex']; pageSize = json['PageSize']; - versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; iPAdress = json['IPAdress']; @@ -54,7 +51,6 @@ class PharmaciesItemsRequestModel { data['PHR_itemName'] = this.pHRItemName; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; - data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; From f23607b6e43a70d83dfed001e9d2968ee9a3c632 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 14 Nov 2021 15:39:37 +0200 Subject: [PATCH 122/199] first step form discharge summary --- lib/routes.dart | 4 + .../all_discharge_summary.dart | 79 +++++ .../discharge_Summary_widget.dart | 272 ++++++++++++++++++ .../discharge_summary/discharge_summary.dart | 187 ++++++++++++ .../pending_discharge_summary.dart | 88 ++++++ .../profile_gird_for_InPatient.dart | 6 +- 6 files changed, 633 insertions(+), 3 deletions(-) create mode 100644 lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart create mode 100644 lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart create mode 100644 lib/screens/patients/profile/discharge_summary/discharge_summary.dart create mode 100644 lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart diff --git a/lib/routes.dart b/lib/routes.dart index da56ce33..4ce73a4e 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_pa import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/diabetic_chart.dart'; import 'package:doctor_app_flutter/screens/patients/profile/diagnosis/diagnosis_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/admission-orders/admission_orders_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/discharge_summary/discharge_summary.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart'; @@ -78,7 +79,9 @@ const String PENDING_ORDERS = 'pending-orders'; const String ADMISSION_ORDERS = 'admission-orders'; const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; + const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values'; +const String DISCHARGE_SUMMARY = 'discharge_summary'; //todo: change the routing way. var routes = { @@ -125,6 +128,7 @@ var routes = { GET_OPERATION_REPORT: (_) => OperationReportScreen(), PENDING_ORDERS: (_) => PendingOrdersScreen(), NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), + DISCHARGE_SUMMARY : (_) => DischargeSummaryPage(), DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), DIABETIC_CHART_VALUES: (_) => DiabeticChart(), diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart new file mode 100644 index 00000000..13c8590b --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -0,0 +1,79 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_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/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.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'; + + +class AllDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; + + const AllDischargeSummary({Key key, this.changeCurrentTab}) : super(key: key); + + @override + _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); +} + +class _AllDischargeSummaryState extends State { + + int pageIndex = 1; + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getDoctorReply(isLocalBusy: false); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: false, + body: model.listDoctorWorkingHoursTable.isEmpty + ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: NotificationListener( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.listDoctorWorkingHoursTable.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DoctorReplyWidget( + reply: model + .listDoctorWorkingHoursTable[index]), + ), + if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1) + DrAppCircularProgressIndeicator() + + ], + ); + }), + onNotification: (t) { + if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 && + model.state != ViewState.BusyLocal) { + setState(() { + pageIndex++; + }); + model.getDoctorReply(pageIndex: pageIndex); + } + return; + }, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart new file mode 100644 index 00000000..8e555b62 --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -0,0 +1,272 @@ +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/doctor/list_gt_my_patients_question_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:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class DischargeSummaryWidget extends StatefulWidget { + final ListGtMyPatientsQuestions reply; + bool isShowMore = false; + + DischargeSummaryWidget({Key key, this.reply}); + + @override + _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); +} + +class _DischargeSummaryWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return Container( + child: CardWithBgWidget( + bgColor: widget.reply.infoStatus == 99 + ? Color(0xFF2B353E) + : widget.reply.infoStatus == 4 + ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 3 + ? Color(0xFFD02127) + : Colors.green[600], + hasBorder: false, + widget: Container( + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if(widget.reply.infoStatus != 0) + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: widget.reply.infoStatus == 99 + ? TranslationBase.of(context).notReplied:widget.reply.infoStatus == 1 + ? TranslationBase.of(context).replayCallStatus + : widget.reply.infoStatus == 2 + ? TranslationBase.of(context).patientArrived + : widget.reply.infoStatus == 3 + ? TranslationBase.of(context) + .calledAndNoResponse + : widget.reply.infoStatus == 4 + ? TranslationBase.of(context) + .underProcess + : widget.reply.infoStatus == 6 + ? TranslationBase.of(context) + .textResponse + : '', + style: TextStyle( + color: widget.reply.infoStatus == 99 + ? Color(0xFF2B353E) + : widget.reply.infoStatus == 4 + ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 3 + ? Color(0xFFD02127) + : Colors.green[600], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 1.8 * SizeConfig.textMultiplier)), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + + " " + + AppDateUtils.getMonth( + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + AppText( + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .hour + .toString() + + ":" + + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .minute + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + Helpers.capitalize(widget.reply.patientName), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + widget.reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), + SizedBox( + width: 4, + ), + widget.reply.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ], + ), + SizedBox( + height: 20, + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + widget.reply.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ], + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of(context).fileNumber, + value: widget.reply.patientID.toString(), + isCopyable:false, + ), + CustomRow( + label: TranslationBase.of(context).age + " : ", + isCopyable:false, + value: + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + ), + SizedBox( + height: 8, + ), + ], + ), + ], + ), + + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: + TranslationBase.of(context).requestType + + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: + "${widget.reply.requestTypeDescription}", + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), + ], + ), + ), + ), + ], + ) + ], + ), + // Container( + // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + // child: Icon(FontAwesomeIcons.arrowRight, + // size: 20, color: Colors.black),) + ], + ), + // onTap: onTap, + )), + ), + ); + } +} diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart new file mode 100644 index 00000000..1530f917 --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -0,0 +1,187 @@ +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/doctor_replay_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/doctor/doctor_replay/doctor_repaly_chat.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.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/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'all_discharge_summary.dart'; +import 'pending_discharge_summary.dart'; + +class DischargeSummaryPage extends StatefulWidget { + final Function changeCurrentTab; + + const DischargeSummaryPage({Key key, this.changeCurrentTab}) : super(key: key); + + @override + _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); +} + +class _DoctorReplyScreenState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + int _activeTab = 0; + int pageIndex = 1; + + @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; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return WillPopScope( + onWillPop: () async { + widget.changeCurrentTab(); + return false; + }, + child: AppScaffold( + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: true, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Scaffold( + extendBodyBehindAppBar: false, + 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, + "Pending", + ), + tabWidget( + screenSize, + _activeTab == 1, + TranslationBase.of(context).all, + ), + ], + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PendingDischargeSummary(), + AllDischargeSummary(), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + } +} + +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/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart new file mode 100644 index 00000000..c0c36732 --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -0,0 +1,88 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_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/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.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'; + + +class PendingDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; + + const PendingDischargeSummary({Key key, this.changeCurrentTab}) + : super(key: key); + + @override + _PendingDischargeSummaryState createState() => + _PendingDischargeSummaryState(); +} + +class _PendingDischargeSummaryState extends State { + int pageIndex = 1; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getDoctorReply(isLocalBusy: false, isGettingNotReply: true); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: false, + body: model.listDoctorNotRepliedQuestions.isEmpty + ? ErrorMessage(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: NotificationListener( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: + model.listDoctorNotRepliedQuestions.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DoctorReplyWidget( + reply: + model.listDoctorNotRepliedQuestions[ + index]), + ), + if (model.state == ViewState.BusyLocal && + index == + model.listDoctorNotRepliedQuestions + .length - + 1) + DrAppCircularProgressIndeicator() + ], + ); + }), + onNotification: (t) { + if (t is ScrollUpdateNotification && + t.metrics.pixels >= + t.metrics.maxScrollExtent - 50 && + model.state != ViewState.BusyLocal) { + setState(() { + pageIndex++; + }); + model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); + } + return; + }, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 69090bde..ca304986 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -115,10 +115,10 @@ class ProfileGridForInPatient extends StatelessWidget { PatientProfileCardModel( TranslationBase.of(context).discharge, TranslationBase.of(context).report, - null, + DISCHARGE_SUMMARY, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, - isDisable: true), + isInPatient: isInpatient,) + , PatientProfileCardModel( TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, From 6ffbf92d437c1ec232c836ee9e5c2ee35e20d546 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 14 Nov 2021 17:05:11 +0200 Subject: [PATCH 123/199] finish pending discharge summary --- lib/config/config.dart | 4 + .../profile/discharge_summary_servive.dart | 32 +++ .../profile}/operation_report_servive.dart | 0 .../profile/discharge_summary_view_model.dart | 31 +++ .../operation_report_view_model.dart | 2 +- lib/locator.dart | 8 +- .../GetDischargeSummaryReqModel.dart | 27 +++ .../GetDischargeSummaryResModel.dart | 192 ++++++++++++++++++ .../all_discharge_summary.dart | 54 ++--- .../discharge_Summary_widget.dart | 123 +---------- .../discharge_summary/discharge_summary.dart | 2 +- .../pending_discharge_summary.dart | 73 +++---- .../operation_report/operation_report.dart | 2 +- .../update_operation_report.dart | 2 +- .../RegisterConfirmationPatientPage.dart | 2 +- 15 files changed, 359 insertions(+), 195 deletions(-) create mode 100644 lib/core/service/patient/profile/discharge_summary_servive.dart rename lib/core/service/{ => patient/profile}/operation_report_servive.dart (100%) create mode 100644 lib/core/viewModel/profile/discharge_summary_view_model.dart rename lib/core/viewModel/{ => profile}/operation_report_view_model.dart (96%) create mode 100644 lib/models/discharge_summary/GetDischargeSummaryReqModel.dart create mode 100644 lib/models/discharge_summary/GetDischargeSummaryResModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index c01434ce..2afbe5ac 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -380,6 +380,10 @@ const CHECK_ACTIVATION_CODE_FOR_PATIENT = const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo"; + +/// Discharge Summary +const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart new file mode 100644 index 00000000..daea1b42 --- /dev/null +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -0,0 +1,32 @@ +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/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart'; + +class DischargeSummaryService extends BaseService { + List _pendingDischargeSummaryList = []; + List get pendingDischargeSummaryList => _pendingDischargeSummaryList; + + Future getPendingDischargeSummary( + {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + + hasError = false; + await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, + onSuccess: (dynamic response, int statusCode) { + _pendingDischargeSummaryList.clear(); + response['List_PendingDischargeSummary'].forEach( + (v) { + _pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getDischargeSummaryReqModel.toJson()); + } +} diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart similarity index 100% rename from lib/core/service/operation_report_servive.dart rename to lib/core/service/patient/profile/operation_report_servive.dart diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart new file mode 100644 index 00000000..29910570 --- /dev/null +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -0,0 +1,31 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.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/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; + +class DischargeSummaryViewModel extends BaseViewModel { + bool hasError = false; + DischargeSummaryService _dischargeSummaryService = + locator(); + + List get pendingDischargeSummaryList => + _dischargeSummaryService.pendingDischargeSummaryList; + + + Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + hasError = false; + setState(ViewState.Busy); + await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + if (_dischargeSummaryService.hasError) { + error = _dischargeSummaryService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + +} diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart similarity index 96% rename from lib/core/viewModel/operation_report_view_model.dart rename to lib/core/viewModel/profile/operation_report_view_model.dart index 2bfdebce..e3f4f430 100644 --- a/lib/core/viewModel/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/operation_report_servive.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.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/operation_report/create_update_operation_report_request_model.dart'; diff --git a/lib/locator.dart b/lib/locator.dart index 243905d8..18c04ffc 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,11 +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/service/operation_report_servive.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; import 'package:doctor_app_flutter/core/service/pending_order_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/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; @@ -31,6 +32,7 @@ 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/profile/operation_report_servive.dart'; import 'core/service/patient/referral_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'; @@ -109,6 +111,7 @@ void setupLocator() { locator.registerLazySingleton(() => OperationReportService()); locator.registerLazySingleton(() => PendingOrderService()); locator.registerLazySingleton(() => PatientRegistrationService()); + locator.registerLazySingleton(() => DischargeSummaryService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -140,5 +143,6 @@ void setupLocator() { locator.registerFactory(() => OperationReportViewModel()); locator.registerFactory(() => PatientRegistrationViewModel()); locator.registerFactory(() => PendingOrdersViewModel()); + locator.registerFactory(() => DischargeSummaryViewModel()); } diff --git a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart new file mode 100644 index 00000000..2d2c14ad --- /dev/null +++ b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart @@ -0,0 +1,27 @@ +class GetDischargeSummaryReqModel { + int patientID; + int admissionNo; + int patientType; + int patientTypeID; + + GetDischargeSummaryReqModel( + {this.patientID, this.admissionNo, this.patientType = 1, this.patientTypeID=1}); + + GetDischargeSummaryReqModel.fromJson(Map json) { + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['SetupID'] = "010266"; + data['isDentalAllowedBackend'] = false; + return data; + } +} diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart new file mode 100644 index 00000000..006ac6a2 --- /dev/null +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -0,0 +1,192 @@ +class GetDischargeSummaryResModel { + String setupID; + int projectID; + int dischargeNo; + String dischargeDate; + int admissionNo; + int assessmentNo; + int patientType; + int patientID; + int clinicID; + int doctorID; + String finalDiagnosis; + String persentation; + String pastHistory; + String planOfCare; + String investigations; + String followupPlan; + String conditionOnDischarge; + String significantFindings; + String planedProcedure; + int daysStayed; + String remarks; + String eRCare; + int status; + bool isActive; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + bool isPatientDied; + Null isMedicineApproved; + Null isOpenBillDischarge; + Null activatedDate; + Null activatedBy; + Null lAMA; + Null patientCodition; + Null others; + Null reconciliationInstruction; + String dischargeInstructions; + String reason; + Null dischargeDisposition; + Null hospitalID; + String createdByName; + Null createdByNameN; + String editedByName; + Null editedByNameN; + + GetDischargeSummaryResModel( + {this.setupID, + this.projectID, + this.dischargeNo, + this.dischargeDate, + this.admissionNo, + this.assessmentNo, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.finalDiagnosis, + this.persentation, + this.pastHistory, + this.planOfCare, + this.investigations, + this.followupPlan, + this.conditionOnDischarge, + this.significantFindings, + this.planedProcedure, + this.daysStayed, + this.remarks, + this.eRCare, + this.status, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.isPatientDied, + this.isMedicineApproved, + this.isOpenBillDischarge, + this.activatedDate, + this.activatedBy, + this.lAMA, + this.patientCodition, + this.others, + this.reconciliationInstruction, + this.dischargeInstructions, + this.reason, + this.dischargeDisposition, + this.hospitalID, + this.createdByName, + this.createdByNameN, + this.editedByName, + this.editedByNameN}); + + GetDischargeSummaryResModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + dischargeNo = json['DischargeNo']; + dischargeDate = json['DischargeDate']; + admissionNo = json['AdmissionNo']; + assessmentNo = json['AssessmentNo']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + finalDiagnosis = json['FinalDiagnosis']; + persentation = json['Persentation']; + pastHistory = json['PastHistory']; + planOfCare = json['PlanOfCare']; + investigations = json['Investigations']; + followupPlan = json['FollowupPlan']; + conditionOnDischarge = json['ConditionOnDischarge']; + significantFindings = json['SignificantFindings']; + planedProcedure = json['PlanedProcedure']; + daysStayed = json['DaysStayed']; + remarks = json['Remarks']; + eRCare = json['ERCare']; + status = json['Status']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + isPatientDied = json['IsPatientDied']; + isMedicineApproved = json['IsMedicineApproved']; + isOpenBillDischarge = json['IsOpenBillDischarge']; + activatedDate = json['ActivatedDate']; + activatedBy = json['ActivatedBy']; + lAMA = json['LAMA']; + patientCodition = json['PatientCodition']; + others = json['Others']; + reconciliationInstruction = json['ReconciliationInstruction']; + dischargeInstructions = json['DischargeInstructions']; + reason = json['Reason']; + dischargeDisposition = json['DischargeDisposition']; + hospitalID = json['HospitalID']; + createdByName = json['CreatedByName']; + createdByNameN = json['CreatedByNameN']; + editedByName = json['EditedByName']; + editedByNameN = json['EditedByNameN']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + data['DischargeDate'] = this.dischargeDate; + data['AdmissionNo'] = this.admissionNo; + data['AssessmentNo'] = this.assessmentNo; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['FinalDiagnosis'] = this.finalDiagnosis; + data['Persentation'] = this.persentation; + data['PastHistory'] = this.pastHistory; + data['PlanOfCare'] = this.planOfCare; + data['Investigations'] = this.investigations; + data['FollowupPlan'] = this.followupPlan; + data['ConditionOnDischarge'] = this.conditionOnDischarge; + data['SignificantFindings'] = this.significantFindings; + data['PlanedProcedure'] = this.planedProcedure; + data['DaysStayed'] = this.daysStayed; + data['Remarks'] = this.remarks; + data['ERCare'] = this.eRCare; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['IsPatientDied'] = this.isPatientDied; + data['IsMedicineApproved'] = this.isMedicineApproved; + data['IsOpenBillDischarge'] = this.isOpenBillDischarge; + data['ActivatedDate'] = this.activatedDate; + data['ActivatedBy'] = this.activatedBy; + data['LAMA'] = this.lAMA; + data['PatientCodition'] = this.patientCodition; + data['Others'] = this.others; + data['ReconciliationInstruction'] = this.reconciliationInstruction; + data['DischargeInstructions'] = this.dischargeInstructions; + data['Reason'] = this.reason; + data['DischargeDisposition'] = this.dischargeDisposition; + data['HospitalID'] = this.hospitalID; + data['CreatedByName'] = this.createdByName; + data['CreatedByNameN'] = this.createdByNameN; + data['EditedByName'] = this.editedByName; + data['EditedByNameN'] = this.editedByNameN; + return data; + } +} diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 13c8590b..0ae7bf04 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_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/doctor/doctor_replay/doctor_reply_widget.dart'; @@ -9,6 +10,8 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; +import 'discharge_Summary_widget.dart'; + class AllDischargeSummary extends StatefulWidget { final Function changeCurrentTab; @@ -24,51 +27,36 @@ class _AllDischargeSummaryState extends State { int pageIndex = 1; @override Widget build(BuildContext context) { - return BaseView( + return BaseView( onModelReady: (model) { - model.getDoctorReply(isLocalBusy: false); + model.getPendingDischargeSummary(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, - body: model.listDoctorWorkingHoursTable.isEmpty + body: model.pendingDischargeSummaryList.isEmpty ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( child: Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: NotificationListener( - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: model.listDoctorWorkingHoursTable.length, - shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - InkWell( - child: DoctorReplyWidget( - reply: model - .listDoctorWorkingHoursTable[index]), - ), - if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1) - DrAppCircularProgressIndeicator() + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.pendingDischargeSummaryList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DischargeSummaryWidget( + dischargeSummary: model + .pendingDischargeSummaryList[index]), + ), - ], - ); - }), - onNotification: (t) { - if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 && - model.state != ViewState.BusyLocal) { - setState(() { - pageIndex++; - }); - model.getDoctorReply(pageIndex: pageIndex); - } - return; - }, - ), + ], + ); + }), ), ), ], diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index 8e555b62..f4c67442 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -2,6 +2,7 @@ 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/discharge_summary/GetDischargeSummaryResModel.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -15,10 +16,10 @@ import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class DischargeSummaryWidget extends StatefulWidget { - final ListGtMyPatientsQuestions reply; + final GetDischargeSummaryResModel dischargeSummary; bool isShowMore = false; - DischargeSummaryWidget({Key key, this.reply}); + DischargeSummaryWidget({Key key, this.dischargeSummary}); @override _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); @@ -31,77 +32,34 @@ class _DischargeSummaryWidgetState extends State { return Container( child: CardWithBgWidget( - bgColor: widget.reply.infoStatus == 99 - ? Color(0xFF2B353E) - : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR - : widget.reply.infoStatus == 3 - ? Color(0xFFD02127) - : Colors.green[600], + bgColor:Colors.transparent, hasBorder: false, widget: Container( child: InkWell( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(widget.reply.infoStatus != 0) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: widget.reply.infoStatus == 99 - ? TranslationBase.of(context).notReplied:widget.reply.infoStatus == 1 - ? TranslationBase.of(context).replayCallStatus - : widget.reply.infoStatus == 2 - ? TranslationBase.of(context).patientArrived - : widget.reply.infoStatus == 3 - ? TranslationBase.of(context) - .calledAndNoResponse - : widget.reply.infoStatus == 4 - ? TranslationBase.of(context) - .underProcess - : widget.reply.infoStatus == 6 - ? TranslationBase.of(context) - .textResponse - : '', - style: TextStyle( - color: widget.reply.infoStatus == 99 - ? Color(0xFF2B353E) - : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR - : widget.reply.infoStatus == 3 - ? Color(0xFFD02127) - : Colors.green[600], - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 1.8 * SizeConfig.textMultiplier)), - ], - ), - ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.dischargeSummary.createdOn) .day .toString() + " " + AppDateUtils.getMonth( AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.dischargeSummary.createdOn) .month) .toString() .substring(0, 3) + ' ' + AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.dischargeSummary.createdOn) .year .toString(), fontFamily: 'Poppins', @@ -109,12 +67,12 @@ class _DischargeSummaryWidgetState extends State { ), AppText( AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.dischargeSummary.createdOn) .hour .toString() + ":" + AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) + widget.dischargeSummary.createdOn) .minute .toString(), fontFamily: 'Poppins', @@ -124,43 +82,6 @@ class _DischargeSummaryWidgetState extends State { ), ], ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: AppText( - Helpers.capitalize(widget.reply.patientName), - fontSize: SizeConfig.textMultiplier * 2.5, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 4), - child: InkWell( - onTap: () { - launch("tel://" + widget.reply.mobileNumber); - }, - child: Icon( - Icons.phone, - color: Colors.black87, - ), - ), - ), - SizedBox( - width: 4, - ), - widget.reply.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ], - ), SizedBox( height: 20, ), @@ -169,22 +90,6 @@ class _DischargeSummaryWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - width: 60, - height: 60, - child: Image.asset( - widget.reply.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ], - ), SizedBox( width: 20, ), @@ -201,15 +106,9 @@ class _DischargeSummaryWidgetState extends State { children: [ CustomRow( label: TranslationBase.of(context).fileNumber, - value: widget.reply.patientID.toString(), + value: widget.dischargeSummary.patientID.toString(), isCopyable:false, ), - CustomRow( - label: TranslationBase.of(context).age + " : ", - isCopyable:false, - value: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", - ), SizedBox( height: 8, ), @@ -241,7 +140,7 @@ class _DischargeSummaryWidgetState extends State { )), new TextSpan( text: - "${widget.reply.requestTypeDescription}", + "${widget.dischargeSummary.dischargeInstructions}", style: TextStyle( fontFamily: 'Poppins', fontSize: SizeConfig diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 1530f917..1625d7bb 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -125,7 +125,7 @@ class _DoctorReplyScreenState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - PendingDischargeSummary(), + PendingDischargeSummary(patient:patient ,), AllDischargeSummary(), ], ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index c0c36732..3981163e 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_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/doctor/doctor_replay/doctor_reply_widget.dart'; @@ -9,11 +11,13 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; +import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { final Function changeCurrentTab; + final PatiantInformtion patient; - const PendingDischargeSummary({Key key, this.changeCurrentTab}) + const PendingDischargeSummary({Key key, this.changeCurrentTab, this.patient}) : super(key: key); @override @@ -26,58 +30,41 @@ class _PendingDischargeSummaryState extends State { @override Widget build(BuildContext context) { - return BaseView( + return BaseView( onModelReady: (model) { - model.getDoctorReply(isLocalBusy: false, isGettingNotReply: true); + model.getPendingDischargeSummary( + patientId: widget.patient.patientId, + admissionNo: int.parse(widget.patient.admissionNo), + + ); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, - body: model.listDoctorNotRepliedQuestions.isEmpty - ? ErrorMessage(error: TranslationBase.of(context).noItem) + body: model.pendingDischargeSummaryList.isEmpty + ? ErrorMessage( + error: TranslationBase.of(context) + .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( child: Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: NotificationListener( - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: - model.listDoctorNotRepliedQuestions.length, - shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - InkWell( - child: DoctorReplyWidget( - reply: - model.listDoctorNotRepliedQuestions[ - index]), - ), - if (model.state == ViewState.BusyLocal && - index == - model.listDoctorNotRepliedQuestions - .length - - 1) - DrAppCircularProgressIndeicator() - ], - ); - }), - onNotification: (t) { - if (t is ScrollUpdateNotification && - t.metrics.pixels >= - t.metrics.maxScrollExtent - 50 && - model.state != ViewState.BusyLocal) { - setState(() { - pageIndex++; - }); - model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); - } - return; - }, - ), + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.pendingDischargeSummaryList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DischargeSummaryWidget( + dischargeSummary: model + .pendingDischargeSummaryList[index]), + ), + ], + ); + }), ), ), ], diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index a445309e..c2751424 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -2,7 +2,7 @@ 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/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_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'; diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 0800bc16..d042ff2f 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -6,7 +6,7 @@ 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/provider/robot_provider.dart'; -import 'package:doctor_app_flutter/core/viewModel/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_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'; diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 1f0a743f..c03c6f96 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -8,7 +8,7 @@ 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/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_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'; From bc92f9b9f54b1eedf67946789bd2c577db6de60f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 15 Nov 2021 08:22:33 +0200 Subject: [PATCH 124/199] contries model --- lib/models/countriesModel.dart | 1087 ++++++++++++++++++++++++++++++++ 1 file changed, 1087 insertions(+) create mode 100644 lib/models/countriesModel.dart diff --git a/lib/models/countriesModel.dart b/lib/models/countriesModel.dart new file mode 100644 index 00000000..89797fab --- /dev/null +++ b/lib/models/countriesModel.dart @@ -0,0 +1,1087 @@ +// final List countries = [ +// new Countries( +// name: "Saudi Arabia", name_ar: "المملكة العربية السعودية", code: '966'), +// new Countries( +// name: "United Arab Emirates", +// name_ar: "الإمارات العربية المتحدة", +// code: '971'), +// ]; + +// class Countries { +// final String name; +// final String name_ar; +// final String code; + +// Countries({this.name, this.name_ar, this.code}); +// } + +class Countries { + String name; + String nameAr; + String code; + String countryCode; + + Countries({this.name, this.nameAr, this.code, this.countryCode}); + + Countries.fromJson(Map json) { + name = json['name']; + nameAr = json['name_ar']; + code = json['code']; + countryCode = json['countryCode']; + } + + Map toJson() { + final Map data = new Map(); + data['name'] = this.name; + data['name_ar'] = this.nameAr; + data['code'] = this.code; + data['countryCode'] = this.countryCode; + return data; + } +} + +List> countriesData = [ + { + "name": "Saudi Arabia", + "name_ar": "المملكة العربية السعودية", + "code": "+966", + "countryCode": "SA", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }, + { + "name": "United Arab Emirates", + "name_ar": "الإمارات العربية المتحدة", + "code": "+971", + "countryCode": "AE", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }, + { + "name": "Bahrain", + "name_ar": "البحرين", + "code": "+973", + "countryCode": "BH", + "maxLength": 8 + }, + {"name": "Kuwait", "name_ar": "الكويت", "code": "+965", "countryCode": "KW"}, + { + "name": "Afghanistan", + "name_ar": "أفغانستان", + "code": "+93", + "countryCode": "AF" + }, + { + "name": "Aland Islands", + "name_ar": "جزر آلاند", + "code": "+358", + "countryCode": "AX" + }, + { + "name": "Albania", + "name_ar": "ألبانيا", + "code": "+355", + "countryCode": "AL" + }, + { + "name": "Algeria", + "name_ar": "الجزائر", + "code": "+213", + "countryCode": "DZ" + }, + { + "name": "AmericanSamoa", + "name_ar": "ساموا الأمريكية", + "code": "+1 684", + "countryCode": "AS" + }, + {"name": "Andorra", "name_ar": "أندورا", "code": "+376", "countryCode": "AD"}, + {"name": "Angola", "name_ar": "أنغولا", "code": "+244", "countryCode": "AO"}, + { + "name": "Anguilla", + "name_ar": "أنغيلا", + "code": "+1 264", + "countryCode": "AI" + }, + { + "name": "Antarctica", + "name_ar": "القارة القطبية الجنوبية", + "code": "+672", + "countryCode": "AQ" + }, + { + "name": "Antigua and Barbuda", + "name_ar": "أنتيغوا وبربودا", + "code": "+1268", + "countryCode": "AG" + }, + { + "name": "Argentina", + "name_ar": "الأرجنتين", + "code": "+54", + "countryCode": "AR" + }, + { + "name": "Armenia", + "name_ar": "أرمينيا", + "code": "+374", + "countryCode": "AM" + }, + {"name": "Aruba", "name_ar": "أروبا", "code": "+297", "countryCode": "AW"}, + { + "name": "Australia", + "name_ar": "أستراليا", + "code": "+61", + "countryCode": "AU" + }, + {"name": "Austria", "name_ar": "النمسا", "code": "+43", "countryCode": "AT"}, + { + "name": "Azerbaijan", + "name_ar": "أذربيجان", + "code": "+994", + "countryCode": "AZ" + }, + { + "name": "Bahamas", + "name_ar": "الباهاما", + "code": "+1 242", + "countryCode": "BS" + }, + { + "name": "Bangladesh", + "name_ar": "بنغلاديش", + "code": "+880", + "countryCode": "BD" + }, + { + "name": "Barbados", + "name_ar": "بربادوس", + "code": "+1 246", + "countryCode": "BB" + }, + { + "name": "Belarus", + "name_ar": "روسيا البيضاء", + "code": "+375", + "countryCode": "BY" + }, + {"name": "Belgium", "name_ar": "بلجيكا", "code": "+32", "countryCode": "BE"}, + {"name": "Belize", "name_ar": "بليز", "code": "+501", "countryCode": "BZ"}, + {"name": "Benin", "name_ar": "بنين", "code": "+229", "countryCode": "BJ"}, + { + "name": "Bermuda", + "name_ar": "برمودا", + "code": "+1 441", + "countryCode": "BM" + }, + {"name": "Bhutan", "name_ar": "بوتان", "code": "+975", "countryCode": "BT"}, + { + "name": "Bolivia, Plurinational State of", + "name_ar": "دولة بوليفيا المتعددة القوميات", + "code": "+591", + "countryCode": "BO" + }, + { + "name": "Bosnia and Herzegovina", + "name_ar": "البوسنة والهرسك", + "code": "+387", + "countryCode": "BA" + }, + { + "name": "Botswana", + "name_ar": "بوتسوانا", + "code": "+267", + "countryCode": "BW" + }, + {"name": "Brazil", "name_ar": "البرازيل", "code": "+55", "countryCode": "BR"}, + { + "name": "British Indian Ocean Territory", + "name_ar": "إقليم المحيط البريطاني الهندي", + "code": "+246", + "countryCode": "IO" + }, + { + "name": "Brunei Darussalam", + "name_ar": "بروناي دار السلام", + "code": "+673", + "countryCode": "BN" + }, + { + "name": "Bulgaria", + "name_ar": "بلغاريا", + "code": "+359", + "countryCode": "BG" + }, + { + "name": "Burkina Faso", + "name_ar": "بوركينا فاسو", + "code": "+226", + "countryCode": "BF" + }, + { + "name": "Burundi", + "name_ar": "بوروندي", + "code": "+257", + "countryCode": "BI" + }, + { + "name": "Cambodia", + "name_ar": "كمبوديا", + "code": "+855", + "countryCode": "KH" + }, + { + "name": "Cameroon", + "name_ar": "الكاميرون", + "code": "+237", + "countryCode": "CM" + }, + {"name": "Canada", "name_ar": "كندا", "code": "+1", "countryCode": "CA"}, + { + "name": "Cape Verde", + "name_ar": "الرأس الأخضر", + "code": "+238", + "countryCode": "CV" + }, + { + "name": "Cayman Islands", + "name_ar": "جزر كايمان", + "code": "+345", + "countryCode": "KY" + }, + { + "name": "Central African Republic", + "name_ar": "جمهورية افريقيا الوسطى", + "code": "+236", + "countryCode": "CF" + }, + {"name": "Chad", "name_ar": "تشاد", "code": "+235", "countryCode": "TD"}, + {"name": "Chile", "name_ar": "تشيلي", "code": "+56", "countryCode": "CL"}, + {"name": "China", "name_ar": "الصين", "code": "+86", "countryCode": "CN"}, + { + "name": "Christmas Island", + "name_ar": "جزيرة الكريسماس", + "code": "+61", + "countryCode": "CX" + }, + { + "name": "Cocos (Keeling) Islands", + "name_ar": "جزر كوكوس كيلينغ", + "code": "+61", + "countryCode": "CC" + }, + { + "name": "Colombia", + "name_ar": "كولومبيا", + "code": "+57", + "countryCode": "CO" + }, + { + "name": "Comoros", + "name_ar": "جزر القمر", + "code": "+269", + "countryCode": "KM" + }, + {"name": "Congo", "name_ar": "الكونغو", "code": "+242", "countryCode": "CG"}, + { + "name": "Congo, The Democratic Republic of the Congo", + "name_ar": "الكونغو ، جمهورية الكونغو الديمقراطية", + "code": "+243", + "countryCode": "CD" + }, + { + "name": "Cook Islands", + "name_ar": "جزر كوك", + "code": "+682", + "countryCode": "CK" + }, + { + "name": "Costa Rica", + "name_ar": "كوستا ريكا", + "code": "+506", + "countryCode": "CR" + }, + { + "name": "Cote d'Ivoire", + "name_ar": "ساحل العاج", + "code": "+225", + "countryCode": "CI" + }, + { + "name": "Croatia", + "name_ar": "كرواتيا", + "code": "+385", + "countryCode": "HR" + }, + {"name": "Cuba", "name_ar": "كوبا", "code": "+53", "countryCode": "CU"}, + {"name": "Cyprus", "name_ar": "قبرص", "code": "+357", "countryCode": "CY"}, + { + "name": "Czech Republic", + "name_ar": "جمهورية التشيك", + "code": "+420", + "countryCode": "CZ" + }, + { + "name": "Denmark", + "name_ar": "الدنمارك", + "code": "+45", + "countryCode": "DK" + }, + { + "name": "Djibouti", + "name_ar": "جيبوتي", + "code": "+253", + "countryCode": "DJ" + }, + { + "name": "Dominica", + "name_ar": "دومينيكا", + "code": "+1 767", + "countryCode": "DM" + }, + { + "name": "Dominican Republic", + "name_ar": "جمهورية الدومنيكان", + "code": "+1 849", + "countryCode": "DO" + }, + { + "name": "Ecuador", + "name_ar": "الإكوادور", + "code": "+593", + "countryCode": "EC" + }, + {"name": "Egypt", "name_ar": "مصر", "code": "+20", "countryCode": "EG"}, + { + "name": "El Salvador", + "name_ar": "السلفادور", + "code": "+503", + "countryCode": "SV" + }, + { + "name": "Equatorial Guinea", + "name_ar": "غينيا الإستوائية", + "code": "+240", + "countryCode": "GQ" + }, + { + "name": "Eritrea", + "name_ar": "إريتريا", + "code": "+291", + "countryCode": "ER" + }, + { + "name": "Estonia", + "name_ar": "استونيا", + "code": "+372", + "countryCode": "EE" + }, + { + "name": "Ethiopia", + "name_ar": "أثيوبيا", + "code": "+251", + "countryCode": "ET" + }, + { + "name": "Falkland Islands (Malvinas)", + "name_ar": "جزر فوكلاند مالفيناس", + "code": "+500", + "countryCode": "FK" + }, + { + "name": "Faroe Islands", + "name_ar": "جزر صناعية", + "code": "+298", + "countryCode": "FO" + }, + {"name": "Fiji", "name_ar": "فيجي", "code": "+679", "countryCode": "FJ"}, + {"name": "Finland", "name_ar": "فنلندا", "code": "+358", "countryCode": "FI"}, + {"name": "France", "name_ar": "فرنسا", "code": "+33", "countryCode": "FR"}, + { + "name": "French Guiana", + "name_ar": "غيانا الفرنسية", + "code": "+594", + "countryCode": "GF" + }, + { + "name": "French Polynesia", + "name_ar": "بولينيزيا الفرنسية", + "code": "+689", + "countryCode": "PF" + }, + {"name": "Gabon", "name_ar": "الغابون", "code": "+241", "countryCode": "GA"}, + {"name": "Gambia", "name_ar": "غامبيا", "code": "+220", "countryCode": "GM"}, + {"name": "Georgia", "name_ar": "جورجيا", "code": "+995", "countryCode": "GE"}, + {"name": "Germany", "name_ar": "ألمانيا", "code": "+49", "countryCode": "DE"}, + {"name": "Ghana", "name_ar": "غانا", "code": "+233", "countryCode": "GH"}, + { + "name": "Gibraltar", + "name_ar": "جبل طارق", + "code": "+350", + "countryCode": "GI" + }, + {"name": "Greece", "name_ar": "اليونان", "code": "+30", "countryCode": "GR"}, + { + "name": "Greenland", + "name_ar": "الأرض الخضراء", + "code": "+299", + "countryCode": "GL" + }, + { + "name": "Grenada", + "name_ar": "غرينادا", + "code": "+1 473", + "countryCode": "GD" + }, + { + "name": "Guadeloupe", + "name_ar": "جوادلوب", + "code": "+590", + "countryCode": "GP" + }, + {"name": "Guam", "name_ar": "غوام", "code": "+1 671", "countryCode": "GU"}, + { + "name": "Guatemala", + "name_ar": "غواتيمالا", + "code": "+502", + "countryCode": "GT" + }, + {"name": "Guernsey", "name_ar": "غيرنسي", "code": "+44", "countryCode": "GG"}, + {"name": "Guinea", "name_ar": "غينيا", "code": "+224", "countryCode": "GN"}, + { + "name": "Guinea-Bissau", + "name_ar": "غينيا بيساو", + "code": "+245", + "countryCode": "GW" + }, + {"name": "Guyana", "name_ar": "غيانا", "code": "+595", "countryCode": "GY"}, + {"name": "Haiti", "name_ar": "هايتي", "code": "+509", "countryCode": "HT"}, + { + "name": "Holy See (Vatican City State)", + "name_ar": "الكرسي الرسولي دولة الفاتيكان", + "code": "+379", + "countryCode": "VA" + }, + { + "name": "Honduras", + "name_ar": "هندوراس", + "code": "+504", + "countryCode": "HN" + }, + { + "name": "Hong Kong", + "name_ar": "هونج كونج", + "code": "+852", + "countryCode": "HK" + }, + {"name": "Hungary", "name_ar": "اليونان", "code": "+36", "countryCode": "HU"}, + { + "name": "Iceland", + "name_ar": "أيسلندا", + "code": "+354", + "countryCode": "IS" + }, + {"name": "India", "name_ar": "الهند", "code": "+91", "countryCode": "IN"}, + { + "name": "Indonesia", + "name_ar": "أندونيسيا", + "code": "+62", + "countryCode": "ID" + }, + { + "name": "Iran, Islamic Republic of Persian Gulf", + "name_ar": "جمهورية إيران الإسلامية الخليج الفارسي", + "code": "+98", + "countryCode": "IR" + }, + {"name": "Iraq", "name_ar": "العراق", "code": "+964", "countryCode": "IQ"}, + { + "name": "Ireland", + "name_ar": "أيرلندا", + "code": "+353", + "countryCode": "IE" + }, + { + "name": "Isle of Man", + "name_ar": "جزيرة آيل أوف مان", + "code": "+44", + "countryCode": "IM" + }, + {"name": "Israel", "name_ar": "إسرائيل", "code": "+972", "countryCode": "IL"}, + {"name": "Italy", "name_ar": "إيطاليا", "code": "+39", "countryCode": "IT"}, + { + "name": "Jamaica", + "name_ar": "جامايكا", + "code": "+1 876", + "countryCode": "JM" + }, + {"name": "Japan", "name_ar": "اليابان", "code": "+81", "countryCode": "JP"}, + {"name": "Jersey", "name_ar": "جيرسي", "code": "+44", "countryCode": "JE"}, + {"name": "Jordan", "name_ar": "الأردن", "code": "+962", "countryCode": "JO"}, + { + "name": "Kazakhstan", + "name_ar": "كازاخستان", + "code": "+77", + "countryCode": "KZ" + }, + {"name": "Kenya", "name_ar": "كينيا", "code": "+254", "countryCode": "KE"}, + { + "name": "Kiribati", + "name_ar": "كيريباس", + "code": "+686", + "countryCode": "KI" + }, + { + "name": "Korea, Democratic People's Republic of Korea", + "name_ar": "جمهورية كوريا الديمقراطية الشعبية", + "code": "+850", + "countryCode": "KP" + }, + { + "name": "Korea, Republic of South Korea", + "name_ar": "جمهورية كوريا الديمقراطية الشعبية", + "code": "+82", + "countryCode": "KR" + }, + { + "name": "Kyrgyzstan", + "name_ar": "قرغيزستان", + "code": "+996", + "countryCode": "KG" + }, + {"name": "Laos", "name_ar": "لاوس", "code": "+856", "countryCode": "LA"}, + {"name": "Latvia", "name_ar": "لاتفيا", "code": "+371", "countryCode": "LV"}, + {"name": "Lebanon", "name_ar": "لبنان", "code": "+961", "countryCode": "LB"}, + {"name": "Lesotho", "name_ar": "ليسوتو", "code": "+266", "countryCode": "LS"}, + { + "name": "Liberia", + "name_ar": "ليبيريا", + "code": "+231", + "countryCode": "LR" + }, + { + "name": "Libyan Arab Jamahiriya", + "name_ar": "الجماهيرية العربية الليبية", + "code": "+218", + "countryCode": "LY" + }, + { + "name": "Liechtenstein", + "name_ar": "ليختنشتاين", + "code": "+423", + "countryCode": "LI" + }, + { + "name": "Lithuania", + "name_ar": "ليتوانيا", + "code": "+370", + "countryCode": "LT" + }, + { + "name": "Luxembourg", + "name_ar": "لوكسمبورغ", + "code": "+352", + "countryCode": "LU" + }, + {"name": "Macao", "name_ar": "ماكاو", "code": "+853", "countryCode": "MO"}, + { + "name": "Macedonia", + "name_ar": "مقدونيا", + "code": "+389", + "countryCode": "MK" + }, + { + "name": "Madagascar", + "name_ar": "مدغشقر", + "code": "+261", + "countryCode": "MG" + }, + {"name": "Malawi", "name_ar": "مالاوي", "code": "+265", "countryCode": "MW"}, + { + "name": "Malaysia", + "name_ar": "ماليزيا", + "code": "+60", + "countryCode": "MY" + }, + { + "name": "Maldives", + "name_ar": "جزر المالديف", + "code": "+960", + "countryCode": "MV" + }, + {"name": "Mali", "name_ar": "مالي", "code": "+223", "countryCode": "ML"}, + {"name": "Malta", "name_ar": "مالطا", "code": "+356", "countryCode": "MT"}, + { + "name": "Marshall Islands", + "name_ar": "جزر مارشال", + "code": "+692", + "countryCode": "MH" + }, + { + "name": "Martinique", + "name_ar": "مارتينيك", + "code": "+596", + "countryCode": "MQ" + }, + { + "name": "Mauritania", + "name_ar": "موريتانيا", + "code": "+222", + "countryCode": "MR" + }, + { + "name": "Mauritius", + "name_ar": "موريشيوس", + "code": "+230", + "countryCode": "MU" + }, + {"name": "Mayotte", "name_ar": "مايوت", "code": "+262", "countryCode": "YT"}, + {"name": "Mexico", "name_ar": "المكسيك", "code": "+52", "countryCode": "MX"}, + { + "name": "Micronesia, Federated States of Micronesia", + "name_ar": "ميكرونيزيا ، ولايات ميكرونيزيا الموحدة", + "code": "+691", + "countryCode": "FM" + }, + { + "name": "Moldova", + "name_ar": "مولدوفا", + "code": "+373", + "countryCode": "MD" + }, + {"name": "Monaco", "name_ar": "موناكو", "code": "+377", "countryCode": "MC"}, + { + "name": "Mongolia", + "name_ar": "منغوليا", + "code": "+976", + "countryCode": "MN" + }, + { + "name": "Montenegro", + "name_ar": "الجبل الأسود", + "code": "+382", + "countryCode": "ME" + }, + { + "name": "Montserrat", + "name_ar": "مونتسيرات", + "code": "+1664", + "countryCode": "MS" + }, + {"name": "Morocco", "name_ar": "المغرب", "code": "+212", "countryCode": "MA"}, + { + "name": "Mozambique", + "name_ar": "موزمبيق", + "code": "+258", + "countryCode": "MZ" + }, + {"name": "Myanmar", "name_ar": "ميانمار", "code": "+95", "countryCode": "MM"}, + { + "name": "Namibia", + "name_ar": "ناميبيا", + "code": "+264", + "countryCode": "NA" + }, + {"name": "Nauru", "name_ar": "ناورو", "code": "+674", "countryCode": "NR"}, + {"name": "Nepal", "name_ar": "نيبال", "code": "+977", "countryCode": "NP"}, + { + "name": "Netherlands", + "name_ar": "هولندا", + "code": "+31", + "countryCode": "NL" + }, + { + "name": "Netherlands Antilles", + "name_ar": "جزر الأنتيل الهولندية", + "code": "+599", + "countryCode": "AN" + }, + { + "name": "New Caledonia", + "name_ar": "كاليدونيا الجديدة", + "code": "+687", + "countryCode": "NC" + }, + { + "name": "New Zealand", + "name_ar": "نيوزيلندا", + "code": "+64", + "countryCode": "NZ" + }, + { + "name": "Nicaragua", + "name_ar": "نيكاراغوا", + "code": "+505", + "countryCode": "NI" + }, + {"name": "Niger", "name_ar": "النيجر", "code": "+227", "countryCode": "NE"}, + { + "name": "Nigeria", + "name_ar": "نيجيريا", + "code": "+234", + "countryCode": "NG" + }, + {"name": "Niue", "name_ar": "نيوي", "code": "+683", "countryCode": "NU"}, + { + "name": "Norfolk Island", + "name_ar": "جزيرة نورفولك", + "code": "+672", + "countryCode": "NF" + }, + { + "name": "Northern Mariana Islands", + "name_ar": "جزر مريانا الشمالية", + "code": "+1 670", + "countryCode": "MP" + }, + {"name": "Norway", "name_ar": "النرويج", "code": "+47", "countryCode": "NO"}, + { + "name": "Oman", + "name_ar": "سلطنة عمان", + "code": "+968", + "countryCode": "OM" + }, + { + "name": "Pakistan", + "name_ar": "باكستان", + "code": "+92", + "countryCode": "PK" + }, + {"name": "Palau", "name_ar": "بالاو", "code": "+680", "countryCode": "PW"}, + { + "name": "Palestinian Territory, Occupied", + "name_ar": "الأراضي الفلسطينية المحتلة", + "code": "+970", + "countryCode": "PS" + }, + {"name": "Panama", "name_ar": "بناما", "code": "+507", "countryCode": "PA"}, + { + "name": "Papua New Guinea", + "name_ar": "بابوا غينيا الجديدة", + "code": "+675", + "countryCode": "PG" + }, + { + "name": "Paraguay", + "name_ar": "باراغواي", + "code": "+595", + "countryCode": "PY" + }, + {"name": "Peru", "name_ar": "بيرو", "code": "+51", "countryCode": "PE"}, + { + "name": "Philippines", + "name_ar": "الفلبين", + "code": "+63", + "countryCode": "PH" + }, + { + "name": "Pitcairn", + "name_ar": "بيتكيرن", + "code": "+872", + "countryCode": "PN" + }, + {"name": "Poland", "name_ar": "بولندا", "code": "+48", "countryCode": "PL"}, + { + "name": "Portugal", + "name_ar": "البرتغال", + "code": "+351", + "countryCode": "PT" + }, + { + "name": "Puerto Rico", + "name_ar": "بورتوريكو", + "code": "+1 939", + "countryCode": "PR" + }, + {"name": "Qatar", "name_ar": "دولة قطر", "code": "+974", "countryCode": "QA"}, + {"name": "Romania", "name_ar": "رومانيا", "code": "+40", "countryCode": "RO"}, + {"name": "Russia", "name_ar": "روسيا", "code": "+7", "countryCode": "RU"}, + {"name": "Rwanda", "name_ar": "رواندا", "code": "+250", "countryCode": "RW"}, + { + "name": "Reunion", + "name_ar": "جمع شمل", + "code": "+262", + "countryCode": "RE" + }, + { + "name": "Saint Barthelemy", + "name_ar": "سانت بارتيليمي", + "code": "+590", + "countryCode": "BL" + }, + { + "name": "Saint Helena, Ascension and Tristan Da Cunha", + "name_ar": "سانت هيلانة ، أسنشن وتريستان دا كونها", + "code": "+290", + "countryCode": "SH" + }, + { + "name": "Saint Kitts and Nevis", + "name_ar": "سانت كيتس ونيفيس", + "code": "+1 869", + "countryCode": "KN" + }, + { + "name": "Saint Lucia", + "name_ar": "القديسة لوسيا", + "code": "+1 758", + "countryCode": "LC" + }, + { + "name": "Saint Martin", + "name_ar": "القديس مارتن", + "code": "+590", + "countryCode": "MF" + }, + { + "name": "Saint Pierre and Miquelon", + "name_ar": "سانت بيير وميكلون", + "code": "+508", + "countryCode": "PM" + }, + { + "name": "Saint Vincent and the Grenadines", + "name_ar": "سانت فنسنت وجزر غرينادين", + "code": "+1 784", + "countryCode": "VC" + }, + {"name": "Samoa", "name_ar": "ساموا", "code": "+685", "countryCode": "WS"}, + { + "name": "San Marino", + "name_ar": "سان مارينو", + "code": "+378", + "countryCode": "SM" + }, + { + "name": "Sao Tome and Principe", + "name_ar": "ساو تومي وبرينسيبي", + "code": "+239", + "countryCode": "ST" + }, + { + "name": "Senegal", + "name_ar": "السنغال", + "code": "+221", + "countryCode": "SN" + }, + {"name": "Serbia", "name_ar": "صربيا", "code": "+381", "countryCode": "RS"}, + { + "name": "Seychelles", + "name_ar": "سيشيل", + "code": "+248", + "countryCode": "SC" + }, + { + "name": "Sierra Leone", + "name_ar": "سيرا ليون", + "code": "+232", + "countryCode": "SL" + }, + { + "name": "Singapore", + "name_ar": "سنغافورة", + "code": "+65", + "countryCode": "SG" + }, + { + "name": "Slovakia", + "name_ar": "سلوفاكيا", + "code": "+421", + "countryCode": "SK" + }, + { + "name": "Slovenia", + "name_ar": "سلوفينيا", + "code": "+386", + "countryCode": "SI" + }, + { + "name": "Solomon Islands", + "name_ar": "جزر سليمان", + "code": "+677", + "countryCode": "SB" + }, + { + "name": "Somalia", + "name_ar": "الصومال", + "code": "+252", + "countryCode": "SO" + }, + { + "name": "South Africa", + "name_ar": "جنوب أفريقيا", + "code": "+27", + "countryCode": "ZA" + }, + { + "name": "South Georgia and the South Sandwich Islands", + "name_ar": "جورجيا الجنوبية وجزر ساندويتش الجنوبية", + "code": "+500", + "countryCode": "GS" + }, + {"name": "Spain", "name_ar": "إسبانيا", "code": "+34", "countryCode": "ES"}, + { + "name": "Sri Lanka", + "name_ar": "سيريلانكا", + "code": "+94", + "countryCode": "LK" + }, + {"name": "Sudan", "name_ar": "سودان", "code": "+249", "countryCode": "SD"}, + { + "name": "Suriname", + "name_ar": "سورينام", + "code": "+597", + "countryCode": "SR" + }, + { + "name": "Svalbard and Jan Mayen", + "name_ar": "سفالبارد وجان ماين", + "code": "+47", + "countryCode": "SJ" + }, + { + "name": "Swaziland", + "name_ar": "سوازيلاند", + "code": "+268", + "countryCode": "SZ" + }, + {"name": "Sweden", "name_ar": "السويد", "code": "+46", "countryCode": "SE"}, + { + "name": "Switzerland", + "name_ar": "سويسرا", + "code": "+41", + "countryCode": "CH" + }, + { + "name": "Syrian Arab Republic", + "name_ar": "الجمهورية العربية السورية", + "code": "+963", + "countryCode": "SY" + }, + {"name": "Taiwan", "name_ar": "تايوان", "code": "+886", "countryCode": "TW"}, + { + "name": "Tajikistan", + "name_ar": "طاجيكستان", + "code": "+992", + "countryCode": "TJ" + }, + { + "name": "Tanzania, United Republic of Tanzania", + "name_ar": "تنزانيا ، جمهورية تنزانيا المتحدة", + "code": "+255", + "countryCode": "TZ" + }, + { + "name": "Thailand", + "name_ar": "تايلاند", + "code": "+66", + "countryCode": "TH" + }, + { + "name": "Timor-Leste", + "name_ar": "تيمور الشرقية", + "code": "+670", + "countryCode": "TL" + }, + {"name": "Togo", "name_ar": "ليذهب", "code": "+228", "countryCode": "TG"}, + { + "name": "Tokelau", + "name_ar": "توكيلاو", + "code": "+690", + "countryCode": "TK" + }, + {"name": "Tonga", "name_ar": "تونغا", "code": "+676", "countryCode": "TO"}, + { + "name": "Trinidad and Tobago", + "name_ar": "ترينداد وتوباغو", + "code": "+1 868", + "countryCode": "TT" + }, + {"name": "Tunisia", "name_ar": "تونس", "code": "+216", "countryCode": "TN"}, + {"name": "Turkey", "name_ar": "ديك رومي", "code": "+90", "countryCode": "TR"}, + { + "name": "Turkmenistan", + "name_ar": "تركمانستان", + "code": "+993", + "countryCode": "TM" + }, + { + "name": "Turks and Caicos Islands", + "name_ar": "جزر تركس وكايكوس", + "code": "+1 649", + "countryCode": "TC" + }, + {"name": "Tuvalu", "name_ar": "توفالو", "code": "+688", "countryCode": "TV"}, + {"name": "Uganda", "name_ar": "أوغندا", "code": "+256", "countryCode": "UG"}, + { + "name": "Ukraine", + "name_ar": "أوكرانيا", + "code": "+380", + "countryCode": "UA" + }, + { + "name": "United Kingdom", + "name_ar": "المملكة المتحدة", + "code": "+44", + "countryCode": "GB" + }, + { + "name": "United States", + "name_ar": "الولايات المتحدة الامريكانية", + "code": "+1", + "countryCode": "US" + }, + { + "name": "Uruguay", + "name_ar": "أوروغواي", + "code": "+598", + "countryCode": "UY" + }, + { + "name": "Uzbekistan", + "name_ar": "أوزبكستان", + "code": "+998", + "countryCode": "UZ" + }, + { + "name": "Vanuatu", + "name_ar": "فانواتو", + "code": "+678", + "countryCode": "VU" + }, + { + "name": "Venezuela, Bolivarian Republic of Venezuela", + "name_ar": "فنزويلا ، جمهورية فنزويلا البوليفارية", + "code": "+58", + "countryCode": "VE" + }, + {"name": "Vietnam", "name_ar": "فيتنام", "code": "+84", "countryCode": "VN"}, + { + "name": "Virgin Islands, British", + "name_ar": "جزر العذراء البريطانية", + "code": "+1 284", + "countryCode": "VG" + }, + { + "name": "Virgin Islands, U.S.", + "name_ar": "جزر فيرجن ، الولايات المتحدة", + "code": "+1 340", + "countryCode": "VI" + }, + { + "name": "Wallis and Futuna", + "name_ar": "واليس وفوتونا", + "code": "+681", + "countryCode": "WF" + }, + {"name": "Yemen", "name_ar": "اليمن", "code": "+967", "countryCode": "YE"}, + {"name": "Zambia", "name_ar": "زامبيا", "code": "+260", "countryCode": "ZM"}, + { + "name": "Zimbabwe", + "name_ar": "زيمبابوي", + "code": "+263", + "countryCode": "ZW" + } +]; +// }); +// List countryList =[]; From 8f0e69df3a798f23a18d2e281334a23bb39471ad Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 15 Nov 2021 08:57:31 +0200 Subject: [PATCH 125/199] fix text fields --- lib/widgets/shared/text_fields/new_text_Field.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index ca5b417c..70729446 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -200,7 +200,7 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2!.copyWith( + style: Theme.of(context).textTheme.bodyText1!.copyWith( fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), From 37d4dfffa2f1db6a176060b87c37508c075bb45b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 15 Nov 2021 16:23:29 +0200 Subject: [PATCH 126/199] all discharge summary --- lib/config/config.dart | 12 +- .../profile/discharge_summary_servive.dart | 29 +- .../profile/discharge_summary_view_model.dart | 19 + .../GetDischargeSummaryResModel.dart | 112 +++--- .../all_discharge_summary.dart | 100 +++-- .../discharge_Summary_widget.dart | 374 ++++++++++++++---- .../discharge_summary/discharge_summary.dart | 18 +- .../pending_discharge_summary.dart | 5 +- .../pending_orders/pending_orders_screen.dart | 72 +++- 9 files changed, 532 insertions(+), 209 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 2afbe5ac..0511f1cd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -346,7 +346,6 @@ const GET_MEDICATION_FOR_IN_PATIENT = const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; - ///Operation Details Services const GET_RESERVATIONS = @@ -377,12 +376,15 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; -const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo"; - +const PATIENT_REGISTRATION = + "Services/Authentication.svc/REST/PatientRegistration"; +const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; /// Discharge Summary -const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_PENDING_DISCHARGE_SUMMARY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_ALL_DISCHARGE_SUMMARY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; var selectedPatientType = 1; diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index daea1b42..12de09ac 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -10,18 +10,41 @@ import 'package:doctor_app_flutter/models/operation_report/get_reservations_requ class DischargeSummaryService extends BaseService { List _pendingDischargeSummaryList = []; - List get pendingDischargeSummaryList => _pendingDischargeSummaryList; + List get pendingDischargeSummaryList => + _pendingDischargeSummaryList; + + List _allDischargeSummaryList = []; + List get allDischargeSummaryList => + _allDischargeSummaryList; Future getPendingDischargeSummary( {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { - hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { _pendingDischargeSummaryList.clear(); response['List_PendingDischargeSummary'].forEach( (v) { - _pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v)); + _pendingDischargeSummaryList + .add(GetDischargeSummaryResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getDischargeSummaryReqModel.toJson()); + } + + Future getAllDischargeSummary( + {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + hasError = false; + await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY, + onSuccess: (dynamic response, int statusCode) { + _pendingDischargeSummaryList.clear(); + response['List_DischargeSummary'].forEach( + (v) { + _pendingDischargeSummaryList + .add(GetDischargeSummaryResModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index 29910570..9db5a6dd 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -15,6 +15,10 @@ class DischargeSummaryViewModel extends BaseViewModel { _dischargeSummaryService.pendingDischargeSummaryList; + List get allDisChargeSummaryList => + _dischargeSummaryService.allDischargeSummaryList; + + Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); hasError = false; @@ -28,4 +32,19 @@ class DischargeSummaryViewModel extends BaseViewModel { } } + + + Future getAllDischargeSummary({int patientId, int admissionNo, }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + hasError = false; + setState(ViewState.Busy); + await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + if (_dischargeSummaryService.hasError) { + error = _dischargeSummaryService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + } diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart index 006ac6a2..0be29e50 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -28,69 +28,69 @@ class GetDischargeSummaryResModel { int editedBy; String editedOn; bool isPatientDied; - Null isMedicineApproved; - Null isOpenBillDischarge; - Null activatedDate; - Null activatedBy; - Null lAMA; - Null patientCodition; - Null others; - Null reconciliationInstruction; + dynamic isMedicineApproved; + dynamic isOpenBillDischarge; + dynamic activatedDate; + dynamic activatedBy; + dynamic lAMA; + dynamic patientCodition; + dynamic others; + dynamic reconciliationInstruction; String dischargeInstructions; String reason; - Null dischargeDisposition; - Null hospitalID; + dynamic dischargeDisposition; + dynamic hospitalID; String createdByName; - Null createdByNameN; + dynamic createdByNameN; String editedByName; - Null editedByNameN; + dynamic editedByNameN; GetDischargeSummaryResModel( {this.setupID, - this.projectID, - this.dischargeNo, - this.dischargeDate, - this.admissionNo, - this.assessmentNo, - this.patientType, - this.patientID, - this.clinicID, - this.doctorID, - this.finalDiagnosis, - this.persentation, - this.pastHistory, - this.planOfCare, - this.investigations, - this.followupPlan, - this.conditionOnDischarge, - this.significantFindings, - this.planedProcedure, - this.daysStayed, - this.remarks, - this.eRCare, - this.status, - this.isActive, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.isPatientDied, - this.isMedicineApproved, - this.isOpenBillDischarge, - this.activatedDate, - this.activatedBy, - this.lAMA, - this.patientCodition, - this.others, - this.reconciliationInstruction, - this.dischargeInstructions, - this.reason, - this.dischargeDisposition, - this.hospitalID, - this.createdByName, - this.createdByNameN, - this.editedByName, - this.editedByNameN}); + this.projectID, + this.dischargeNo, + this.dischargeDate, + this.admissionNo, + this.assessmentNo, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.finalDiagnosis, + this.persentation, + this.pastHistory, + this.planOfCare, + this.investigations, + this.followupPlan, + this.conditionOnDischarge, + this.significantFindings, + this.planedProcedure, + this.daysStayed, + this.remarks, + this.eRCare, + this.status, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.isPatientDied, + this.isMedicineApproved, + this.isOpenBillDischarge, + this.activatedDate, + this.activatedBy, + this.lAMA, + this.patientCodition, + this.others, + this.reconciliationInstruction, + this.dischargeInstructions, + this.reason, + this.dischargeDisposition, + this.hospitalID, + this.createdByName, + this.createdByNameN, + this.editedByName, + this.editedByNameN}); GetDischargeSummaryResModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 0ae7bf04..fcec04c4 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -1,66 +1,94 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_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/doctor/doctor_replay/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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:flutter/material.dart'; import 'discharge_Summary_widget.dart'; - class AllDischargeSummary extends StatefulWidget { final Function changeCurrentTab; + final PatiantInformtion patient; - const AllDischargeSummary({Key key, this.changeCurrentTab}) : super(key: key); + const AllDischargeSummary({this.changeCurrentTab, this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); } class _AllDischargeSummaryState extends State { - int pageIndex = 1; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) { - model.getPendingDischargeSummary(); + model.getAllDischargeSummary( + patientId: widget.patient.patientId, + admissionNo: int.parse(widget.patient.admissionNo), + ); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - body: model.pendingDischargeSummaryList.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) - : Column( - children: [ - Expanded( - child: Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: model.pendingDischargeSummaryList.length, - shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - InkWell( - child: DischargeSummaryWidget( - dischargeSummary: model - .pendingDischargeSummaryList[index]), - ), - - ], - ); - }), - ), - ), - ], - ), + body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + model.pendingDischargeSummaryList.isEmpty + ? ErrorMessage( + error: TranslationBase.of(context).noDataAvailable) + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).discharge, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).summary, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: + model.pendingDischargeSummaryList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DischargeSummaryWidget( + dischargeSummary: + model.pendingDischargeSummaryList[ + index]), + ), + ], + ); + }), + ), + ), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index f4c67442..88f150e5 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -1,19 +1,17 @@ -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/discharge_summary/GetDischargeSummaryResModel.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_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:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:url_launcher/url_launcher.dart'; class DischargeSummaryWidget extends StatefulWidget { final GetDischargeSummaryResModel dischargeSummary; @@ -26,27 +24,54 @@ class DischargeSummaryWidget extends StatefulWidget { } class _DischargeSummaryWidgetState extends State { + bool isCardExpanded = true; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return Container( - child: CardWithBgWidget( - bgColor:Colors.transparent, - hasBorder: false, - widget: Container( - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + return Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Padding( + padding: EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - AppDateUtils.getDateTimeFromServerFormat( + CustomRow( + label: TranslationBase.of(context).doctorName + ": ", + value: widget.dischargeSummary.doctorID.toString() ?? + "".toString(), + isCopyable: false, + ), + CustomRow( + label: TranslationBase.of(context).branch + ": ", + value: widget.dischargeSummary.projectID.toString() ?? + "".toString(), + isCopyable: false, + ), + CustomRow( + label: TranslationBase.of(context).clinicName + ": ", + value: widget.dischargeSummary.clinicID.toString() ?? + "".toString(), + isCopyable: false, + ), + CustomRow( + label: TranslationBase.of(context).dischargeDate + ": ", + value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn) .day .toString() + @@ -62,61 +87,149 @@ class _DischargeSummaryWidgetState extends State { widget.dischargeSummary.createdOn) .year .toString(), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + isCopyable: false, ), - AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.dischargeSummary.createdOn) - .hour - .toString() + - ":" + - AppDateUtils.getDateTimeFromServerFormat( - widget.dischargeSummary.createdOn) - .minute - .toString(), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + InkWell( + onTap: () { + setState(() { + isCardExpanded = !isCardExpanded; + }); + }, + child: Icon(isCardExpanded + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), ], ), - SizedBox( - height: 20, - ), - - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, + bodyWidget: Row( children: [ - SizedBox( - width: 20, - ), Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - // SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomRow( - label: TranslationBase.of(context).fileNumber, - value: widget.dischargeSummary.patientID.toString(), - isCopyable:false, - ), - SizedBox( - height: 8, - ), + SizedBox( + height: 15.0, + ), + AppText("More Details"), + SizedBox( + height: 15.0, + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: "Past History" + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: Helpers.parseHtmlString( + widget.dischargeSummary.pastHistory), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), ], ), - ], + ), + ), + SizedBox( + height: 5.0, + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: "Investigations" + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: Helpers.parseHtmlString( + widget.dischargeSummary.investigations ?? + ""), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), + ], + ), + ), + ), + SizedBox( + height: 5.0, + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: "Condition On Discharge" + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: Helpers.parseHtmlString(widget + .dischargeSummary.conditionOnDischarge), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), + ], + ), + ), + ), + SizedBox( + height: 5.0, ), - Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( @@ -128,9 +241,7 @@ class _DischargeSummaryWidgetState extends State { color: Color(0xFF575757)), children: [ new TextSpan( - text: - TranslationBase.of(context).requestType + - ": ", + text: "Planed Procedure" + ": ", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -139,8 +250,8 @@ class _DischargeSummaryWidgetState extends State { //TranslationBase.of(context).doctorResponse + " : ", )), new TextSpan( - text: - "${widget.dischargeSummary.dischargeInstructions}", + text: Helpers.parseHtmlString( + widget.dischargeSummary.planedProcedure), style: TextStyle( fontFamily: 'Poppins', fontSize: SizeConfig @@ -157,15 +268,130 @@ class _DischargeSummaryWidgetState extends State { ) ], ), - // Container( - // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, - // child: Icon(FontAwesomeIcons.arrowRight, - // size: 20, color: Colors.black),) - ], + isExpand: isCardExpanded, + // widget: Container( + // child: InkWell( + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [], + // ), + // SizedBox( + // height: 20, + // ), + // + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // SizedBox( + // width: 20, + // ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // // SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // CustomRow( + // label: TranslationBase.of(context) + // .fileNumber, + // value: widget.dischargeSummary.patientID + // .toString(), + // isCopyable: false, + // ), + // SizedBox( + // height: 8, + // ), + // ], + // ), + // ], + // ), + // + // Container( + // width: MediaQuery.of(context).size.width * 0.5, + // child: RichText( + // maxLines: 3, + // overflow: TextOverflow.ellipsis, + // text: new TextSpan( + // style: new TextStyle( + // fontSize: 1.3 * SizeConfig.textMultiplier, + // color: Color(0xFF575757)), + // children: [ + // new TextSpan( + // text: TranslationBase.of(context) + // .requestType + + // ": ", + // style: TextStyle( + // fontSize: SizeConfig + // .getTextMultiplierBasedOnWidth() * + // 2.8, + // color: Color(0xFF575757), + // //TranslationBase.of(context).doctorResponse + " : ", + // )), + // new TextSpan( + // text: Helpers.parseHtmlString(widget + // .dischargeSummary.pastHistory), + // style: TextStyle( + // fontFamily: 'Poppins', + // fontSize: SizeConfig + // .getTextMultiplierBasedOnWidth() * + // 3, + // color: Color(0xFF2E303A), + // fontWeight: FontWeight.w700, + // )), + // ], + // ), + // ), + // ), + // ], + // ) + // ], + // ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // AppText( + // AppDateUtils.getDateTimeFromServerFormat( + // widget.dischargeSummary.createdOn) + // .day + // .toString() + + // " " + + // AppDateUtils.getMonth( + // AppDateUtils.getDateTimeFromServerFormat( + // widget.dischargeSummary.createdOn) + // .month) + // .toString() + // .substring(0, 3) + + // ' ' + + // AppDateUtils.getDateTimeFromServerFormat( + // widget.dischargeSummary.createdOn) + // .year + // .toString(), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ), + // ], + // ), + // // Container( + // // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + // // child: Icon(FontAwesomeIcons.arrowRight, + // // size: 20, color: Colors.black),) + // ], + // ), + // // onTap: onTap, + // )), + ), ), - // onTap: onTap, - )), - ), + ), + ], ); } } diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 1625d7bb..31935fcf 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -1,18 +1,9 @@ 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/doctor_replay_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/doctor/doctor_replay/doctor_repaly_chat.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.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/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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/cupertino.dart'; import 'package:flutter/material.dart'; @@ -23,7 +14,8 @@ import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { final Function changeCurrentTab; - const DischargeSummaryPage({Key key, this.changeCurrentTab}) : super(key: key); + const DischargeSummaryPage({Key key, this.changeCurrentTab}) + : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); @@ -125,8 +117,10 @@ class _DoctorReplyScreenState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - PendingDischargeSummary(patient:patient ,), - AllDischargeSummary(), + PendingDischargeSummary( + patient: patient, + ), + AllDischargeSummary(patient: patient), ], ), ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 3981163e..ef70020a 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -33,9 +33,8 @@ class _PendingDischargeSummaryState extends State { return BaseView( onModelReady: (model) { model.getPendingDischargeSummary( - patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), - + patientId: widget.patient.patientId, + admissionNo: int.parse(widget.patient.admissionNo), ); }, builder: (_, model, w) => AppScaffold( diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index a03ca3c5..e9e4f8b2 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -36,28 +36,60 @@ class PendingOrdersScreen extends StatelessWidget { model.pendingOrdersList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).noDataAvailable) - : Container( - child: ListView.builder( - itemCount: model.pendingOrdersList.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).pending, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), - border: Border.all( - color: Color(0xFF707070), width: 0.30), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: - AppText(model.pendingOrdersList[index].notes), - ), + ], ), - ); - })), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: AppText( + model.pendingOrdersList[index].notes), + ), + ), + ); + })), + ], + ), ), ); } From eceb3976ad731b612af62702a641c25261ac756c Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 16 Nov 2021 10:00:20 +0200 Subject: [PATCH 127/199] fix issues happend after merge --- lib/config/size_config.dart | 16 - .../Prescriptions/prescription_report.dart | 2 +- .../viewModel/authentication_view_model.dart | 18 +- lib/screens/home/home_screen.dart | 2 + .../reschedule-leaves/reschedule_leave.dart | 1181 ++++++++--------- pubspec.lock | 139 +- 6 files changed, 729 insertions(+), 629 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index dc58e3e6..3e07990b 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -92,22 +92,6 @@ class SizeConfig { return widthMultiplier; } - 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) { diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index 56e835ef..4b5d574a 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -5,7 +5,7 @@ class PrescriptionReport { String? companyName; dynamic? days; String? doctorName; - var? doseDailyQuantity; + var doseDailyQuantity; String? frequency; dynamic? frequencyNumber; String? image; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 7e081697..a5bedff8 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -318,28 +318,27 @@ class AuthenticationViewModel extends BaseViewModel { } } + /// call firebase service to check if the user already login in before or not /// call firebase service to check if the user already login in before or not getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - } - setState(ViewState.Busy); - } catch (e) { - Helpers.showErrorToast("fdfdfdfdf" + e.toString()); + _firebaseMessaging.requestNotificationPermissions(); } + setState(ViewState.Busy); var token = await _firebaseMessaging.getToken(); if (localToken == "") { - localToken = token!; + localToken = token; await _authService.selectDeviceImei(localToken); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user = _authService.dashboardItemsList[0]; - sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + user =_authService.dashboardItemsList[0]; + sharedPref.setObj( + LAST_LOGIN_USER, _authService.dashboardItemsList[0]); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, @@ -353,6 +352,7 @@ class AuthenticationViewModel extends BaseViewModel { } } + /// determine the status of the app APP_STATUS get status { if (state == ViewState.Busy) { diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 585596e5..c609ad7a 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/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'; @@ -18,6 +19,7 @@ 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/screens/patients/register_patient/RegisterPatientPage.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/shared/app_texts_widget.dart'; diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 6db77387..7d90c9a8 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -37,19 +37,19 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - late ProjectViewModel projectsProvider; - late SickLeaveViewModel sickLeaveViewModel; - + ProjectViewModel projectsProvider; + SickLeaveViewModel sickLeaveViewModel; + String _selectedClinic; Map profile = {}; - String offTime = '1'; + var offTime = '1'; var date; var doctorID; var reason; dynamic fromDate; dynamic toDate; var clinicID; - late String fromTime; - late String toTime; + String fromTime; + String toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { @@ -104,620 +104,615 @@ class _RescheduleLeaveScreen extends State { onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( onModelReady: (model2) => { - model2.getOffTime(), - model2.getReasons(offTime == '1' - ? 18 - : offTime == '2' - ? 19 - : 102), - model2.getCoveringDoctors() - }, + model2.getOffTime(), + model2.getReasons(offTime == '1' + ? 18 + : offTime == '2' + ? 19 + : 102), + model2.getCoveringDoctors() + }, builder: (_, model2, w) => GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - baseViewModel: model2, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // width: double.infinity, - // child: Padding( - // padding: EdgeInsets.only( - // top: SizeConfig.widthMultiplier * 0.9, - // bottom: - // SizeConfig.widthMultiplier * 0.9, - // right: SizeConfig.widthMultiplier * 3, - // left: SizeConfig.widthMultiplier * 3), - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Expanded( - // // add Expanded to have your dropdown button fill remaining space - // child: - // DropdownButtonHideUnderline( - // child: new IgnorePointer( - // ignoring: true, - // child: DropdownButton( - // focusColor: - // Colors.grey, - // isExpanded: true, - // dropdownColor: - // Colors.grey, - // value: getClinicName( - // model) ?? - // "", - // iconSize: 0, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext - // context) { - // return model - // .getClinicNameList() - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize - // .max, - // children: < - // Widget>[ - // AppText( - // item, - // fontSize: - // SizeConfig.textMultiplier * - // 2.1, - // color: Colors - // .grey[ - // 500], - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: - // (newValue) => - // {}, - // items: model - // .getClinicNameList() - // .map((item) { - // return DropdownMenuItem( - // value: item - // .toString(), - // child: Text( - // item, - // textAlign: - // TextAlign - // .end, - // ), - // ); - // }).toList(), - // ))), - // ), - // ], - // ) - // ], - // ), - // )), + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model2, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // width: double.infinity, + // child: Padding( + // padding: EdgeInsets.only( + // top: SizeConfig.widthMultiplier * 0.9, + // bottom: + // SizeConfig.widthMultiplier * 0.9, + // right: SizeConfig.widthMultiplier * 3, + // left: SizeConfig.widthMultiplier * 3), + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // // add Expanded to have your dropdown button fill remaining space + // child: + // DropdownButtonHideUnderline( + // child: new IgnorePointer( + // ignoring: true, + // child: DropdownButton( + // focusColor: + // Colors.grey, + // isExpanded: true, + // dropdownColor: + // Colors.grey, + // value: getClinicName( + // model) ?? + // "", + // iconSize: 0, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext + // context) { + // return model + // .getClinicNameList() + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize + // .max, + // children: < + // Widget>[ + // AppText( + // item, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors + // .grey[ + // 500], + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: + // (newValue) => + // {}, + // items: model + // .getClinicNameList() + // .map((item) { + // return DropdownMenuItem( + // value: item + // .toString(), + // child: Text( + // item, + // textAlign: + // TextAlign + // .end, + // ), + // ); + // }).toList(), + // ))), + // ), + // ], + // ) + // ], + // ), + // )), - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.all(Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // padding: EdgeInsets.all(5), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // new IgnorePointer( - // ignoring: true, - // child: AppTextFormField( - // readOnly: true, - // hintText: profile != null - // ? profile['DoctorName'] - // : "", - // borderColor: Colors.white, - // onSaved: (value) {}, - // inputFormatter: ONLY_NUMBERS)) - // ], - // ), - // ), + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // padding: EdgeInsets.all(5), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // new IgnorePointer( + // ignoring: true, + // child: AppTextFormField( + // readOnly: true, + // hintText: profile != null + // ? profile['DoctorName'] + // : "", + // borderColor: Colors.white, + // onSaved: (value) {}, + // inputFormatter: ONLY_NUMBERS)) + // ], + // ), + // ), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allOffTime.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + // focusColor: Colors.grey, + isExpanded: true, + value: offTime == null ? model2.allOffTime[0]['code'] : offTime, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item['description'], + + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + setState(() { + offTime = newValue; + }); + if (offTime == '1') { + model2.getReasons(18); + } else if (offTime == '2') { + model2.getReasons(19); + } else if (offTime == '3' || offTime == '5') { + model2.getReasons(102); + setState(() { + offTime = newValue; + }); + } + }, + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), + child: Text( + item['description'], + textAlign: TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], + ), + )), + offTime == '1' + ? Column( + children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allOffTime.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - // focusColor: Colors.grey, - isExpanded: true, - value: offTime == null - ? model2.allOffTime[0]['code'].toString() - : offTime, - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allOffTime.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item['description'], - - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (String? newValue) { - setState(() { - offTime = newValue; - }); - if (offTime == '1') { - model2.getReasons(18); - } else if (offTime == '2') { - model2.getReasons(19); - } else if (offTime == '3' || offTime == '5') { - model2.getReasons(102); - setState(() { - offTime = newValue; - }); - } - }, - items: model2.allOffTime.map((item) { - return DropdownMenuItem( - value: item['code'].toString(), - child: Text( - item['description'], - textAlign: TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, + ) + ], )), - offTime == '1' - ? Column( - children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: - IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (val) => fromDate = val, - onSaved: (val) => fromDate = val, - ) - ], - )), - Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).fromTime, - type: DateTimePickerType.time, - controller: _controller4, - onChanged: (val) => fromTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => fromTime = val!, - ) - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).toTime, - type: DateTimePickerType.time, - controller: _controller5, - onChanged: (val) => toTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => toTime = val!, - ) - ], - ), - ), - ) - ], - ) - ], - ) - : Column( - children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: - IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - readOnly: true, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - fromDate = value; - }); - }), - ], - )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).toDate, - readOnly: true, - borderColor: Colors.white, - prefix: - IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController2, - onTap: () { - _presentDatePicker('toDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - toDate = value; - }); - }), - ], - )) - ], + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, + controller: _controller4, + onChanged: (val) => fromTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => fromTime = val, + ) + ], + ), ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, + controller: _controller5, + onChanged: (val) => toTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => toTime = val, + ) + ], + ), + ), + ) + ], + ) + ], + ) + : Column( + children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allReasons.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - value: model2.allReasons[0]['id'].toString() ?? "", - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allReasons.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - projectsProvider.isArabic - ? item['nameAr'] - : item['nameEn'], - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - reason = newValue; - }) - }, - items: model2.allReasons.map((item) { - return DropdownMenuItem( - value: item['id'].toString(), - child: Text( - projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], - textAlign: TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + readOnly: true, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + fromDate = value; + }); + }), + ], )), - Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.coveringDoctors.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownSearch( - mode: Mode.BOTTOM_SHEET, - - dropdownSearchDecoration: InputDecoration( - contentPadding: EdgeInsets.all(0), border: InputBorder.none), - //maxHeight: 300, - items: model2.coveringDoctors.map((item) { - return projectsProvider.isArabic - ? item['doctorNameN'].toString() - : item['doctorName'].toString(); - }).toList(), - // label: "Doctor List", - onChanged: (item) { - model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorName'] == item ) - doctorID = newVal['DoctorID']} - }); - }, - selectedItem: getSelectedDoctor(model2), - showSearchBox: true, - searchBoxDecoration: InputDecoration( - border: OutlineInputBorder(), - contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), - labelText: "Search Doctor", - ), - popupTitle: Container( - height: 50, - decoration: BoxDecoration( - color: Theme.of(context).primaryColorDark, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), - topRight: Radius.circular(20), - ), - ), - child: Center( - child: Text( - '', - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - ), - ), - popupShape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), - topRight: Radius.circular(24), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).toDate, + readOnly: true, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, + onTap: () { + _presentDatePicker('toDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + toDate = value; + }); + }), + ], + )) + ], + ), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allReasons.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: model2.allReasons[0]['id'].toString() ?? "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + projectsProvider.isArabic + ? item['nameAr'] + : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, ), - ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + reason = newValue; + }) + }, + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), + child: Text( + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, ), - // DropdownButtonHideUnderline( - // child: DropdownButton( - // focusColor: Colors.grey, - // isExpanded: true, - // value: doctorID == null - // ? model2 - // .coveringDoctors[0] - // ['doctorID'] - // .toString() - // : doctorID, - // iconSize: 40, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext context) { - // return model2 - // .coveringDoctors - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // AppText( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // fontSize: SizeConfig - // .textMultiplier * - // 2.1, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) => { - // setState(() { - // doctorID = newValue; - // }) - // }, - // items: model2 - // .coveringDoctors - // .map((item) { - // return DropdownMenuItem< - // String>( - // value: item['doctorID'] - // .toString(), - // child: Text( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // textAlign: - // TextAlign.start, - // ), - // ); - // }).toList(), - // )), - ) - : SizedBox(), - ], + ); + }).toList(), + )), ) + : SizedBox(), ], - ), - )), - SizedBox(height: SizeConfig.screenHeight * .3), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.isUpdate == true - ? TranslationBase.of(context).updateReschedule - : TranslationBase.of(context).addReschedule, - color: HexColor('#359846'), - onPressed: () { - if (offTime == '1' || offTime == '2') { - if (widget.isUpdate == true) { - updateRecheduleLeave(model2); - } else { - addRecheduleLeave(model2); - } - } else { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); - } - }, - ), + ) ], ), - ), - // Column( - // children: [ - // AppText(TranslationBase.of(context) - // .previousSickLeaveIssue + - // ' ') - // ], - // ) - ], + )), + + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.coveringDoctors.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownSearch( + mode: Mode.BOTTOM_SHEET, + + dropdownSearchDecoration: InputDecoration( + contentPadding: EdgeInsets.all(0), border: InputBorder.none), + //maxHeight: 300, + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic + ? item['doctorNameN'] + : item['doctorName']; + }).toList(), + // label: "Doctor List", + onChanged: (item) { + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorName'] == item) + doctorID = newVal['DoctorID'] + }); + }, + selectedItem: getSelectedDoctor(model2), + showSearchBox: true, + searchBoxDecoration: InputDecoration( + border: OutlineInputBorder(), + contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), + labelText: "Search Doctor", + ), + popupTitle: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Center( + child: Text( + '', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), + ), + ), + ), + // DropdownButtonHideUnderline( + // child: DropdownButton( + // focusColor: Colors.grey, + // isExpanded: true, + // value: doctorID == null + // ? model2 + // .coveringDoctors[0] + // ['doctorID'] + // .toString() + // : doctorID, + // iconSize: 40, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return model2 + // .coveringDoctors + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // AppText( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // fontSize: SizeConfig + // .textMultiplier * + // 2.1, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) => { + // setState(() { + // doctorID = newValue; + // }) + // }, + // items: model2 + // .coveringDoctors + // .map((item) { + // return DropdownMenuItem< + // String>( + // value: item['doctorID'] + // .toString(), + // child: Text( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // textAlign: + // TextAlign.start, + // ), + // ); + // }).toList(), + // )), + ) + : SizedBox(), + ], + ) + ], + ), + )), + SizedBox(height: SizeConfig.screenHeight * .3), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.isUpdate == true + ? TranslationBase.of(context).updateReschedule + : TranslationBase.of(context).addReschedule, + color: HexColor('#359846'), + onPressed: () { + if (offTime == '1' || offTime == '2') { + if (widget.isUpdate == true) { + updateRecheduleLeave(model2); + } else { + addRecheduleLeave(model2); + } + } else { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); + } + }, + ), + ], + ), ), - ), + // Column( + // children: [ + // AppText(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) + ], ), ), ), - ))); + ), + ), + ))); } getProfile() async { @@ -801,8 +796,8 @@ class _RescheduleLeaveScreen extends State { context, MaterialPageRoute( builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') - // MyReferredPatient(), - ), + // MyReferredPatient(), + ), ); } }); @@ -872,8 +867,8 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} - }); + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} + }); return doctorName; } } diff --git a/pubspec.lock b/pubspec.lock index f6841219..27ad91b3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "12.0.0" + version: "14.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "0.41.2" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "3.1.6" args: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.8.1" autocomplete_textfield: dependency: "direct main" description: @@ -43,6 +43,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.3" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" barcode_scan_fix: dependency: "direct main" description: @@ -134,6 +141,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "8.1.0" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.1" characters: dependency: transitive description: @@ -147,7 +161,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" charts_common: dependency: transitive description: @@ -252,7 +266,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.1" csslib: dependency: transitive description: @@ -412,6 +426,20 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" flutter_colorpicker: dependency: "direct main" description: @@ -574,6 +602,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.4" + hijri: + dependency: transitive + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" html: dependency: "direct main" description: @@ -616,6 +658,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.8" imei_plugin: dependency: "direct main" description: @@ -692,7 +741,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" mime: dependency: transitive description: @@ -735,6 +784,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" package_config: dependency: transitive description: @@ -763,6 +819,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.1" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" path_provider_linux: dependency: transitive description: @@ -770,6 +847,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" path_provider_platform_interface: dependency: transitive description: @@ -889,6 +973,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.1" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.25.0" scratch_space: dependency: transitive description: @@ -978,6 +1069,20 @@ packages: relative: true source: path version: "0.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0+4" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1+1" stack_trace: dependency: transitive description: @@ -1013,6 +1118,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" term_glyph: dependency: transitive description: @@ -1026,7 +1138,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.2" timing: dependency: transitive description: @@ -1097,6 +1209,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.5" vector_math: dependency: transitive description: @@ -1217,5 +1336,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.13.0 <3.0.0" - flutter: ">=2.2.0" + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" From dfce0d20e24f847d35fc83b430a9ba0b639c60a8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 16 Nov 2021 14:02:12 +0200 Subject: [PATCH 128/199] discharge summary card --- .../profile/discharge_summary_servive.dart | 5 +- .../GetDischargeSummaryResModel.dart | 11 +- .../all_discharge_summary.dart | 10 +- .../discharge_Summary_widget.dart | 130 +----------------- .../pending_discharge_summary.dart | 35 ++++- 5 files changed, 50 insertions(+), 141 deletions(-) diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index 12de09ac..a92ef0eb 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -40,11 +40,10 @@ class DischargeSummaryService extends BaseService { hasError = false; await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { - _pendingDischargeSummaryList.clear(); + _allDischargeSummaryList.clear(); response['List_DischargeSummary'].forEach( (v) { - _pendingDischargeSummaryList - .add(GetDischargeSummaryResModel.fromJson(v)); + _allDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart index 0be29e50..10ddab00 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -44,6 +44,8 @@ class GetDischargeSummaryResModel { dynamic createdByNameN; String editedByName; dynamic editedByNameN; + String clinicName; + String projectName; GetDischargeSummaryResModel( {this.setupID, @@ -90,7 +92,9 @@ class GetDischargeSummaryResModel { this.createdByName, this.createdByNameN, this.editedByName, - this.editedByNameN}); + this.editedByNameN, + this.clinicName, + this.projectName}); GetDischargeSummaryResModel.fromJson(Map json) { setupID = json['SetupID']; @@ -138,6 +142,8 @@ class GetDischargeSummaryResModel { createdByNameN = json['CreatedByNameN']; editedByName = json['EditedByName']; editedByNameN = json['EditedByNameN']; + clinicName = json['ClinicDescription']; + projectName = json['ProjectName']; } Map toJson() { @@ -187,6 +193,9 @@ class GetDischargeSummaryResModel { data['CreatedByNameN'] = this.createdByNameN; data['EditedByName'] = this.editedByName; data['EditedByNameN'] = this.editedByNameN; + data['ClinicDescription'] = this.clinicName; + data['ProjectName'] = this.projectName; + return data; } } diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index fcec04c4..f29315ae 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -34,7 +34,7 @@ class _AllDischargeSummaryState extends State { baseViewModel: model, isShowAppBar: false, body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) - model.pendingDischargeSummaryList.isEmpty + model.allDisChargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context).noDataAvailable) : Column( @@ -70,17 +70,15 @@ class _AllDischargeSummaryState extends State { padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: ListView.builder( scrollDirection: Axis.vertical, - itemCount: - model.pendingDischargeSummaryList.length, + itemCount: model.allDisChargeSummaryList.length, shrinkWrap: true, itemBuilder: (BuildContext ctxt, int index) { return Column( children: [ InkWell( child: DischargeSummaryWidget( - dischargeSummary: - model.pendingDischargeSummaryList[ - index]), + dischargeSummary: model + .allDisChargeSummaryList[index]), ), ], ); diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index 88f150e5..c1e72f96 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -24,7 +24,7 @@ class DischargeSummaryWidget extends StatefulWidget { } class _DischargeSummaryWidgetState extends State { - bool isCardExpanded = true; + bool isCardExpanded = false; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -53,19 +53,20 @@ class _DischargeSummaryWidgetState extends State { children: [ CustomRow( label: TranslationBase.of(context).doctorName + ": ", - value: widget.dischargeSummary.doctorID.toString() ?? - "".toString(), + value: + widget.dischargeSummary.createdByName.toString() ?? + "".toString(), isCopyable: false, ), CustomRow( label: TranslationBase.of(context).branch + ": ", - value: widget.dischargeSummary.projectID.toString() ?? + value: widget.dischargeSummary.projectName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( label: TranslationBase.of(context).clinicName + ": ", - value: widget.dischargeSummary.clinicID.toString() ?? + value: widget.dischargeSummary.clinicName.toString() ?? "".toString(), isCopyable: false, ), @@ -269,125 +270,6 @@ class _DischargeSummaryWidgetState extends State { ], ), isExpand: isCardExpanded, - // widget: Container( - // child: InkWell( - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [], - // ), - // SizedBox( - // height: 20, - // ), - // - // Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // SizedBox( - // width: 20, - // ), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // // SizedBox(height: 10,), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // CustomRow( - // label: TranslationBase.of(context) - // .fileNumber, - // value: widget.dischargeSummary.patientID - // .toString(), - // isCopyable: false, - // ), - // SizedBox( - // height: 8, - // ), - // ], - // ), - // ], - // ), - // - // Container( - // width: MediaQuery.of(context).size.width * 0.5, - // child: RichText( - // maxLines: 3, - // overflow: TextOverflow.ellipsis, - // text: new TextSpan( - // style: new TextStyle( - // fontSize: 1.3 * SizeConfig.textMultiplier, - // color: Color(0xFF575757)), - // children: [ - // new TextSpan( - // text: TranslationBase.of(context) - // .requestType + - // ": ", - // style: TextStyle( - // fontSize: SizeConfig - // .getTextMultiplierBasedOnWidth() * - // 2.8, - // color: Color(0xFF575757), - // //TranslationBase.of(context).doctorResponse + " : ", - // )), - // new TextSpan( - // text: Helpers.parseHtmlString(widget - // .dischargeSummary.pastHistory), - // style: TextStyle( - // fontFamily: 'Poppins', - // fontSize: SizeConfig - // .getTextMultiplierBasedOnWidth() * - // 3, - // color: Color(0xFF2E303A), - // fontWeight: FontWeight.w700, - // )), - // ], - // ), - // ), - // ), - // ], - // ) - // ], - // ), - // Column( - // crossAxisAlignment: CrossAxisAlignment.end, - // children: [ - // AppText( - // AppDateUtils.getDateTimeFromServerFormat( - // widget.dischargeSummary.createdOn) - // .day - // .toString() + - // " " + - // AppDateUtils.getMonth( - // AppDateUtils.getDateTimeFromServerFormat( - // widget.dischargeSummary.createdOn) - // .month) - // .toString() - // .substring(0, 3) + - // ' ' + - // AppDateUtils.getDateTimeFromServerFormat( - // widget.dischargeSummary.createdOn) - // .year - // .toString(), - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ), - // ], - // ), - // // Container( - // // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, - // // child: Icon(FontAwesomeIcons.arrowRight, - // // size: 20, color: Colors.black),) - // ], - // ), - // // onTap: onTap, - // )), ), ), ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index ef70020a..4984999f 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -1,16 +1,11 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_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/doctor/doctor_replay/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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:flutter/material.dart'; - import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { @@ -43,9 +38,35 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + .noDataAvailable) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).discharge, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).summary, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), Expanded( child: Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), From 47437c863774ff9d28a6249ab56b6c0f7d09ee7b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 18 Nov 2021 16:32:38 +0200 Subject: [PATCH 129/199] some fixes to go flutter 2 --- .../lab_order/labs_service.dart | 4 +- .../prescription/prescriptions_service.dart | 2 +- .../sick_leave/sickleave_service.dart | 2 +- lib/core/service/pending_order_service.dart | 4 +- .../viewModel/PatientSearchViewModel.dart | 2 +- .../viewModel/prescriptions_view_model.dart | 2 +- .../list_gt_my_patients_question_model.dart | 1 - .../doctor_replay/all_doctor_questions.dart | 2 +- .../doctor_replay/doctor_repaly_chat.dart | 2 +- .../doctor_replay/doctor_reply_screen.dart | 2 +- .../not_replaied_doctor_questions.dart | 2 +- .../In_patient/in_patient_screen.dart | 2 +- .../profile/UCAF/ucaf_pager_screen.dart | 2 +- .../admission_orders_screen.dart | 2 +- ...iabetic_details_blood_pressurewideget.dart | 2 +- .../line_chart_for_diabetic.dart | 10 +-- .../profile/diagnosis/diagnosis_screen.dart | 2 +- .../all_discharge_summary.dart | 2 +- .../discharge_Summary_widget.dart | 2 +- .../discharge_summary/discharge_summary.dart | 2 +- .../pending_discharge_summary.dart | 2 +- .../profile/lab_result/FlowChartPage.dart | 66 ++++++++++--------- .../lab_result/LineChartCurvedLabHistory.dart | 4 +- .../all_lab_special_result_page.dart | 2 +- .../special_lab_result_details_page.dart | 2 +- .../AddVerifyMedicalReport.dart | 2 +- .../nursing_note/nursing_note_screen.dart | 2 +- .../operation_report/operation_report.dart | 2 +- .../update_operation_report.dart | 2 +- .../pending_orders/pending_orders_screen.dart | 2 +- .../referral/my-referral-detail-screen.dart | 2 +- .../assessment/update_assessment_page.dart | 2 +- .../objective/update_objective_page.dart | 2 +- .../bottom_sheet_dialog_button.dart | 2 +- .../shared_soap_widgets/remove_button.dart | 2 +- .../steper/steps_widget.dart | 2 +- .../subjective/allergies/allergies_item.dart | 2 +- ..._key_checkbox_search_allergies_widget.dart | 8 +-- .../subjective/update_subjective_page.dart | 4 +- .../soap_update/update_soap_index.dart | 4 +- .../RegisterConfirmationPatientPage.dart | 2 +- .../register_patient/RegisterPatientPage.dart | 2 +- .../RegisterSearchPatientPage.dart | 4 +- .../VerifyActivationCodePage.dart | 2 +- .../profile/patient-profile-app-bar.dart | 2 +- .../profile/profile_medical_info_widget.dart | 2 +- .../shared/bottom_navigation_item.dart | 3 +- .../text_fields/country_textfield_custom.dart | 14 ++-- 48 files changed, 100 insertions(+), 98 deletions(-) diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index b291c312..1fe088c0 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -14,7 +14,7 @@ import '../../base/base_service.dart'; class LabsService extends BaseService { List patientLabOrdersList = []; - List _allSpecialLab = List(); + List _allSpecialLab = []; List get allSpecialLab => _allSpecialLab; AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(); @@ -56,7 +56,7 @@ class LabsService extends BaseService { List patientLabSpecialResult = []; List labResultList = []; List labOrdersResultsList = []; - List labOrdersResultHistoryList = List(); + List labOrdersResultHistoryList = []; Future getLaboratoryResult( {String? projectID, diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index daebebf9..55ab7a89 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -18,7 +18,7 @@ import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { List prescriptionsList = []; - List medicationForInPatient = List(); + List medicationForInPatient = []; List prescriptionsOrderList = []; List prescriptionInPatientList = []; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index e4e090d0..6efeba18 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -30,7 +30,7 @@ class SickLeaveService extends BaseService { List getAllSickLeavePatient = []; - List getAllSickLeaveDoctor = List(); + List getAllSickLeaveDoctor = []; SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(); diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index e6f35bb8..f0bcf5e9 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -6,10 +6,10 @@ import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_m import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; class PendingOrderService extends BaseService { - List _pendingOrderList = List(); + List _pendingOrderList = []; List get pendingOrderList => _pendingOrderList; - List _admissionOrderList = List(); + List _admissionOrderList = []; List get admissionOrderList => _admissionOrderList; Future getPendingOrders( diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 61ad9d70..b9a9a323 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -145,7 +145,7 @@ class PatientSearchViewModel extends BaseViewModel { List get myIinPatientList => _inPatientService.myInPatientList; List filteredInPatientItems = []; - List filteredMyInPatientItems = List(); + List filteredMyInPatientItems = []; Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isLocalBusy = false}) async { await getDoctorProfile(); diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index 84c655a7..f48294a4 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -32,7 +32,7 @@ class PrescriptionsViewModel extends BaseViewModel { List get medicationForInPatient => _prescriptionsService.medicationForInPatient; - List _medicationForInPatient = List(); + List _medicationForInPatient = []; getPrescriptions(PatiantInformtion patient) async { setState(ViewState.Busy); diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index a8f56ed9..0e630c5f 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,5 +1,4 @@ class ListGtMyPatientsQuestions { -import 'package:doctor_app_flutter/util/date-utils.dart'; Null rowID; String? setupID; diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 5166d2b1..ac6736e0 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart'; class AllDoctorQuestions extends StatefulWidget { final Function changeCurrentTab; - const AllDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key); + const AllDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key); @override _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index 52331e8e..85c06b18 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget { final DoctorReplayViewModel previousModel; bool showMsgBox = false; DoctorReplayChat( - {Key key, this.reply, this.previousModel, + {Key? key, this.reply, this.previousModel, }); @override diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 8b51319c..84c951f8 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -28,7 +28,7 @@ import 'not_replaied_Doctor_Questions.dart'; class DoctorReplyScreen extends StatefulWidget { final Function changeCurrentTab; - const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key? key, this.changeCurrentTab}) : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 5b21809f..65b95217 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart'; class NotRepliedDoctorQuestions extends StatefulWidget { final Function changeCurrentTab; - const NotRepliedDoctorQuestions({Key key, this.changeCurrentTab}) + const NotRepliedDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key); @override diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index ef9f8b03..b70d5788 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -25,7 +25,7 @@ class InPatientScreen extends StatefulWidget { bool isAllClinic = true; bool showBottomSheet = false; String selectedClinicName; - InPatientScreen({Key key, this.specialClinic}); + InPatientScreen({Key? key, this.specialClinic}); @override _InPatientScreenState createState() => _InPatientScreenState(); diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 8c38ece7..87be05b2 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -15,7 +15,7 @@ import 'UCAF-detail-screen.dart'; import 'UCAF-input-screen.dart'; class UCAFPagerScreen extends StatefulWidget { - const UCAFPagerScreen({Key key}) : super(key: key); + const UCAFPagerScreen({Key? key}) : super(key: key); @override _UCAFPagerScreenState createState() => _UCAFPagerScreenState(); diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index f83117e2..41b8d0ee 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AdmissionOrdersScreen extends StatefulWidget { - const AdmissionOrdersScreen({Key key}) : super(key: key); + const AdmissionOrdersScreen({Key? key}) : super(key: key); @override _AdmissionOrdersScreenState createState() => _AdmissionOrdersScreenState(); diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index b3b1b581..c68f848f 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -13,7 +13,7 @@ class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; DiabeticDetails( - {Key key, this.diabeticDetailsList,}); + {Key? key, this.diabeticDetailsList,}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart index 671230c2..1159e970 100644 --- a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -14,8 +14,8 @@ class LineChartForDiabetic extends StatelessWidget { LineChartForDiabetic( {this.title, this.timeSeries1, this.indexes, this.isOX= false}); - List xAxixs = List(); - List yAxixs = List(); + List xAxixs = []; + List yAxixs = []; @override Widget build(BuildContext context) { @@ -188,12 +188,12 @@ class LineChartForDiabetic extends StatelessWidget { } List getData(context) { - List spots = List(); + List spots = []; for (int index = 0; index < timeSeries1.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = List(); + List spots2 = []; // for (int index = 0; index < timeSeries2.length; index++) { // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); // } @@ -225,7 +225,7 @@ class LineChartForDiabetic extends StatelessWidget { ), ); - List lineChartData = List(); + List lineChartData = []; if(spots.isNotEmpty){ lineChartData.add(lineChartBarData1); } diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 65e483b5..caa7421b 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -31,7 +31,7 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class DiagnosisScreen extends StatefulWidget { - const DiagnosisScreen({Key key}) : super(key: key); + const DiagnosisScreen({Key? key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 0ae7bf04..73317d8d 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -16,7 +16,7 @@ import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { final Function changeCurrentTab; - const AllDischargeSummary({Key key, this.changeCurrentTab}) : super(key: key); + const AllDischargeSummary({Key? key, this.changeCurrentTab}) : super(key: key); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index f4c67442..8d5b02ae 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -19,7 +19,7 @@ class DischargeSummaryWidget extends StatefulWidget { final GetDischargeSummaryResModel dischargeSummary; bool isShowMore = false; - DischargeSummaryWidget({Key key, this.dischargeSummary}); + DischargeSummaryWidget({Key? key, this.dischargeSummary}); @override _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 1625d7bb..3bcd673a 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -23,7 +23,7 @@ import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { final Function changeCurrentTab; - const DischargeSummaryPage({Key key, this.changeCurrentTab}) : super(key: key); + const DischargeSummaryPage({Key? key, this.changeCurrentTab}) : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 3981163e..317eeb4d 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -17,7 +17,7 @@ class PendingDischargeSummary extends StatefulWidget { final Function changeCurrentTab; final PatiantInformtion patient; - const PendingDischargeSummary({Key key, this.changeCurrentTab, this.patient}) + const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient}) : super(key: key); @override diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index f634a466..3bf6929b 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -20,7 +20,7 @@ class FlowChartPage extends StatelessWidget { final bool isInpatient; FlowChartPage( - {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); + {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @override Widget build(BuildContext context) { @@ -29,45 +29,47 @@ class FlowChartPage extends StatelessWidget { patientLabOrder: patientLabOrder, procedureDescription: filterName, patient: patient), - //onModelReady: (model) => - model.getPatientLabOrdersResults(//patientLabOrder: patientLabOrder,// procedure: filterName,// patient: patient), + // onModelReady: (model) => model.getPatientLabOrdersResults( + // patientLabOrder: patientLabOrder, + // procedure: filterName, + // patient: patient), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, baseViewModel: model, body: model.labOrdersResultHistoryList.isNotEmpty ? SingleChildScrollView( - child: Container( - child: LabResultHistoryChartAndDetails( - name: filterName, - labResultHistory: model.labOrdersResultHistoryList, - ), - // child: LabResultChartAndDetails( - // name: filterName, - // labResult: model.labOrdersResultsList, - // ), - ), - ) + child: Container( + child: LabResultHistoryChartAndDetails( + name: filterName, + labResultHistory: model.labOrdersResultHistoryList, + ), + // child: LabResultChartAndDetails( + // name: filterName, + // labResult: model.labOrdersResultsList, + // ), + ), + ) : Container( - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noDataAvailable, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, ), - ), - ), + ) + ], + ), + ), + ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart index ea9300d0..e0d0323b 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart @@ -17,7 +17,7 @@ class LineChartCurvedLabHistory extends StatefulWidget { class LineChartCurvedLabHistoryState extends State { bool isShowingMainData; - List xAxixs = List(); + List xAxixs = []; int indexes = 0; @override @@ -197,7 +197,7 @@ class LineChartCurvedLabHistoryState extends State { } List getData() { - List spots = List(); + List spots = []; for (int index = 0; index < widget.labResultHistory.length; index++) { try { var resultValueDouble = diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 545b4378..4393b26f 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AllLabSpecialResult extends StatefulWidget { - const AllLabSpecialResult({Key key}) : super(key: key); + const AllLabSpecialResult({Key? key}) : super(key: key); @override _AllLabSpecialResultState createState() => _AllLabSpecialResultState(); diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index db86dd72..9a20209a 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget { final String resultData; final PatiantInformtion patient; - const SpecialLabResultDetailsPage({Key key, this.resultData, this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key? key, this.resultData, this.patient}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 2aa95b23..3f35fd80 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -23,7 +23,7 @@ class AddVerifyMedicalReport extends StatefulWidget { final String medicalNote; const AddVerifyMedicalReport( - {Key key, + {Key? key, this.patient, this.patientType, this.arrivalType, diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 0fbac8bf..50d76dfb 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -30,7 +30,7 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class NursingProgressNoteScreen extends StatefulWidget { - const NursingProgressNoteScreen({Key key}) : super(key: key); + const NursingProgressNoteScreen({Key? key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index c2751424..bc5ca8d7 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -33,7 +33,7 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class OperationReportScreen extends StatefulWidget { final int visitType; - const OperationReportScreen({Key key, this.visitType}) : super(key: key); + const OperationReportScreen({Key? key, this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index d042ff2f..8148e2a9 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -40,7 +40,7 @@ class UpdateOperationReport extends StatefulWidget { final bool isUpdate; const UpdateOperationReport( - {Key key, + {Key? key, // this.operationReportViewModel, this.patient, this.visitType, diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index a03ca3c5..c820fded 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:flutter/material.dart'; class PendingOrdersScreen extends StatelessWidget { - const PendingOrdersScreen({Key key}) : super(key: key); + const PendingOrdersScreen({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 3c8331ea..ac8ddd16 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -18,7 +18,7 @@ import 'package:flutter/material.dart'; class MyReferralDetailScreen extends StatelessWidget { final MyReferralPatientModel referralPatient; - const MyReferralDetailScreen({Key key, this.referralPatient}) : super(key: key); + const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index c2133553..f42289f9 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -44,7 +44,7 @@ class UpdateAssessmentPage extends StatefulWidget { class _UpdateAssessmentPageState extends State implements AssessmentCallBack { bool isAssessmentExpand = false; - List mySelectedAssessmentList = List(); + List mySelectedAssessmentList = []; @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 536e2df9..99891220 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -44,7 +44,7 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; - List mySelectedExamination = List(); + List mySelectedExamination = []; BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index 835dd225..c7d48e1c 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -9,7 +9,7 @@ class BottomSheetDialogButton extends StatelessWidget { double headerHeight = SizeConfig.heightMultiplier * 12; - BottomSheetDialogButton({Key key, this.onTap, this.label}) : super(key: key); + BottomSheetDialogButton({Key? key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart index 1e5231c9..c64fe86a 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart @@ -10,7 +10,7 @@ class RemoveButton extends StatelessWidget { final Function onTap; final String label; - const RemoveButton({Key key, this.onTap, this.label}) : super(key: key); + const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index e1c97d75..22f92f00 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -16,7 +16,7 @@ class StepsWidget extends StatelessWidget { final PatiantInformtion patientInfo; StepsWidget( - {Key key, + {Key? key, this.index, this.changeCurrentTab, this.height = 0.0, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 130e730d..cceab871 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -26,7 +26,7 @@ class AddAllergiesItem extends StatefulWidget { final MasterKeyModel item; const AddAllergiesItem( - {Key key, + {Key? key, this.model, this.removeAllergy, this.addAllergy, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 8819f04a..2c13c5b2 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -24,7 +24,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final String hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key key, + {Key? key, this.model, this.addSelectedAllergy, this.removeAllergy, @@ -43,7 +43,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { - List items = List(); + List items = []; TextEditingController filteredSearchController = TextEditingController(); @override @@ -122,10 +122,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } void filterSearchResults(String query) { - List dummySearchList = List(); + List dummySearchList = []; dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = List(); + List dummyListData = []; dummySearchList.forEach((items) { if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) { diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 87686586..79417789 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -46,8 +46,8 @@ class _UpdateSubjectivePageState extends State TextEditingController medicationController = TextEditingController(); final formKey = GlobalKey(); - List myAllergiesList = List(); - List myHistoryList = List(); + List myAllergiesList = []; + List myHistoryList = []; getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); 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 2ea12a6e..707770eb 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -31,8 +31,8 @@ class UpdateSoapIndex extends StatefulWidget { class _UpdateSoapIndexState extends State with TickerProviderStateMixin { PageController? _controller; int _currentIndex = 0; - List myAllergiesList = List(); - List myHistoryList = List(); + List myAllergiesList = []; + List myHistoryList = []; changePageViewIndex(pageIndex, {isChangeState = true}) { if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index c03c6f96..6aaacb26 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -44,7 +44,7 @@ class RegisterConfirmationPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterConfirmationPatientPage( - {Key key, this.operationReportViewModel, this.patient, this.model}) + {Key? key, this.operationReportViewModel, this.patient, this.model}) : super(key: key); @override diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 231ff3d1..9bc2d6fe 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -12,7 +12,7 @@ import 'package:flutter/material.dart'; import 'RegisterSearchPatientPage.dart'; class RegisterPatientPage extends StatefulWidget { - const RegisterPatientPage({Key key}) : super(key: key); + const RegisterPatientPage({Key? key}) : super(key: key); @override _RegisterPatientPageState createState() => _RegisterPatientPageState(); diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 2afc593e..fd425c01 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -30,7 +30,7 @@ class RegisterSearchPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterSearchPatientPage( - {Key key, this.changePageViewIndex, this.model}) + {Key? key, this.changePageViewIndex, this.model}) : super(key: key); @override @@ -66,7 +66,7 @@ class _RegisterSearchPatientPageState extends State { @override void initState() { _phoneCode.text = ""; - countryList = List(); + countryList = []; dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"}; dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"}; diff --git a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart index d58e5a3b..6f0e1a31 100644 --- a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart +++ b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class VerifyActivationCodePage extends StatefulWidget { - const VerifyActivationCodePage({Key key}) : super(key: key); + const VerifyActivationCodePage({Key? key}) : super(key: key); @override _VerifyActivationCodePageState createState() => diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index bc1f9a28..5158d466 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -399,7 +399,7 @@ class HeaderRow extends StatelessWidget { final String label; final String value; - const HeaderRow({Key key, this.label, this.value}) : super(key: key); + const HeaderRow({Key? key, this.label, this.value}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index a7832481..55a3d105 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { final bool isInpatient; ProfileMedicalInfoWidget( - {Key key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); + {Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index bc50ad82..0d5b09f6 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -1,4 +1,5 @@ import 'package:badges/badges.dart'; +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/core/viewModel/doctor_replay_view_model.dart'; import 'package:flutter/cupertino.dart'; @@ -14,7 +15,7 @@ class BottomNavigationItem extends StatelessWidget { final int? index; final int currentIndex; final String? name; - final DashboardViewModel dashboardViewModel; + final DashboardViewModel? dashboardViewModel; BottomNavigationItem( diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart index baed4995..51f586e1 100644 --- a/lib/widgets/shared/text_fields/country_textfield_custom.dart +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -7,16 +7,16 @@ import 'package:flutter/material.dart'; class CountryTextField extends StatefulWidget { final dynamic element; - final String elementError; - final List elementList; - final String keyName; - final String keyId; - final String hintText; - final double width; + final String? elementError; + final List? elementList; + final String? keyName; + final String? keyId; + final String? hintText; + final double? width; final Function(dynamic) okFunction; CountryTextField( - {Key key, + {Key? key, @required this.element, @required this.elementError, this.width, From 7f9969b6cf0f75f381b247015995940063053047 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 18 Nov 2021 16:49:18 +0200 Subject: [PATCH 130/199] some fixes to go flutter 2 --- .../viewModel/LiveCarePatientViewModel.dart | 4 +- .../PatientMedicalReportViewModel.dart | 4 +- .../PatientRegistrationViewModel.dart | 10 +- lib/core/viewModel/SOAP_view_model.dart | 12 +- .../viewModel/authentication_view_model.dart | 2 +- lib/core/viewModel/dashboard_view_model.dart | 6 +- lib/core/viewModel/labs_view_model.dart | 4 +- lib/core/viewModel/patient_view_model.dart | 6 +- .../viewModel/pednding_orders_view_model.dart | 4 +- .../viewModel/prescription_view_model.dart | 2 +- .../viewModel/prescriptions_view_model.dart | 2 +- .../profile/discharge_summary_view_model.dart | 2 +- .../profile/operation_report_view_model.dart | 6 +- lib/core/viewModel/sick_leave_view_model.dart | 4 +- .../profile_medical_info_widget_search.dart | 189 +++++++++--------- 15 files changed, 128 insertions(+), 129 deletions(-) diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index a561e5c6..e7dc0a92 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -252,7 +252,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.addPatientToDoctorList(vcID: vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -264,7 +264,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.removePatientFromDoctorList(vcID: vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error; + error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 56bb5d2c..59485e92 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -59,7 +59,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.addMedicalReport(patient, htmlText); if (_service.hasError) { - error = _service.error; + error = _service.error!; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else @@ -72,7 +72,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); if (_service.hasError) { - error = _service.error; + error = _service.error!; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 866f99a8..64fdae18 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -30,7 +30,7 @@ class PatientRegistrationViewModel extends BaseViewModel { await _patientRegistrationService .checkPatientForRegistration(registrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error; + error = _patientRegistrationService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -135,7 +135,7 @@ class PatientRegistrationViewModel extends BaseViewModel { // await _patientRegistrationService. // getPatientInfo(getPatientInfoRequestModel); // if (_patientRegistrationService.hasError) { - // error = _patientRegistrationService.error; + // error = _patientRegistrationService.error!; // setState(ViewState.ErrorLocal); // } else setState(ViewState.Idle); @@ -155,7 +155,7 @@ class PatientRegistrationViewModel extends BaseViewModel { model: this, checkPatientForRegistrationModel: checkPatientForRegistrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error; + error = _patientRegistrationService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -191,7 +191,7 @@ class PatientRegistrationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientRegistrationService.checkActivationCode(model); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error; + error = _patientRegistrationService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -201,7 +201,7 @@ class PatientRegistrationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientRegistrationService.registrationPatient(registrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error; + error = _patientRegistrationService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index b133dad0..09afc8be 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -354,7 +354,7 @@ class SOAPViewModel extends BaseViewModel { patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else { patient.episodeNo = _SOAPService.episodeID; @@ -584,7 +584,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -644,7 +644,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError || _prescriptionService.hasError) { - error = _SOAPService.error + _prescriptionService.error; + error = _SOAPService.error + _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -684,7 +684,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (allowSetState) { if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -708,7 +708,7 @@ class SOAPViewModel extends BaseViewModel { } if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -766,7 +766,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services); if (_SOAPService.hasError) { - error = _SOAPService.error; + error = _SOAPService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index a5bedff8..697f5654 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -332,7 +332,7 @@ class AuthenticationViewModel extends BaseViewModel { await _authService.selectDeviceImei(localToken); if (_authService.hasError) { - error = _authService.error; + error = _authService.error!; setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index e9949637..38bf85e6 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -42,7 +42,7 @@ List get specialClinicalCareList => ]); if (_dashboardService.hasError) { - error = _dashboardService.error; + error = _dashboardService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -91,7 +91,7 @@ List get specialClinicalCareList => ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error; + error = authProvider.error!; } } @@ -118,7 +118,7 @@ List get specialClinicalCareList => await getDoctorProfile(); await _doctorReplyService.getNotRepliedCount(); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error; + error = _doctorReplyService.error!; setState(ViewState.ErrorLocal); } else { notifyListeners(); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 96e86035..aca7c9e0 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -163,7 +163,7 @@ class LabsViewModel extends BaseViewModel { await _labsService.getPatientLabOrdersResultHistoryByDescription( patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -182,7 +182,7 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getAllSpecialLabResult(mrn: patientId); if (_labsService.hasError) { - error = _labsService.error; + error = _labsService.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index d398521b..a11bb8f6 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -323,7 +323,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getNursingProgressNote(requestModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -337,7 +337,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getDiagnosisForInPatient(requestModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -362,7 +362,7 @@ class PatientViewModel extends BaseViewModel { setupID: "010266"); await _patientService.getDiabeticChartValues(requestModel); if (_patientService.hasError) { - error = _patientService.error; + error = _patientService.error!; if (isLocalBusy) setState(ViewState.ErrorLocal); else diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index 3f3e92be..cbf81c15 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -21,7 +21,7 @@ class PendingOrdersViewModel extends BaseViewModel { await _pendingOrderService.getPendingOrders( patientId: patientId, admissionNo: admissionNo); if (_pendingOrderService.hasError) { - error = _pendingOrderService.error; + error = _pendingOrderService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -34,7 +34,7 @@ class PendingOrdersViewModel extends BaseViewModel { await _pendingOrderService.getAdmissionOrders( patientId: patientId, admissionNo: admissionNo); if (_pendingOrderService.hasError) { - error = _pendingOrderService.error; + error = _pendingOrderService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 2ff1f793..53b95099 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -256,7 +256,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionsService.getMedicationForInPatient(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index f48294a4..b1a23a14 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -132,7 +132,7 @@ class PrescriptionsViewModel extends BaseViewModel { getMedicationForInPatient(PatiantInformtion patient) async { await _prescriptionsService.getMedicationForInPatient(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index 29910570..b147a11b 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -21,7 +21,7 @@ class DischargeSummaryViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { - error = _dischargeSummaryService.error; + error = _dischargeSummaryService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart index e3f4f430..1d37bc16 100644 --- a/lib/core/viewModel/profile/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -23,7 +23,7 @@ class OperationReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _operationReportService.getReservations(patientId: patientId); if (_operationReportService.hasError) { - error = _operationReportService.error; + error = _operationReportService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -36,7 +36,7 @@ class OperationReportViewModel extends BaseViewModel { GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" ); await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel); if (_operationReportService.hasError) { - error = _operationReportService.error; + error = _operationReportService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -51,7 +51,7 @@ class OperationReportViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _operationReportService.updateOperationReport(createUpdateOperationReport); if (_operationReportService.hasError) { - error = _operationReportService.error; + error = _operationReportService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 31f37a23..181f5c94 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -98,7 +98,7 @@ class SickLeaveViewModel extends BaseViewModel { final results = await Future.wait(services); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; // if (isLocalBusy) setState(ViewState.ErrorLocal); // else @@ -112,7 +112,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeaveDoctor(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error; + error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 03fbc76d..e457b6dd 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -13,7 +13,7 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget { final PatiantInformtion patient; final String patientType; final String? arrivalType; - final bool? isInpatient; + final bool isInpatient; final bool? isDischargedPatient; ProfileMedicalInfoWidgetSearch( @@ -23,7 +23,7 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget { this.arrivalType, required this.from, required this.to, - this.isInpatient, + this.isInpatient = false, this.isDischargedPatient}); @override @@ -62,22 +62,21 @@ class _ProfileMedicalInfoWidgetSearchState extends State Date: Sun, 21 Nov 2021 16:16:41 +0200 Subject: [PATCH 131/199] first step from fix service --- lib/core/service/NavigationService.dart | 4 ++-- lib/core/service/PatientRegistrationService.dart | 12 ++++++------ lib/core/service/base/base_service.dart | 1 + .../service/patient/LiveCarePatientServices.dart | 12 ++++++------ .../profile/discharge_summary_servive.dart | 2 +- .../profile/operation_report_servive.dart | 6 +++--- .../lab_order/labs_service.dart | 4 ++-- .../PatientMedicalReportService.dart | 2 +- .../prescription/prescriptions_service.dart | 4 ++-- .../procedure/procedure_service.dart | 2 +- .../patient_medical_file/soap/SOAP_service.dart | 6 +++--- .../ucaf/patient-ucaf-service.dart | 16 ++++++++-------- lib/core/service/pending_order_service.dart | 12 ++++++------ 13 files changed, 42 insertions(+), 41 deletions(-) diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index f32c2c0d..182adb6c 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -17,10 +17,10 @@ class NavigationService { } Future pushAndRemoveUntil(Route newRoute) { - return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); + return navigatorKey.currentState!.pushAndRemoveUntil(newRoute,(asd)=>false); } pop() { - return navigatorKey.currentState.pop(); + return navigatorKey.currentState!.pop(); } } \ No newline at end of file diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 236bcd42..14e2c3df 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -9,8 +9,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; class PatientRegistrationService extends BaseService { - GetPatientInfoResponseModel getPatientInfoResponseModel; - String logInTokenID; + late GetPatientInfoResponseModel getPatientInfoResponseModel; + late String logInTokenID; checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -39,11 +39,11 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - {SendActivationCodeByOTPNotificationTypeForRegistrationModel + {required SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - int otpType, - PatientRegistrationViewModel model, - CheckPatientForRegistrationModel + required int otpType, + required PatientRegistrationViewModel model, + required CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index a8a87c8f..05d1d1ab 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index b0bf13e1..b390556d 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -47,7 +47,7 @@ class LiveCarePatientServices extends BaseService { /// add new items. localPatientList.forEach((element) { - if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((_patientList.singleWhere((it) => it.patientId == element.patientId)) == null) { _patientList.add(element); } }); @@ -55,7 +55,7 @@ class LiveCarePatientServices extends BaseService { /// remove items. List removedPatientList = []; _patientList.forEach((element) { - if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((localPatientList.singleWhere((it) => it.patientId == element.patientId)) == null) { removedPatientList.add(element); } }); @@ -155,12 +155,12 @@ class LiveCarePatientServices extends BaseService { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future addPatientToDoctorList({int vcID}) async { + Future addPatientToDoctorList({required int vcID}) async { hasError = false; await getDoctorProfile(); AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; @@ -173,11 +173,11 @@ class LiveCarePatientServices extends BaseService { }, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive); } - Future removePatientFromDoctorList({int vcID}) async { + Future removePatientFromDoctorList({required int vcID}) async { hasError = false; AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); await getDoctorProfile(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index daea1b42..52c15e79 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -13,7 +13,7 @@ class DischargeSummaryService extends BaseService { List get pendingDischargeSummaryList => _pendingDischargeSummaryList; Future getPendingDischargeSummary( - {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + {required GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index 7ac4ade7..b3a43717 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -14,8 +14,8 @@ class OperationReportService extends BaseService { List get operationDetailsList => _operationDetailsList; Future getReservations( - {GetReservationsRequestModel getReservationsRequestModel, - int patientId}) async { + {required GetReservationsRequestModel getReservationsRequestModel, + required int patientId}) async { getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); @@ -36,7 +36,7 @@ class OperationReportService extends BaseService { } Future getOperationReportDetails( - {GetOperationDetailsRequestModel getOperationReportRequestModel, + {required GetOperationDetailsRequestModel getOperationReportRequestModel, }) async { hasError = false; diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 1fe088c0..84861d5b 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -179,7 +179,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResultHistoryByDescription( - {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -201,7 +201,7 @@ class LabsService extends BaseService { }, body: body); } - Future getAllSpecialLabResult({int mrn}) async { + Future getAllSpecialLabResult({required int mrn}) async { _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( patientID: mrn, patientType: 1, diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 98536476..1af15e10 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -94,7 +94,7 @@ class PatientMedicalReportService extends BaseService { ? body['SetupID'] : SETUP_ID : SETUP_ID; - body['AdmissionNo'] = int.parse(patient.admissionNo); + body['AdmissionNo'] = int.parse(patient!.admissionNo!); body['MedicalReportHTML'] = htmlText; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index 55ab7a89..bf3100c5 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -192,9 +192,9 @@ class PrescriptionsService extends BaseService { hasError = false; _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel( isDentalAllowedBackend: false, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), tokenID: "@dm!n", - projectID: patient.projectId, + projectID: patient!.projectId!, ); await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, onSuccess: (dynamic response, int statusCode) { 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 576c593d..5708b6b3 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -104,7 +104,7 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int? mrn, int appointmentNo}) async { + Future getProcedure({int? mrn, required int appointmentNo}) async { _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel( patientMRN: mrn, ); diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index d206de77..dbdb3855 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -83,7 +83,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error+ "\n"+error; + super.error = super.error!+ "\n"+error; }, body: postAllergyRequestModel.toJson()); } @@ -93,7 +93,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error =super.error + "\n"+error; + super.error =super.error! + "\n"+error; }, body: postHistoriesRequestModel.toJson()); } @@ -155,7 +155,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error +"\n"+error; + super.error = super.error! +"\n"+error; }, body: patchHistoriesRequestModel.toJson()); } diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 535a5b49..2028ed6b 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -8,8 +8,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { - List patientChiefComplaintList; - List patientVitalSignsHistory; + late List patientChiefComplaintList; + late List patientVitalSignsHistory; List patientAssessmentList = []; List orderProcedureList = []; PrescriptionModel? prescriptionList; @@ -22,13 +22,13 @@ class UcafService extends LookupService { body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - patientChiefComplaintList = null; + patientChiefComplaintList = []; await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); if (patientChiefComplaintList != null) { patientChiefComplaintList.clear(); } else { - patientChiefComplaintList = new List(); + patientChiefComplaintList = []; } response['List_ChiefComplaint']['entityList'].forEach((v) { patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); @@ -50,14 +50,14 @@ class UcafService extends LookupService { body['InOutPatientType'] = 2; } - patientVitalSignsHistory = null; + patientVitalSignsHistory = []; await baseAppClient.post( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = new List(); + patientVitalSignsHistory = []; } if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { @@ -86,14 +86,14 @@ class UcafService extends LookupService { body['From'] = fromDate; body['To'] = toDate; - patientVitalSignsHistory = null; + patientVitalSignsHistory = []; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = new List(); + patientVitalSignsHistory = []; } if (response['VitalSignsHistory'] != null) { response['VitalSignsHistory'].forEach((v) { diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index f0bcf5e9..09ca517e 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -13,9 +13,9 @@ class PendingOrderService extends BaseService { List get admissionOrderList => _admissionOrderList; Future getPendingOrders( - {PendingOrderRequestModel pendingOrderRequestModel, - int patientId, - int admissionNo}) async { + {required PendingOrderRequestModel pendingOrderRequestModel, + required int patientId, + required int admissionNo}) async { pendingOrderRequestModel = PendingOrderRequestModel( patientID: patientId, admissionNo: admissionNo, @@ -40,9 +40,9 @@ class PendingOrderService extends BaseService { } Future getAdmissionOrders( - {AdmissionOrdersRequestModel admissionOrdersRequestModel, - int patientId, - int admissionNo}) async { + {required AdmissionOrdersRequestModel admissionOrdersRequestModel, + required int patientId, + required int admissionNo}) async { admissionOrdersRequestModel = AdmissionOrdersRequestModel( patientID: patientId, admissionNo: admissionNo, From dc0f3e72352343969d46a2608d380299241fe8e9 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 21 Nov 2021 17:58:54 +0200 Subject: [PATCH 132/199] fix utils && widget --- lib/config/size_config.dart | 4 +- lib/core/service/AnalyticsService.dart | 2 +- .../service/PatientRegistrationService.dart | 5 +- .../profile/operation_report_servive.dart | 2 +- lib/core/service/pending_order_service.dart | 8 +- .../viewModel/LiveCarePatientViewModel.dart | 2 +- .../PatientRegistrationViewModel.dart | 8 +- .../viewModel/PatientSearchViewModel.dart | 24 +- lib/core/viewModel/SOAP_view_model.dart | 47 +- .../viewModel/authentication_view_model.dart | 30 +- .../viewModel/doctor_replay_view_model.dart | 4 +- lib/core/viewModel/labs_view_model.dart | 4 +- .../viewModel/patient-ucaf-viewmodel.dart | 8 +- lib/core/viewModel/patient_view_model.dart | 2 +- .../viewModel/pednding_orders_view_model.dart | 4 +- lib/core/viewModel/procedure_View_model.dart | 6 +- .../profile/discharge_summary_view_model.dart | 2 +- .../GetChiefComplaintReqModel.dart | 2 +- .../post_chief_complaint_request_model.dart | 2 +- lib/util/translations_delegate_base.dart | 54 +- .../patients/patient_card/PatientCard.dart | 26 +- .../profile/PatientProfileButton.dart | 8 +- .../profile/patient-profile-app-bar.dart | 67 +- ...ent-profile-header-new-design-app-bar.dart | 38 +- .../profile/profile_medical_info_widget.dart | 4 +- lib/widgets/shared/app_texts_widget.dart | 22 +- .../shared/bottom_navigation_item.dart | 4 +- .../shared/buttons/app_buttons_widget.dart | 1 - lib/widgets/shared/card_with_bg_widget.dart | 4 +- .../text_fields/app-textfield-custom.dart | 8 +- .../app_text_field_custom_serach.dart | 28 +- .../text_fields/country_textfield_custom.dart | 16 +- lib/widgets/shared/user-guid/CusomRow.dart | 16 +- lib/widgets/transitions/slide_up_page.dart | 4 +- pubspec.lock | 1340 ----------------- pubspec.yaml | 1 + 36 files changed, 241 insertions(+), 1566 deletions(-) delete mode 100644 pubspec.lock diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 3e07990b..c6ec4fdd 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -76,7 +76,7 @@ class SizeConfig { } - static getTextMultiplierBasedOnWidth({double width}) { + static getTextMultiplierBasedOnWidth({double? width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -84,7 +84,7 @@ class SizeConfig { return widthMultiplier; } - static getWidthMultiplier({double width}) { +static getWidthMultiplier({double? width}) { // TODO handel LandScape case if (width != null) { return width / 100; diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index 0ad669ab..b5ffb318 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -7,7 +7,7 @@ class AnalyticsService { FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics); - Future logEvent({@required String eventCategory, @required String eventAction}) async { + Future logEvent({required String eventCategory, required String eventAction}) async { await _analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 14e2c3df..5f29325a 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -39,13 +39,12 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - {required SendActivationCodeByOTPNotificationTypeForRegistrationModel - registrationModel, + { required int otpType, required PatientRegistrationViewModel model, required CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { - registrationModel = + SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( oTPSendType: otpType, patientIdentificationID: checkPatientForRegistrationModel diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index b3a43717..937b4639 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -14,7 +14,7 @@ class OperationReportService extends BaseService { List get operationDetailsList => _operationDetailsList; Future getReservations( - {required GetReservationsRequestModel getReservationsRequestModel, + { required int patientId}) async { getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index 09ca517e..527f3d20 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -13,10 +13,10 @@ class PendingOrderService extends BaseService { List get admissionOrderList => _admissionOrderList; Future getPendingOrders( - {required PendingOrderRequestModel pendingOrderRequestModel, + { required int patientId, required int admissionNo}) async { - pendingOrderRequestModel = PendingOrderRequestModel( + PendingOrderRequestModel pendingOrderRequestModel = PendingOrderRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, @@ -40,10 +40,10 @@ class PendingOrderService extends BaseService { } Future getAdmissionOrders( - {required AdmissionOrdersRequestModel admissionOrdersRequestModel, + { required int patientId, required int admissionNo}) async { - admissionOrdersRequestModel = AdmissionOrdersRequestModel( + AdmissionOrdersRequestModel admissionOrdersRequestModel = AdmissionOrdersRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index e7dc0a92..54ae3ab8 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -235,7 +235,7 @@ class LiveCarePatientViewModel extends BaseViewModel { ); } - updateInCallPatient({PatiantInformtion patient, appointmentNo}) { + updateInCallPatient({required PatiantInformtion patient, appointmentNo}) { _liveCarePatientServices.patientList.forEach((e) { if (e.patientId == patient.patientId) { e.episodeNo = 0; diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 64fdae18..31d84608 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -18,7 +18,7 @@ class PatientRegistrationViewModel extends BaseViewModel { GetPatientInfoResponseModel get getPatientInfoResponseModel => _patientRegistrationService.getPatientInfoResponseModel; - CheckPatientForRegistrationModel checkPatientForRegistrationModel; + late CheckPatientForRegistrationModel checkPatientForRegistrationModel; Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -142,10 +142,10 @@ class PatientRegistrationViewModel extends BaseViewModel { } Future sendActivationCodeByOTPNotificationType( - {SendActivationCodeByOTPNotificationTypeForRegistrationModel + {required SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - int otpType, - PatientRegistrationViewModel user}) async { + required int otpType, + required PatientRegistrationViewModel user}) async { setState(ViewState.BusyLocal); print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index b9a9a323..04e6ff09 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -169,7 +169,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) { + sortInPatient({bool isDes = false, required bool isAllClinic, required bool isMyInPatient}) { if (isMyInPatient ? myIinPatientList.length > 0 : isAllClinic @@ -232,7 +232,7 @@ class PatientSearchViewModel extends BaseViewModel { InpatientClinicList.clear(); inPatientList.forEach((element) { if (!InpatientClinicList.contains(element.clinicDescription)) { - InpatientClinicList.add(element.clinicDescription); + InpatientClinicList.add(element!.clinicDescription!); } }); } @@ -260,7 +260,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - filterByHospital({int hospitalId}) { + filterByHospital({required int hospitalId}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].projectId == hospitalId) { @@ -270,7 +270,7 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } - filterByClinic({String clinicName}) { + filterByClinic({required String clinicName}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].clinicDescription == clinicName) { @@ -286,7 +286,7 @@ class PatientSearchViewModel extends BaseViewModel { } void filterSearchResults(String query, - {bool isAllClinic, bool isMyInPatient}) { + {required bool isAllClinic, required bool isMyInPatient}) { var strExist = query.length > 0 ? true : false; if (isMyInPatient) { @@ -298,13 +298,13 @@ class PatientSearchViewModel extends BaseViewModel { filteredMyInPatientItems.clear(); for (var i = 0; i < localFilteredMyInPatientItems.length; i++) { String firstName = - localFilteredMyInPatientItems[i].firstName.toUpperCase(); + localFilteredMyInPatientItems[i].firstName!.toUpperCase(); String lastName = - localFilteredMyInPatientItems[i].lastName.toUpperCase(); + localFilteredMyInPatientItems[i].lastName!.toUpperCase(); String mobile = - localFilteredMyInPatientItems[i].mobileNumber.toUpperCase(); + localFilteredMyInPatientItems[i].mobileNumber!.toUpperCase(); String patientID = - localFilteredMyInPatientItems[i].patientId.toString(); + localFilteredMyInPatientItems[i].patientId!.toString(); if (firstName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) || @@ -351,11 +351,11 @@ class PatientSearchViewModel extends BaseViewModel { filteredInPatientItems.clear(); for (var i = 0; i < localFilteredInPatientItems.length; i++) { String firstName = - localFilteredInPatientItems[i].firstName.toUpperCase(); + localFilteredInPatientItems[i].firstName!.toUpperCase(); String lastName = - localFilteredInPatientItems[i].lastName.toUpperCase(); + localFilteredInPatientItems[i].lastName!.toUpperCase(); String mobile = - localFilteredInPatientItems[i].mobileNumber.toUpperCase(); + localFilteredInPatientItems[i].mobileNumber!.toUpperCase(); String patientID = localFilteredInPatientItems[i].patientId.toString(); diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 09afc8be..0e45825e 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -100,7 +100,7 @@ class SOAPViewModel extends BaseViewModel { List get allMedicationList => _prescriptionService.allMedicationList; - SubjectiveCallBack subjectiveCallBack; + late SubjectiveCallBack subjectiveCallBack; setSubjectiveCallBack(SubjectiveCallBack callBack) { this.subjectiveCallBack = callBack; @@ -110,7 +110,7 @@ class SOAPViewModel extends BaseViewModel { subjectiveCallBack.nextFunction(model); } - ObjectiveCallBack objectiveCallBack; + late ObjectiveCallBack objectiveCallBack; setObjectiveCallBack(ObjectiveCallBack callBack) { this.objectiveCallBack = callBack; @@ -120,7 +120,7 @@ class SOAPViewModel extends BaseViewModel { objectiveCallBack.nextFunction(model); } - AssessmentCallBack assessmentCallBack; + late AssessmentCallBack assessmentCallBack; setAssessmentCallBack(AssessmentCallBack callBack) { this.assessmentCallBack = callBack; @@ -130,7 +130,7 @@ class SOAPViewModel extends BaseViewModel { assessmentCallBack.nextFunction(model); } - PlanCallBack planCallBack; + late PlanCallBack planCallBack; setPlanCallBack(PlanCallBack callBack) { this.planCallBack = callBack; @@ -299,8 +299,8 @@ class SOAPViewModel extends BaseViewModel { patientInfo.appointmentNo.toString(), ), ); - if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) - getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); + if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty) + getPhysicalExamReqModel.admissionNo = int.parse(patientInfo!.admissionNo!); else getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); @@ -350,7 +350,7 @@ class SOAPViewModel extends BaseViewModel { GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel( patientID: patient.patientId, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { @@ -480,10 +480,9 @@ class SOAPViewModel extends BaseViewModel { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( admissionNo: - patientInfo - .admissionNo != + patientInfo!.admissionNo != null - ? int.parse(patientInfo.admissionNo) + ? int.parse(patientInfo!.admissionNo!) : null, patientMRN: patientInfo.patientMRN, appointmentNo: patientInfo.appointmentNo != null @@ -644,7 +643,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError || _prescriptionService.hasError) { - error = _SOAPService.error + _prescriptionService.error!; + error = _SOAPService.error! + _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -716,11 +715,11 @@ class SOAPViewModel extends BaseViewModel { postSubjectServices( {patientInfo, - String complaintsText, - String medicationText, - String illnessText, - List myHistoryList, - List myAllergiesList}) async { + required String complaintsText, + required String medicationText, + required String illnessText, + required List myHistoryList, + required List myAllergiesList}) async { var services; PostChiefComplaintRequestModel postChiefComplaintRequestModel = @@ -774,9 +773,9 @@ class SOAPViewModel extends BaseViewModel { PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( {patientInfo, - String complaintsText, - String medicationText, - String illnessText}) { + required String complaintsText, + required String medicationText, + required String illnessText}) { return new PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) @@ -794,13 +793,13 @@ class SOAPViewModel extends BaseViewModel { } PostHistoriesRequestModel createPostHistoriesRequestModel( - {patientInfo, List myHistoryList}) { + {patientInfo, required List myHistoryList}) { PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: patientInfo.appointmentNo, @@ -822,7 +821,7 @@ class SOAPViewModel extends BaseViewModel { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add( ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, @@ -831,9 +830,9 @@ class SOAPViewModel extends BaseViewModel { appointmentNo: patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdBy: allergy.createdBy ?? doctorProfile!.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, + editedBy: doctorProfile!.doctorID, editedOn: DateTime.now().toIso8601String(), isChecked: allergy.isChecked, isUpdatedByNurse: false)); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 697f5654..059cb4fa 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -86,7 +86,7 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; @@ -95,8 +95,8 @@ class AuthenticationViewModel extends BaseViewModel { insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); insertIMEIDetailsModel.doctorID = - loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; - insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; + loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID; + insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; @@ -133,7 +133,7 @@ class AuthenticationViewModel extends BaseViewModel { iMEI: user!.iMEI, facilityId: user!.projectID, memberID: user!.doctorID, - loginDoctorID: int.parse(user.editedBy.toString()), + loginDoctorID: int.parse(user!.editedBy.toString()), zipCode: user!.outSA == true ? '971' : '966', mobileNumber: user!.mobile, oTPSendType: authMethodType.getTypeIdService(), @@ -154,8 +154,8 @@ class AuthenticationViewModel extends BaseViewModel { int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation[0].memberID, - loginDoctorID: loggedUser.listMemberInformation[0].employeeID, + memberID: loggedUser!.listMemberInformation![0].memberID, + loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, otpSendType: authMethodType.getTypeIdService().toString(), ); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); @@ -164,7 +164,7 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { await sharedPref.setString(TOKEN, - _authService.activationCodeForDoctorAppRes.logInTokenID); + _authService.activationCodeForDoctorAppRes.logInTokenID!); setState(ViewState.Idle); } } @@ -178,12 +178,12 @@ class AuthenticationViewModel extends BaseViewModel { projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, logInTokenID: await sharedPref.getString(TOKEN), activationCode: activationCode, - memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID , + memberID:userInfo.userID!=null? int.parse(userInfo!.userID!):user!.doctorID , password: userInfo.password, - facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(), + facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user!.projectID.toString(), oTPSendType: await sharedPref.getInt(OTP_TYPE), iMEI: localToken, - loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID, + loginDoctorID:userInfo.userID!=null? int.parse(userInfo!.userID!):user!.editedBy,// loggedUser.listMemberInformation[0].employeeID, isForSilentLogin:isSilentLogin, generalid: "Cs2020@2016\$2958"); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); @@ -237,7 +237,7 @@ class AuthenticationViewModel extends BaseViewModel { await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(TOKEN, - sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); + sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); } saveObjToString(String key, value) async { @@ -323,12 +323,12 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions(); + _firebaseMessaging.requestPermission(); } setState(ViewState.Busy); var token = await _firebaseMessaging.getToken(); if (localToken == "") { - localToken = token; + localToken = token!; await _authService.selectDeviceImei(localToken); if (_authService.hasError) { @@ -340,9 +340,9 @@ class AuthenticationViewModel extends BaseViewModel { sharedPref.setObj( LAST_LOGIN_USER, _authService.dashboardItemsList[0]); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - user.vidaRefreshTokenID); + user!.vidaRefreshTokenID!); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - user.vidaAuthTokenID); + user!.vidaAuthTokenID!); this.unverified = true; } setState(ViewState.Idle); diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index bb7dd336..de03c6e3 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -52,8 +52,8 @@ class DoctorReplayViewModel extends BaseViewModel { transactionNo: model.transactionNo.toString(), doctorResponse: response, infoStatus: 6, - createdBy: this.doctorProfile.doctorID, - infoEnteredBy: this.doctorProfile.doctorID, + createdBy: this.doctorProfile!.doctorID!, + infoEnteredBy: this.doctorProfile!.doctorID!, setupID: "010266"); setState(ViewState.BusyLocal); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index aca7c9e0..05393f33 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -158,7 +158,7 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResultHistoryByDescription( - {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResultHistoryByDescription( patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient); @@ -178,7 +178,7 @@ class LabsViewModel extends BaseViewModel { DrAppToastMsg.showSuccesToast(mes); } - Future getAllSpecialLabResult({int patientId}) async { + Future getAllSpecialLabResult({required int patientId}) async { setState(ViewState.Busy); await _labsService.getAllSpecialLabResult(mrn: patientId); if (_labsService.hasError) { diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 7c3dfb4e..6ca5f94f 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -32,9 +32,9 @@ class UcafViewModel extends BaseViewModel { List get orderProcedures => _ucafService.orderProcedureList; - Function saveUCAFOnTap; + late Function saveUCAFOnTap; - String selectedLanguage; + late String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -45,8 +45,8 @@ class UcafViewModel extends BaseViewModel { resetDataInFirst({bool firstPage = true}) { if(firstPage){ - _ucafService.patientVitalSignsHistory = null; - _ucafService.patientChiefComplaintList = null; + _ucafService.patientVitalSignsHistory = []; + _ucafService.patientChiefComplaintList = []; } _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index a11bb8f6..2eb9772f 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -355,7 +355,7 @@ class PatientViewModel extends BaseViewModel { GetDiabeticChartValuesRequestModel requestModel = GetDiabeticChartValuesRequestModel( patientID: patient.patientId, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), patientTypeID: 1, patientType: 1, resultType: resultType, diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index cbf81c15..e89345ee 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -15,7 +15,7 @@ class PendingOrdersViewModel extends BaseViewModel { List get admissionOrderList => _pendingOrderService.admissionOrderList; - Future getPendingOrders({int patientId, int admissionNo}) async { + Future getPendingOrders({required int patientId, required int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getPendingOrders( @@ -28,7 +28,7 @@ class PendingOrdersViewModel extends BaseViewModel { } } - Future getAdmissionOrders({int patientId, int admissionNo}) async { + Future getAdmissionOrders({required int patientId, required int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getAdmissionOrders( diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index f7dfad9a..4de6bbe3 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -60,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel { List _patientLabOrdersListClinic = []; List _patientLabOrdersListHospital = []; - Future getProcedure({int? mrn, String? patientType, int appointmentNo}) async { + Future getProcedure({int? mrn, String? patientType, int? appointmentNo}) async { hasError = false; await getDoctorProfile(); //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); + await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo!); if (_procedureService.hasError) { error = _procedureService.error!; if (patientType == "7") @@ -155,7 +155,7 @@ class ProcedureViewModel extends BaseViewModel { error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { - await getProcedure(mrn: mrn); + await getProcedure(mrn: mrn, appointmentNo: null); setState(ViewState.Idle); } } diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index b147a11b..e1fdb37c 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -15,7 +15,7 @@ class DischargeSummaryViewModel extends BaseViewModel { _dischargeSummaryService.pendingDischargeSummaryList; - Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { + Future getPendingDischargeSummary({required int patientId, required int admissionNo, }) async { GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); hasError = false; setState(ViewState.Busy); diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 1bb586c2..25c38d8f 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -4,7 +4,7 @@ class GetChiefComplaintReqModel { int? episodeId; int? episodeID; dynamic doctorID; - int admissionNo; + int? admissionNo; GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index 142aadf3..56b97a92 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -2,7 +2,7 @@ class PostChiefComplaintRequestModel { int? appointmentNo; int? episodeID; int? patientMRN; - int admissionNo; + int? admissionNo; String? chiefComplaint; String? hopi; String? currentMedication; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 2de4d13d..114de3d3 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -91,8 +91,8 @@ class TranslationBase { String? get inPatient => localizedValues['inPatient']![locale.languageCode]; String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; - String? get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; + String? get myInPatientTitle => localizedValues['myInPatientTitle']![locale.languageCode]; + String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; @@ -211,8 +211,8 @@ class TranslationBase { String? get replay => localizedValues['replay']![locale.languageCode]; - String? get progressNote =>localizedValues['progressNote'][locale.languageCode]; - String get operationReports => localizedValues['operationReports']![locale.languageCode]; + String? get progressNote =>localizedValues['progressNote']![locale.languageCode]; + String? get operationReports => localizedValues['operationReports']![locale.languageCode]; String? get progress => localizedValues['progress']![locale.languageCode]; @@ -294,10 +294,10 @@ class TranslationBase { String? get age => localizedValues['age']![locale.languageCode]; String? get nationality => localizedValues['nationality']![locale.languageCode]; - String get occupation => localizedValues['occupation'][locale.languageCode]; - String get healthID => localizedValues['healthID'][locale.languageCode]; - String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; - String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; + String? get occupation => localizedValues['occupation']![locale.languageCode]; + String? get healthID => localizedValues['healthID']![locale.languageCode]; + String? get identityNumber => localizedValues['identityNumber']![locale.languageCode]; + String? get maritalStatus => localizedValues['maritalStatus']![locale.languageCode]; String? get today => localizedValues['today']![locale.languageCode]; @@ -482,7 +482,7 @@ class TranslationBase { String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; String? get next => localizedValues['next']![locale.languageCode]; - String get finish => localizedValues['finish'][locale.languageCode]; + String? get finish => localizedValues['finish']![locale.languageCode]; String? get previous => localizedValues['previous']![locale.languageCode]; @@ -991,9 +991,9 @@ class TranslationBase { String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]; String? get searchHere => localizedValues['searchHere']![locale.languageCode]; String? get remove => localizedValues['remove']![locale.languageCode]; - String get inProgress => localizedValues['inProgress'][locale.languageCode]; - String get completed => localizedValues['Completed'][locale.languageCode]; - String get locked => localizedValues['Locked'][locale.languageCode]; + String? get inProgress => localizedValues['inProgress']![locale.languageCode]; + String? get completed => localizedValues['Completed']![locale.languageCode]; + String? get locked => localizedValues['Locked']![locale.languageCode]; String? get step => localizedValues['step']![locale.languageCode]; String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]; @@ -1097,21 +1097,21 @@ class TranslationBase { String? get addPrescription => localizedValues['addPrescription']![locale.languageCode]; String? get edit => localizedValues['edit']![locale.languageCode]; String? get summeryReply => localizedValues['summeryReply']![locale.languageCode]; - String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; - String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; - String get roomNo => localizedValues['roomNo'][locale.languageCode]; - String get seeMore => localizedValues['seeMore'][locale.languageCode]; - String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; - String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; - String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; - String get underProcess => localizedValues['underProcess'][locale.languageCode]; - String get textResponse => localizedValues['textResponse'][locale.languageCode]; - String get special => localizedValues['special'][locale.languageCode]; - String get requestType => localizedValues['requestType'][locale.languageCode]; - String get allClinic => localizedValues['allClinic'][locale.languageCode]; - String get notReplied => localizedValues['notReplied'][locale.languageCode]; - String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; - String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; + String? get severityValidationError => localizedValues['severityValidationError']![locale.languageCode]; + String? get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully']![locale.languageCode]; + String? get roomNo => localizedValues['roomNo']![locale.languageCode]; + String? get seeMore => localizedValues['seeMore']![locale.languageCode]; + String? get replayCallStatus => localizedValues['replayCallStatus']![locale.languageCode]; + String? get patientArrived => localizedValues['patientArrived']![locale.languageCode]; + String? get calledAndNoResponse => localizedValues['calledAndNoResponse']![locale.languageCode]; + String? get underProcess => localizedValues['underProcess']![locale.languageCode]; + String? get textResponse => localizedValues['textResponse']![locale.languageCode]; + String? get special => localizedValues['special']![locale.languageCode]; + String? get requestType => localizedValues['requestType']![locale.languageCode]; + String? get allClinic => localizedValues['allClinic']![locale.languageCode]; + String? get notReplied => localizedValues['notReplied']![locale.languageCode]; + String? get registerNewPatient => localizedValues['registerNewPatient']![locale.languageCode]; + String? get registeraPatient => localizedValues['registeraPatient']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 88e72b7e..65876517 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -38,10 +38,10 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - String nationalityName = patientInfo.nationalityName != null - ? patientInfo.nationalityName.trim() + String? nationalityName = patientInfo.nationalityName != null + ? patientInfo.nationalityName!.trim() : patientInfo.nationality != null - ? patientInfo.nationality.trim() + ? patientInfo.nationality!.trim() : patientInfo.nationalityId != null ? patientInfo.nationalityId @@ -283,7 +283,7 @@ class PatientCard extends StatelessWidget { child: Container( alignment: Alignment.centerRight, child: AppText( - nationalityName.truncate(14), + nationalityName!.truncate(14), fontWeight: FontWeight.bold, fontSize: 14, textOverflow: TextOverflow.ellipsis, @@ -352,16 +352,16 @@ class PatientCard extends StatelessWidget { ), CustomRow( label: - TranslationBase.of(context).age + " : ", + TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) CustomRow( label: patientInfo.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate + + .admissionDate! + " : ", value: patientInfo.admissionDate == null ? "" @@ -370,22 +370,22 @@ class PatientCard extends StatelessWidget { if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .numOfDays + + .numOfDays! + " : ", value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}", ), if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .clinicName + + .clinicName! + " : ", value: "${patientInfo.clinicDescription}", ), if (patientInfo.admissionDate != null) CustomRow( label: - TranslationBase.of(context).roomNo + + TranslationBase.of(context).roomNo! + " : ", value: "${patientInfo.roomId}", ), @@ -394,9 +394,9 @@ class PatientCard extends StatelessWidget { children: [ CustomRow( label: TranslationBase.of(context) - .clinic + + .clinic! + " : ", - value: patientInfo.clinicName, + value: patientInfo!.clinicName!, ), ], ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 700e7a2b..2bbb36a2 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -9,8 +9,8 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class PatientProfileButton extends StatelessWidget { - final String nameLine1; - final String nameLine2; + final String? nameLine1; + final String? nameLine2; final String icon; final dynamic route; final PatiantInformtion patient; @@ -35,8 +35,8 @@ class PatientProfileButton extends StatelessWidget { required this.patient, required this.patientType, required this.arrivalType, - required this.nameLine1, - required this.nameLine2, + this.nameLine1, + this.nameLine2, required this.icon, this.route, this.isDisable = false, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 5158d466..64337c68 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -14,10 +14,27 @@ import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatientProfileAppBarModel patientProfileAppBarModel; - final bool isFromLabResult; + 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; final VoidCallback? onPressed; - PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed}); + PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed, this.height, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare= false, this.doctorName, this.branch, this.appointmentDate, this.profileUrl, this.invoiceNO, this.orderNo, this.isPrescriptions, this.isMedicalFile, this.episode, this.visitDate, this.clinic, this.isAppointmentHeader}); @override Widget build(BuildContext context) { @@ -185,7 +202,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 1, ), AppText( - patient.patientId.toString(), + patientProfileAppBarModel.patient!.patientId.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -225,12 +242,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), HeaderRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", value: - "${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: !isFromLiveCare)}", ),if (patientProfileAppBarModel.patient!.appointmentDate != null && patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty && - !isFromLabResult) + !isFromLabResult!) HeaderRow( label: TranslationBase.of(context).appointmentDate! + " : ", @@ -250,24 +267,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patient.admissionDate != null && - patient.admissionDate.isNotEmpty) + if (patientProfileAppBarModel.patient!.admissionDate != null && + patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty) HeaderRow( - label: patient.admissionDate == null + label: patientProfileAppBarModel.patient!.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate + + : TranslationBase.of(context).admissionDate! + " : ", - value: patient.admissionDate == null + value: patientProfileAppBarModel.patient!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", ), - if (patient.admissionDate != null) + if (patientProfileAppBarModel.patient!.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && - patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + patientProfileAppBarModel.patient!.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", ) ], ), @@ -322,12 +339,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { 3.5, isCopyable: true, ), - if (orderNo != null && !isPrescriptions) + if (orderNo != null && !isPrescriptions!) HeaderRow( label: 'Order No: ', value: orderNo ?? '', ), - if (invoiceNO != null && !isPrescriptions) + if (invoiceNO != null && !isPrescriptions!) HeaderRow( label: 'Invoice: ', value: invoiceNO ?? "", @@ -342,23 +359,23 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { label: 'Clinic: ', value: clinic ?? '', ), - if (isMedicalFile && episode != null) + if (isMedicalFile! && episode != null) HeaderRow( label: 'Episode: ', value: episode ?? '', ), - if (isMedicalFile && visitDate != null) + if (isMedicalFile! && visitDate != null) HeaderRow( label: 'Visit Date: ', value: visitDate ?? '', ), - if (!isMedicalFile) + if (!isMedicalFile!) HeaderRow( - label: !isPrescriptions + label: !isPrescriptions! ? 'Result Date:' : 'Prescriptions Date ', value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', ), ]), ), @@ -396,8 +413,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { } class HeaderRow extends StatelessWidget { - final String label; - final String value; + final String? label; + final String? value; const HeaderRow({Key? key, this.label, this.value}) : super(key: key); 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 f0678e22..f1ab00e0 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 @@ -24,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; - final Stream videoCallDurationStream; + final Stream? videoCallDurationStream; PatientProfileHeaderNewDesignAppBar( this.patient, this.patientType, this.arrivalType, @@ -38,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient!.gender!; } return Container( padding: EdgeInsets.only( @@ -76,7 +76,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.fullName ?? - patient.patientDetails.fullName), + patient.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -99,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -121,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( - snapshot.data, + snapshot!.data!, style: TextStyle(color: Colors.white), ), ), @@ -186,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget patient.arrivedOn != null ? AppDateUtils .convertStringToDateFormat( - patient.arrivedOn, + patient!.arrivedOn!, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', @@ -203,7 +203,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), @@ -273,12 +273,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient!.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext? context, + Object? exception, + StackTrace? stackTrace) { return Text(''); }, )) @@ -289,9 +289,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ], ), HeaderRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) Column( @@ -300,7 +300,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget HeaderRow( label: patient.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate + + : TranslationBase.of(context).admissionDate! + " : ", value: patient.admissionDate == null ? "" @@ -310,8 +310,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate!)).inDays + 1}", ) ], ) @@ -326,7 +326,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + late String newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -343,7 +343,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget date.day.toString().padLeft(2, '0'); } - return newDate ?? ''; + return newDate??''; } isToday(date) { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 55a3d105..5f417a20 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { final bool isInpatient; ProfileMedicalInfoWidget( - {Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); + {Key? key, required this.patient, required this.patientType, required this.arrivalType, required this.from, required this.to, this.isInpatient = false}); @override Widget build(BuildContext context) { @@ -57,7 +57,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, + nameLine1: TranslationBase.of(context).lab??'', nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), PatientProfileButton( diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index df02cdfd..57b85141 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -101,7 +101,7 @@ class _AppTextState extends State { return GestureDetector( child: Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin) + ? EdgeInsets.all(widget.margin!) : EdgeInsets.only( top: widget.marginTop!, right: widget.marginRight!, bottom: widget.marginBottom!, left: widget.marginLeft!), child: Column( @@ -111,7 +111,7 @@ class _AppTextState extends State { Stack( children: [ _textWidget(), - if (widget.readMore && text.length > widget.maxLength && hidden) + if (widget.readMore! && text.length > widget.maxLength! && hidden) Positioned( bottom: 0, left: 0, @@ -127,7 +127,7 @@ class _AppTextState extends State { ) ], ), - if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) + if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -157,14 +157,14 @@ class _AppTextState extends State { } Widget _textWidget() { - if (widget.isCopyable) { + if (widget.isCopyable!) { return Theme( data: ThemeData( textSelectionColor: Colors.lightBlueAccent, ), child: Container( child: SelectableText( - !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, // overflow: widget.maxLines != null // ? ((widget.maxLines > 1) @@ -174,12 +174,12 @@ class _AppTextState extends State { maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), @@ -192,18 +192,18 @@ class _AppTextState extends State { ); } else { return Text( - !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 0d5b09f6..37dbe28c 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -65,7 +65,7 @@ class BottomNavigationItem extends StatelessWidget { ), ], ), - if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) + if(currentIndex == 3 && dashboardViewModel!.notRepliedCount != 0) Positioned( right: 18.0, bottom: 40.0, @@ -77,7 +77,7 @@ class BottomNavigationItem extends StatelessWidget { borderRadius: BorderRadius.circular(8), badgeContent: Container( // padding: EdgeInsets.all(2.0), - child: Text(dashboardViewModel.notRepliedCount.toString(), + child: Text(dashboardViewModel!.notRepliedCount.toString(), style: TextStyle( color: Colors.white, fontSize: 12.0)), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 96536f46..a4dafc9e 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -50,7 +50,6 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - height: widget.height, height: widget.height, child: IgnorePointer( ignoring: widget.loading! || widget.disabled!, diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index cef5e947..1fcee64c 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -4,7 +4,7 @@ import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { final Widget widget; - final Color bgColor; + final Color? bgColor; final bool hasBorder; final double padding; final double marginLeft; @@ -12,7 +12,7 @@ class CardWithBgWidget extends StatelessWidget { CardWithBgWidget( {required this.widget, - required this.bgColor, + this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 5483946c..a9da7546 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -24,7 +24,7 @@ class AppTextFieldCustom extends StatefulWidget { final int? maxLines; final List? inputFormatters; final Function(String)? onChanged; - final Function onFieldSubmitted; + final Function? onFieldSubmitted; final String? validationError; final bool? isPrscription; @@ -152,7 +152,7 @@ class _AppTextFieldCustomState extends State { widget.onChanged!(value); } }, - onFieldSubmitted: widget.onFieldSubmitted, + onFieldSubmitted: widget.onFieldSubmitted!(), obscureText: widget.isSecure!), ) : AppText( @@ -170,7 +170,7 @@ class _AppTextFieldCustomState extends State { ? Container( margin: EdgeInsets.only( bottom: widget.isSearchTextField - ? (widget.controller.text.isEmpty || + ? (widget.controller!.text.isEmpty || widget.controller == null) ? 10 : 25 @@ -187,7 +187,7 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null && widget.validationError.isNotEmpty) TextFieldsError(error: widget.validationError!), + if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget.validationError!), ], ); } diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index 2a5304e2..cdc6b09d 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -7,7 +7,7 @@ import 'app-textfield-custom.dart'; class AppTextFieldCustomSearch extends StatelessWidget { const AppTextFieldCustomSearch({ - Key key, + Key? key, this.onChangeFun, this.positionedChild, this.marginTop, @@ -20,23 +20,23 @@ class AppTextFieldCustomSearch extends StatelessWidget { this.hintText, }); - final TextEditingController searchController; + final TextEditingController? searchController; - final Function onChangeFun; - final Function onFieldSubmitted; + final Function? onChangeFun; + final Function? onFieldSubmitted; - final Widget positionedChild; - final IconButton suffixIcon; - final double marginTop; - final String validationError; - final String hintText; + final Widget ?positionedChild; + final IconButton? suffixIcon; + final double? marginTop; + final String? validationError; + final String? hintText; - final TextInputType inputType; - final List inputFormatters; + final TextInputType? inputType; + final List? inputFormatters; @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!), child: Stack( children: [ AppTextFieldCustom( @@ -54,11 +54,11 @@ class AppTextFieldCustomSearch extends StatelessWidget { onPressed: () {}, ), controller: searchController, - onChanged: onChangeFun, + onChanged: onChangeFun!(), onFieldSubmitted: onFieldSubmitted, validationError: validationError), if (positionedChild != null) - Positioned(right: 35, top: 5, child: positionedChild) + Positioned(right: 35, top: 5, child: positionedChild!) ], ), ); diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart index 51f586e1..145ece5e 100644 --- a/lib/widgets/shared/text_fields/country_textfield_custom.dart +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -13,7 +13,7 @@ class CountryTextField extends StatefulWidget { final String? keyId; final String? hintText; final double? width; - final Function(dynamic) okFunction; + final Function(dynamic)? okFunction; CountryTextField( {Key? key, @@ -41,14 +41,14 @@ class _CountryTextfieldState extends State { ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: widget.elementList, + list: widget.elementList!, attributeName: '${widget.keyName}', - attributeValueId: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyId}'] + attributeValueId: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyId}'] : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => - widget.okFunction(selectedValue), + widget.okFunction!(selectedValue), ); showDialog( barrierDismissible: false, @@ -61,14 +61,14 @@ class _CountryTextfieldState extends State { : null, child: AppTextFieldCustom( hintText: widget.hintText, - dropDownText: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyName}'] + dropDownText: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyName}'] : widget.element != null ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, validationError: - widget.elementList.length != 1 ? widget.elementError : null, + widget.elementList!.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index b66d4926..a88e89dd 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -5,17 +5,17 @@ import '../app_texts_widget.dart'; class CustomRow extends StatelessWidget { const CustomRow({ - Key key, - this.label, - this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, + Key? key, + this.label, + required this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, }) : super(key: key); - final String label; + final String? label; final String value; - final double labelSize; - final double valueSize; - final double width; - final bool isCopyable; + final double? labelSize; + final double? valueSize; + final double? width; + final bool? isCopyable; @override Widget build(BuildContext context) { diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index ea9b520f..1893a172 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; - final String settingRoute; + final String? settingRoute; - SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) + SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 27ad91b3..00000000 --- a/pubspec.lock +++ /dev/null @@ -1,1340 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "14.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.41.2" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.6" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.1" - autocomplete_textfield: - dependency: "direct main" - description: - name: autocomplete_textfield - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - badges: - dependency: "direct main" - description: - name: badges - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - barcode_scan_fix: - dependency: "direct main" - description: - name: barcode_scan_fix - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.5" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.7" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "2.16.3" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "8.1.0" - cached_network_image: - dependency: "direct main" - description: - name: cached_network_image - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.1" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - chewie: - dependency: transitive - description: - name: chewie - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.2" - chewie_audio: - dependency: transitive - description: - name: chewie_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - connectivity: - dependency: "direct main" - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.6" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.10" - date_time_picker: - dependency: "direct main" - description: - name: date_time_picker - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - device_info: - dependency: "direct main" - description: - name: device_info - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - device_info_platform_interface: - dependency: transitive - description: - name: device_info_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - dropdown_search: - dependency: "direct main" - description: - name: dropdown_search - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - eva_icons_flutter: - dependency: "direct main" - description: - name: eva_icons_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - expandable: - dependency: "direct main" - description: - name: expandable - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.1" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - file_picker: - dependency: "direct main" - description: - name: file_picker - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2+2" - firebase_core: - dependency: transitive - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.1" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - firebase_messaging: - dependency: "direct main" - description: - name: firebase_messaging - url: "https://pub.dartlang.org" - source: hosted - version: "10.0.2" - firebase_messaging_platform_interface: - dependency: transitive - description: - name: firebase_messaging_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - firebase_messaging_web: - dependency: transitive - description: - name: firebase_messaging_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - url: "https://pub.dartlang.org" - source: hosted - version: "0.36.2" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" - flutter_cache_manager: - dependency: transitive - description: - name: flutter_cache_manager - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - flutter_colorpicker: - dependency: "direct main" - description: - name: flutter_colorpicker - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" - flutter_device_type: - dependency: "direct main" - description: - name: flutter_device_type - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - flutter_flexible_toast: - dependency: "direct main" - description: - name: flutter_flexible_toast - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - flutter_gifimage: - dependency: "direct main" - description: - name: flutter_gifimage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_html: - dependency: "direct main" - description: - name: flutter_html - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - flutter_inappwebview: - dependency: transitive - description: - name: flutter_inappwebview - url: "https://pub.dartlang.org" - source: hosted - version: "5.3.2" - flutter_keyboard_visibility: - dependency: transitive - description: - name: flutter_keyboard_visibility - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.2" - flutter_keyboard_visibility_platform_interface: - dependency: transitive - description: - name: flutter_keyboard_visibility_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_web: - dependency: transitive - description: - name: flutter_keyboard_visibility_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_layout_grid: - dependency: transitive - description: - name: flutter_layout_grid - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_math_fork: - dependency: transitive - description: - name: flutter_math_fork - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3+1" - flutter_page_indicator: - dependency: transitive - description: - name: flutter_page_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - flutter_staggered_grid_view: - dependency: "direct main" - description: - name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.22.0" - flutter_swiper: - dependency: "direct main" - description: - name: flutter_swiper - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: "direct main" - description: - name: font_awesome_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "9.1.0" - get_it: - dependency: "direct main" - description: - name: get_it - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.3" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - hexcolor: - dependency: "direct main" - description: - name: hexcolor - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - hijri: - dependency: transitive - description: - name: hijri - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - hijri_picker: - dependency: "direct main" - description: - name: hijri_picker - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - html: - dependency: "direct main" - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.0" - html_editor_enhanced: - dependency: "direct main" - description: - name: html_editor_enhanced - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0+1-dev.1" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.3" - http_interceptor: - dependency: "direct main" - description: - name: http_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.8" - imei_plugin: - dependency: "direct main" - description: - name: imei_plugin - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - infinite_listview: - dependency: transitive - description: - name: infinite_listview - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.1" - local_auth: - dependency: "direct main" - description: - name: local_auth - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - maps_launcher: - dependency: "direct main" - description: - name: maps_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - numberpicker: - dependency: transitive - description: - name: numberpicker - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - numerus: - dependency: transitive - description: - name: numerus - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - octo_image: - dependency: transitive - description: - name: octo_image - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1" - path_provider: - dependency: transitive - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.7" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - percent_indicator: - dependency: "direct main" - description: - name: percent_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "8.1.1" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.6.0" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - pointer_interceptor: - dependency: transitive - description: - name: pointer_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+1" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.1" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.0" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8" - quiver: - dependency: "direct main" - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.25.0" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.4" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.4+1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.9" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - speech_to_text: - dependency: "direct main" - description: - path: speech_to_text - relative: true - source: path - version: "0.0.0" - sqflite: - dependency: transitive - description: - name: sqflite - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0+4" - sqflite_common: - dependency: transitive - description: - name: sqflite_common - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1+1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - sticky_headers: - dependency: "direct main" - description: - name: sticky_headers - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+3" - transformer_page_view: - dependency: transitive - description: - name: transformer_page_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.6" - tuple: - dependency: transitive - description: - name: tuple - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.6" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.5" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - video_player: - dependency: transitive - description: - name: video_player - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.6" - video_player_platform_interface: - dependency: transitive - description: - name: video_player_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.0" - video_player_web: - dependency: transitive - description: - name: video_player_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - visibility_detector: - dependency: transitive - description: - name: visibility_detector - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - wakelock: - dependency: transitive - description: - name: wakelock - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.2" - wakelock_macos: - dependency: transitive - description: - name: wakelock_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+1" - wakelock_platform_interface: - dependency: transitive - description: - name: wakelock_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1+1" - wakelock_web: - dependency: transitive - description: - name: wakelock_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+1" - wakelock_windows: - dependency: transitive - description: - name: wakelock_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - webview_flutter: - dependency: transitive - description: - name: webview_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.2" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.2" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index 15c1a718..323cb1b0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -71,6 +71,7 @@ dependencies: # Firebase firebase_messaging: ^10.0.1 + firebase_analytics : ^8.3.4 #GIF image flutter_gifimage: ^1.0.1 From ec83d720384faba687bfe57ce7b468a8801e374e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 22 Nov 2021 08:56:45 +0200 Subject: [PATCH 133/199] first step from fix screen --- lib/core/viewModel/dashboard_view_model.dart | 2 +- .../auth/verification_methods_screen.dart | 10 ++++---- .../doctor_replay/all_doctor_questions.dart | 8 +++---- .../doctor_replay/doctor_repaly_chat.dart | 18 +++++++------- .../doctor_replay/doctor_reply_screen.dart | 8 +++---- .../doctor_replay/doctor_reply_widget.dart | 6 ++--- .../not_replaied_doctor_questions.dart | 8 +++---- lib/screens/home/home_patient_card.dart | 6 ++--- lib/screens/home/home_screen.dart | 24 ++++--------------- 9 files changed, 38 insertions(+), 52 deletions(-) diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 38bf85e6..2a064296 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -81,7 +81,7 @@ List get specialClinicalCareList => // setState(ViewState.Idle); } - Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index d22e13df..17aa4fdc 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -12,6 +12,7 @@ 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:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -25,6 +26,7 @@ import '../../widgets/auth/verification_methods_list.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); +///TODO Elham* check if this still in user or not class VerificationMethodsScreen extends StatefulWidget { final password; @@ -339,7 +341,7 @@ class _VerificationMethodsScreenState extends State { SecondaryButton( label: TranslationBase .of(context) - .useAnotherAccount, + .useAnotherAccount??'', color: Color(0xFFD02127), //fontWeight: FontWeight.w700, onTap: () { @@ -387,7 +389,7 @@ class _VerificationMethodsScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { await sharedPref.setString(TOKEN, - authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType,isSilentLogin: true); @@ -470,8 +472,8 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String value,bool isSilentLogin = false}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); + checkActivationCode({String? value,bool isSilentLogin = false}) async { + await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(authenticationViewModel.error); diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index ac6736e0..66f2e7aa 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -12,9 +12,8 @@ import 'package:flutter/material.dart'; import 'doctor_repaly_chat.dart'; class AllDoctorQuestions extends StatefulWidget { - final Function changeCurrentTab; - const AllDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key); + const AllDoctorQuestions({Key? key}) : super(key: key); @override _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); @@ -31,10 +30,9 @@ class _AllDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( @@ -82,7 +80,7 @@ class _AllDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex); } - return; + return false; }, ), ), diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index 85c06b18..39528c9c 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -7,11 +7,11 @@ 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/shared/TextFields.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/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget { final DoctorReplayViewModel previousModel; bool showMsgBox = false; DoctorReplayChat( - {Key? key, this.reply, this.previousModel, + {Key? key, required this.reply, required this.previousModel, }); @override @@ -37,8 +37,8 @@ class _DoctorReplayChatState extends State { @override Widget build(BuildContext context) { - if(widget.reply.doctorResponse.isNotEmpty){ - msgController.text = widget.reply.doctorResponse; + if(widget.reply.doctorResponse!.isNotEmpty){ + msgController.text = widget.reply.doctorResponse!; } else { widget.showMsgBox = true; @@ -172,7 +172,7 @@ class _DoctorReplayChatState extends State { margin: EdgeInsets.symmetric(horizontal: 0), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber); + launch("tel://" +widget.reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -194,7 +194,7 @@ class _DoctorReplayChatState extends State { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( - widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!)):AppDateUtils.getHour(DateTime.now()), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Colors.white, @@ -236,7 +236,7 @@ class _DoctorReplayChatState extends State { SizedBox(height: 30,), SizedBox(height: 30,), - if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) + if(widget.reply.doctorResponse != null && widget.reply.doctorResponse!.isNotEmpty) Align( alignment: Alignment.centerRight, child: Container( @@ -269,7 +269,7 @@ class _DoctorReplayChatState extends State { width: 50, height: 50, child: Image.asset( - widget.previousModel.doctorProfile.gender == 0 + widget.previousModel.doctorProfile!.gender == 0 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -280,7 +280,7 @@ class _DoctorReplayChatState extends State { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - widget.previousModel.doctorProfile.doctorName, + widget.previousModel.doctorProfile!.doctorName, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF2B353E), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 84c951f8..9bdfe49d 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -28,7 +28,7 @@ import 'not_replaied_Doctor_Questions.dart'; class DoctorReplyScreen extends StatefulWidget { final Function changeCurrentTab; - const DoctorReplyScreen({Key? key, this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); @@ -36,7 +36,7 @@ class DoctorReplyScreen extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -69,7 +69,7 @@ class _DoctorReplyScreenState extends State return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -109,7 +109,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context).all!, ), ], ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index 77014074..c48dbf08 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -188,10 +188,10 @@ class _DoctorReplyWidgetState extends State { isCopyable:false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", isCopyable:false, value: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", ), SizedBox( height: 8, @@ -213,7 +213,7 @@ class _DoctorReplyWidgetState extends State { children: [ new TextSpan( text: - TranslationBase.of(context).requestType + + TranslationBase.of(context).requestType! + ": ", style: TextStyle( fontSize: SizeConfig diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 65b95217..1416e70a 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart'; class NotRepliedDoctorQuestions extends StatefulWidget { final Function changeCurrentTab; - const NotRepliedDoctorQuestions({Key? key, this.changeCurrentTab}) + const NotRepliedDoctorQuestions({Key? key, required this.changeCurrentTab}) : super(key: key); @override @@ -33,10 +33,10 @@ class _NotRepliedDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorNotRepliedQuestions.isEmpty - ? ErrorMessage(error: TranslationBase.of(context).noItem) + ? ErrorMessage(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( @@ -91,7 +91,7 @@ class _NotRepliedDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); } - return; + return false; }, ), ), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 704c9eb3..a1a5f8f8 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { final Color backgroundColor; final IconData cardIcon; - final String cardIconImage; + final String? cardIconImage; final Color backgroundIconColor; final String text; final Color textColor; @@ -17,7 +17,7 @@ class HomePatientCard extends StatelessWidget { required this.backgroundColor, required this.backgroundIconColor, required this.cardIcon, - required this.cardIconImage, + this.cardIconImage, required this.text, required this.textColor, required this.onTap, @@ -75,7 +75,7 @@ class HomePatientCard extends StatelessWidget { color: textColor, ) : Image.asset( - cardIconImage, + cardIconImage!, height: iconSize, width: iconSize, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c609ad7a..2d469daf 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPat 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/errors/error_message.dart'; @@ -29,6 +30,7 @@ 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 '../../routes.dart'; import 'home_screen_header.dart'; @@ -51,7 +53,7 @@ class _HomeScreenState extends State { bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - String? clinicId; + var clinicId; late AuthenticationViewModel authenticationViewModel; int colorIndex = 0; final GlobalKey scaffoldKey = new GlobalKey(); @@ -328,22 +330,6 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - // List backgroundColors = List(3); - // backgroundColors[0] = Color(0xffD02127); - // backgroundColors[1] = Colors.grey[300]; - // backgroundColors[2] = Color(0xff2B353E); - // List backgroundIconColors = List(3); - // backgroundIconColors[0] = Colors.white12; - // backgroundIconColors[1] = Colors.white38; - // backgroundIconColors[2] = Colors.white10; - // List textColors = List(3); - // textColors[0] = Colors.white; - // textColors[1] = Color(0xFF353E47); - // textColors[2] = Colors.white; - // - // List patientCards = []; - // - List backgroundColors = []; backgroundColors.add(Color(0xffD02127)); backgroundColors.add(Colors.grey[300]!); @@ -407,7 +393,7 @@ class _HomeScreenState extends State { context, FadePage( page: InPatientScreen( - specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!), + specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!)!, ), ), ); @@ -421,7 +407,7 @@ class _HomeScreenState extends State { //TODO Elham* match the of the icon cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient, + text: TranslationBase.of(context).registerNewPatient!, onTap: () { Navigator.push( context, From 1f28a09043e0f525979ae3da8b121d6b391826c1 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 22 Nov 2021 10:15:12 +0200 Subject: [PATCH 134/199] first step from fix screen --- .../doctor_replay/all_doctor_questions.dart | 2 +- .../add_patient_sick_leave_screen.dart | 16 +- .../patient_sick_leave_screen.dart | 12 +- .../patients/In_patient/InPatientHeader.dart | 4 +- lib/screens/patients/In_patient/NoData.dart | 4 +- .../In_patient/in_patient_list_page.dart | 14 +- .../In_patient/in_patient_screen.dart | 16 +- .../In_patient/list_of_all_in_patient.dart | 14 +- .../In_patient/list_of_my_inpatient.dart | 11 +- .../profile/UCAF/ucaf_pager_screen.dart | 2 +- .../admission_orders_screen.dart | 25 +-- .../diabetic_chart/diabetic_chart.dart | 8 +- ...iabetic_details_blood_pressurewideget.dart | 4 +- .../line_chart_for_diabetic.dart | 4 +- .../profile/diagnosis/diagnosis_screen.dart | 16 +- .../all_discharge_summary.dart | 5 +- .../discharge_summary/discharge_summary.dart | 2 +- .../pending_discharge_summary.dart | 2 +- .../all_lab_special_result_page.dart | 2 +- .../nursing_note/nursing_note_screen.dart | 4 +- .../operation_report/operation_report.dart | 2 +- .../pending_orders/pending_orders_screen.dart | 2 +- .../profile/patient-profile-app-bar.dart | 207 +++++++++++------- lib/widgets/shared/app_scaffold_widget.dart | 2 +- 24 files changed, 202 insertions(+), 178 deletions(-) diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 66f2e7aa..7088902b 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -32,7 +32,7 @@ class _AllDoctorQuestionsState extends State { baseViewModel: model, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 8c9f0f1d..9f42bbca 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -38,7 +38,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget { AddPatientSickLeaveScreen( {this.appointmentNo, this.patientMRN, - this.patient, this.previousModel}); + required this.patient, required this.previousModel}); @override _AddPatientSickLeaveScreenState createState() => @@ -52,7 +52,7 @@ class _AddPatientSickLeaveScreenState extends State { TextEditingController _clinicController = new TextEditingController(); TextEditingController _doctorController = new TextEditingController(); TextEditingController _remarkController = new TextEditingController(); - DateTime currentDate; + late DateTime currentDate; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); bool isFormSubmitted = false; @@ -85,8 +85,8 @@ class _AddPatientSickLeaveScreenState extends State { return BaseView( onModelReady: (model) async { await model.getDoctorProfile(); - _clinicController.text = model.doctorProfile.clinicDescription; - _doctorController.text = model.doctorProfile.doctorName; + _clinicController.text = model.doctorProfile!.clinicDescription!; + _doctorController.text = model.doctorProfile!.doctorName!; await model.preSickLeaveStatistics( widget.appointmentNo, widget.patientMRN); }, @@ -97,7 +97,7 @@ class _AddPatientSickLeaveScreenState extends State { child: AppScaffold( baseViewModel: model, appBar: BottomSheetTitle( - title: TranslationBase.of(context).addSickLeave, + title: TranslationBase.of(context).addSickLeave!, ), isShowAppBar: true, body: Center( @@ -112,9 +112,9 @@ class _AddPatientSickLeaveScreenState extends State { ), AppTextFieldCustom( height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).sickLeave + + hintText: TranslationBase.of(context).sickLeave! + ' ' + - TranslationBase.of(context).days, + TranslationBase.of(context).days!, maxLines: 1, minLines: 1, dropDownColor: Colors.white, @@ -154,7 +154,7 @@ class _AddPatientSickLeaveScreenState extends State { minLines: 1, isTextFieldHasSuffix: true, suffixIcon: IconButton( - icon: Icon(Icons.calendar_today)), + icon: Icon(Icons.calendar_today), onPressed: () { },), inputFormatters: [ FilteringTextInputFormatter.allow( RegExp(ONLY_NUMBERS)) diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 51c5b35b..a1817985 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -23,13 +23,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientSickLeaveScreen extends StatelessWidget { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( @@ -84,7 +84,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ), ), AddNewOrder( - label: TranslationBase.of(context).noSickLeaveApplied, + label: TranslationBase.of(context).noSickLeaveApplied!, onTap: () async { await locator().logEvent( eventCategory: "Add Sick Leave Screen" @@ -193,7 +193,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .startDate + + .startDate! + ' ' ?? "", labelSize: SizeConfig @@ -217,7 +217,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .endDate + + .endDate! + ' ' ?? "", labelSize: SizeConfig @@ -269,7 +269,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ) : patient.patientStatusType != 43 ? ErrorMessage( - error: TranslationBase.of(context).noSickLeave, + error: TranslationBase.of(context).noSickLeave!, ) : SizedBox(), SizedBox( diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index f2d0f74e..3ee29b28 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -10,8 +10,8 @@ import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { InPatientHeader( - {this.model, - this.specialClinic, + {required this.model, + required this.specialClinic, this.activeTab, this.selectedMapId, this.onChangeFunc}) diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 0c48cd2a..89f7c65e 100644 --- a/lib/screens/patients/In_patient/NoData.dart +++ b/lib/screens/patients/In_patient/NoData.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class NoData extends StatelessWidget { const NoData({ - Key key, + Key? key, }) : super(key: key); @override @@ -13,7 +13,7 @@ class NoData extends StatelessWidget { child: SingleChildScrollView( child: Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), + error: TranslationBase.of(context).noDataAvailable!)), ), ); } diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index 6e9ad14f..edbdd113 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -25,12 +25,12 @@ class InPatientListPage extends StatefulWidget { final Function onChangeValue; InPatientListPage( - {this.isMyInPatient, - this.patientSearchViewModel, - this.selectedClinicName, - this.onChangeValue, - this.isAllClinic, - this.showBottomSheet}); + {required this.isMyInPatient, + required this.patientSearchViewModel, + required this.selectedClinicName, + required this.onChangeValue, + required this.isAllClinic, + required this.showBottomSheet}); @override _InPatientListPageState createState() => _InPatientListPageState(); @@ -279,7 +279,7 @@ class _InPatientListPageState extends State { .patientSearchViewModel .InpatientClinicList[index]); widget.patientSearchViewModel - .filterByClinic(clinicName: value); + .filterByClinic(clinicName: value.toString()); }); }, activeColor: Colors.red, diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index b70d5788..940cc9e8 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -24,8 +24,8 @@ class InPatientScreen extends StatefulWidget { bool isAllClinic = true; bool showBottomSheet = false; - String selectedClinicName; - InPatientScreen({Key? key, this.specialClinic}); + late String selectedClinicName; + InPatientScreen({Key? key, required this.specialClinic}); @override _InPatientScreenState createState() => _InPatientScreenState(); @@ -33,9 +33,9 @@ class InPatientScreen extends StatefulWidget { class _InPatientScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; - int selectedMapId; + late int selectedMapId; @override void initState() { @@ -79,7 +79,7 @@ class _InPatientScreenState extends State builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: InPatientHeader( + appBar: InPatientHeader( model: model, selectedMapId: selectedMapId, specialClinic: widget.specialClinic, @@ -136,13 +136,13 @@ class _InPatientScreenState extends State unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll, + TranslationBase.of(context).inPatientAll!, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 1, - TranslationBase.of(context).myInPatientTitle, + TranslationBase.of(context).myInPatientTitle!, counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged), + TranslationBase.of(context).discharged!), ], ), ), diff --git a/lib/screens/patients/In_patient/list_of_all_in_patient.dart b/lib/screens/patients/In_patient/list_of_all_in_patient.dart index 06634819..b29aafa2 100644 --- a/lib/screens/patients/In_patient/list_of_all_in_patient.dart +++ b/lib/screens/patients/In_patient/list_of_all_in_patient.dart @@ -7,10 +7,10 @@ import 'NoData.dart'; class ListOfAllInPatient extends StatelessWidget { const ListOfAllInPatient({ - Key key, - @required this.isAllClinic, - @required this.hasQuery, - this.patientSearchViewModel, + Key? key, + required this.isAllClinic, + required this.hasQuery, + required this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -42,7 +42,7 @@ class ListOfAllInPatient extends StatelessWidget { isInpatient: true, isMyPatient: patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile.doctorID, + patientSearchViewModel.doctorProfile!.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { @@ -61,7 +61,7 @@ class ListOfAllInPatient extends StatelessWidget { "arrivalType": "1", "isMyPatient": patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile.doctorID, + patientSearchViewModel.doctorProfile!.doctorID, }); }, ); @@ -77,7 +77,7 @@ class ListOfAllInPatient extends StatelessWidget { patientSearchViewModel.removeOnFilteredList(); } } - return; + return false; }, ), ), diff --git a/lib/screens/patients/In_patient/list_of_my_inpatient.dart b/lib/screens/patients/In_patient/list_of_my_inpatient.dart index f5f7c070..79b7c0df 100644 --- a/lib/screens/patients/In_patient/list_of_my_inpatient.dart +++ b/lib/screens/patients/In_patient/list_of_my_inpatient.dart @@ -6,10 +6,10 @@ import '../../../routes.dart'; import 'NoData.dart'; class ListOfMyInpatient extends StatelessWidget { const ListOfMyInpatient({ - Key key, - @required this.isAllClinic, - @required this.hasQuery, - this.patientSearchViewModel, + Key? key, + required this.isAllClinic, + required this.hasQuery, + required this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -56,9 +56,6 @@ class ListOfMyInpatient extends StatelessWidget { }, ); }), - onNotification: (t) { - return; - }, ), ), ); diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 87be05b2..2be71d19 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -53,7 +53,7 @@ class _UCAFPagerScreenState extends State @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 41b8d0ee..0ec237da 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -23,22 +23,22 @@ class AdmissionOrdersScreen extends StatefulWidget { class _AdmissionOrdersScreenState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: 2014005178, patientId: patient.patientMRN), + admissionNo: 2014005178, patientId: patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -50,7 +50,7 @@ class _AdmissionOrdersScreenState extends State { body: model.admissionOrderList == null || model.admissionOrderList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).noDataAvailable) + error: TranslationBase.of(context).noDataAvailable!) : Container( color: Colors.grey[200], child: Column( @@ -257,21 +257,6 @@ class _AdmissionOrdersScreenState extends State { SizedBox( height: 8, ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // children: [ - // Expanded( - // child: AppText( - // model - // .admissionOrderList[ - // index] - // .notes, - // fontSize: 10, - // isCopyable: true, - // ), - // ), - // ]) ], ), SizedBox( diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index 1aea89c2..1802fc24 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -26,7 +26,7 @@ import 'diabetic_details_blood_pressurewideget.dart'; class DiabeticChart extends StatefulWidget { DiabeticChart({ - Key key, + Key? key, }) : super(key: key); @override @@ -45,11 +45,11 @@ class _DiabeticChartState extends State { DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) ]; - DiabeticType selectedDiabeticType; + late DiabeticType selectedDiabeticType; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; ProjectViewModel projectsProvider = Provider.of(context); return BaseView( @@ -199,7 +199,7 @@ class _DiabeticChartState extends State { ], ), ) - : ErrorMessage(error: TranslationBase.of(context).noItem), + : ErrorMessage(error: TranslationBase.of(context).noItem!), ], ), )), diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index c68f848f..af0c9f60 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -13,7 +13,7 @@ class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; DiabeticDetails( - {Key? key, this.diabeticDetailsList,}); + {Key? key, required this.diabeticDetailsList,}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -70,7 +70,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart index 1159e970..6f4005f1 100644 --- a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -12,7 +12,7 @@ class LineChartForDiabetic extends StatelessWidget { final bool isOX; LineChartForDiabetic( - {this.title, this.timeSeries1, this.indexes, this.isOX= false}); + {required this.title, required this.timeSeries1, required this.indexes, this.isOX= false}); List xAxixs = []; List yAxixs = []; @@ -93,7 +93,7 @@ class LineChartForDiabetic extends StatelessWidget { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( + getTextStyles: (value) => TextStyle( color: Colors.black, fontSize: 10, ), diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index caa7421b..4241fc20 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -39,20 +39,20 @@ class DiagnosisScreen extends StatefulWidget { class _ProgressNoteState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getDiagnosisForInPatient(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = GetDiagnosisForInPatientRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientTypeID: patient.patientType, + admissionNo: int.parse(patient!.admissionNo!), + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } @@ -61,7 +61,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -77,7 +77,7 @@ class _ProgressNoteState extends State { body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).noItem) + error: TranslationBase.of(context).noItem!) : Container( color: Colors.grey[200], child: Column( @@ -209,7 +209,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase.of( context) - .icd + " : ", + .icd! + " : ", fontSize: 12, ), Expanded( diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 73317d8d..c20abe4e 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -14,9 +14,8 @@ import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; - const AllDischargeSummary({Key? key, this.changeCurrentTab}) : super(key: key); + const AllDischargeSummary({Key? key}) : super(key: key); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -35,7 +34,7 @@ class _AllDischargeSummaryState extends State { baseViewModel: model, isShowAppBar: false, body: model.pendingDischargeSummaryList.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 3bcd673a..ad9ced55 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -57,7 +57,7 @@ class _DoctorReplyScreenState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return WillPopScope( diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 317eeb4d..ae746a93 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -44,7 +44,7 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 4393b26f..f18d89c8 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -31,7 +31,7 @@ class _AllLabSpecialResultState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 50d76dfb..09d5381f 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -45,7 +45,7 @@ class _ProgressNoteState extends State { getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -62,7 +62,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index bc5ca8d7..4bea5b1d 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -50,7 +50,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index c820fded..6ea8067a 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -13,7 +13,7 @@ class PendingOrdersScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 64337c68..05372d81 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -1,6 +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'; @@ -13,7 +14,8 @@ import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { - final PatientProfileAppBarModel patientProfileAppBarModel; + final PatiantInformtion? patient; + final PatientProfileAppBarModel? patientProfileAppBarModel; final double? height; final bool isInpatient; final bool isDischargedPatient; @@ -34,17 +36,42 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final bool? isFromLabResult; final VoidCallback? onPressed; - PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed, this.height, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare= false, this.doctorName, this.branch, this.appointmentDate, this.profileUrl, this.invoiceNO, this.orderNo, this.isPrescriptions, this.isMedicalFile, this.episode, this.visitDate, this.clinic, this.isAppointmentHeader}); + PatientProfileAppBar(this.patient, + { this.patientProfileAppBarModel, + this.isFromLabResult = false, + this.onPressed, + this.height, + this.isInpatient = false, + this.isDischargedPatient = false, + this.isFromLiveCare = false, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo, + this.isPrescriptions, + this.isMedicalFile, + this.episode, + this.visitDate, + this.clinic, + this.isAppointmentHeader}); + late PatiantInformtion localPatient; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + if (patient == null) { + localPatient = patientProfileAppBarModel!.patient!; + } else { + localPatient = patient!; + } int gender = 1; - if (patientProfileAppBarModel.patient!.patientDetails != null) { - gender = patientProfileAppBarModel.patient!.patientDetails!.gender!; + if (localPatient!.patientDetails != null) { + gender = localPatient!.patientDetails!.gender!; } else { - gender = patientProfileAppBarModel.patient!.gender!; + gender = localPatient!.gender!; } return Container( @@ -75,12 +102,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), Expanded( child: AppText( - patientProfileAppBarModel.patient!.firstName != null - ? (Helpers.capitalize(patientProfileAppBarModel.patient!.firstName) + + localPatient!.firstName != null + ? (Helpers.capitalize(localPatient!.firstName) + " " + - Helpers.capitalize(patientProfileAppBarModel.patient!.lastName)) - : Helpers.capitalize(patientProfileAppBarModel.patient!.fullName ?? - patientProfileAppBarModel.patient!.patientDetails!.fullName!), + Helpers.capitalize(localPatient!.lastName)) + : Helpers.capitalize(localPatient!.fullName ?? + localPatient!.patientDetails!.fullName!), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -101,7 +128,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patientProfileAppBarModel.patient!.mobileNumber!); + launch("tel://" + localPatient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -109,24 +136,30 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ), - if(patientProfileAppBarModel.videoCallDurationStream != null) - StreamBuilder( - stream: patientProfileAppBarModel.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(); - }, - ), + if (patientProfileAppBarModel!.videoCallDurationStream != null) + StreamBuilder( + stream: patientProfileAppBarModel!.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: [ @@ -137,7 +170,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', + gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -149,12 +184,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - patientProfileAppBarModel.patient!.patientStatusType != null + localPatient!.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patientProfileAppBarModel.patient!.patientStatusType == 43 + localPatient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, color: Colors.green, @@ -173,8 +208,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { .getTextMultiplierBasedOnWidth() * 3.5, ), - patientProfileAppBarModel.patient!.startTime != null - ? AppText(patientProfileAppBarModel.patient!.startTime != null ? patientProfileAppBarModel.patient!.startTime : '', + localPatient!.startTime != null + ? AppText( + localPatient!.startTime != null + ? localPatient!.startTime + : '', fontWeight: FontWeight.w700, fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -202,7 +240,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 1, ), AppText( - patientProfileAppBarModel.patient!.patientId.toString(), + localPatient!.patientId.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -215,23 +253,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Row( children: [ AppText( - patientProfileAppBarModel.patient!.nationalityName ?? - patientProfileAppBarModel.patient!.nationality ?? - patientProfileAppBarModel.patient!.nationalityId ?? + localPatient!.nationalityName ?? + localPatient!.nationality ?? + localPatient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), - patientProfileAppBarModel.patient!.nationalityFlagURL != null + localPatient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patientProfileAppBarModel.patient!.nationalityFlagURL!, + localPatient!.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, + Object exception, + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -244,47 +284,46 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { HeaderRow( label: TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", - ),if (patientProfileAppBarModel.patient!.appointmentDate != null && - patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty && + "${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + ), + if (localPatient!.appointmentDate != null && + localPatient!.appointmentDate!.isNotEmpty && !isFromLabResult!) HeaderRow( - label: - TranslationBase.of(context).appointmentDate! + " : ", - value: - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)), + label: TranslationBase.of(context).appointmentDate! + + " : ", + value: AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + localPatient!.appointmentDate!)), ), - if (patientProfileAppBarModel.isFromLabResult!) - - HeaderRow( - label: "Result Date: ", - value: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', - + if (patientProfileAppBarModel!.isFromLabResult!) + HeaderRow( + label: "Result Date: ", + value: + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel!.appointmentDate!, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patientProfileAppBarModel.patient!.admissionDate != null && - patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty) + if (localPatient!.admissionDate != null && + localPatient!.admissionDate!.isNotEmpty) HeaderRow( - label: patientProfileAppBarModel.patient!.admissionDate == null + label: localPatient!.admissionDate == null ? "" : TranslationBase.of(context).admissionDate! + " : ", - value: patientProfileAppBarModel.patient!.admissionDate == null + value: localPatient!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate.toString())))}", ), - if (patientProfileAppBarModel.patient!.admissionDate != null) + if (localPatient!.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && - patientProfileAppBarModel.patient!.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", + localPatient!.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(localPatient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}", ) ], ), @@ -292,7 +331,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ]), - if (patientProfileAppBarModel.isAppointmentHeader!) + if (patientProfileAppBarModel!.isAppointmentHeader!) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -300,12 +339,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5), + 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), + bottom: + BorderSide(color: Colors.grey[400]!, width: 2.5), + left: + BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -316,8 +359,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { children: [ Container( child: LargeAvatar( - name: patientProfileAppBarModel.doctorName ?? "", - url: patientProfileAppBarModel.profileUrl, + name: patientProfileAppBarModel!.doctorName ?? "", + url: patientProfileAppBarModel!.profileUrl, ), width: 25, height: 25, @@ -346,7 +389,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), if (invoiceNO != null && !isPrescriptions!) HeaderRow( - label: 'Invoice: ', + label: 'Invoice: ', value: invoiceNO ?? "", ), if (branch != null) @@ -376,8 +419,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { : 'Prescriptions Date ', value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', - ), - ]), + ), + ]), ), ), ], @@ -395,21 +438,21 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size( double.maxFinite, - patientProfileAppBarModel.height == 0 - ? patientProfileAppBarModel.isAppointmentHeader! + patientProfileAppBarModel!.height == 0 + ? patientProfileAppBarModel!.isAppointmentHeader! ? 270 - : ((patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty) - ? patientProfileAppBarModel.isFromLabResult! + : ((localPatient!.appointmentDate!.isNotEmpty) + ? patientProfileAppBarModel!.isFromLabResult! ? 190 : 170 - : patientProfileAppBarModel.patient!.admissionDate != null - ? patientProfileAppBarModel.isFromLabResult! + : localPatient!.admissionDate != null + ? patientProfileAppBarModel!.isFromLabResult! ? 190 : 170 - : patientProfileAppBarModel.isDischargedPatient! + : patientProfileAppBarModel!.isDischargedPatient! ? 240 : 130) - : patientProfileAppBarModel.height!); + : patientProfileAppBarModel!.height!); } class HeaderRow extends StatelessWidget { diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index a8c59032..5511f949 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -56,7 +56,7 @@ class AppScaffold extends StatelessWidget { extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar - ? patientProfileAppBarModel != null ? PatientProfileAppBar( + ? patientProfileAppBarModel != null ? PatientProfileAppBar(patientProfileAppBarModel!.patient!, patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ?? AppBar( elevation: 0, From d808f8b2ac3ed02dbddd5e7d69b133b43dbd955b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 22 Nov 2021 11:26:11 +0200 Subject: [PATCH 135/199] 4 step from fix screen --- .../PatientMedicalReportViewModel.dart | 4 +- lib/screens/live_care/end_call_screen.dart | 19 +-- .../all_discharge_summary.dart | 7 +- .../discharge_Summary_widget.dart | 12 +- .../discharge_summary/discharge_summary.dart | 10 +- .../pending_discharge_summary.dart | 7 +- .../profile/lab_result/FlowChartPage.dart | 2 +- .../lab_result/LabResultHistoryPage.dart | 2 +- .../profile/lab_result/LabResultWidget.dart | 2 +- .../Lab_Result_history_details_wideget.dart | 4 +- .../lab_result/LineChartCurvedLabHistory.dart | 4 +- .../all_lab_special_result_page.dart | 22 +-- .../lab_result_history_chart_and_detials.dart | 6 +- .../lab_result/laboratory_result_widget.dart | 2 +- .../special_lab_result_details_page.dart | 2 +- .../AddVerifyMedicalReport.dart | 28 ++-- .../notes/note/progress_note_screen.dart | 12 +- .../nursing_note/nursing_note_screen.dart | 12 +- .../operation_report/operation_report.dart | 12 +- .../update_operation_report.dart | 22 +-- .../pending_orders/pending_orders_screen.dart | 128 +++++++++--------- .../register_patient/CustomEditableText.dart | 2 +- .../register_patient/VerifyMethodPage.dart | 6 +- .../base_add_procedure_tab_page.dart | 2 +- 24 files changed, 163 insertions(+), 166 deletions(-) diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 59485e92..996766ec 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -68,9 +68,9 @@ class PatientMedicalReportViewModel extends BaseViewModel { } } - Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { + Future updateMedicalReport(PatiantInformtion patient, String htmlText, int? limitNumber, String? invoiceNumber) async { setState(ViewState.Busy); - await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); + await _service.updateMedicalReport(patient, htmlText, limitNumber!, invoiceNumber!); if (_service.hasError) { error = _service.error!; await getMedicalReportList(patient); diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 886061c8..a9ab2d9f 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -189,19 +189,20 @@ class _EndCallScreenState extends State { .of(context) .scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient!,isInpatient: isInpatient, - isDischargedPatient: isDischargedPatient, - height: (patient!.patientStatusType != null && patient!.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - ), + appBar: PatientProfileAppBar( + patient, 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/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index f29315ae..50e1cd4d 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -10,10 +10,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const AllDischargeSummary({this.changeCurrentTab, this.patient}); + const AllDischargeSummary({ required this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -27,7 +26,7 @@ class _AllDischargeSummaryState extends State { onModelReady: (model) { model.getAllDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( @@ -36,7 +35,7 @@ class _AllDischargeSummaryState extends State { body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty ? ErrorMessage( - error: TranslationBase.of(context).noDataAvailable) + error: TranslationBase.of(context).noDataAvailable!) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index 9af1493c..33572f93 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -17,7 +17,7 @@ class DischargeSummaryWidget extends StatefulWidget { final GetDischargeSummaryResModel dischargeSummary; bool isShowMore = false; - DischargeSummaryWidget({Key? key, this.dischargeSummary}); + DischargeSummaryWidget({Key? key, required this.dischargeSummary}); @override _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); @@ -40,7 +40,7 @@ class _DischargeSummaryWidgetState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: EdgeInsets.all(15.0), @@ -52,26 +52,26 @@ class _DischargeSummaryWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CustomRow( - label: TranslationBase.of(context).doctorName + ": ", + label: TranslationBase.of(context).doctorName! + ": ", value: widget.dischargeSummary.createdByName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).branch + ": ", + label: TranslationBase.of(context).branch! + ": ", value: widget.dischargeSummary.projectName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).clinicName + ": ", + label: TranslationBase.of(context).clinicName! + ": ", value: widget.dischargeSummary.clinicName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).dischargeDate + ": ", + label: TranslationBase.of(context).dischargeDate! + ": ", value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn) .day diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index ae321872..b5ab77a7 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -12,9 +12,8 @@ import 'all_discharge_summary.dart'; import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { - final Function changeCurrentTab; - const DischargeSummaryPage({Key? key, this.changeCurrentTab}) + const DischargeSummaryPage({Key? key, }) : super(key: key); @override @@ -23,7 +22,7 @@ class DischargeSummaryPage extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -54,11 +53,10 @@ class _DoctorReplyScreenState extends State return WillPopScope( onWillPop: () async { - widget.changeCurrentTab(); return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: true, // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileAppBar( @@ -103,7 +101,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context).all!, ), ], ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index d25f41a1..a99ce464 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -9,10 +9,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient}) + const PendingDischargeSummary({Key? key, required this.patient}) : super(key: key); @override @@ -29,7 +28,7 @@ class _PendingDischargeSummaryState extends State { onModelReady: (model) { model.getPendingDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( @@ -38,7 +37,7 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noDataAvailable) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) + .noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index 3bf6929b..f0ee0404 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -20,7 +20,7 @@ class FlowChartPage extends StatelessWidget { final bool isInpatient; FlowChartPage( - {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); + {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 118bc476..4a23710f 100644 --- a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -14,7 +14,7 @@ class LabResultHistoryPage extends StatelessWidget { final String filterName; final PatiantInformtion patient; - LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); + LabResultHistoryPage({required this.patientLabOrder, required this.filterName, required this.patient}); // TODO mosa UI changes @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 67e50e53..df0eef1f 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -220,7 +220,7 @@ class LabResultWidget extends StatelessWidget { FadePage( page: FlowChartPage( filterName: - patientLabResultList[index].description, + patientLabResultList[index].description!, patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient, diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart index 490d0ec4..aa28c4ed 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { final List labResultHistory; LabResultHistoryDetailsWidget({ - this.labResultHistory, + required this.labResultHistory, }); @override @@ -72,7 +72,7 @@ class _VitalSignDetailsWidgetState extends State ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart index e0d0323b..606c75a2 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart @@ -9,14 +9,14 @@ class LineChartCurvedLabHistory extends StatefulWidget { final String title; final List labResultHistory; - LineChartCurvedLabHistory({this.title, this.labResultHistory}); + LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); @override State createState() => LineChartCurvedLabHistoryState(); } class LineChartCurvedLabHistoryState extends State { - bool isShowingMainData; + late bool isShowingMainData; List xAxixs = []; int indexes = 0; diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index f18d89c8..c24d0677 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -21,12 +21,12 @@ class AllLabSpecialResult extends StatefulWidget { } class _AllLabSpecialResultState extends State { - String patientType; + late String patientType; - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { @@ -46,7 +46,7 @@ class _AllLabSpecialResultState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - model.getAllSpecialLabResult(patientId: patient.patientMRN), + model.getAllSpecialLabResult(patientId: patient!.patientMRN!), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -71,9 +71,9 @@ class _AllLabSpecialResultState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).special + + TranslationBase.of(context).special! + " " + - TranslationBase.of(context).lab, + TranslationBase.of(context).lab!, style: "caption2", color: Colors.black, fontSize: 13, @@ -137,15 +137,15 @@ class _AllLabSpecialResultState extends State { model.allSpecialLabList[index] .isLiveCareAppointment ? TranslationBase.of(context) - .liveCare + .liveCare! .toUpperCase() : !model.allSpecialLabList[index] .isInOutPatient ? TranslationBase.of(context) - .inPatientLabel + .inPatientLabel! .toUpperCase() : TranslationBase.of(context) - .outpatient + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), diff --git a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart index 322eb817..fdf95b2c 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart @@ -9,9 +9,9 @@ import 'LineChartCurvedLabHistory.dart'; class LabResultHistoryChartAndDetails extends StatelessWidget { LabResultHistoryChartAndDetails({ - Key key, - @required this.labResultHistory, - @required this.name, + Key? key, + required this.labResultHistory, + required this.name, }) : super(key: key); final List labResultHistory; diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 54d894b6..e84552ba 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -151,7 +151,7 @@ class _LaboratoryResultWidgetState extends State { else if (widget.details == null) Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, + error: TranslationBase.of(context).noDataAvailable!, ), ), SizedBox( diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index 9a20209a..e338635a 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget { final String resultData; final PatiantInformtion patient; - const SpecialLabResultDetailsPage({Key? key, this.resultData, this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key? key, required this.resultData, required this.patient}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 3f35fd80..66c63024 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -15,20 +15,20 @@ import 'package:permission_handler/permission_handler.dart'; class AddVerifyMedicalReport extends StatefulWidget { final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final MedicalReportModel medicalReport; + final String?patientType; + final String? arrivalType; + final MedicalReportModel? medicalReport; final PatientMedicalReportViewModel model; - final MedicalReportStatus status; - final String medicalNote; + final MedicalReportStatus? status; + final String? medicalNote; const AddVerifyMedicalReport( {Key? key, - this.patient, + required this.patient, this.patientType, this.arrivalType, this.medicalReport, - this.model, + required this.model, this.status, this.medicalNote}) : super(key: key); @@ -71,11 +71,11 @@ class _AddVerifyMedicalReportState extends State { HtmlRichEditor( initialText: (widget.medicalReport != null ? widget.medicalNote - : widget.model.medicalReportTemplate[0].templateText.length > 0 + : widget.model.medicalReportTemplate[0].templateText!.length > 0 ? widget.model.medicalReportTemplate[0].templateText : ""), hint: "Write the medical report ", - height: MediaQuery.of(context).size.height * 0.75, + height: MediaQuery.of(context).size.height * 0.75, controller: _controller, ), ], ), @@ -101,7 +101,7 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); @@ -109,8 +109,8 @@ class _AddVerifyMedicalReportState extends State { ?await widget.model.updateMedicalReport( widget.patient, txtOfMedicalReport, - widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, - widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) + widget.medicalReport != null ? widget.medicalReport!.lineItemNo : null, + widget.medicalReport != null ? widget.medicalReport!.invoiceNo : null) : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); //model.getMedicalReportList(patient); @@ -138,10 +138,10 @@ class _AddVerifyMedicalReportState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport); + await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport!); GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context); if (widget.model.state == ViewState.ErrorLocal) { diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 9fae26f4..f17688f5 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -87,7 +87,7 @@ class _ProgressNoteState extends State { body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Container( color: Colors.grey[200], child: Column( @@ -113,8 +113,8 @@ class _ProgressNoteState extends State { ); }, label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet - : TranslationBase.of(context).addProgressNote, + ? TranslationBase.of(context).addNewOrderSheet! + : TranslationBase.of(context).addProgressNote!, ), Expanded( child: Container( @@ -129,7 +129,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile.doctorID != + .doctorProfile!.doctorID != model .patientProgressNoteList[ index] @@ -156,7 +156,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile.doctorID != + .doctorProfile!.doctorID != model .patientProgressNoteList[ index] @@ -201,7 +201,7 @@ class _ProgressNoteState extends State { .status != 4 && authenticationViewModel - .doctorProfile.doctorID == + .doctorProfile!.doctorID == model .patientProgressNoteList[ index] diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 09d5381f..6b608073 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -37,11 +37,11 @@ class NursingProgressNoteScreen extends StatefulWidget { } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { @@ -52,8 +52,8 @@ class _ProgressNoteState extends State { print(type); GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientTypeID: patient.patientType, + admissionNo: int.parse(patient!.admissionNo!), + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } @@ -79,7 +79,7 @@ class _ProgressNoteState extends State { body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Container( color: Colors.grey[200], child: Column( diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 4bea5b1d..376f8dbb 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -31,7 +31,7 @@ import '../../../../widgets/shared/app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class OperationReportScreen extends StatefulWidget { - final int visitType; + final int? visitType; const OperationReportScreen({Key? key, this.visitType}) : super(key: key); @@ -40,11 +40,11 @@ class OperationReportScreen extends StatefulWidget { } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -55,7 +55,7 @@ class _ProgressNoteState extends State { if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( - onModelReady: (model) => model.getReservations(patient.patientMRN), + onModelReady: (model) => model.getReservations(patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -71,7 +71,7 @@ class _ProgressNoteState extends State { model.reservationList == null || model.reservationList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Expanded( child: Container( child: ListView.builder( diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 8148e2a9..6ff2b7de 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -36,16 +36,16 @@ class UpdateOperationReport extends StatefulWidget { final GetReservationsResponseModel reservation; // final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; - final int visitType; + final int? visitType; final bool isUpdate; const UpdateOperationReport( {Key? key, // this.operationReportViewModel, - this.patient, + required this.patient, this.visitType, - this.isUpdate, - this.reservation}) + required this.isUpdate, + required this.reservation}) : super(key: key); @override @@ -53,12 +53,12 @@ class UpdateOperationReport extends StatefulWidget { } class _UpdateOperationReportState extends State { - int selectedType; + late int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController(); @@ -135,7 +135,7 @@ class _UpdateOperationReportState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: BottomSheetTitle( - title: TranslationBase.of(context).operationReports, + title: TranslationBase.of(context).operationReports!, ), body: SingleChildScrollView( child: Container( @@ -540,8 +540,8 @@ class _UpdateOperationReportState extends State { child: AppButton( title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).operationReports, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).operationReports!, color: Color(0xff359846), // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, @@ -590,9 +590,9 @@ class _UpdateOperationReportState extends State { bloodLossDetailController.text, patientID: widget.patient.patientId, admissionNo: - int.parse(widget.patient.admissionNo), + int.parse(widget.patient.admissionNo!), createdBy: model - .doctorProfile.doctorID, + .doctorProfile!.doctorID!, setupID: "010266"); await model .updateOperationReport( diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index d2c5139a..c69f3868 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -9,11 +9,11 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:flutter/material.dart'; class PendingOrdersScreen extends StatelessWidget { - const PendingOrdersScreen({Key? key}) : super(key: key); + const PendingOrdersScreen({Key key}) : super(key: key); @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; @@ -24,73 +24,73 @@ class PendingOrdersScreen extends StatelessWidget { admissionNo: int.parse(patient.admissionNo)), builder: (BuildContext context, PendingOrdersViewModel model, Widget child) => - AppScaffold( - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - isShowAppBar: true, - baseViewModel: model, - appBarTitle: "Pending Orders", - body: model.pendingOrdersList == null || + AppScaffold( + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Pending Orders", + body: model.pendingOrdersList == null || model.pendingOrdersList.length == 0 - ? DrAppEmbeddedError( + ? DrAppEmbeddedError( error: TranslationBase.of(context).noDataAvailable) - : Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).pending, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).orders, - fontSize: 25.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).pending, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], ), - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.pendingOrdersList.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all( - color: Color(0xFF707070), width: 0.30), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: AppText( - model.pendingOrdersList[index].notes), + ), + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), ), - ); - })), - ], - ), - ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: AppText( + model.pendingOrdersList[index].notes), + ), + ), + ); + })), + ], + ), + ), ); } } diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index 17405829..58713495 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class CustomEditableText extends StatefulWidget { CustomEditableText({ Key key, - @required this.controller, + required this.controller, this.hint, this.isEditable = false, this.isSubmitted, }) : super(key: key); diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 8634e76e..f2d0646f 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -501,15 +501,15 @@ class _ActivationPageState extends State { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 8d6a42e3..10bbe773 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -21,7 +21,7 @@ class BaseAddProcedureTabPage extends StatefulWidget { final ProcedureType? procedureType; const BaseAddProcedureTabPage( - {Key? key, this.model, this.prescriptionModel, this.patient, @required this.procedureType}) + {Key? key, this.model, this.prescriptionModel, this.patient, required this.procedureType}) : super(key: key); @override From 948b8c877d0ea6643949c4fdcc2140aad5bda414 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Nov 2021 11:28:59 +0200 Subject: [PATCH 136/199] flutter 2 models --- .../CheckActivationCodeModel.dart | 96 +++---- .../CheckPatientForRegistrationModel.dart | 64 ++--- .../GetPatientInfoRequestModel.dart | 44 +-- .../GetPatientInfoResponseModel.dart | 272 +++++++++--------- .../PatientRegistrationModel.dart | 152 +++++----- ...PNotificationTypeForRegistrationModel.dart | 92 +++--- .../get_medication_for_inpatient_model.dart | 60 ++-- ...edication_for_inpatient_request_model.dart | 24 +- ...on_code_for_doctor_app_response_model.dart | 30 +- .../model/diabetic_chart/DiabeticType.dart | 6 +- .../GetDiabeticChartValuesRequestModel.dart | 30 +- .../GetDiabeticChartValuesResponseModel.dart | 22 +- .../GetDiagnosisForInPatientRequestModel.dart | 18 +- ...GetDiagnosisForInPatientResponseModel.dart | 39 +-- lib/core/model/labs/LabResultHistory.dart | 96 +++---- .../labs/all_special_lab_result_model.dart | 54 ++-- .../labs/all_special_lab_result_request.dart | 28 +- lib/core/model/labs/lab_result.dart | 12 +- ..._patient_to_doctor_list_request_model.dart | 13 +- .../GetNursingProgressNoteRequestModel.dart | 16 +- .../GetNursingProgressNoteResposeModel.dart | 10 +- .../PatientSearchRequestModel.dart | 20 +- .../get_ordered_procedure_request_model.dart | 5 +- .../referral/MyReferralPatientModel.dart | 74 ++--- .../sick_leave_doctor_request_model.dart | 16 +- .../sick_leave/sick_leave_patient_model.dart | 10 +- .../sick_leave_patient_request_model.dart | 2 +- pubspec.lock | 10 +- 28 files changed, 673 insertions(+), 642 deletions(-) diff --git a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart index 4b95c1b0..16202cac 100644 --- a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart +++ b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart @@ -1,56 +1,56 @@ class CheckActivationCodeModel { - int patientMobileNumber; - String mobileNo; - int projectOutSA; - int loginType; - String zipCode; - bool isRegister; - String logInTokenID; - int searchType; - int patientID; - int nationalID; - int patientIdentificationID; - bool forRegisteration; - String activationCode; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; + int? patientMobileNumber; + String? mobileNo; + int? projectOutSA; + int? loginType; + String? zipCode; + bool? isRegister; + String? logInTokenID; + int? searchType; + int? patientID; + int? nationalID; + int? patientIdentificationID; + bool? forRegisteration; + String? activationCode; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String dOB; - int isHijri; - String healthId; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? dOB; + int? isHijri; + String? healthId; CheckActivationCodeModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.forRegisteration, - this.activationCode, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.forRegisteration, + this.activationCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); CheckActivationCodeModel.fromJson(Map json) { patientMobileNumber = json['PatientMobileNumber']; diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart index 3465cf8d..89e1bfd6 100644 --- a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart @@ -1,40 +1,40 @@ class CheckPatientForRegistrationModel { - int patientIdentificationID; - int patientMobileNumber; - String zipCode; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; + int? patientIdentificationID; + int? patientMobileNumber; + String? zipCode; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String tokenID; - int patientID; - bool isRegister; - String dOB; - int isHijri; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? tokenID; + int? patientID; + bool? isRegister; + String? dOB; + int? isHijri; CheckPatientForRegistrationModel( {this.patientIdentificationID, - this.patientMobileNumber, - this.zipCode, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.isRegister, - this.dOB, - this.isHijri}); + this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.isRegister, + this.dOB, + this.isHijri}); CheckPatientForRegistrationModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart index f05131ef..1f00fba0 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart @@ -1,30 +1,30 @@ class GetPatientInfoRequestModel { - String patientIdentificationID; - String dOB; - int isHijri; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; + String? patientIdentificationID; + String? dOB; + int? isHijri; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; + bool? isDentalAllowedBackend; + int? deviceTypeID; GetPatientInfoRequestModel( {this.patientIdentificationID, - this.dOB, - this.isHijri, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID}); + this.dOB, + this.isHijri, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); GetPatientInfoRequestModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart index 158bd1e2..a1a25e17 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart @@ -1,78 +1,78 @@ class GetPatientInfoResponseModel { dynamic date; - int languageID; - int serviceName; + int? languageID; + int? serviceName; dynamic time; dynamic androidLink; dynamic authenticationTokenID; dynamic data; - bool dataw; - int dietType; + bool? dataw; + int? dietType; dynamic errorCode; dynamic errorEndUserMessage; dynamic errorEndUserMessageN; dynamic errorMessage; - int errorType; - int foodCategory; + int? errorType; + int? foodCategory; dynamic iOSLink; - bool isAuthenticated; - int mealOrderStatus; - int mealType; - int messageStatus; - int numberOfResultRecords; + bool? isAuthenticated; + int? mealOrderStatus; + int? mealType; + int? messageStatus; + int? numberOfResultRecords; dynamic patientBlodType; dynamic successMsg; dynamic successMsgN; dynamic vidaUpdatedResponse; dynamic accessTokenObject; - int age; + int? age; dynamic clientIdentifierId; - int createdBy; - String dateOfBirth; - String firstNameAr; - String firstNameEn; - String gender; + int? createdBy; + String? dateOfBirth; + String? firstNameAr; + String? firstNameEn; + String? gender; dynamic genderAr; dynamic genderEn; - String healthId; - String idNumber; - String idType; - bool isHijri; - int isInstertedOrUpdated; - int isNull; - int isPatientExistNHIC; - bool isRecordLockedByCurrentUser; - String lastNameAr; - String lastNameEn; + String? healthId; + String? idNumber; + String? idType; + bool? isHijri; + int? isInstertedOrUpdated; + int? isNull; + int? isPatientExistNHIC; + bool? isRecordLockedByCurrentUser; + String? lastNameAr; + String? lastNameEn; dynamic listActiveAccessToken; - String maritalStatus; - String maritalStatusCode; - String nationalDateOfBirth; - String nationality; - String nationalityCode; - String occupation; + String? maritalStatus; + String? maritalStatusCode; + String? nationalDateOfBirth; + String? nationality; + String? nationalityCode; + String? occupation; dynamic pCDTransactionDataResultList; dynamic pCDGetVidaPatientForManualVerificationList; dynamic pCDNHICHMGPatientDetailsMatchCalulationList; - int pCDReturnValue; - String patientStatus; - String placeofBirth; + int? pCDReturnValue; + String? patientStatus; + String? placeofBirth; dynamic practitionerStatusCode; dynamic practitionerStatusDescAr; dynamic practitionerStatusDescEn; - int rowCount; - String secondNameAr; - String secondNameEn; - String thirdNameAr; - String thirdNameEn; + int? rowCount; + String? secondNameAr; + String? secondNameEn; + String? thirdNameAr; + String? thirdNameEn; dynamic yakeenVidaPatientDataStatisticsByPatientIdList; dynamic yakeenVidaPatientDataStatisticsList; dynamic yakeenVidaPatientDataStatisticsPrefferedList; dynamic accessToken; - int categoryCode; + int? categoryCode; dynamic categoryNameAr; dynamic categoryNameEn; - int constraintCode; + int? constraintCode; dynamic constraintNameAr; dynamic constraintNameEn; dynamic content; @@ -84,99 +84,99 @@ class GetPatientInfoResponseModel { dynamic licenseStatusDescEn; dynamic organizations; dynamic registrationNumber; - int specialtyCode; + int? specialtyCode; dynamic specialtyNameAr; dynamic specialtyNameEn; GetPatientInfoResponseModel( {this.date, - this.languageID, - this.serviceName, - this.time, - this.androidLink, - this.authenticationTokenID, - this.data, - this.dataw, - this.dietType, - this.errorCode, - this.errorEndUserMessage, - this.errorEndUserMessageN, - this.errorMessage, - this.errorType, - this.foodCategory, - this.iOSLink, - this.isAuthenticated, - this.mealOrderStatus, - this.mealType, - this.messageStatus, - this.numberOfResultRecords, - this.patientBlodType, - this.successMsg, - this.successMsgN, - this.vidaUpdatedResponse, - this.accessTokenObject, - this.age, - this.clientIdentifierId, - this.createdBy, - this.dateOfBirth, - this.firstNameAr, - this.firstNameEn, - this.gender, - this.genderAr, - this.genderEn, - this.healthId, - this.idNumber, - this.idType, - this.isHijri, - this.isInstertedOrUpdated, - this.isNull, - this.isPatientExistNHIC, - this.isRecordLockedByCurrentUser, - this.lastNameAr, - this.lastNameEn, - this.listActiveAccessToken, - this.maritalStatus, - this.maritalStatusCode, - this.nationalDateOfBirth, - this.nationality, - this.nationalityCode, - this.occupation, - this.pCDTransactionDataResultList, - this.pCDGetVidaPatientForManualVerificationList, - this.pCDNHICHMGPatientDetailsMatchCalulationList, - this.pCDReturnValue, - this.patientStatus, - this.placeofBirth, - this.practitionerStatusCode, - this.practitionerStatusDescAr, - this.practitionerStatusDescEn, - this.rowCount, - this.secondNameAr, - this.secondNameEn, - this.thirdNameAr, - this.thirdNameEn, - this.yakeenVidaPatientDataStatisticsByPatientIdList, - this.yakeenVidaPatientDataStatisticsList, - this.yakeenVidaPatientDataStatisticsPrefferedList, - this.accessToken, - this.categoryCode, - this.categoryNameAr, - this.categoryNameEn, - this.constraintCode, - this.constraintNameAr, - this.constraintNameEn, - this.content, - this.errorList, - this.licenseExpiryDate, - this.licenseIssuedDate, - this.licenseStatusCode, - this.licenseStatusDescAr, - this.licenseStatusDescEn, - this.organizations, - this.registrationNumber, - this.specialtyCode, - this.specialtyNameAr, - this.specialtyNameEn}); + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.vidaUpdatedResponse, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.isRecordLockedByCurrentUser, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationalDateOfBirth, + this.nationality, + this.nationalityCode, + this.occupation, + this.pCDTransactionDataResultList, + this.pCDGetVidaPatientForManualVerificationList, + this.pCDNHICHMGPatientDetailsMatchCalulationList, + this.pCDReturnValue, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.rowCount, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.yakeenVidaPatientDataStatisticsByPatientIdList, + this.yakeenVidaPatientDataStatisticsList, + this.yakeenVidaPatientDataStatisticsPrefferedList, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.errorList, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); GetPatientInfoResponseModel.fromJson(Map json) { date = json['Date']; @@ -233,9 +233,9 @@ class GetPatientInfoResponseModel { occupation = json['Occupation']; pCDTransactionDataResultList = json['PCDTransactionDataResultList']; pCDGetVidaPatientForManualVerificationList = - json['PCD_GetVidaPatientForManualVerificationList']; + json['PCD_GetVidaPatientForManualVerificationList']; pCDNHICHMGPatientDetailsMatchCalulationList = - json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; + json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; pCDReturnValue = json['PCD_ReturnValue']; patientStatus = json['PatientStatus']; placeofBirth = json['PlaceofBirth']; @@ -248,11 +248,11 @@ class GetPatientInfoResponseModel { thirdNameAr = json['ThirdNameAr']; thirdNameEn = json['ThirdNameEn']; yakeenVidaPatientDataStatisticsByPatientIdList = - json['YakeenVidaPatientDataStatisticsByPatientIdList']; + json['YakeenVidaPatientDataStatisticsByPatientIdList']; yakeenVidaPatientDataStatisticsList = - json['YakeenVidaPatientDataStatisticsList']; + json['YakeenVidaPatientDataStatisticsList']; yakeenVidaPatientDataStatisticsPrefferedList = - json['YakeenVidaPatientDataStatisticsPrefferedList']; + json['YakeenVidaPatientDataStatisticsPrefferedList']; accessToken = json['accessToken']; categoryCode = json['categoryCode']; categoryNameAr = json['categoryNameAr']; diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart index 83ff53d7..a73ecb0b 100644 --- a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart @@ -1,42 +1,42 @@ class PatientRegistrationModel { - Patientobject patientobject; - String patientIdentificationID; - String patientMobileNumber; - String logInTokenID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; + Patientobject? patientobject; + String? patientIdentificationID; + String? patientMobileNumber; + String? logInTokenID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String tokenID; - String dOB; - int isHijri; - String healthId; - String zipCode; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? tokenID; + String? dOB; + int? isHijri; + String? healthId; + String? zipCode; PatientRegistrationModel( {this.patientobject, - this.patientIdentificationID, - this.patientMobileNumber, - this.logInTokenID, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.dOB, - this.isHijri, - this.healthId, - this.zipCode}); + this.patientIdentificationID, + this.patientMobileNumber, + this.logInTokenID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.dOB, + this.isHijri, + this.healthId, + this.zipCode}); PatientRegistrationModel.fromJson(Map json) { patientobject = json['Patientobject'] != null @@ -64,7 +64,7 @@ class PatientRegistrationModel { Map toJson() { final Map data = new Map(); if (this.patientobject != null) { - data['Patientobject'] = this.patientobject.toJson(); + data['Patientobject'] = this.patientobject!.toJson(); } data['PatientIdentificationID'] = this.patientIdentificationID; data['PatientMobileNumber'] = this.patientMobileNumber; @@ -88,50 +88,50 @@ class PatientRegistrationModel { } class Patientobject { - bool tempValue; - int patientIdentificationType; - String patientIdentificationNo; - int mobileNumber; - int patientOutSA; - String firstNameN; - String middleNameN; - String lastNameN; - String firstName; - String middleName; - String lastName; - String strDateofBirth; - String dateofBirth; - int gender; - String nationalityID; - String dateofBirthN; - String emailAddress; - String sourceType; - String preferredLanguage; - String marital; - String eHealthIDField; + bool? tempValue; + int? patientIdentificationType; + String? patientIdentificationNo; + int? mobileNumber; + int? patientOutSA; + String? firstNameN; + String? middleNameN; + String? lastNameN; + String? firstName; + String? middleName; + String? lastName; + String? strDateofBirth; + String? dateofBirth; + int? gender; + String? nationalityID; + String? dateofBirthN; + String? emailAddress; + String? sourceType; + String? preferredLanguage; + String? marital; + String? eHealthIDField; Patientobject( {this.tempValue, - this.patientIdentificationType, - this.patientIdentificationNo, - this.mobileNumber, - this.patientOutSA, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.firstName, - this.middleName, - this.lastName, - this.strDateofBirth, - this.dateofBirth, - this.gender, - this.nationalityID, - this.dateofBirthN, - this.emailAddress, - this.sourceType, - this.preferredLanguage, - this.marital, - this.eHealthIDField}); + this.patientIdentificationType, + this.patientIdentificationNo, + this.mobileNumber, + this.patientOutSA, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.firstName, + this.middleName, + this.lastName, + this.strDateofBirth, + this.dateofBirth, + this.gender, + this.nationalityID, + this.dateofBirthN, + this.emailAddress, + this.sourceType, + this.preferredLanguage, + this.marital, + this.eHealthIDField}); Patientobject.fromJson(Map json) { tempValue = json['TempValue']; diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart index 8244a95f..af08661f 100644 --- a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -1,54 +1,54 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { - int patientMobileNumber; - String mobileNo; - int projectOutSA; - int loginType; - String zipCode; - bool isRegister; - String logInTokenID; - int searchType; - int patientID; - int nationalID; - int patientIdentificationID; - int oTPSendType; - int languageID; - double versionID; - int channel; - String iPAdress; - String generalid; - int patientOutSA; + int? patientMobileNumber; + String? mobileNo; + int? projectOutSA; + int? loginType; + String? zipCode; + bool? isRegister; + String? logInTokenID; + int? searchType; + int? patientID; + int? nationalID; + int? patientIdentificationID; + int? oTPSendType; + int? languageID; + double? versionID; + int? channel; + String? iPAdress; + String? generalid; + int? patientOutSA; Null sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String dOB; - int isHijri; - String healthId; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? dOB; + int? isHijri; + String? healthId; SendActivationCodeByOTPNotificationTypeForRegistrationModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.oTPSendType, - this.languageID, - this.versionID, - this.channel, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( Map json) { diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart index 8ba07f2a..4644131e 100644 --- a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart @@ -1,40 +1,40 @@ class GetMedicationForInPatientModel { - String setupID; - int projectID; - int admissionNo; - int patientID; - int orderNo; - int prescriptionNo; - int lineItemNo; - String prescriptionDatetime; - int itemID; - int directionID; - int refillID; - String dose; - int unitofMeasurement; - String startDatetime; - String stopDatetime; - int noOfDoses; - int routeId; - String comments; - int reviewedPharmacist; + String? setupID; + int? projectID; + int? admissionNo; + int? patientID; + int? orderNo; + int? prescriptionNo; + int? lineItemNo; + String? prescriptionDatetime; + int? itemID; + int? directionID; + int? refillID; + String? dose; + int? unitofMeasurement; + String? startDatetime; + String? stopDatetime; + int? noOfDoses; + int? routeId; + String? comments; + int? reviewedPharmacist; dynamic reviewedPharmacistDatetime; dynamic discountinueDatetime; dynamic rescheduleDatetime; - int status; - String statusDescription; - int createdBy; - String createdOn; + int? status; + String? statusDescription; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; dynamic strength; - String pHRItemDescription; - String pHRItemDescriptionN; - String doctorName; - String uomDescription; - String routeDescription; - String directionDescription; - String refillDescription; + String? pHRItemDescription; + String? pHRItemDescriptionN; + String? doctorName; + String? uomDescription; + String? routeDescription; + String? directionDescription; + String? refillDescription; GetMedicationForInPatientModel( {this.setupID, diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart index 7c906643..71c1305a 100644 --- a/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart @@ -1,16 +1,16 @@ class GetMedicationForInPatientRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int admissionNo; - String sessionID; - int projectID; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? admissionNo; + String? sessionID; + int? projectID; GetMedicationForInPatientRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index b30413e5..3fa2f69b 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -5,16 +5,19 @@ class CheckActivationCodeForDoctorAppResponseModel { late List? listDoctorsClinic; List? listDoctorProfile; late MemberInformation? memberInformation; - String vidaAuthTokenID; - String vidaRefreshTokenID; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; CheckActivationCodeForDoctorAppResponseModel( - {this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, + {this.authenticationTokenID, + this.listDoctorsClinic, + this.memberInformation, this.listDoctorProfile, this.vidaAuthTokenID, this.vidaRefreshTokenID}); - CheckActivationCodeForDoctorAppResponseModel.fromJson(Map json) { + CheckActivationCodeForDoctorAppResponseModel.fromJson( + Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { listDoctorsClinic = []; @@ -32,19 +35,22 @@ class CheckActivationCodeForDoctorAppResponseModel { vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; - memberInformation = - json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null; + memberInformation = json['memberInformation'] != null + ? new MemberInformation.fromJson(json['memberInformation']) + : null; } Map toJson() { final Map data = new Map(); data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { - data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList(); + data['List_DoctorsClinic'] = + this.listDoctorsClinic!.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { - data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList(); + data['List_DoctorProfile'] = + this.listDoctorProfile!.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { data['memberInformation'] = this.memberInformation!.toJson(); @@ -61,7 +67,13 @@ class ListDoctorsClinic { late bool? isActive; late String? clinicName; - ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); + ListDoctorsClinic( + {this.setupID, + this.projectID, + this.doctorID, + this.clinicID, + this.isActive, + this.clinicName}); ListDoctorsClinic.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/model/diabetic_chart/DiabeticType.dart b/lib/core/model/diabetic_chart/DiabeticType.dart index 26641e61..8a9cfbe1 100644 --- a/lib/core/model/diabetic_chart/DiabeticType.dart +++ b/lib/core/model/diabetic_chart/DiabeticType.dart @@ -1,7 +1,7 @@ class DiabeticType { - int value; - String nameEn; - String nameAr; + int? value; + String? nameEn; + String? nameAr; DiabeticType({this.value, this.nameEn, this.nameAr}); diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart index 7fad3106..34a8e997 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart @@ -1,22 +1,22 @@ class GetDiabeticChartValuesRequestModel { - int deviceTypeID; - int patientID; - int resultType; - int admissionNo; - String setupID; - bool patientOutSA; - int patientType; - int patientTypeID; + int? deviceTypeID; + int? patientID; + int? resultType; + int? admissionNo; + String? setupID; + bool? patientOutSA; + int? patientType; + int? patientTypeID; GetDiabeticChartValuesRequestModel( {this.deviceTypeID, - this.patientID, - this.resultType, - this.admissionNo, - this.setupID, - this.patientOutSA, - this.patientType, - this.patientTypeID}); + this.patientID, + this.resultType, + this.admissionNo, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); GetDiabeticChartValuesRequestModel.fromJson(Map json) { deviceTypeID = json['DeviceTypeID']; diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart index fa2c1ca2..1e5dd8fd 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart @@ -1,18 +1,18 @@ class GetDiabeticChartValuesResponseModel { - String resultType; - int admissionNo; - String dateChart; - int resultValue; - int createdBy; - String createdOn; + String? resultType; + int? admissionNo; + String? dateChart; + int? resultValue; + int? createdBy; + String? createdOn; GetDiabeticChartValuesResponseModel( {this.resultType, - this.admissionNo, - this.dateChart, - this.resultValue, - this.createdBy, - this.createdOn}); + this.admissionNo, + this.dateChart, + this.resultValue, + this.createdBy, + this.createdOn}); GetDiabeticChartValuesResponseModel.fromJson(Map json) { resultType = json['ResultType']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart index 310cfb50..bea61fc9 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart @@ -1,16 +1,16 @@ class GetDiagnosisForInPatientRequestModel { - int patientID; - int admissionNo; - String setupID; - int patientType; - int patientTypeID; + int? patientID; + int? admissionNo; + String? setupID; + int? patientType; + int? patientTypeID; GetDiagnosisForInPatientRequestModel( {this.patientID, - this.admissionNo, - this.setupID, - this.patientType, - this.patientTypeID}); + this.admissionNo, + this.setupID, + this.patientType, + this.patientTypeID}); GetDiagnosisForInPatientRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart index 1ec48964..491ac591 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -1,26 +1,27 @@ class GetDiagnosisForInPatientResponseModel { - String iCDCode10ID; - int diagnosisTypeID; - int conditionID; - bool complexDiagnosis; - String asciiDesc; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String createdByName; - String editedByName; + String? iCDCode10ID; + int? diagnosisTypeID; + int? conditionID; + bool? complexDiagnosis; + String? asciiDesc; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? createdByName; + String? editedByName; GetDiagnosisForInPatientResponseModel( {this.iCDCode10ID, - this.diagnosisTypeID, - this.conditionID, - this.complexDiagnosis, - this.asciiDesc, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, this.createdByName}); + this.diagnosisTypeID, + this.conditionID, + this.complexDiagnosis, + this.asciiDesc, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.createdByName}); GetDiagnosisForInPatientResponseModel.fromJson(Map json) { iCDCode10ID = json['ICDCode10ID']; diff --git a/lib/core/model/labs/LabResultHistory.dart b/lib/core/model/labs/LabResultHistory.dart index 7c4221ca..4d4221e1 100644 --- a/lib/core/model/labs/LabResultHistory.dart +++ b/lib/core/model/labs/LabResultHistory.dart @@ -1,54 +1,54 @@ class LabResultHistory { - String description; - String femaleInterpretativeData; - int gender; - bool isCertificateAllowed; - int lineItemNo; - String maleInterpretativeData; - String notes; - int orderLineItemNo; - int orderNo; - String packageID; - int patientID; - String projectID; - String referanceRange; - String resultValue; - int resultValueBasedLineItemNo; - String resultValueFlag; - String sampleCollectedOn; - String sampleReceivedOn; - String setupID; - String superVerifiedOn; - String testCode; - String uOM; - String verifiedOn; - String verifiedOnDateTime; + String? description; + String? femaleInterpretativeData; + int? gender; + bool? isCertificateAllowed; + int? lineItemNo; + String? maleInterpretativeData; + String? notes; + int? orderLineItemNo; + int? orderNo; + String? packageID; + int? patientID; + String? projectID; + String? referanceRange; + String? resultValue; + int? resultValueBasedLineItemNo; + String? resultValueFlag; + String? sampleCollectedOn; + String? sampleReceivedOn; + String? setupID; + String? superVerifiedOn; + String? testCode; + String? uOM; + String? verifiedOn; + String? verifiedOnDateTime; LabResultHistory( {this.description, - this.femaleInterpretativeData, - this.gender, - this.isCertificateAllowed, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.orderLineItemNo, - this.orderNo, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.resultValueBasedLineItemNo, - this.resultValueFlag, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.isCertificateAllowed, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.orderLineItemNo, + this.orderNo, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.resultValueBasedLineItemNo, + this.resultValueFlag, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResultHistory.fromJson(Map json) { description = json['Description']; @@ -105,4 +105,4 @@ class LabResultHistory { data['VerifiedOnDateTime'] = this.verifiedOnDateTime; return data; } -} \ No newline at end of file +} diff --git a/lib/core/model/labs/all_special_lab_result_model.dart b/lib/core/model/labs/all_special_lab_result_model.dart index ffdc5ee5..a177e16e 100644 --- a/lib/core/model/labs/all_special_lab_result_model.dart +++ b/lib/core/model/labs/all_special_lab_result_model.dart @@ -5,51 +5,51 @@ class AllSpecialLabResultModel { dynamic appointmentDate; dynamic appointmentNo; dynamic appointmentTime; - String clinicDescription; - String clinicDescriptionEnglish; + String? clinicDescription; + String? clinicDescriptionEnglish; dynamic clinicDescriptionN; dynamic clinicID; dynamic createdOn; - double decimalDoctorRate; + double? decimalDoctorRate; dynamic doctorID; - String doctorImageURL; - String doctorName; - String doctorNameEnglish; + String? doctorImageURL; + String? doctorName; + String? doctorNameEnglish; dynamic doctorNameN; dynamic doctorRate; dynamic doctorStarsRate; - String doctorTitle; + String? doctorTitle; dynamic gender; - String genderDescription; - bool inOutPatient; - String invoiceNo; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; + String? genderDescription; + bool? inOutPatient; + String? invoiceNo; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; - bool isLiveCareAppointment; - bool isRead; - bool isSendEmail; - String moduleID; - String nationalityFlagURL; + bool? isLiveCareAppointment; + bool? isRead; + bool? isSendEmail; + String? moduleID; + String? nationalityFlagURL; dynamic noOfPatientsRate; dynamic orderDate; - String orderNo; + String? orderNo; dynamic patientID; - String projectID; - String projectName; + String? projectID; + String? projectName; dynamic projectNameN; - String qR; - String resultData; - String resultDataHTML; + String? qR; + String? resultData; + String? resultDataHTML; dynamic resultDataTxt; - String setupID; + String? setupID; //List speciality; dynamic status; dynamic statusDesc; - String strOrderDate; + String? strOrderDate; AllSpecialLabResultModel( {this.actualDoctorRate, diff --git a/lib/core/model/labs/all_special_lab_result_request.dart b/lib/core/model/labs/all_special_lab_result_request.dart index d5df1405..950f0e96 100644 --- a/lib/core/model/labs/all_special_lab_result_request.dart +++ b/lib/core/model/labs/all_special_lab_result_request.dart @@ -1,18 +1,18 @@ class AllSpecialLabResultRequestModel { - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - String tokenID; - int patientTypeID; - int patientType; - int patientID; - int projectID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? patientOutSA; + String? sessionID; + bool? isDentalAllowedBackend; + int? deviceTypeID; + String? tokenID; + int? patientTypeID; + int? patientType; + int? patientID; + int? projectID; AllSpecialLabResultRequestModel( {this.versionID, diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 53035721..0cc48aef 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -34,7 +34,8 @@ class LabResult { this.referanceRange, this.resultValue, this.maxValue, - this.minValue,this.sampleCollectedOn, + this.minValue, + this.sampleCollectedOn, this.sampleReceivedOn, this.setupID, this.superVerifiedOn, @@ -95,9 +96,9 @@ class LabResult { int checkResultStatus() { try { - var max = double.tryParse(maxValue) ?? null; - var min = double.tryParse(minValue) ?? null; - var result = double.tryParse(resultValue) ?? null; + var max = double.tryParse(maxValue!) ?? null; + var min = double.tryParse(minValue!) ?? null; + var result = double.tryParse(resultValue!) ?? null; if (max != null && min != null && result != null) { if (result > max) { return 1; @@ -109,10 +110,9 @@ class LabResult { } else { return 0; } - }catch (e){ + } catch (e) { return 0; } - } } diff --git a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart index 1d63e885..f96016d7 100644 --- a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart +++ b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart @@ -1,11 +1,12 @@ class AddPatientToDoctorListRequestModel { - int vCID; - String tokenID; - String generalid; - int doctorId; - bool isOutKsa; + int? vCID; + String? tokenID; + String? generalid; + int? doctorId; + bool? isOutKsa; - AddPatientToDoctorListRequestModel({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); + AddPatientToDoctorListRequestModel( + {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); AddPatientToDoctorListRequestModel.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart index 4335053c..b7fd7aa5 100644 --- a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart @@ -1,14 +1,18 @@ import 'package:doctor_app_flutter/config/config.dart'; class GetNursingProgressNoteRequestModel { - int patientID; - int admissionNo; - int patientTypeID; - int patientType; - String setupID; + int? patientID; + int? admissionNo; + int? patientTypeID; + int? patientType; + String? setupID; GetNursingProgressNoteRequestModel( - {this.patientID, this.admissionNo, this.patientTypeID = 1, this.patientType = 1, this.setupID }); + {this.patientID, + this.admissionNo, + this.patientTypeID = 1, + this.patientType = 1, + this.setupID}); GetNursingProgressNoteRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart index fb7fbcec..aaf9c7ab 100644 --- a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart @@ -1,14 +1,14 @@ class GetNursingProgressNoteResposeModel { - String notes; + String? notes; dynamic conditionType; - int createdBy; - String createdOn; + int? createdBy; + String? createdOn; dynamic editedBy; dynamic editedOn; - String createdByName; + String? createdByName; - String editedByName; + String? editedByName; GetNursingProgressNoteResposeModel( {this.notes, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 2839833a..c2c1bab8 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -1,15 +1,15 @@ class PatientSearchRequestModel { - int ?doctorID; - String?firstName; - String?middleName; - String?lastName; - String?patientMobileNumber; - String?patientIdentificationID; - int ?patientID; + int? doctorID; + String? firstName; + String? middleName; + String? lastName; + String? patientMobileNumber; + String? patientIdentificationID; + int? patientID; String? from; - String ?to; - int ?searchType; - int projectID; + String? to; + int? searchType; + int? projectID; String? mobileNo; String? identificationNo; int? nursingStationID; diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index 02ffb44e..dbfb75cd 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,9 +1,10 @@ class GetOrderedProcedureRequestModel { String? vidaAuthTokenID; int? patientMRN; - int appointmentNo; + int? appointmentNo; - GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); + GetOrderedProcedureRequestModel( + {this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); GetOrderedProcedureRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 17ee2f8f..6f68a6d7 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -35,7 +35,7 @@ class MyReferralPatientModel { int? referralClinic; int? referringClinic; int? referralStatus; - DateTime ?referralDate; + DateTime? referralDate; String? referringDoctorRemarks; String? referredDoctorRemarks; String? referralResponseOn; @@ -62,15 +62,15 @@ class MyReferralPatientModel { String? referringClinicDescription; String? referringDoctorName; int? referalStatus; - String sourceSetupID; - int sourceProjectId; - String targetSetupID; - int targetProjectId; - int targetClinicID; - int targetDoctorID; - int sourceAppointmentNo; - int targetAppointmentNo; - String remarksFromSource; + String? sourceSetupID; + int? sourceProjectId; + String? targetSetupID; + int? targetProjectId; + int? targetClinicID; + int? targetDoctorID; + int? sourceAppointmentNo; + int? targetAppointmentNo; + String? remarksFromSource; MyReferralPatientModel( {this.rowID, @@ -113,27 +113,36 @@ class MyReferralPatientModel { this.referralResponseOn, this.priority, this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID, this.remarksFromSource}); + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.referalStatus, + this.sourceSetupID, + this.sourceAppointmentNo, + this.sourceProjectId, + this.targetProjectId, + this.targetAppointmentNo, + this.targetClinicID, + this.targetSetupID, + this.targetDoctorID, + this.remarksFromSource}); MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; @@ -219,7 +228,6 @@ class MyReferralPatientModel { sourceAppointmentNo = json['SourceAppointmentNo']; targetAppointmentNo = json['TargetAppointmentNo']; remarksFromSource = json['RemarksFromSource']; - } Map toJson() { @@ -298,6 +306,6 @@ class MyReferralPatientModel { } get patientName { - return this.firstName !+ " " + this.lastName!; + return this.firstName! + " " + this.lastName!; } } diff --git a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart index 26bb76bd..8087481c 100644 --- a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart @@ -1,12 +1,16 @@ class GetSickLeaveDoctorRequestModel { - int patientMRN; - String appointmentNo; - int status; - String vidaAuthTokenID; - String vidaRefreshTokenID; + int? patientMRN; + String? appointmentNo; + int? status; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; GetSickLeaveDoctorRequestModel( - {this.patientMRN, this.appointmentNo, this.status, this.vidaAuthTokenID, this.vidaRefreshTokenID}); + {this.patientMRN, + this.appointmentNo, + this.status, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); GetSickLeaveDoctorRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 1caaa066..cca30c3d 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -21,13 +21,13 @@ class SickLeavePatientModel { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - bool isInOutPatient; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + bool? isInOutPatient; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; - bool isLiveCareAppointment; + bool? isLiveCareAppointment; dynamic noOfPatientsRate; dynamic patientName; dynamic projectName; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index 0abe94fe..9987c4ff 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -10,7 +10,7 @@ class SickLeavePatientRequestModel { int? patientTypeID; String? tokenID; int? patientID; - int patientMRN; + int? patientMRN; String? sessionID; SickLeavePatientRequestModel( diff --git a/pubspec.lock b/pubspec.lock index 27ad91b3..00eb0727 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" autocomplete_textfield: dependency: "direct main" description: @@ -154,7 +154,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -734,7 +734,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" meta: dependency: transitive description: @@ -1138,7 +1138,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.3" timing: dependency: transitive description: @@ -1222,7 +1222,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" video_player: dependency: transitive description: From 1146f613dfa9b4d2e08c63835ae638d0b52c3acd Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Nov 2021 11:44:18 +0200 Subject: [PATCH 137/199] flutter 2 models --- .../profile/discharge_summary_servive.dart | 7 +- .../profile/operation_report_servive.dart | 19 +- .../viewModel/authentication_view_model.dart | 194 ++- .../profile/discharge_summary_view_model.dart | 31 +- .../diabetic_chart/diabetic_chart.dart | 165 +- ...iabetic_details_blood_pressurewideget.dart | 14 +- .../profile/diagnosis/diagnosis_screen.dart | 28 +- .../Lab_Result_history_details_wideget.dart | 7 +- .../all_lab_special_result_page.dart | 20 +- .../AddVerifyMedicalReport.dart | 70 +- .../nursing_note/nursing_note_screen.dart | 7 +- pubspec.lock | 1396 +++++++++++++++++ 12 files changed, 1708 insertions(+), 250 deletions(-) create mode 100644 pubspec.lock diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index 7ab58089..782e220f 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -18,7 +18,8 @@ class DischargeSummaryService extends BaseService { _allDischargeSummaryList; Future getPendingDischargeSummary( - {required GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + {required GetDischargeSummaryReqModel + getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { @@ -36,7 +37,7 @@ class DischargeSummaryService extends BaseService { } Future getAllDischargeSummary( - {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + {GetDischargeSummaryReqModel? getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { @@ -49,6 +50,6 @@ class DischargeSummaryService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getDischargeSummaryReqModel.toJson()); + }, body: getDischargeSummaryReqModel!.toJson()); } } diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index 937b4639..3a39a4b8 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -11,12 +11,11 @@ class OperationReportService extends BaseService { List get reservationList => _reservationList; List _operationDetailsList = []; - List get operationDetailsList => _operationDetailsList; + List get operationDetailsList => + _operationDetailsList; - Future getReservations( - { - required int patientId}) async { - getReservationsRequestModel = + Future getReservations({required int patientId}) async { + GetReservationsRequestModel getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); hasError = false; @@ -35,10 +34,9 @@ class OperationReportService extends BaseService { }, body: getReservationsRequestModel.toJson()); } - Future getOperationReportDetails( - {required GetOperationDetailsRequestModel getOperationReportRequestModel, - }) async { - + Future getOperationReportDetails({ + required GetOperationDetailsRequestModel getOperationReportRequestModel, + }) async { hasError = false; await baseAppClient.post(GET_OPERATION_DETAILS, onSuccess: (dynamic response, int statusCode) { @@ -46,7 +44,8 @@ class OperationReportService extends BaseService { _operationDetailsList.clear(); response['List_OperationDetails'].forEach( (v) { - _operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v)); + _operationDetailsList + .add(GetOperationDetailsResponseModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 059cb4fa..4110b079 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -43,16 +43,20 @@ class AuthenticationViewModel extends BaseViewModel { NewLoginInformationModel get loginInfo => _authService.loginInfo; - List get doctorProfilesList => _authService.doctorProfilesList; + List get doctorProfilesList => + _authService.doctorProfilesList; - SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => - _authService.activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel + get activationCodeVerificationScreenRes => + _authService.activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => - _authService.activationCodeForDoctorAppRes; + SendActivationCodeForDoctorAppResponseModel + get activationCodeForDoctorAppRes => + _authService.activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => - _authService.checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel + get checkActivationCodeForDoctorAppRes => + _authService.checkActivationCodeForDoctorAppRes; NewLoginInformationModel? loggedUser; GetIMEIDetailsModel? user; @@ -66,13 +70,12 @@ class AuthenticationViewModel extends BaseViewModel { bool unverified = false; bool isFromLogin = false; APP_STATUS appStatus = APP_STATUS.LOADING; - String localToken =""; + String localToken = ""; AuthenticationViewModel() { getDeviceInfoFromFirebase(); getDoctorProfile(); } - /// Insert Device IMEI Future insertDeviceImei(token) async { var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); @@ -86,19 +89,29 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; - InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); - insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; + profileInfo['MobileNo'] = + loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; + InsertIMEIDetailsModel insertIMEIDetailsModel = + InsertIMEIDetailsModel.fromJson(profileInfo); + insertIMEIDetailsModel.genderDescription = + profileInfo['Gender_Description']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; - insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; + insertIMEIDetailsModel.titleDescriptionN = + profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = - loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID; - insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; - insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + insertIMEIDetailsModel.doctorID = loggedIn != null + ? loggedIn['List_MemberInformation'][0]['MemberID'] + : user!.doctorID; + insertIMEIDetailsModel.outSA = + loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; + insertIMEIDetailsModel.vidaAuthTokenID = + await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; await _authService.insertDeviceImei(insertIMEIDetailsModel); @@ -127,20 +140,23 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen( + AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); - ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( - iMEI: user!.iMEI, - facilityId: user!.projectID, - memberID: user!.doctorID, - loginDoctorID: int.parse(user!.editedBy.toString()), - zipCode: user!.outSA == true ? '971' : '966', - mobileNumber: user!.mobile, - oTPSendType: authMethodType.getTypeIdService(), - isMobileFingerPrint: 1, - vidaAuthTokenID: user!.vidaAuthTokenID, - vidaRefreshTokenID: user!.vidaRefreshTokenID); - await _authService.sendActivationCodeVerificationScreen(activationCodeModel); + ActivationCodeForVerificationScreenModel activationCodeModel = + ActivationCodeForVerificationScreenModel( + iMEI: user!.iMEI, + facilityId: user!.projectID, + memberID: user!.doctorID, + loginDoctorID: int.parse(user!.editedBy.toString()), + zipCode: user!.outSA == true ? '971' : '966', + mobileNumber: user!.mobile, + oTPSendType: authMethodType.getTypeIdService(), + isMobileFingerPrint: 1, + vidaAuthTokenID: user!.vidaAuthTokenID, + vidaRefreshTokenID: user!.vidaRefreshTokenID); + await _authService + .sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { error = _authService.error!; setState(ViewState.ErrorLocal); @@ -149,56 +165,73 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password}) async { + Future sendActivationCodeForDoctorApp( + {required AuthMethodTypes authMethodType, + required String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( - facilityId: projectID, - memberID: loggedUser!.listMemberInformation![0].memberID, - loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, - otpSendType: authMethodType.getTypeIdService().toString(), - ); + facilityId: projectID, + memberID: loggedUser!.listMemberInformation![0].memberID, + loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, + otpSendType: authMethodType.getTypeIdService().toString(), + ); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { error = _authService.error!; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString(TOKEN, - _authService.activationCodeForDoctorAppRes.logInTokenID!); + await sharedPref.setString( + TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!); setState(ViewState.Idle); } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({required String activationCode,bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp( + {required String activationCode, bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); - CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, - mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, - logInTokenID: await sharedPref.getString(TOKEN), - activationCode: activationCode, - memberID:userInfo.userID!=null? int.parse(userInfo!.userID!):user!.doctorID , - password: userInfo.password, - facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user!.projectID.toString(), - oTPSendType: await sharedPref.getInt(OTP_TYPE), - iMEI: localToken, - loginDoctorID:userInfo.userID!=null? int.parse(userInfo!.userID!):user!.editedBy,// loggedUser.listMemberInformation[0].employeeID, - isForSilentLogin:isSilentLogin, - generalid: "Cs2020@2016\$2958"); - await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = + new CheckActivationCodeRequestModel( + zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, + mobileNumber: + loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null + ? await sharedPref.getInt(PROJECT_ID) + : user!.projectID, + logInTokenID: await sharedPref.getString(TOKEN), + activationCode: activationCode, + memberID: userInfo.userID != null + ? int.parse(userInfo!.userID!) + : user!.doctorID, + password: userInfo.password, + facilityId: userInfo.projectID != null + ? userInfo.projectID.toString() + : user!.projectID.toString(), + oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID: userInfo.userID != null + ? int.parse(userInfo!.userID!) + : user! + .editedBy, // loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin: isSilentLogin, + generalid: "Cs2020@2016\$2958"); + await _authService + .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { error = _authService.error!; setState(ViewState.ErrorLocal); } else { - await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); + await setDataAfterSendActivationSuccess( + checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = + GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { @@ -230,13 +263,15 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel)async { - // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); - await sharedPref.setString(TOKEN, + setDataAfterSendActivationSuccess( + CheckActivationCodeForDoctorAppResponseModel + sendActivationCodeForDoctorAppResponseModel) async { + // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); + await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); } @@ -275,7 +310,9 @@ class AuthenticationViewModel extends BaseViewModel { clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, - languageID: 2);///TODO change the lan + languageID: 2); + + ///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error!; @@ -288,13 +325,17 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { - sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); + sharedPref.setString( + TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { - localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); + localSetDoctorProfile( + checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); } else { - sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); + sharedPref.setObj( + CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); + ClinicModel clinic = ClinicModel.fromJson( + checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } @@ -336,13 +377,13 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user =_authService.dashboardItemsList[0]; + user = _authService.dashboardItemsList[0]; sharedPref.setObj( LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - user!.vidaRefreshTokenID!); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - user!.vidaAuthTokenID!); + await sharedPref.setString( + VIDA_REFRESH_TOKEN_ID, user!.vidaRefreshTokenID!); + await sharedPref.setString( + VIDA_AUTH_TOKEN_ID, user!.vidaAuthTokenID!); this.unverified = true; } setState(ViewState.Idle); @@ -352,7 +393,6 @@ class AuthenticationViewModel extends BaseViewModel { } } - /// determine the status of the app APP_STATUS get status { if (state == ViewState.Busy) { diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index 9e7e7627..250f7cb7 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -14,16 +14,20 @@ class DischargeSummaryViewModel extends BaseViewModel { List get pendingDischargeSummaryList => _dischargeSummaryService.pendingDischargeSummaryList; - List get allDisChargeSummaryList => _dischargeSummaryService.allDischargeSummaryList; - - Future getPendingDischargeSummary({required int patientId, required int admissionNo, }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + Future getPendingDischargeSummary({ + required int patientId, + required int admissionNo, + }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = + GetDischargeSummaryReqModel( + admissionNo: admissionNo, patientID: patientId); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getPendingDischargeSummary( + getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { error = _dischargeSummaryService.error!; setState(ViewState.ErrorLocal); @@ -32,19 +36,22 @@ class DischargeSummaryViewModel extends BaseViewModel { } } - - - Future getAllDischargeSummary({int patientId, int admissionNo, }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + Future getAllDischargeSummary({ + int? patientId, + int? admissionNo, + }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = + GetDischargeSummaryReqModel( + admissionNo: admissionNo!, patientID: patientId!); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getAllDischargeSummary( + getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { - error = _dischargeSummaryService.error; + error = _dischargeSummaryService.error!; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - } diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index 1802fc24..e7eca146 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -42,7 +42,10 @@ class _DiabeticChartState extends State { DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1), DiabeticType(nameAr: "Urine Acet", nameEn: "Urine Acet", value: 2), DiabeticType(nameAr: "Blood Glucose", nameEn: "Blood Glucose", value: 3), - DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) + DiabeticType( + nameAr: "Blood Glucose(Glucometer)", + nameEn: "Blood Glucose(Glucometer)", + value: 4) ]; late DiabeticType selectedDiabeticType; @@ -56,7 +59,8 @@ class _DiabeticChartState extends State { onModelReady: (model) async { selectedDiabeticType = diabeticType[2]; - await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false); + await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, + isLocalBusy: false); generateData(model); }, builder: (_, model, w) => AppScaffold( @@ -70,84 +74,69 @@ class _DiabeticChartState extends State { child: Column( children: [ Container( - width: MediaQuery.of(context).size.width * 0.7, + width: MediaQuery.of(context).size.width * 0.7, child: DropdownButtonHideUnderline( child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedDiabeticType.value, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return diabeticType - .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( - diabeticType - .length - .toString(), - color: Colors.white, - fontSize: projectsProvider - .isArabic - ? 10 - : 11, - textAlign: - TextAlign.center, - ), - )), - ], - ), - AppText( - selectedDiabeticType.nameEn, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedDiabeticType.value, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return diabeticType.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( + diabeticType.length.toString(), + color: Colors.white, + fontSize: + projectsProvider.isArabic ? 10 : 11, + textAlign: TextAlign.center, + ), + )), ], - ); - }).toList(); - }, - onChanged: (newValue) async { - await onChangeFunc(newValue, model, patient); - setState(() { - - }); - }, - items: diabeticType - .map((item) { - return DropdownMenuItem( - child: AppText( - item.nameEn, - textAlign: TextAlign.left, ), - value: item.value, - ); - }).toList(), - )), + AppText(selectedDiabeticType.nameEn, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + await onChangeFunc(newValue, model, patient); + setState(() {}); + }, + items: diabeticType.map((item) { + return DropdownMenuItem( + child: AppText( + item.nameEn, + textAlign: TextAlign.left, + ), + value: item.value, + ); + }).toList(), + )), ), timeSeriesData1.length != 0 || timeSeriesData2.length != 0 ? Padding( @@ -155,14 +144,13 @@ class _DiabeticChartState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( margin: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartForDiabetic( - title: selectedDiabeticType.nameEn, + title: selectedDiabeticType.nameEn!, isOX: false, timeSeries1: timeSeriesData1, // timeSeries2: timeSeriesData2, @@ -211,21 +199,21 @@ class _DiabeticChartState extends State { model.diabeticChartValuesList.toList().forEach( (element) { DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.dateChart); - if (element.resultValue.toInt() != 0) + AppDateUtils.getDateTimeFromServerFormat(element.dateChart!); + if (element.resultValue!.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue.toDouble(), + element.resultValue!.toDouble(), ), ); - if (element.resultValue.toInt() != 0) + if (element.resultValue!.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue.toDouble(), + element.resultValue!.toDouble(), ), ); }, @@ -236,20 +224,17 @@ class _DiabeticChartState extends State { onChangeFunc(newValue, PatientViewModel model, patient) async { GifLoaderDialogUtils.showMyDialog(context); setState(() { - selectedDiabeticType = diabeticType[newValue-1]; + selectedDiabeticType = diabeticType[newValue - 1]; timeSeriesData1.clear(); timeSeriesData2.clear(); }); - await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true); - if(model.state == ViewState.ErrorLocal){ + await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, + isLocalBusy: true); + if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } generateData(model); GifLoaderDialogUtils.hideDialog(context); - - - - } } diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index af0c9f60..f1600b10 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -12,8 +12,10 @@ import 'package:provider/provider.dart'; class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; - DiabeticDetails( - {Key? key, required this.diabeticDetailsList,}); + DiabeticDetails({ + Key? key, + required this.diabeticDetailsList, + }); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -40,7 +42,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -52,7 +53,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), child: Container( child: AppText( - "Result", + "Result", fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -70,7 +71,8 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), + horizontalInside: + BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), @@ -85,7 +87,7 @@ class _VitalSignDetailsWidgetState extends State { widget.diabeticDetailsList.forEach((diabetic) { var data = diabetic.resultValue; DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart); + AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart!); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 4241fc20..640e3061 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -50,10 +50,11 @@ class _ProgressNoteState extends State { print(type); GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = - GetDiagnosisForInPatientRequestModel( + GetDiagnosisForInPatientRequestModel( admissionNo: int.parse(patient!.admissionNo!), patientTypeID: patient!.patientType!, - patientID: patient.patientId, setupID: "010266"); + patientID: patient.patientId, + setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } @@ -76,8 +77,7 @@ class _ProgressNoteState extends State { ), body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).noItem!) + ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Container( color: Colors.grey[200], child: Column( @@ -85,8 +85,7 @@ class _ProgressNoteState extends State { Expanded( child: Container( child: ListView.builder( - itemCount: - model.diagnosisForInPatientList.length, + itemCount: model.diagnosisForInPatientList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, @@ -160,7 +159,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn), + .createdOn!), isArabic: projectViewModel .isArabic, @@ -186,7 +185,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn)) + .createdOn!)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, @@ -207,9 +206,9 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of( - context) - .icd! + " : ", + TranslationBase.of(context) + .icd! + + " : ", fontSize: 12, ), Expanded( @@ -228,16 +227,17 @@ class _ProgressNoteState extends State { ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ - AppText("Ascii Desc : ", + AppText( + "Ascii Desc : ", fontSize: 12, ), Expanded( child: AppText( model .diagnosisForInPatientList[ - index] + index] .asciiDesc, fontSize: 12, isCopyable: true, diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart index aa28c4ed..ba49e356 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -19,7 +19,8 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); } -class _VitalSignDetailsWidgetState extends State { +class _VitalSignDetailsWidgetState + extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -85,7 +86,7 @@ class _VitalSignDetailsWidgetState extends State List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResultHistory.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); tableRow.add(TableRow(children: [ Container( child: Container( @@ -113,4 +114,4 @@ class _VitalSignDetailsWidgetState extends State }); return tableRow; } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index c24d0677..6efac930 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -110,10 +110,10 @@ class _AllLabSpecialResultState extends State { height: 160, decoration: BoxDecoration( color: model.allSpecialLabList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? Colors.red[900] : !model.allSpecialLabList[index] - .isInOutPatient + .isInOutPatient! ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -135,12 +135,12 @@ class _AllLabSpecialResultState extends State { child: Center( child: Text( model.allSpecialLabList[index] - .isLiveCareAppointment + .isLiveCareAppointment! ? TranslationBase.of(context) .liveCare! .toUpperCase() : !model.allSpecialLabList[index] - .isInOutPatient + .isInOutPatient! ? TranslationBase.of(context) .inPatientLabel! .toUpperCase() @@ -159,21 +159,21 @@ class _AllLabSpecialResultState extends State { FadePage( page: SpecialLabResultDetailsPage( resultData: model.allSpecialLabList[index] - .resultDataHTML, + .resultDataHTML!, patient: patient, ), ), ), doctorName: - model.allSpecialLabList[index].doctorName, + model.allSpecialLabList[index].doctorName!, invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', profileUrl: model - .allSpecialLabList[index].doctorImageURL, + .allSpecialLabList[index].doctorImageURL!, branch: - model.allSpecialLabList[index].projectName, - clinic: model - .allSpecialLabList[index].clinicDescription, + model.allSpecialLabList[index].projectName!, + clinic: model.allSpecialLabList[index] + .clinicDescription!, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( model.allSpecialLabList[index].createdOn, diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 66c63024..5035806d 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -14,21 +14,21 @@ import 'package:html_editor_enhanced/html_editor.dart'; import 'package:permission_handler/permission_handler.dart'; class AddVerifyMedicalReport extends StatefulWidget { - final PatiantInformtion patient; - final String?patientType; + final PatiantInformtion? patient; + final String? patientType; final String? arrivalType; final MedicalReportModel? medicalReport; - final PatientMedicalReportViewModel model; + final PatientMedicalReportViewModel? model; final MedicalReportStatus? status; final String? medicalNote; const AddVerifyMedicalReport( {Key? key, - required this.patient, + this.patient, this.patientType, this.arrivalType, this.medicalReport, - required this.model, + this.model, this.status, this.medicalNote}) : super(key: key); @@ -69,13 +69,26 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: (widget.medicalReport != null + initialText: (widget.medicalReport != + null ? widget.medicalNote - : widget.model.medicalReportTemplate[0].templateText!.length > 0 - ? widget.model.medicalReportTemplate[0].templateText + : widget + .model! + .medicalReportTemplate[ + 0] + .templateText! + .length > + 0 + ? widget + .model! + .medicalReportTemplate[0] + .templateText : ""), hint: "Write the medical report ", - height: MediaQuery.of(context).size.height * 0.75, controller: _controller, + height: + MediaQuery.of(context).size.height * + 0.75, + controller: _controller, ), ], ), @@ -106,22 +119,30 @@ class _AddVerifyMedicalReportState extends State { if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.medicalReport != null - ?await widget.model.updateMedicalReport( - widget.patient, + ? await widget.model!.updateMedicalReport( + widget.patient!, txtOfMedicalReport, - widget.medicalReport != null ? widget.medicalReport!.lineItemNo : null, - widget.medicalReport != null ? widget.medicalReport!.invoiceNo : null) - : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); + widget.medicalReport != null + ? widget.medicalReport!.lineItemNo + : null, + widget.medicalReport != null + ? widget.medicalReport!.invoiceNo + : null) + : await widget.model!.addMedicalReport( + widget.patient!, txtOfMedicalReport); //model.getMedicalReportList(patient); Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); + if (widget.model!.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model!.error); } } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); + DrAppToastMsg.showErrorToast( + "Please enter medical note"); } }, ), @@ -138,17 +159,22 @@ class _AddVerifyMedicalReportState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await _controller.getText(); + txtOfMedicalReport = + await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport!); + await widget.model!.verifyMedicalReport( + widget.patient!, widget.medicalReport!); GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); + if (widget.model!.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model!.error); } } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); + DrAppToastMsg.showErrorToast( + "Please enter medical note"); } }, ), diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 6b608073..472f3f85 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -54,7 +54,8 @@ class _ProgressNoteState extends State { GetNursingProgressNoteRequestModel( admissionNo: int.parse(patient!.admissionNo!), patientTypeID: patient!.patientType!, - patientID: patient.patientId, setupID: "010266"); + patientID: patient.patientId, + setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } @@ -162,7 +163,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ index] - .createdOn), + .createdOn!), isArabic: projectViewModel .isArabic, @@ -188,7 +189,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ index] - .createdOn)) + .createdOn!)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 00000000..957312ba --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1396 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "30.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "2.7.0" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.6" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + autocomplete_textfield: + dependency: "direct main" + description: + name: autocomplete_textfield + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.3" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + barcode_scan_fix: + dependency: "direct main" + description: + name: barcode_scan_fix + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + bazel_worker: + dependency: transitive + description: + name: bazel_worker + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + build_modules: + dependency: transitive + description: + name: build_modules + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.3" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.2" + build_web_compilers: + dependency: "direct dev" + description: + name: build_web_compilers + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.3" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + chewie: + dependency: transitive + description: + name: chewie + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.2" + chewie_audio: + dependency: transitive + description: + name: chewie_audio + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + connectivity: + dependency: "direct main" + description: + name: connectivity + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.6" + connectivity_for_web: + dependency: transitive + description: + name: connectivity_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0+1" + connectivity_macos: + dependency: transitive + description: + name: connectivity_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+2" + connectivity_platform_interface: + dependency: transitive + description: + name: connectivity_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.1" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + date_time_picker: + dependency: "direct main" + description: + name: date_time_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + device_info: + dependency: "direct main" + description: + name: device_info + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + device_info_platform_interface: + dependency: transitive + description: + name: device_info_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + dropdown_search: + dependency: "direct main" + description: + name: dropdown_search + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + equatable: + dependency: transitive + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + eva_icons_flutter: + dependency: "direct main" + description: + name: eva_icons_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + expandable: + dependency: "direct main" + description: + name: expandable + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + file_picker: + dependency: "direct main" + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.2" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + url: "https://pub.dartlang.org" + source: hosted + version: "8.3.4" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0+1" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + url: "https://pub.dartlang.org" + source: hosted + version: "10.0.9" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.9" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + fl_chart: + dependency: "direct main" + description: + name: fl_chart + url: "https://pub.dartlang.org" + source: hosted + version: "0.36.4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + flutter_colorpicker: + dependency: "direct main" + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_device_type: + dependency: "direct main" + description: + name: flutter_device_type + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + flutter_flexible_toast: + dependency: "direct main" + description: + name: flutter_flexible_toast + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + flutter_gifimage: + dependency: "direct main" + description: + name: flutter_gifimage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + flutter_inappwebview: + dependency: transitive + description: + name: flutter_inappwebview + url: "https://pub.dartlang.org" + source: hosted + version: "5.3.2" + flutter_keyboard_visibility: + dependency: transitive + description: + name: flutter_keyboard_visibility + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_layout_grid: + dependency: transitive + description: + name: flutter_layout_grid + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3+1" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + flutter_staggered_grid_view: + dependency: "direct main" + description: + name: flutter_staggered_grid_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.22.0" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "9.2.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + get_it: + dependency: "direct main" + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + hexcolor: + dependency: "direct main" + description: + name: hexcolor + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + hijri: + dependency: transitive + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + html: + dependency: "direct main" + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.15.0" + html_editor_enhanced: + dependency: "direct main" + description: + name: html_editor_enhanced + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0+1-dev.1" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" + http_interceptor: + dependency: "direct main" + description: + name: http_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.8" + imei_plugin: + dependency: "direct main" + description: + name: imei_plugin + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + infinite_listview: + dependency: transitive + description: + name: infinite_listview + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.0" + local_auth: + dependency: "direct main" + description: + name: local_auth + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.8" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + maps_launcher: + dependency: "direct main" + description: + name: maps_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + numberpicker: + dependency: transitive + description: + name: numberpicker + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + numerus: + dependency: transitive + description: + name: numerus + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.1+1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + percent_indicator: + dependency: "direct main" + description: + name: percent_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "3.4.0" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + url: "https://pub.dartlang.org" + source: hosted + version: "8.3.0" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0+1" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + quiver: + dependency: "direct main" + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1+1" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.25.0" + scratch_space: + dependency: transitive + description: + name: scratch_space + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.8" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.10" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + speech_to_text: + dependency: "direct main" + description: + path: speech_to_text + relative: true + source: path + version: "0.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0+4" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1+1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + sticky_headers: + dependency: "direct main" + description: + name: sticky_headers + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.3" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" + tuple: + dependency: transitive + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.5" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + video_player: + dependency: transitive + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.7" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.0" + video_player_web: + dependency: transitive + description: + name: video_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.2" + wakelock: + dependency: transitive + description: + name: wakelock + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.6" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + webview_flutter: + dependency: transitive + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "5.3.1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" +sdks: + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" From 24618e52321f531b85cab17ae3792192fe77f888 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Nov 2021 15:01:06 +0200 Subject: [PATCH 138/199] flutter 2 models --- .../viewModel/PatientSearchViewModel.dart | 68 +++++++---- lib/models/SOAP/GetPhysicalExamReqModel.dart | 2 +- .../GetEpisodeForInpatientReqModel.dart | 6 +- .../PostEpisodeForInpatientRequestModel.dart | 6 +- .../selected_items/my_selected_allergy.dart | 17 ++- .../selected_items/my_selected_assement.dart | 32 ++--- .../selected_items/my_selected_history.dart | 4 +- .../admission_orders_model.dart | 22 ++-- .../admission_orders_request_model.dart | 32 ++--- lib/models/countriesModel.dart | 8 +- .../GetDischargeSummaryReqModel.dart | 13 +- .../GetDischargeSummaryResModel.dart | 70 +++++------ .../request_create_doctor_response.dart | 34 +++--- .../doctor/replay/request_doctor_reply.dart | 9 +- lib/models/livecare/start_call_res.dart | 20 +-- ...update_operation_report_request_model.dart | 94 +++++++-------- .../get_operation_details_request_modle.dart | 54 ++++----- .../get_operation_details_response_modle.dart | 114 +++++++++--------- .../get_reservations_request_model.dart | 26 ++-- .../get_reservations_response_model.dart | 60 ++++----- lib/models/patient/patiant_info_model.dart | 49 +++++--- .../pending_order_request_model.dart | 32 ++--- .../pending_orders/pending_orders_model.dart | 2 +- .../sick_leave_statisitics_model.dart | 10 +- lib/screens/live_care/video_call.dart | 76 ++++++++---- .../patients/DischargedPatientPage.dart | 12 +- .../register_patient/CustomEditableText.dart | 22 ++-- 27 files changed, 483 insertions(+), 411 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 04e6ff09..b54bdce0 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -39,10 +39,14 @@ class PatientSearchViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < _outPatientService.patientList.length; i++) { - String firstName = _outPatientService.patientList[i].firstName!.toUpperCase(); - String lastName = _outPatientService.patientList[i].lastName!.toUpperCase(); - String mobile = _outPatientService.patientList[i].mobileNumber!.toUpperCase(); - String patientID = _outPatientService.patientList[i].patientId.toString(); + String firstName = + _outPatientService.patientList[i].firstName!.toUpperCase(); + String lastName = + _outPatientService.patientList[i].lastName!.toUpperCase(); + String mobile = + _outPatientService.patientList[i].mobileNumber!.toUpperCase(); + String patientID = + _outPatientService.patientList[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) || @@ -58,7 +62,8 @@ class PatientSearchViewModel extends BaseViewModel { } } - getOutPatient(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { + getOutPatient(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { @@ -88,9 +93,11 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.Idle); } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService.getPatientFileInformation(patientSearchRequestModel); + await _outPatientService + .getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error!; setState(ViewState.Error); @@ -109,22 +116,32 @@ class PatientSearchViewModel extends BaseViewModel { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { - selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); - selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + selectedFromDate = DateTime( + DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); + selectedToDate = DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); dateTo = AppDateUtils.convertDateToFormat(selectedToDate!, 'yyyy-MM-dd'); dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 6), + 'yyyy-MM-dd'); dateFrom = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); } else { dateFrom = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); dateTo = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); } PatientSearchRequestModel currentModel = PatientSearchRequestModel(); currentModel.patientID = patientSearchRequestModel!.patientID; @@ -138,23 +155,27 @@ class PatientSearchViewModel extends BaseViewModel { filterData = _outPatientService.patientList; } - PatientInPatientService _inPatientService = locator(); + PatientInPatientService _inPatientService = + locator(); List get inPatientList => _inPatientService.inPatientList; - List get myIinPatientList => _inPatientService.myInPatientList; + List get myIinPatientList => + _inPatientService.myInPatientList; List filteredInPatientItems = []; List filteredMyInPatientItems = []; - Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isLocalBusy = false}) async { + Future getInPatientList(PatientSearchRequestModel requestModel, + {bool isMyInpatient = false, bool isLocalBusy = false}) async { await getDoctorProfile(); if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); + if (inPatientList.length == 0) + await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error!; if (isLocalBusy) { @@ -169,7 +190,10 @@ class PatientSearchViewModel extends BaseViewModel { } } - sortInPatient({bool isDes = false, required bool isAllClinic, required bool isMyInPatient}) { + sortInPatient( + {bool isDes = false, + required bool isAllClinic, + required bool isMyInPatient}) { if (isMyInPatient ? myIinPatientList.length > 0 : isAllClinic @@ -182,12 +206,12 @@ class PatientSearchViewModel extends BaseViewModel { : [...filteredInPatientItems]; if (isDes) localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => b - .admissionDateWithDateTimeForm - .compareTo(a.admissionDateWithDateTimeForm)); + .admissionDateWithDateTimeForm! + .compareTo(a.admissionDateWithDateTimeForm!)); else localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => a - .admissionDateWithDateTimeForm - .compareTo(b.admissionDateWithDateTimeForm)); + .admissionDateWithDateTimeForm! + .compareTo(b.admissionDateWithDateTimeForm!)); if (isMyInPatient) { filteredMyInPatientItems.clear(); filteredMyInPatientItems.addAll(localInPatient); diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 27b454d2..ea2d8f97 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,7 +1,7 @@ class GetPhysicalExamReqModel { int? patientMRN; int? appointmentNo; - int admissionNo; + int? admissionNo; String? episodeID; String? from; String? to; diff --git a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart index 2b49066e..4d5efc98 100644 --- a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart +++ b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart @@ -1,7 +1,7 @@ class GetEpisodeForInpatientReqModel { - int patientID; - int patientTypeID; - int admissionNo; + int? patientID; + int? patientTypeID; + int? admissionNo; GetEpisodeForInpatientReqModel( {this.patientID, this.patientTypeID, this.admissionNo}); diff --git a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart index 2dff7a60..b9ea104e 100644 --- a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart +++ b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart @@ -1,7 +1,7 @@ class PostEpisodeForInpatientRequestModel { - int admissionNo; - int patientID; - int patientTypeID; + int? admissionNo; + int? patientID; + int? patientTypeID; PostEpisodeForInpatientRequestModel( {this.admissionNo, this.patientID, this.patientTypeID = 1}); diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/models/SOAP/selected_items/my_selected_allergy.dart index 512a4f64..01d47b22 100644 --- a/lib/models/SOAP/selected_items/my_selected_allergy.dart +++ b/lib/models/SOAP/selected_items/my_selected_allergy.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAllergy { - MasterKeyModel selectedAllergySeverity; - MasterKeyModel selectedAllergy; - String remark; - bool isChecked; - bool isExpanded; - bool isLocal; - int createdBy; - bool hasValidationError; + MasterKeyModel? selectedAllergySeverity; + MasterKeyModel? selectedAllergy; + String? remark; + bool? isChecked; + bool? isExpanded; + bool? isLocal; + int? createdBy; + bool? hasValidationError; MySelectedAllergy( {this.selectedAllergySeverity, @@ -19,5 +19,4 @@ class MySelectedAllergy { this.isLocal = true, this.createdBy, this.hasValidationError = false}); - } diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/models/SOAP/selected_items/my_selected_assement.dart index 01572e6d..acadceda 100644 --- a/lib/models/SOAP/selected_items/my_selected_assement.dart +++ b/lib/models/SOAP/selected_items/my_selected_assement.dart @@ -1,24 +1,26 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAssessment { - MasterKeyModel selectedICD; - MasterKeyModel selectedDiagnosisCondition; - MasterKeyModel selectedDiagnosisType; - String remark; - int appointmentId; - int createdBy; - String createdOn; - int doctorID; - String doctorName; - String icdCode10ID; + MasterKeyModel? selectedICD; + MasterKeyModel? selectedDiagnosisCondition; + MasterKeyModel? selectedDiagnosisType; + String? remark; + int? appointmentId; + int? createdBy; + String? createdOn; + int? doctorID; + String? doctorName; + String? icdCode10ID; MySelectedAssessment( {this.selectedICD, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, this.appointmentId, this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); + this.remark, + this.appointmentId, + this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); } diff --git a/lib/models/SOAP/selected_items/my_selected_history.dart b/lib/models/SOAP/selected_items/my_selected_history.dart index 3769c418..177fb46e 100644 --- a/lib/models/SOAP/selected_items/my_selected_history.dart +++ b/lib/models/SOAP/selected_items/my_selected_history.dart @@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedHistory { MasterKeyModel selectedHistory; String remark; - bool isChecked; - bool isLocal; + bool? isChecked; + bool? isLocal; MySelectedHistory( {this.selectedHistory, this.remark, this.isChecked, this.isLocal = true}); diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/models/admisson_orders/admission_orders_model.dart index a0891a02..01539342 100644 --- a/lib/models/admisson_orders/admission_orders_model.dart +++ b/lib/models/admisson_orders/admission_orders_model.dart @@ -1,15 +1,15 @@ class AdmissionOrdersModel { - int procedureID; - String procedureName; - String procedureNameN; - int orderNo; - int doctorID; - int clinicID; - String createdOn; - int createdBy; - String editedOn; - int editedBy; - String createdByName; + int? procedureID; + String? procedureName; + String? procedureNameN; + int? orderNo; + int? doctorID; + int? clinicID; + String? createdOn; + int? createdBy; + String? editedOn; + int? editedBy; + String? createdByName; AdmissionOrdersModel( {this.procedureID, diff --git a/lib/models/admisson_orders/admission_orders_request_model.dart b/lib/models/admisson_orders/admission_orders_request_model.dart index 897bb8f8..4b6296e5 100644 --- a/lib/models/admisson_orders/admission_orders_request_model.dart +++ b/lib/models/admisson_orders/admission_orders_request_model.dart @@ -1,20 +1,20 @@ class AdmissionOrdersRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int admissionNo; - String sessionID; - int projectID; - String setupID; - bool patientOutSA; - int patientType; - int patientTypeID; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? admissionNo; + String? sessionID; + int? projectID; + String? setupID; + bool? patientOutSA; + int? patientType; + int? patientTypeID; AdmissionOrdersRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/models/countriesModel.dart b/lib/models/countriesModel.dart index 89797fab..79ba027e 100644 --- a/lib/models/countriesModel.dart +++ b/lib/models/countriesModel.dart @@ -16,10 +16,10 @@ // } class Countries { - String name; - String nameAr; - String code; - String countryCode; + String? name; + String? nameAr; + String? code; + String? countryCode; Countries({this.name, this.nameAr, this.code, this.countryCode}); diff --git a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart index 2d2c14ad..cc643e3f 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart @@ -1,11 +1,14 @@ class GetDischargeSummaryReqModel { - int patientID; - int admissionNo; - int patientType; - int patientTypeID; + int? patientID; + int? admissionNo; + int? patientType; + int? patientTypeID; GetDischargeSummaryReqModel( - {this.patientID, this.admissionNo, this.patientType = 1, this.patientTypeID=1}); + {this.patientID, + this.admissionNo, + this.patientType = 1, + this.patientTypeID = 1}); GetDischargeSummaryReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart index 10ddab00..214acc97 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -1,33 +1,33 @@ class GetDischargeSummaryResModel { - String setupID; - int projectID; - int dischargeNo; - String dischargeDate; - int admissionNo; - int assessmentNo; - int patientType; - int patientID; - int clinicID; - int doctorID; - String finalDiagnosis; - String persentation; - String pastHistory; - String planOfCare; - String investigations; - String followupPlan; - String conditionOnDischarge; - String significantFindings; - String planedProcedure; - int daysStayed; - String remarks; - String eRCare; - int status; - bool isActive; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - bool isPatientDied; + String? setupID; + int? projectID; + int? dischargeNo; + String? dischargeDate; + int? admissionNo; + int? assessmentNo; + int? patientType; + int? patientID; + int? clinicID; + int? doctorID; + String? finalDiagnosis; + String? persentation; + String? pastHistory; + String? planOfCare; + String? investigations; + String? followupPlan; + String? conditionOnDischarge; + String? significantFindings; + String? planedProcedure; + int? daysStayed; + String? remarks; + String? eRCare; + int? status; + bool? isActive; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + bool? isPatientDied; dynamic isMedicineApproved; dynamic isOpenBillDischarge; dynamic activatedDate; @@ -36,16 +36,16 @@ class GetDischargeSummaryResModel { dynamic patientCodition; dynamic others; dynamic reconciliationInstruction; - String dischargeInstructions; - String reason; + String? dischargeInstructions; + String? reason; dynamic dischargeDisposition; dynamic hospitalID; - String createdByName; + String? createdByName; dynamic createdByNameN; - String editedByName; + String? editedByName; dynamic editedByNameN; - String clinicName; - String projectName; + String? clinicName; + String? projectName; GetDischargeSummaryResModel( {this.setupID, diff --git a/lib/models/doctor/replay/request_create_doctor_response.dart b/lib/models/doctor/replay/request_create_doctor_response.dart index 49e421d9..0544ef05 100644 --- a/lib/models/doctor/replay/request_create_doctor_response.dart +++ b/lib/models/doctor/replay/request_create_doctor_response.dart @@ -1,24 +1,24 @@ class CreateDoctorResponseModel { - String setupID; - int projectID; - String transactionNo; - int infoEnteredBy; - int infoStatus; - int createdBy; - int editedBy; - String doctorResponse; - int doctorID; + String? setupID; + int? projectID; + String? transactionNo; + int? infoEnteredBy; + int? infoStatus; + int? createdBy; + int? editedBy; + String? doctorResponse; + int? doctorID; CreateDoctorResponseModel( {this.setupID, - this.projectID, - this.transactionNo, - this.infoEnteredBy, - this.infoStatus, - this.createdBy, - this.editedBy, - this.doctorResponse, - this.doctorID}); + this.projectID, + this.transactionNo, + this.infoEnteredBy, + this.infoStatus, + this.createdBy, + this.editedBy, + this.doctorResponse, + this.doctorID}); CreateDoctorResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/replay/request_doctor_reply.dart b/lib/models/doctor/replay/request_doctor_reply.dart index f2daa591..8283801a 100644 --- a/lib/models/doctor/replay/request_doctor_reply.dart +++ b/lib/models/doctor/replay/request_doctor_reply.dart @@ -13,9 +13,9 @@ class RequestDoctorReply { String? sessionID; bool? isLoginForDoctorApp; bool? patientOutSA; - int pageIndex; - int pageSize; - int infoStatus; + int? pageIndex; + int? pageSize; + int? infoStatus; RequestDoctorReply( {this.projectID, @@ -68,8 +68,7 @@ class RequestDoctorReply { data['PatientOutSA'] = this.patientOutSA; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; - if(this.infoStatus != null) - data['InfoStatus'] = this.infoStatus; + if (this.infoStatus != null) data['InfoStatus'] = this.infoStatus; return data; } } diff --git a/lib/models/livecare/start_call_res.dart b/lib/models/livecare/start_call_res.dart index 7309c410..c4b0d224 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/models/livecare/start_call_res.dart @@ -5,17 +5,17 @@ class StartCallRes { bool? isAuthenticated; int? messageStatus; String? appointmentNo; - bool isRecording; + bool? isRecording; - StartCallRes( - {this.result, - this.openSessionID, - this.openTokenID, - this.isAuthenticated, - this.appointmentNo, - this.messageStatus, - this.isRecording = true, - }); + StartCallRes({ + this.result, + this.openSessionID, + this.openTokenID, + this.isAuthenticated, + this.appointmentNo, + this.messageStatus, + this.isRecording = true, + }); StartCallRes.fromJson(Map json) { result = json['Result']; diff --git a/lib/models/operation_report/create_update_operation_report_request_model.dart b/lib/models/operation_report/create_update_operation_report_request_model.dart index f6d72b1b..cecbce0b 100644 --- a/lib/models/operation_report/create_update_operation_report_request_model.dart +++ b/lib/models/operation_report/create_update_operation_report_request_model.dart @@ -1,54 +1,54 @@ class CreateUpdateOperationReportRequestModel { - String setupID; - int patientID; - int reservationNo; - int admissionNo; - String preOpDiagmosis; - String postOpDiagmosis; - String surgeon; - String assistant; - String anasthetist; - String operation; - String inasion; - String finding; - String surgeryProcedure; - String postOpInstruction; - int createdBy; - int editedBy; - String complicationDetails; - String bloodLossDetail; - String histopathSpecimen; - String microbiologySpecimen; - String otherSpecimen; - String scrubNurse; - String circulatingNurse; - String bloodTransfusedDetail; + String? setupID; + int? patientID; + int? reservationNo; + int? admissionNo; + String? preOpDiagmosis; + String? postOpDiagmosis; + String? surgeon; + String? assistant; + String? anasthetist; + String? operation; + String? inasion; + String? finding; + String? surgeryProcedure; + String? postOpInstruction; + int? createdBy; + int? editedBy; + String? complicationDetails; + String? bloodLossDetail; + String? histopathSpecimen; + String? microbiologySpecimen; + String? otherSpecimen; + String? scrubNurse; + String? circulatingNurse; + String? bloodTransfusedDetail; CreateUpdateOperationReportRequestModel( {this.setupID, - this.patientID, - this.reservationNo, - this.admissionNo, - this.preOpDiagmosis, - this.postOpDiagmosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.createdBy, - this.editedBy, - this.complicationDetails, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.patientID, + this.reservationNo, + this.admissionNo, + this.preOpDiagmosis, + this.postOpDiagmosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.createdBy, + this.editedBy, + this.complicationDetails, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); CreateUpdateOperationReportRequestModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/operation_report/get_operation_details_request_modle.dart b/lib/models/operation_report/get_operation_details_request_modle.dart index 7e23b503..fd7be8a4 100644 --- a/lib/models/operation_report/get_operation_details_request_modle.dart +++ b/lib/models/operation_report/get_operation_details_request_modle.dart @@ -1,34 +1,34 @@ class GetOperationDetailsRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int reservationNo; - String sessionID; - int projectID; - String setupID; - bool patientOutSA; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? reservationNo; + String? sessionID; + int? projectID; + String? setupID; + bool? patientOutSA; GetOperationDetailsRequestModel( {this.isDentalAllowedBackend = false, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.reservationNo, - this.sessionID, - this.projectID, - this.setupID, - this.patientOutSA}); + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.reservationNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA}); GetOperationDetailsRequestModel.fromJson(Map json) { isDentalAllowedBackend = json['isDentalAllowedBackend']; diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/models/operation_report/get_operation_details_response_modle.dart index 04540ea6..b57acc4a 100644 --- a/lib/models/operation_report/get_operation_details_response_modle.dart +++ b/lib/models/operation_report/get_operation_details_response_modle.dart @@ -1,74 +1,74 @@ class GetOperationDetailsResponseModel { - String setupID; - int projectID; - int reservationNo; - int patientID; - int admissionID; + String? setupID; + int? projectID; + int? reservationNo; + int? patientID; + int? admissionID; dynamic surgeryDate; - String preOpDiagnosis; - String postOpDiagnosis; - String surgeon; - String assistant; - String anasthetist; - String operation; - String inasion; - String finding; - String surgeryProcedure; - String postOpInstruction; - bool isActive; - int createdBy; - String createdName; + String? preOpDiagnosis; + String? postOpDiagnosis; + String? surgeon; + String? assistant; + String? anasthetist; + String? operation; + String? inasion; + String? finding; + String? surgeryProcedure; + String? postOpInstruction; + bool? isActive; + int? createdBy; + String? createdName; dynamic createdNameN; - String createdOn; + String? createdOn; dynamic editedBy; dynamic editedByName; dynamic editedByNameN; dynamic editedOn; dynamic oRBookStatus; - String complicationDetail; - String bloodLossDetail; - String histopathSpecimen; - String microbiologySpecimen; - String otherSpecimen; + String? complicationDetail; + String? bloodLossDetail; + String? histopathSpecimen; + String? microbiologySpecimen; + String? otherSpecimen; dynamic scrubNurse; dynamic circulatingNurse; dynamic bloodTransfusedDetail; GetOperationDetailsResponseModel( {this.setupID, - this.projectID, - this.reservationNo, - this.patientID, - this.admissionID, - this.surgeryDate, - this.preOpDiagnosis, - this.postOpDiagnosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.isActive, - this.createdBy, - this.createdName, - this.createdNameN, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedByNameN, - this.editedOn, - this.oRBookStatus, - this.complicationDetail, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.projectID, + this.reservationNo, + this.patientID, + this.admissionID, + this.surgeryDate, + this.preOpDiagnosis, + this.postOpDiagnosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.isActive, + this.createdBy, + this.createdName, + this.createdNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn, + this.oRBookStatus, + this.complicationDetail, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); GetOperationDetailsResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/operation_report/get_reservations_request_model.dart b/lib/models/operation_report/get_reservations_request_model.dart index 06425254..8de0bbf3 100644 --- a/lib/models/operation_report/get_reservations_request_model.dart +++ b/lib/models/operation_report/get_reservations_request_model.dart @@ -1,17 +1,17 @@ class GetReservationsRequestModel { - int patientID; - int projectID; - String doctorID; - int clinicID; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - bool patientOutSA; - int deviceTypeID; - String tokenID; - String sessionID; + int? patientID; + int? projectID; + String? doctorID; + int? clinicID; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + bool? patientOutSA; + int? deviceTypeID; + String? tokenID; + String? sessionID; GetReservationsRequestModel( {this.patientID, diff --git a/lib/models/operation_report/get_reservations_response_model.dart b/lib/models/operation_report/get_reservations_response_model.dart index 3bebdc8b..b6191353 100644 --- a/lib/models/operation_report/get_reservations_response_model.dart +++ b/lib/models/operation_report/get_reservations_response_model.dart @@ -1,38 +1,38 @@ class GetReservationsResponseModel { - String setupID; - int projectID; - int oTReservationID; - String oTReservationDate; - String oTReservationDateN; - int oTID; - int admissionRequestNo; - int admissionNo; - int primaryDoctorID; - int patientType; - int patientID; - int patientStatusType; - int clinicID; - int doctorID; - String operationDate; - int operationType; - String endDate; - String timeStart; - String timeEnd; + String? setupID; + int? projectID; + int? oTReservationID; + String? oTReservationDate; + String? oTReservationDateN; + int? oTID; + int? admissionRequestNo; + int? admissionNo; + int? primaryDoctorID; + int? patientType; + int? patientID; + int? patientStatusType; + int? clinicID; + int? doctorID; + String? operationDate; + int? operationType; + String? endDate; + String? timeStart; + String? timeEnd; dynamic remarks; - int status; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - String patientName; + int? status; + int? createdBy; + String? createdOn; + int? editedBy; + String? editedOn; + String? patientName; Null patientNameN; Null gender; - String dateofBirth; - String mobileNumber; - String emailAddress; - String doctorName; + String? dateofBirth; + String? mobileNumber; + String? emailAddress; + String? doctorName; Null doctorNameN; - String clinicDescription; + String? clinicDescription; Null clinicDescriptionN; GetReservationsResponseModel( diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index aa27d68e..2ab6ba90 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatiantInformtion { - PatiantInformtion? patientDetails; + PatiantInformtion? patientDetails; int? genderInt; dynamic age; String? appointmentDate; - DateTime appointmentDateWithDateTimeForm; + DateTime? appointmentDateWithDateTimeForm; dynamic appointmentNo; dynamic appointmentType; String? arrivalTime; @@ -55,7 +55,7 @@ class PatiantInformtion { int? patientMRN; String? admissionNo; String? admissionDate; - DateTime admissionDateWithDateTimeForm; + DateTime? admissionDateWithDateTimeForm; String? createdOn; String? roomId; String? bedId; @@ -79,7 +79,7 @@ class PatiantInformtion { int? vcId; String? voipToken; - PatiantInformtion( + PatiantInformtion( {this.patientDetails, this.projectId, this.clinicId, @@ -158,7 +158,9 @@ class PatiantInformtion { PatiantInformtion.fromJson(Map json) { { - patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null; + patientDetails = json['patientDetails'] != null + ? new PatiantInformtion.fromJson(json['patientDetails']) + : null; projectId = json["ProjectID"] ?? json["projectID"]; clinicId = json["ClinicID"] ?? json["clinicID"]; doctorId = json["DoctorID"] ?? json["doctorID"]; @@ -186,7 +188,8 @@ class PatiantInformtion { nationalityId = json["NationalityID"] ?? json["nationalityID"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"]; - patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + patientIdentificationNo = + json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; //TODO make 7 dynamic when the backend retrun it in patient arrival patientType = json["PatientType"] ?? json["patientType"] ?? 1; admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; @@ -196,10 +199,16 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"]; - clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; - nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName']; - nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN']; + clinicDescription = + json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = + json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? + json["nationalityName"] ?? + json['NationalityName']; + nationalityNameN = json["NationalityNameN"] ?? + json["nationalityNameN"] ?? + json['NationalityNameN']; age = json["Age"] ?? json["age"]; genderDescription = json["GenderDescription"]; nursingStationName = json["NursingStationName"]; @@ -207,7 +216,8 @@ class PatiantInformtion { startTime = json["startTime"] ?? json['StartTime']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentType = json['appointmentType']; - appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid']; + appointmentTypeId = + json['appointmentTypeId'] ?? json['appointmentTypeid']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; clinicGroupId = json['clinicGroupId']; companyName = json['companyName']; @@ -229,9 +239,12 @@ class PatiantInformtion { ? int?.parse(json["patientId"].toString()) : ''); visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; - nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL']; - patientStatusType = json['patientStatusType'] ?? json['PatientStatusType']; - visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + nationalityFlagURL = + json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = + json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = + json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; startTimes = json['StartTime'] ?? json['StartTime']; dischargeDate = json['DischargeDate']; status = json['Status']; @@ -254,8 +267,9 @@ class PatiantInformtion { ? AppDateUtils.convertStringToDate(json["admissionDate"]) : null; - appointmentDateWithDateTimeForm = - json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null; + appointmentDateWithDateTimeForm = json["AppointmentDate"] != null + ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) + : null; } } @@ -303,7 +317,8 @@ class PatiantInformtion { data["gender"] = this.gender; data['Age'] = this.age; - data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null; + data['AppointmentDate'] = + this.appointmentDate!.isNotEmpty ? this.appointmentDate : null; data['AppointmentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/models/pending_orders/pending_order_request_model.dart index c69cf780..47577b16 100644 --- a/lib/models/pending_orders/pending_order_request_model.dart +++ b/lib/models/pending_orders/pending_order_request_model.dart @@ -1,20 +1,20 @@ class PendingOrderRequestModel { - bool isDentalAllowedBackend; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int deviceTypeID; - String tokenID; - int patientID; - int admissionNo; - String sessionID; - int projectID; - String setupID; - bool patientOutSA; - int patientType; - int patientTypeID; + bool? isDentalAllowedBackend; + double? versionID; + int? channel; + int? languageID; + String? iPAdress; + String? generalid; + int? deviceTypeID; + String? tokenID; + int? patientID; + int? admissionNo; + String? sessionID; + int? projectID; + String? setupID; + bool? patientOutSA; + int? patientType; + int? patientTypeID; PendingOrderRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/models/pending_orders/pending_orders_model.dart b/lib/models/pending_orders/pending_orders_model.dart index 89525369..65f93f89 100644 --- a/lib/models/pending_orders/pending_orders_model.dart +++ b/lib/models/pending_orders/pending_orders_model.dart @@ -1,5 +1,5 @@ class PendingOrderModel { - String notes; + String? notes; PendingOrderModel({this.notes}); diff --git a/lib/models/sickleave/sick_leave_statisitics_model.dart b/lib/models/sickleave/sick_leave_statisitics_model.dart index f679807c..179664a6 100644 --- a/lib/models/sickleave/sick_leave_statisitics_model.dart +++ b/lib/models/sickleave/sick_leave_statisitics_model.dart @@ -1,12 +1,12 @@ class SickLeaveStatisticsModel { - String recommendedSickLeaveDays; - int totalLeavesByAllClinics; - int totalLeavesByDoctor; + String? recommendedSickLeaveDays; + int? totalLeavesByAllClinics; + int? totalLeavesByDoctor; SickLeaveStatisticsModel( {this.recommendedSickLeaveDays, - this.totalLeavesByAllClinics, - this.totalLeavesByDoctor}); + this.totalLeavesByAllClinics, + this.totalLeavesByDoctor}); SickLeaveStatisticsModel.fromJson(Map json) { recommendedSickLeaveDays = json['recommendedSickLeaveDays']; diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index f78bef85..f62e3e11 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -18,7 +18,8 @@ class VideoCallPage extends StatefulWidget { final PatiantInformtion patientData; final listContext; final LiveCarePatientViewModel model; - VideoCallPage({required this.patientData, this.listContext, required this.model}); + VideoCallPage( + {required this.patientData, this.listContext, required this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -66,8 +67,12 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, - isRecording: tokenData != null ? tokenData.isRecording: false, - patientName: widget.patientData.fullName != null ? widget.patientData.fullName! : widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", + isRecording: tokenData != null ? tokenData.isRecording! : false, + patientName: widget.patientData.fullName != null + ? widget.patientData.fullName! + : widget.patientData.firstName != null + ? "${widget.patientData.firstName} ${widget.patientData.lastName}" + : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], @@ -98,7 +103,8 @@ class _VideoCallPageState extends State { }); connectOpenTok(result); - }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } @override @@ -126,14 +132,20 @@ class _VideoCallPageState extends State { ), Text( _start == 0 ? 'Dailing' : 'Connected', - style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), + style: TextStyle( + color: Colors.deepPurpleAccent, + fontWeight: FontWeight.w300, + fontSize: 15), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, ), Text( widget.patientData.fullName!, - style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), + style: TextStyle( + color: Colors.deepPurpleAccent, + fontWeight: FontWeight.w900, + fontSize: 20), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -141,7 +153,10 @@ class _VideoCallPageState extends State { Container( child: Text( _start == 0 ? 'Connecting...' : _timmer.toString(), - style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), + style: TextStyle( + color: Colors.deepPurpleAccent, + fontWeight: FontWeight.w300, + fontSize: 15), )), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -188,8 +203,8 @@ class _VideoCallPageState extends State { _showAlert(BuildContext context) async { await showDialog( context: context, - builder: (dialogContex) => - AlertDialog(content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { + builder: (dialogContex) => AlertDialog(content: StatefulBuilder( + builder: (BuildContext context, StateSetter setState) { return Container( height: MediaQuery.of(context).size.height * 0.7, width: MediaQuery.of(context).size.width * .9, @@ -202,7 +217,8 @@ class _VideoCallPageState extends State { top: -40.0, child: InkResponse( onTap: () { - Navigator.of(context, rootNavigator: true).pop('dialog'); + Navigator.of(context, rootNavigator: true) + .pop('dialog'); Navigator.of(context).pop(); }, child: CircleAvatar( @@ -220,7 +236,8 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {endCall()}, - child: Text(TranslationBase.of(context).endcall!), + child: + Text(TranslationBase.of(context).endcall!), color: Colors.red, textColor: Colors.white, )), @@ -228,7 +245,8 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {resumeCall()}, - child: Text(TranslationBase.of(context).resumecall!), + child: + Text(TranslationBase.of(context).resumecall!), color: Colors.green[900], textColor: Colors.white, ), @@ -237,7 +255,8 @@ class _VideoCallPageState extends State { padding: EdgeInsets.all(8.0), child: RaisedButton( onPressed: () => {endCallWithCharge()}, - child: Text(TranslationBase.of(context).endcallwithcharge!), + child: Text(TranslationBase.of(context) + .endcallwithcharge!), textColor: Colors.white, ), ), @@ -247,7 +266,8 @@ class _VideoCallPageState extends State { onPressed: () => { setState(() => {isTransfer = true}) }, - child: Text(TranslationBase.of(context).transfertoadmin!), + child: Text( + TranslationBase.of(context).transfertoadmin!), color: Colors.yellow[900], ), ), @@ -261,11 +281,14 @@ class _VideoCallPageState extends State { child: TextField( maxLines: 3, controller: notes, - decoration: InputDecoration.collapsed(hintText: "Enter your notes here"), + decoration: InputDecoration.collapsed( + hintText: + "Enter your notes here"), )), Center( child: RaisedButton( - onPressed: () => {this.transferToAdmin(notes)}, + onPressed: () => + {this.transferToAdmin(notes)}, child: Text('Transfer'), color: Colors.yellow[900], )) @@ -287,24 +310,33 @@ class _VideoCallPageState extends State { transferToAdmin(notes) { closeRoute(); - _liveCareProvider.transfterToAdmin(widget.patientData, notes).then((result) { + _liveCareProvider + .transfterToAdmin(widget.patientData, notes) + .then((result) { connectOpenTok(result); - }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCall() { closeRoute(); - _liveCareProvider.endCall(widget.patientData, false, doctorprofile['DoctorID']).then((result) { + _liveCareProvider + .endCall(widget.patientData, false, doctorprofile['DoctorID']) + .then((result) { print(result); - }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCallWithCharge() { - _liveCareProvider.endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']).then((result) { + _liveCareProvider + .endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']) + .then((result) { closeRoute(); print('end callwith charge'); print(result); - }).catchError((error) => {Helpers.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } closeRoute() { diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 6791785a..83e8376a 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -59,7 +59,6 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( height: 12, ), @@ -70,6 +69,7 @@ class _DischargedPatientState extends State { }, marginTop: 0, suffixIcon: IconButton( + onPressed: () {}, icon: Icon( DoctorApp.filter_1, color: Colors.black, @@ -170,14 +170,14 @@ class _DischargedPatientState extends State { ? model .filterData[ index] - .nationalityName + .nationalityName! .trim() : model.filterData[index].nationality != null ? model .filterData[ index] - .nationality + .nationality! .trim() : model.filterData[index].nationalityId != null @@ -203,7 +203,7 @@ class _DischargedPatientState extends State { .network( model.filterData[index].nationalityFlagURL != null - ? model.filterData[index].nationalityFlagURL + ? model.filterData[index].nationalityFlagURL! : '', height: 25, @@ -320,7 +320,7 @@ class _DischargedPatientState extends State { text: model.filterData[index].admissionDate == null ? "" - : TranslationBase.of(context).admissionDate + + : TranslationBase.of(context).admissionDate! + " : ", style: TextStyle( fontSize: @@ -385,7 +385,7 @@ class _DischargedPatientState extends State { .w300, ), AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}", fontSize: 15, fontWeight: diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index 58713495..ac20d1e1 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -9,7 +9,8 @@ class CustomEditableText extends StatefulWidget { Key key, required this.controller, this.hint, - this.isEditable = false, this.isSubmitted, + this.isEditable = false, + this.isSubmitted, }) : super(key: key); final TextEditingController controller; @@ -27,7 +28,7 @@ class _CustomEditableTextState extends State { Widget build(BuildContext context) { return Column( children: [ - if(!widget.isEditable) + if (!widget.isEditable) Container( height: 60, decoration: BoxDecoration( @@ -36,7 +37,7 @@ class _CustomEditableTextState extends State { borderRadius: BorderRadius.all(Radius.circular(20)), border: Border.fromBorderSide( BorderSide( - color: Colors.grey[300], + color: Colors.grey[300]!, width: 2, ), ), @@ -62,7 +63,6 @@ class _CustomEditableTextState extends State { child: Icon( DoctorApp.edit_1, size: 20, - ), onTap: () { setState(() { @@ -74,17 +74,15 @@ class _CustomEditableTextState extends State { ), ), ), - if(widget.isEditable) + if (widget.isEditable) AppTextFieldCustom( hintText: widget.hint, //TranslationBase.of(context).addoperationReports, controller: widget.controller, - validationError: widget.controller - .text.isEmpty && - widget.isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: + widget.controller.text.isEmpty && widget.isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, maxLines: 1, minLines: 1, hasBorder: true, @@ -92,4 +90,4 @@ class _CustomEditableTextState extends State { ], ); } -} \ No newline at end of file +} From 81ae0b04d3b535b745778bdac658212e217e221b Mon Sep 17 00:00:00 2001 From: Elham Ali Date: Mon, 22 Nov 2021 13:06:16 +0000 Subject: [PATCH 139/199] Revert "Merge branch 'hussam_flutter_2' into 'development'" This reverts merge request !893 --- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- ios/Runner.xcodeproj/project.pbxproj | 69 - .../contents.xcworkspacedata | 2 +- lib/UpdatePage.dart | 36 +- lib/client/base_app_client.dart | 129 +- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 2 +- lib/config/size_config.dart | 34 +- .../insurance_approval_request_model.dart | 26 +- .../CheckActivationCodeModel.dart | 96 +- .../CheckPatientForRegistrationModel.dart | 64 +- .../GetPatientInfoRequestModel.dart | 44 +- .../GetPatientInfoResponseModel.dart | 272 ++-- .../PatientRegistrationModel.dart | 152 +- ...PNotificationTypeForRegistrationModel.dart | 92 +- .../model/Prescriptions/Prescriptions.dart | 85 +- .../get_medication_for_inpatient_model.dart | 60 +- ...edication_for_inpatient_request_model.dart | 24 +- .../in_patient_prescription_model.dart | 2 +- .../Prescriptions/perscription_pharmacy.dart | 46 +- .../post_prescrition_req_model.dart | 42 +- .../prescription_in_patient.dart | 68 +- .../Prescriptions/prescription_model.dart | 8 +- .../Prescriptions/prescription_report.dart | 84 +- .../prescription_report_enh.dart | 53 +- .../Prescriptions/prescription_req_model.dart | 2 +- .../Prescriptions/prescriptions_order.dart | 92 +- ...t_get_list_pharmacy_for_prescriptions.dart | 48 +- .../request_prescription_report.dart | 76 +- .../request_prescription_report_enh.dart | 75 +- .../admissionRequest/admission-request.dart | 105 +- .../model/admissionRequest/clinic-model.dart | 21 +- .../model/admissionRequest/ward-model.dart | 8 +- .../model/auth/activation_Code_req_model.dart | 16 +- ...on_code_for_verification_screen_model.dart | 29 +- ...on_code_for_doctor_app_response_model.dart | 78 +- .../check_activation_code_request_model.dart | 40 +- lib/core/model/auth/imei_details.dart | 59 +- lib/core/model/auth/insert_imei_model.dart | 66 +- .../new_login_information_response_model.dart | 46 +- ...on_code_for_doctor_app_response_model.dart | 8 +- .../model/calculate_box_request_model.dart | 10 +- .../model/diabetic_chart/DiabeticType.dart | 6 +- .../GetDiabeticChartValuesRequestModel.dart | 30 +- .../GetDiabeticChartValuesResponseModel.dart | 22 +- .../GetDiagnosisForInPatientRequestModel.dart | 18 +- ...GetDiagnosisForInPatientResponseModel.dart | 39 +- .../get_hospitals_request_model.dart | 18 +- .../get_hospitals_response_model.dart | 6 +- lib/core/model/hospitals_model.dart | 32 +- .../model/insurance/insurance_approval.dart | 66 +- .../insurance_approval_in_patient_model.dart | 118 +- lib/core/model/labs/LabOrderResult.dart | 30 +- lib/core/model/labs/LabResultHistory.dart | 96 +- .../labs/all_special_lab_result_model.dart | 54 +- .../labs/all_special_lab_result_request.dart | 28 +- lib/core/model/labs/lab_result.dart | 47 +- lib/core/model/labs/patient_lab_orders.dart | 72 +- .../labs/patient_lab_special_result.dart | 10 +- .../labs/request_patient_lab_orders.dart | 26 +- .../request_patient_lab_special_result.dart | 36 +- .../labs/request_send_lab_report_email.dart | 98 +- .../live_care/AlternativeServicesList.dart | 8 +- ...dingPatientERForDoctorAppRequestModel.dart | 6 +- ..._patient_to_doctor_list_request_model.dart | 13 +- .../live_care_login_reguest_model.dart | 10 +- .../medical_report/medical_file_model.dart | 258 ++-- .../medical_file_request_model.dart | 6 +- lib/core/model/note/CreateNoteModel.dart | 38 +- .../GetNursingProgressNoteRequestModel.dart | 16 +- .../GetNursingProgressNoteResposeModel.dart | 10 +- lib/core/model/note/note_model.dart | 40 +- lib/core/model/note/update_note_model.dart | 66 +- .../patient_muse/PatientMuseResultsModel.dart | 24 +- .../PatientSearchRequestModel.dart | 30 +- lib/core/model/procedure/ControlsModel.dart | 4 +- .../Procedure_template_request_model.dart | 56 +- .../model/procedure/categories_procedure.dart | 50 +- .../get_ordered_procedure_model.dart | 72 +- .../get_ordered_procedure_request_model.dart | 9 +- .../model/procedure/get_procedure_model.dart | 44 +- .../procedure/get_procedure_req_model.dart | 12 +- .../procedure/post_procedure_req_model.dart | 28 +- .../procedure_category_list_model.dart | 14 +- .../procedure/procedure_templateModel.dart | 18 +- .../procedure_template_details_model.dart | 58 +- ...cedure_template_details_request_model.dart | 58 +- .../procedure/procedure_valadate_model.dart | 14 +- .../procedure_valadate_request_model.dart | 10 +- .../update_procedure_request_model.dart | 28 +- lib/core/model/radiology/final_radiology.dart | 24 +- .../request_patient_rad_orders_details.dart | 46 +- .../request_send_rad_report_email.dart | 58 +- .../referral/DischargeReferralPatient.dart | 90 +- .../referral/MyReferralPatientModel.dart | 184 ++- .../MyReferralPatientRequestModel.dart | 46 +- lib/core/model/referral/ReferralRequest.dart | 96 +- .../add_referred_remarks_request.dart | 30 +- .../get_medication_response_model.dart | 18 +- .../search_drug/item_by_medicine_model.dart | 42 +- .../item_by_medicine_request_model.dart | 4 +- .../model/search_drug/search_drug_model.dart | 10 +- .../search_drug_request_model.dart | 2 +- .../sick_leave_doctor_request_model.dart | 16 +- .../sick_leave/sick_leave_patient_model.dart | 18 +- .../sick_leave_patient_request_model.dart | 28 +- lib/core/service/AnalyticsService.dart | 2 +- lib/core/service/NavigationService.dart | 14 +- .../service/PatientRegistrationService.dart | 15 +- lib/core/service/VideoCallService.dart | 34 +- lib/core/service/authentication_service.dart | 120 +- lib/core/service/base/base_service.dart | 60 +- lib/core/service/home/dasboard_service.dart | 2 +- lib/core/service/home/scan_qr_service.dart | 8 +- .../service/hospitals/hospitals_service.dart | 3 +- .../patient/DischargedPatientService.dart | 14 +- .../patient/LiveCarePatientServices.dart | 26 +- .../patient/MyReferralPatientService.dart | 28 +- .../service/patient/PatientMuseService.dart | 7 +- lib/core/service/patient/ReferralService.dart | 28 +- .../patient-doctor-referral-service.dart | 51 +- .../patient/patientInPatientService.dart | 11 +- lib/core/service/patient/patient_service.dart | 62 +- .../profile/discharge_summary_servive.dart | 7 +- .../profile/operation_report_servive.dart | 19 +- .../patient-admission-request-service.dart | 1 - .../insurance/InsuranceCardService.dart | 36 +- .../lab_order/labs_service.dart | 44 +- .../PatientMedicalReportService.dart | 7 +- .../medical_report/medical_file_service.dart | 10 +- .../prescription/prescription_service.dart | 88 +- .../prescription/prescriptions_service.dart | 44 +- .../procedure/procedure_service.dart | 27 +- .../radiology/radiology_service.dart | 6 +- .../sick_leave/sickleave_service.dart | 8 +- .../soap/SOAP_service.dart | 110 +- .../ucaf/patient-ucaf-service.dart | 42 +- .../patient-vital-signs-service.dart | 48 +- lib/core/service/pending_order_service.dart | 20 +- .../viewModel/DischargedPatientViewModel.dart | 16 +- lib/core/viewModel/InsuranceViewModel.dart | 8 +- .../viewModel/LiveCarePatientViewModel.dart | 56 +- .../PatientMedicalReportViewModel.dart | 18 +- lib/core/viewModel/PatientMuseViewModel.dart | 12 +- .../PatientRegistrationViewModel.dart | 18 +- .../viewModel/PatientSearchViewModel.dart | 79 +- lib/core/viewModel/SOAP_view_model.dart | 217 +-- .../viewModel/authentication_view_model.dart | 286 ++-- lib/core/viewModel/base_view_model.dart | 24 +- lib/core/viewModel/dashboard_view_model.dart | 45 +- .../viewModel/doctor_replay_view_model.dart | 8 +- lib/core/viewModel/hospitals_view_model.dart | 12 +- lib/core/viewModel/labs_view_model.dart | 54 +- .../viewModel/leave_rechdule_response.dart | 28 +- lib/core/viewModel/livecare_view_model.dart | 2 +- .../viewModel/medical_file_view_model.dart | 4 +- lib/core/viewModel/medicine_view_model.dart | 43 +- .../patient-admission-request-viewmodel.dart | 22 +- .../viewModel/patient-referral-viewmodel.dart | 139 +- .../viewModel/patient-ucaf-viewmodel.dart | 77 +- .../patient-vital-sign-viewmodel.dart | 60 +- lib/core/viewModel/patient_view_model.dart | 64 +- .../viewModel/pednding_orders_view_model.dart | 8 +- .../viewModel/prescription_view_model.dart | 48 +- .../viewModel/prescriptions_view_model.dart | 24 +- lib/core/viewModel/procedure_View_model.dart | 96 +- .../profile/discharge_summary_view_model.dart | 33 +- .../profile/operation_report_view_model.dart | 6 +- lib/core/viewModel/project_view_model.dart | 21 +- lib/core/viewModel/radiology_view_model.dart | 62 +- lib/core/viewModel/referral_view_model.dart | 13 +- lib/core/viewModel/scan_qr_view_model.dart | 2 +- lib/core/viewModel/schedule_view_model.dart | 5 +- lib/core/viewModel/sick_leave_view_model.dart | 29 +- lib/icons_app/doctor_app_icons.dart | 7 +- lib/landing_page.dart | 12 +- lib/models/SOAP/Allergy_model.dart | 52 +- .../GetChiefComplaintReqModel.dart | 15 +- .../GetChiefComplaintResModel.dart | 52 +- lib/models/SOAP/GeneralGetReqForSOAP.dart | 6 +- lib/models/SOAP/GetAllergiesResModel.dart | 49 +- lib/models/SOAP/GetAssessmentReqModel.dart | 26 +- lib/models/SOAP/GetAssessmentResModel.dart | 58 +- .../SOAP/GetGetProgressNoteReqModel.dart | 27 +- .../SOAP/GetGetProgressNoteResModel.dart | 44 +- lib/models/SOAP/GetHistoryReqModel.dart | 15 +- lib/models/SOAP/GetHistoryResModel.dart | 26 +- .../SOAP/GetPhysicalExamListResModel.dart | 74 +- lib/models/SOAP/GetPhysicalExamReqModel.dart | 12 +- lib/models/SOAP/PatchAssessmentReqModel.dart | 34 +- lib/models/SOAP/PostEpisodeReqModel.dart | 14 +- .../SOAP/get_Allergies_request_model.dart | 17 +- .../GetEpisodeForInpatientReqModel.dart | 6 +- .../PostEpisodeForInpatientRequestModel.dart | 6 +- lib/models/SOAP/master_key_model.dart | 46 +- lib/models/SOAP/order-procedure.dart | 98 +- .../SOAP/post_allergy_request_model.dart | 65 +- .../SOAP/post_assessment_request_model.dart | 38 +- .../post_chief_complaint_request_model.dart | 20 +- .../SOAP/post_histories_request_model.dart | 35 +- .../post_physical_exam_request_model.dart | 59 +- .../post_progress_note_request_model.dart | 15 +- .../selected_items/my_selected_allergy.dart | 17 +- .../selected_items/my_selected_assement.dart | 32 +- .../selected_items/my_selected_history.dart | 4 +- .../admission_orders_model.dart | 22 +- .../admission_orders_request_model.dart | 32 +- lib/models/countriesModel.dart | 8 +- lib/models/dashboard/dashboard_model.dart | 27 +- ...cial_clinical_care_List_Respose_Model.dart | 10 +- ...nical_care_mapping_List_Respose_Model.dart | 12 +- .../GetDischargeSummaryReqModel.dart | 13 +- .../GetDischargeSummaryResModel.dart | 70 +- lib/models/doctor/clinic_model.dart | 20 +- lib/models/doctor/doctor_profile_model.dart | 96 +- ...list_doctor_working_hours_table_model.dart | 15 +- .../list_gt_my_patients_question_model.dart | 121 +- lib/models/doctor/profile_req_Model.dart | 28 +- .../request_create_doctor_response.dart | 34 +- .../doctor/replay/request_doctor_reply.dart | 35 +- .../request_add_referred_doctor_remarks.dart | 63 +- lib/models/doctor/request_schedule.dart | 30 +- .../statstics_for_certain_doctor_request.dart | 19 +- lib/models/doctor/user_model.dart | 24 +- .../verify_referral_doctor_remarks.dart | 107 +- lib/models/livecare/end_call_req.dart | 13 +- lib/models/livecare/get_panding_req_list.dart | 25 +- lib/models/livecare/get_pending_res_list.dart | 66 +- lib/models/livecare/session_status_model.dart | 14 +- lib/models/livecare/start_call_req.dart | 22 +- lib/models/livecare/start_call_res.dart | 32 +- lib/models/livecare/transfer_to_admin.dart | 20 +- ...update_operation_report_request_model.dart | 94 +- .../get_operation_details_request_modle.dart | 54 +- .../get_operation_details_response_modle.dart | 114 +- .../get_reservations_request_model.dart | 26 +- .../get_reservations_response_model.dart | 60 +- .../MedicalReport/MedicalReportTemplate.dart | 52 +- .../MedicalReport/MeidcalReportModel.dart | 106 +- lib/models/patient/PatientArrivalEntity.dart | 78 +- .../get_clinic_by_project_id_request.dart | 27 +- .../get_doctor_by_clinic_id_request.dart | 57 +- ...t_list_stp_referral_frequency_request.dart | 25 +- .../patient/get_pending_patient_er_model.dart | 226 ++- .../patient/insurance_aprovals_request.dart | 37 +- .../lab_orders/lab_orders_req_model.dart | 45 +- .../lab_orders/lab_orders_res_model.dart | 50 +- lib/models/patient/lab_result/lab_result.dart | 122 +- .../lab_result/lab_result_req_model.dart | 56 +- .../patient/my_referral/PendingReferral.dart | 82 +- .../patient/my_referral/clinic-doctor.dart | 173 +-- .../my_referral_patient_model.dart | 200 +-- .../my_referred_patient_model.dart | 260 ++-- lib/models/patient/orders_request.dart | 39 +- lib/models/patient/patiant_info_model.dart | 177 +-- ...et_patient_arrival_list_request_model.dart | 17 +- lib/models/patient/patient_model.dart | 134 +- .../prescription/prescription_report.dart | 114 +- .../prescription_report_for_in_patient.dart | 168 +- .../prescription/prescription_req_model.dart | 71 + .../prescription/prescription_res_model.dart | 72 +- .../request_prescription_report.dart | 54 +- .../patient_profile_app_bar_model.dart | 91 -- lib/models/patient/progress_note_request.dart | 41 +- .../radiology/radiology_req_model.dart | 30 +- .../radiology/radiology_res_model.dart | 36 +- ...st_prescription_report_for_in_patient.dart | 56 +- .../patient/refer_to_doctor_request.dart | 68 +- .../request_my_referral_patient_model.dart | 60 +- .../patient/topten_users_res_model.dart | 15 +- .../vital_sign/patient-vital-sign-data.dart | 113 +- .../patient-vital-sign-history.dart | 7 +- .../vital_sign/vital_sign_req_model.dart | 49 +- .../vital_sign/vital_sign_res_model.dart | 20 +- .../pending_order_request_model.dart | 32 +- .../pending_orders/pending_orders_model.dart | 2 +- .../pharmacies_List_request_model.dart | 25 +- .../pharmacies_items_request_model.dart | 22 +- .../sickleave/add_sickleave_request.dart | 17 +- .../sickleave/extend_sick_leave_request.dart | 11 +- .../sickleave/get_all_sickleave_response.dart | 18 +- .../sick_leave_statisitics_model.dart | 10 +- lib/root_page.dart | 14 +- lib/screens/auth/login_screen.dart | 346 +++-- .../auth/verification_methods_screen.dart | 527 ++++--- lib/screens/base/base_view.dart | 12 +- .../doctor_replay/all_doctor_questions.dart | 8 +- .../doctor_replay/doctor_repaly_chat.dart | 18 +- .../doctor_replay/doctor_reply_screen.dart | 8 +- .../doctor_replay/doctor_reply_widget.dart | 51 +- .../not_replaied_doctor_questions.dart | 8 +- .../doctor/patient_arrival_screen.dart | 26 +- .../home/dashboard_referral_patient.dart | 158 -- .../home/dashboard_slider-item-widget.dart | 27 +- lib/screens/home/dashboard_swipe_widget.dart | 193 ++- lib/screens/home/home_page_card.dart | 25 +- lib/screens/home/home_patient_card.dart | 34 +- lib/screens/home/home_screen.dart | 88 +- lib/screens/home/home_screen_header.dart | 219 --- lib/screens/home/label.dart | 45 - lib/screens/live_care/end_call_screen.dart | 115 +- .../live-care_transfer_to_admin.dart | 63 +- .../live_care/live_care_patient_screen.dart | 22 +- lib/screens/live_care/panding_list.dart | 104 +- lib/screens/live_care/video_call.dart | 29 +- .../medical-file/health_summary_page.dart | 100 +- .../medical-file/medical_file_details.dart | 696 ++++++--- .../medicine/medicine_search_screen.dart | 57 +- .../medicine/pharmacies_list_screen.dart | 179 ++- .../add_patient_sick_leave_screen.dart | 16 +- .../patient_sick_leave_screen.dart | 12 +- .../patients/DischargedPatientPage.dart | 12 +- lib/screens/patients/ECGPage.dart | 186 +-- .../patients/In_patient/InPatientHeader.dart | 4 +- lib/screens/patients/In_patient/NoData.dart | 4 +- .../In_patient/in_patient_list_page.dart | 14 +- .../In_patient/in_patient_screen.dart | 16 +- .../In_patient/list_of_all_in_patient.dart | 14 +- .../In_patient/list_of_my_inpatient.dart | 11 +- .../ReferralDischargedPatientDetails.dart | 141 +- .../ReferralDischargedPatientPage.dart | 133 +- .../insurance_approval_screen_patient.dart | 16 +- .../patients/insurance_approvals_details.dart | 1237 ++++++++------- .../out_patient/filter_date_page.dart | 87 +- .../out_patient/out_patient_screen.dart | 154 +- ...t_patient_prescription_details_screen.dart | 40 +- .../patient_search/patient_search_header.dart | 6 +- .../patient_search_result_screen.dart | 81 +- .../patient_search/patient_search_screen.dart | 38 +- .../patients/patient_search/time_bar.dart | 110 ++ .../profile/UCAF/UCAF-detail-screen.dart | 62 +- .../profile/UCAF/UCAF-input-screen.dart | 87 +- .../profile/UCAF/page-stepper-widget.dart | 46 +- .../profile/UCAF/ucaf_pager_screen.dart | 4 +- .../admission_orders_screen.dart | 27 +- .../admission-request-first-screen.dart | 28 +- .../admission-request-third-screen.dart | 17 +- .../admission-request_second-screen.dart | 47 +- .../diabetic_chart/diabetic_chart.dart | 173 ++- ...iabetic_details_blood_pressurewideget.dart | 14 +- .../line_chart_for_diabetic.dart | 14 +- .../profile/diagnosis/diagnosis_screen.dart | 42 +- .../all_discharge_summary.dart | 7 +- .../discharge_Summary_widget.dart | 12 +- .../discharge_summary/discharge_summary.dart | 12 +- .../pending_discharge_summary.dart | 7 +- .../profile/lab_result/FlowChartPage.dart | 60 +- .../lab_result/LabResultHistoryPage.dart | 2 +- .../profile/lab_result/LabResultWidget.dart | 70 +- .../Lab_Result_details_wideget.dart | 12 +- .../Lab_Result_history_details_wideget.dart | 11 +- .../profile/lab_result/LineChartCurved.dart | 58 +- .../lab_result/LineChartCurvedLabHistory.dart | 8 +- .../all_lab_special_result_page.dart | 46 +- .../lab_result_chart_and_detials.dart | 27 +- .../lab_result_history_chart_and_detials.dart | 6 +- .../lab_result/lab_result_secreen.dart | 11 +- .../lab_result/laboratory_result_page.dart | 38 +- .../lab_result/laboratory_result_widget.dart | 69 +- .../profile/lab_result/labs_home_page.dart | 78 +- .../special_lab_result_details_page.dart | 2 +- .../AddVerifyMedicalReport.dart | 83 +- .../MedicalReportDetailPage.dart | 54 +- .../medical_report/MedicalReportPage.dart | 232 +-- .../notes/note/progress_note_screen.dart | 544 ++++--- .../profile/notes/note/update_note.dart | 145 +- .../nursing_note/nursing_note_screen.dart | 25 +- .../operation_report/operation_report.dart | 16 +- .../update_operation_report.dart | 24 +- .../pending_orders/pending_orders_screen.dart | 124 +- ...n_patient_prescription_details_screen.dart | 80 +- ...out_patient_prescription_details_item.dart | 2 +- .../PatientProfileCardModel.dart | 29 +- .../patient_profile_screen.dart | 79 +- .../profile_gird_for_InPatient.dart | 108 +- .../profile_gird_for_other.dart | 42 +- .../profile_gird_for_search.dart | 33 +- .../radiology/radiology_details_page.dart | 17 +- .../radiology/radiology_home_page.dart | 38 +- .../radiology/radiology_report_screen.dart | 8 +- .../referral/AddReplayOnReferralPatient.dart | 65 +- .../ReplySummeryOnReferralPatient.dart | 24 +- .../referral/my-referral-detail-screen.dart | 4 +- .../my-referral-inpatient-screen.dart | 111 +- .../referral/my-referral-patient-screen.dart | 56 +- .../referral/patient_referral_screen.dart | 43 +- .../refer-patient-screen-in-patient.dart | 48 +- .../referral/refer-patient-screen.dart | 49 +- .../referral_patient_detail_in-paint.dart | 135 +- .../referral/referred-patient-screen.dart | 107 +- .../referred_patient_detail_in-paint.dart | 321 ++-- .../assessment/add_assessment_details.dart | 509 ++++--- .../assessment/update_assessment_page.dart | 56 +- .../objective/add_examination_page.dart | 28 +- .../objective/add_examination_widget.dart | 56 +- .../objective/examination_item_card.dart | 19 +- .../examinations_list_search_widget.dart | 31 +- .../objective/update_objective_page.dart | 18 +- .../soap_update/plan/update_plan_page.dart | 39 +- .../shared_soap_widgets/SOAP_open_items.dart | 51 +- .../shared_soap_widgets/SOAP_step_header.dart | 12 +- .../bottom_sheet_dialog_button.dart | 2 +- .../bottom_sheet_title.dart | 72 +- .../expandable_SOAP_widget.dart | 37 +- .../shared_soap_widgets/remove_button.dart | 2 +- .../steper/steps_widget.dart | 2 +- .../subjective/allergies/add_allergies.dart | 41 +- .../subjective/allergies/allergies_item.dart | 2 +- ..._key_checkbox_search_allergies_widget.dart | 8 +- .../allergies/update_allergies_widget.dart | 28 +- .../update_Chief_complaints.dart | 73 +- .../history/add_history_dialog.dart | 28 +- .../subjective/history/priority_bar.dart | 20 +- .../history/update_history_widget.dart | 26 +- .../subjective/medication/add_medication.dart | 365 +++-- .../medication/update_medication_widget.dart | 19 +- .../subjective/update_subjective_page.dart | 140 +- .../soap_update/update_soap_index.dart | 16 +- .../profile/vital_sign/LineChartCurved.dart | 21 +- .../LineChartCurvedBloodPressure.dart | 53 +- ...al_sign_details_blood_pressurewideget.dart | 22 +- .../vital_sign/vital_sign_details_screen.dart | 44 +- .../vital_sign_details_wideget.dart | 9 +- .../profile/vital_sign/vital_sign_item.dart | 10 +- .../vital_sign_item_details_screen.dart | 53 +- .../vital_sing_chart_and_detials.dart | 106 +- .../vital_sing_chart_blood_pressure.dart | 35 +- .../register_patient/CustomEditableText.dart | 24 +- .../RegisterConfirmationPatientPage.dart | 2 +- .../register_patient/RegisterPatientPage.dart | 2 +- .../RegisterSearchPatientPage.dart | 4 +- .../VerifyActivationCodePage.dart | 2 +- .../register_patient/VerifyMethodPage.dart | 6 +- .../prescription/add_prescription_form.dart | 160 +- lib/screens/prescription/drugtodrug.dart | 67 +- .../prescription_checkout_screen.dart | 154 +- .../prescription_details_page.dart | 33 +- .../prescription_item_in_patient_page.dart | 30 +- .../prescription/prescription_items_page.dart | 325 ++-- .../prescription/prescription_text_filed.dart | 24 +- .../prescription/prescriptions_page.dart | 30 +- .../update_prescription_form.dart | 656 +++++--- .../procedures/ExpansionProcedure.dart | 36 +- lib/screens/procedures/ProcedureCard.dart | 24 +- lib/screens/procedures/ProcedureType.dart | 32 +- .../procedures/add-favourite-procedure.dart | 103 +- .../procedures/add-procedure-page.dart | 87 +- .../base_add_procedure_tab_page.dart | 108 +- .../entity_list_checkbox_search_widget.dart | 117 +- .../procedures/entity_list_fav_procedure.dart | 54 +- .../procedures/procedure_checkout_screen.dart | 20 +- lib/screens/procedures/procedure_screen.dart | 40 +- lib/screens/procedures/update-procedure.dart | 119 +- lib/screens/qr_reader/QR_reader_screen.dart | 3 +- .../add-rescheduleleave.dart | 256 ++-- .../reschedule-leaves/reschedule_leave.dart | 1164 +++++++------- lib/util/NotificationPermissionUtils.dart | 2 +- lib/util/VideoChannel.dart | 45 +- lib/util/date-utils.dart | 4 +- lib/util/dr_app_shared_pref.dart | 10 +- lib/util/extenstions.dart | 7 +- lib/util/helpers.dart | 69 +- lib/util/translations_delegate_base.dart | 1345 +++++++++-------- lib/widgets/auth/method_type_card.dart | 43 +- lib/widgets/auth/sms-popup.dart | 313 ++-- .../auth/verification_methods_list.dart | 53 +- lib/widgets/charts/app_bar_chart.dart | 43 + lib/widgets/charts/app_line_chart.dart | 10 +- lib/widgets/charts/app_time_series_chart.dart | 11 +- lib/widgets/dashboard/activity_button.dart | 44 + lib/widgets/dashboard/activity_card.dart | 50 - .../dashboard_item_texts_widget.dart | 66 + lib/widgets/dashboard/guage_chart.dart | 12 +- lib/widgets/dashboard/out_patient_stack.dart | 60 +- lib/widgets/dashboard/row_count.dart | 14 +- .../dashboard/swiper_rounded_pagination.dart | 10 +- .../data_display/list/custom_Item.dart | 24 +- .../data_display/list/flexible_container.dart | 10 +- lib/widgets/dialog/AskPermissionDialog.dart | 2 +- lib/widgets/doctor/lab_result_widget.dart | 24 +- .../doctor/my_referral_patient_widget.dart | 63 +- lib/widgets/doctor/my_schedule_widget.dart | 47 +- .../medicine/medicine_item_widget.dart | 10 +- .../patients/clinic_list_dropdwon.dart | 99 ++ lib/widgets/patients/dynamic_elements.dart | 163 ++ .../patient-referral-item-widget.dart | 88 +- .../patients/patient_card/PatientCard.dart | 214 +-- .../patients/patient_card/ShowTimer.dart | 4 +- .../profile/PatientProfileButton.dart | 30 +- .../profile/Profile_general_info_Widget.dart | 45 + .../profile/add-order/addNewOrder.dart | 9 +- .../patients/profile/large_avatar.dart | 34 +- .../profile/patient-profile-app-bar.dart | 235 ++- ...ent-profile-header-new-design-app-bar.dart | 38 +- .../prescription_in_patinets_widget.dart | 39 +- .../prescription_out_patinets_widget.dart | 38 +- .../profile/profile-welcome-widget.dart | 12 +- .../profile_general_info_content_widget.dart | 45 + .../profile/profile_medical_info_widget.dart | 4 +- ...rofile_medical_info_widget_in_patient.dart | 176 +++ .../profile_medical_info_widget_search.dart | 218 ++- .../patients/vital_sign_details_wideget.dart | 14 +- lib/widgets/shared/StarRating.dart | 17 +- .../shared/{text_fields => }/TextFields.dart | 281 ++-- lib/widgets/shared/app_drawer_widget.dart | 95 +- .../shared/app_expandable_notifier.dart | 58 + .../shared/app_expandable_notifier_new.dart | 127 ++ lib/widgets/shared/app_loader_widget.dart | 16 +- lib/widgets/shared/app_scaffold_widget.dart | 64 +- lib/widgets/shared/app_texts_widget.dart | 112 +- lib/widgets/shared/bottom_nav_bar.dart | 2 +- .../shared/bottom_navigation_item.dart | 59 +- .../shared/buttons/app_buttons_widget.dart | 77 +- .../shared/buttons/button_bottom_sheet.dart | 39 +- .../shared/buttons/secondary_button.dart | 82 +- .../shared/card_with_bgNew_widget.dart | 28 +- lib/widgets/shared/card_with_bg_widget.dart | 25 +- lib/widgets/shared/charts/app_line_chart.dart | 41 + .../shared/charts/app_time_series_chart.dart | 121 ++ lib/widgets/shared/custom_shape_clipper.dart | 26 + .../shared/dialogs/ShowImageDialog.dart | 10 +- .../shared/dialogs/dailog-list-select.dart | 88 +- .../shared/dialogs/master_key_dailog.dart | 32 +- .../dialogs/search-drugs-dailog-list.dart | 92 ++ .../shared/divider_with_spaces_around.dart | 5 +- lib/widgets/shared/doctor_card.dart | 150 +- lib/widgets/shared/doctor_card_insurance.dart | 30 +- .../dr_app_circular_progress_Indeicator.dart | 5 +- lib/widgets/shared/drawer_item_widget.dart | 35 +- .../shared/errors/dr_app_embedded_error.dart | 27 +- lib/widgets/shared/errors/error_message.dart | 17 +- .../shared/expandable-widget-header-body.dart | 21 +- .../shared/expandable_item_widget.dart | 91 ++ .../shared/in_patient_doctor_card.dart | 194 --- .../shared/loader/gif_loader_container.dart | 29 +- .../master_key_checkbox_search_widget.dart | 54 +- lib/widgets/shared/network_base_view.dart | 12 +- lib/widgets/shared/profile_image_widget.dart | 61 +- .../shared/rounded_container_widget.dart | 69 +- lib/widgets/shared/speech-text-popup.dart | 17 +- .../text_fields/app-textfield-custom.dart | 98 +- .../app_text_field_custom_serach.dart | 28 +- .../text_fields/app_text_form_field.dart | 43 +- .../text_fields/auto_complete_text_field.dart | 13 +- .../text_fields/country_textfield_custom.dart | 30 +- .../shared/text_fields/html_rich_editor.dart | 109 +- .../shared/text_fields/new_text_Field.dart | 213 ++- .../shared/text_fields/text_field_error.dart | 4 +- .../shared/text_fields/text_fields_utils.dart | 21 +- lib/widgets/shared/user-guid/CusomRow.dart | 16 +- .../app_anchored_overlay_widget.dart | 183 +++ .../shared/user-guid/app_get_position.dart | 75 + .../shared/user-guid/app_shape_painter.dart | 42 + .../shared/user-guid/app_showcase.dart | 349 +++++ .../shared/user-guid/app_showcase_widget.dart | 97 ++ .../shared/user-guid/app_tool_tip_widget.dart | 290 ++++ .../user-guid/custom_validation_error.dart | 21 +- .../user-guid/in_patient_doctor_card.dart | 196 +++ lib/widgets/transitions/fade_page.dart | 49 +- lib/widgets/transitions/slide_up_page.dart | 4 +- pubspec.lock | 519 +++---- pubspec.yaml | 70 +- speech_to_text/example/pubspec.lock | 42 +- speech_to_text/pubspec.lock | 174 ++- speech_to_text/pubspec.yaml | 10 +- 566 files changed, 20439 insertions(+), 16400 deletions(-) create mode 100644 lib/models/patient/prescription/prescription_req_model.dart delete mode 100644 lib/models/patient/profile/patient_profile_app_bar_model.dart delete mode 100644 lib/screens/home/dashboard_referral_patient.dart delete mode 100644 lib/screens/home/home_screen_header.dart delete mode 100644 lib/screens/home/label.dart create mode 100644 lib/screens/patients/patient_search/time_bar.dart create mode 100644 lib/widgets/charts/app_bar_chart.dart create mode 100644 lib/widgets/dashboard/activity_button.dart delete mode 100644 lib/widgets/dashboard/activity_card.dart create mode 100644 lib/widgets/dashboard/dashboard_item_texts_widget.dart create mode 100644 lib/widgets/patients/clinic_list_dropdwon.dart create mode 100644 lib/widgets/patients/dynamic_elements.dart create mode 100644 lib/widgets/patients/profile/Profile_general_info_Widget.dart create mode 100644 lib/widgets/patients/profile/profile_general_info_content_widget.dart create mode 100644 lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart rename lib/widgets/shared/{text_fields => }/TextFields.dart (52%) create mode 100644 lib/widgets/shared/app_expandable_notifier.dart create mode 100644 lib/widgets/shared/app_expandable_notifier_new.dart create mode 100644 lib/widgets/shared/charts/app_line_chart.dart create mode 100644 lib/widgets/shared/charts/app_time_series_chart.dart create mode 100644 lib/widgets/shared/custom_shape_clipper.dart create mode 100644 lib/widgets/shared/dialogs/search-drugs-dailog-list.dart create mode 100644 lib/widgets/shared/expandable_item_widget.dart delete mode 100644 lib/widgets/shared/in_patient_doctor_card.dart create mode 100644 lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart create mode 100644 lib/widgets/shared/user-guid/app_get_position.dart create mode 100644 lib/widgets/shared/user-guid/app_shape_painter.dart create mode 100644 lib/widgets/shared/user-guid/app_showcase.dart create mode 100644 lib/widgets/shared/user-guid/app_showcase_widget.dart create mode 100644 lib/widgets/shared/user-guid/app_tool_tip_widget.dart create mode 100644 lib/widgets/shared/user-guid/in_patient_doctor_card.dart diff --git a/android/build.gradle b/android/build.gradle index 51c49a99..bf0f679d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.3' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bfae97b2..296b146b 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Jun 13 08:51:58 EEST 2021 +#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c31cbe8e..66be39bf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -260,78 +260,9 @@ files = ( ); inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/DKImagePickerController/DKImagePickerController.framework", - "${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", - "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", - "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", - "${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework", - "${BUILT_PRODUCTS_DIR}/OrderedSet/OrderedSet.framework", - "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", - "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", - "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", - "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", - "${BUILT_PRODUCTS_DIR}/Try/Try.framework", - "${BUILT_PRODUCTS_DIR}/barcode_scan_fix/barcode_scan_fix.framework", - "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", - "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", - "${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework", - "${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework", - "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", - "${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework", - "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", - "${BUILT_PRODUCTS_DIR}/imei_plugin/imei_plugin.framework", - "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", - "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", - "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", - "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", - "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", - "${BUILT_PRODUCTS_DIR}/video_player/video_player.framework", - "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", - "${BUILT_PRODUCTS_DIR}/webview_flutter/webview_flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKImagePickerController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKPhotoGallery.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OrderedSet.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Try.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan_fix.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/imei_plugin.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 919434a6..1d526a16 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "group:Runner.xcodeproj"> diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index b3202c52..16284ed1 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -10,11 +10,12 @@ import 'package:url_launcher/url_launcher.dart'; import 'widgets/shared/buttons/secondary_button.dart'; class UpdatePage extends StatelessWidget { - final String? message; - final String? androidLink; - final String? iosLink; + final String message; + final String androidLink; + final String iosLink; - const UpdatePage({Key? key, this.message, this.androidLink, this.iosLink}) : super(key: key); + const UpdatePage({Key key, this.message, this.androidLink, this.iosLink}) + : super(key: key); @override Widget build(BuildContext context) { @@ -29,27 +30,18 @@ class UpdatePage extends StatelessWidget { children: [ Image.asset( 'assets/images/update_rocket_image.png', - width: double.maxFinite, - fit: BoxFit.fill, + width: double.maxFinite,fit: BoxFit.fill, ), Image.asset('assets/images/HMG_logo.png'), - SizedBox( - height: 8, - ), + SizedBox(height: 8,), AppText( - TranslationBase.of(context).updateTheApp!.toUpperCase(), - fontSize: 17, + TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, fontWeight: FontWeight.w600, ), - SizedBox( - height: 12, - ), + SizedBox(height: 12,), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - message ?? "Update the app", - fontSize: 12, - ), + child: AppText(message??"Update the app",fontSize: 12,), ) ], ), @@ -60,14 +52,14 @@ class UpdatePage extends StatelessWidget { // padding: const EdgeInsets.all(8.0), margin: EdgeInsets.all(15), child: SecondaryButton( - color: Colors.red[800]!, + color: Colors.red[800], onTap: () { if (Platform.isIOS) - launch(iosLink!); + launch(iosLink); else - launch(androidLink!); + launch(androidLink); }, - label: TranslationBase.of(context).updateNow!.toUpperCase(), + label: TranslationBase.of(context).updateNow.toUpperCase(), ), ), ), diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 1414c78f..af4e6e97 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -22,9 +22,9 @@ Helpers helpers = new Helpers(); class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, - {required Map body, - required Function(dynamic response, int statusCode) onSuccess, - required Function(String error, int statusCode) onFailure, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isLiveCare = false, bool isFallLanguage = false}) async { @@ -36,28 +36,30 @@ class BaseAppClient { bool callLog = true; try { - Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - DoctorProfileModel? doctorProfile; if (profile != null) { - doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile.doctorID; + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + if (body['DoctorID'] == null) + body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; + if (body['EditedBy'] == null) + body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile.projectID; + body['ProjectID'] = doctorProfile?.projectID; } - if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID; - if (body['DoctorID'] == '') { - body['DoctorID'] = null; - } - if (body['EditedBy'] == '') { - body.remove("EditedBy"); - } + if (body['ClinicID'] == null) + body['ClinicID'] = doctorProfile?.clinicID; + } + if (body['DoctorID'] == '') { + body['DoctorID'] = null; + } + if (body['EditedBy'] == '') { + body.remove("EditedBy"); } if (body['TokenID'] == null) { - body['TokenID'] = token; + body['TokenID'] = token ?? ''; } // body['TokenID'] = "@dm!n" ?? ''; if (!isFallLanguage) { @@ -80,10 +82,12 @@ class BaseAppClient { body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { - body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaAuthTokenID'] = + await sharedPref.getString(VIDA_AUTH_TOKEN_ID); } if (body['VidaRefreshTokenID'] == null) { - body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaRefreshTokenID'] = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } int projectID = await sharedPref.getInt(PROJECT_ID); @@ -103,22 +107,30 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(Uri.parse(url), - body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); + final response = await http.post(url, + body: json.encode(body), + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await Provider.of(AppGlobal.CONTEX, listen: false).logout(); + await Provider.of(AppGlobal.CONTEX, + listen: false) + .logout(); + Helpers.showErrorToast('Your session expired Please login again'); locator().pushNamedAndRemoveUntil(ROOT); } @@ -144,18 +156,22 @@ class BaseAppClient { } postPatient(String endPoint, - {required Map body, - required Function(dynamic response, int statusCode) onSuccess, - required Function(String error, int statusCode) onFailure, - PatiantInformtion? patient, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + @required PatiantInformtion patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; try { - Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; + Map headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }; String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] @@ -175,11 +191,12 @@ class BaseAppClient { : PATIENT_OUT_SA_PATIENT_REQ; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -187,7 +204,7 @@ class BaseAppClient { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] - : patient!.patientType != null + : patient.patientType != null ? patient.patientType : PATIENT_TYPE : PATIENT_TYPE; @@ -195,13 +212,15 @@ class BaseAppClient { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] - : patient!.patientType != null + : patient.patientType != null ? patient.patientType : PATIENT_TYPE_ID : PATIENT_TYPE_ID; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token; - body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN; + body['PatientID'] = body['PatientID'] != null + ? body['PatientID'] + : patient.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -217,7 +236,8 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Helpers.checkConnection()) { - final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); + final response = await http.post(url.trim(), + body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -229,7 +249,8 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -245,20 +266,28 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", statusCode); + onFailure("Server Error found with no available message", + statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } } else { @@ -268,7 +297,9 @@ class BaseAppClient { if (parsed['message'] != null) { onFailure(parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -291,8 +322,12 @@ class BaseAppClient { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { - error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; + for (var i = 0; + i < parsed["ValidationErrors"]["ValidationErrors"].length; + i++) { + error = error + + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + + "\n"; } } } diff --git a/lib/config/config.dart b/lib/config/config.dart index 55c65680..0511f1cd 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 = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9c40e638..a4eb5dbc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -647,7 +647,7 @@ const Map> localizedValues = { "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف طلب جديد"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, + "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغي"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index c6ec4fdd..abb3ddd6 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -5,14 +5,14 @@ class SizeConfig { static double _blockWidth = 0; static double _blockHeight = 0; - static late double realScreenWidth; - static late double realScreenHeight; - static late double screenWidth; - static late double screenHeight; - static late double textMultiplier; - static late double imageSizeMultiplier; - static late double heightMultiplier; - static late double widthMultiplier; + static double realScreenWidth; + static double realScreenHeight; + static double screenWidth; + static double screenHeight; + static double textMultiplier; + static double imageSizeMultiplier; + static double heightMultiplier; + static double widthMultiplier; static bool isPortrait = true; static bool isMobilePortrait = false; @@ -25,7 +25,6 @@ class SizeConfig { void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; - if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } @@ -48,17 +47,21 @@ class SizeConfig { 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; } - _blockWidth = (screenWidth / 100); - _blockHeight = (screenHeight / 100); - + _blockWidth = screenWidth / 100; + _blockHeight = screenHeight / 100; + textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; heightMultiplier = _blockHeight; @@ -76,7 +79,7 @@ class SizeConfig { } - static getTextMultiplierBasedOnWidth({double? width}) { + static getTextMultiplierBasedOnWidth({double width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -84,7 +87,7 @@ class SizeConfig { return widthMultiplier; } -static getWidthMultiplier({double? width}) { + static getWidthMultiplier({double width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -92,11 +95,12 @@ static getWidthMultiplier({double? width}) { return widthMultiplier; } - static getHeightMultiplier({double? height}) { + static getHeightMultiplier({double height}) { // TODO handel LandScape case if (height != null) { return height / 100; } return heightMultiplier; } + } diff --git a/lib/core/insurance_approval_request_model.dart b/lib/core/insurance_approval_request_model.dart index 11f7804e..02f71ecb 100644 --- a/lib/core/insurance_approval_request_model.dart +++ b/lib/core/insurance_approval_request_model.dart @@ -1,17 +1,17 @@ class InsuranceApprovalInPatientRequestModel { - int? patientID; - int? patientTypeID; - int? eXuldAPPNO; - int? projectID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int patientID; + int patientTypeID; + int eXuldAPPNO; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; InsuranceApprovalInPatientRequestModel( {this.patientID, diff --git a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart index 16202cac..4b95c1b0 100644 --- a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart +++ b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart @@ -1,56 +1,56 @@ class CheckActivationCodeModel { - int? patientMobileNumber; - String? mobileNo; - int? projectOutSA; - int? loginType; - String? zipCode; - bool? isRegister; - String? logInTokenID; - int? searchType; - int? patientID; - int? nationalID; - int? patientIdentificationID; - bool? forRegisteration; - String? activationCode; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; + int patientMobileNumber; + String mobileNo; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + int nationalID; + int patientIdentificationID; + bool forRegisteration; + String activationCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; Null sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - String? dOB; - int? isHijri; - String? healthId; + bool isDentalAllowedBackend; + int deviceTypeID; + String dOB; + int isHijri; + String healthId; CheckActivationCodeModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.forRegisteration, - this.activationCode, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.forRegisteration, + this.activationCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); CheckActivationCodeModel.fromJson(Map json) { patientMobileNumber = json['PatientMobileNumber']; diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart index 89e1bfd6..3465cf8d 100644 --- a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart @@ -1,40 +1,40 @@ class CheckPatientForRegistrationModel { - int? patientIdentificationID; - int? patientMobileNumber; - String? zipCode; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; + int patientIdentificationID; + int patientMobileNumber; + String zipCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; Null sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - String? tokenID; - int? patientID; - bool? isRegister; - String? dOB; - int? isHijri; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + int patientID; + bool isRegister; + String dOB; + int isHijri; CheckPatientForRegistrationModel( {this.patientIdentificationID, - this.patientMobileNumber, - this.zipCode, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.isRegister, - this.dOB, - this.isHijri}); + this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.isRegister, + this.dOB, + this.isHijri}); CheckPatientForRegistrationModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart index 1f00fba0..f05131ef 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart @@ -1,30 +1,30 @@ class GetPatientInfoRequestModel { - String? patientIdentificationID; - String? dOB; - int? isHijri; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; + String patientIdentificationID; + String dOB; + int isHijri; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; Null sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; + bool isDentalAllowedBackend; + int deviceTypeID; GetPatientInfoRequestModel( {this.patientIdentificationID, - this.dOB, - this.isHijri, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID}); + this.dOB, + this.isHijri, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); GetPatientInfoRequestModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart index a1a25e17..158bd1e2 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart @@ -1,78 +1,78 @@ class GetPatientInfoResponseModel { dynamic date; - int? languageID; - int? serviceName; + int languageID; + int serviceName; dynamic time; dynamic androidLink; dynamic authenticationTokenID; dynamic data; - bool? dataw; - int? dietType; + bool dataw; + int dietType; dynamic errorCode; dynamic errorEndUserMessage; dynamic errorEndUserMessageN; dynamic errorMessage; - int? errorType; - int? foodCategory; + int errorType; + int foodCategory; dynamic iOSLink; - bool? isAuthenticated; - int? mealOrderStatus; - int? mealType; - int? messageStatus; - int? numberOfResultRecords; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; dynamic patientBlodType; dynamic successMsg; dynamic successMsgN; dynamic vidaUpdatedResponse; dynamic accessTokenObject; - int? age; + int age; dynamic clientIdentifierId; - int? createdBy; - String? dateOfBirth; - String? firstNameAr; - String? firstNameEn; - String? gender; + int createdBy; + String dateOfBirth; + String firstNameAr; + String firstNameEn; + String gender; dynamic genderAr; dynamic genderEn; - String? healthId; - String? idNumber; - String? idType; - bool? isHijri; - int? isInstertedOrUpdated; - int? isNull; - int? isPatientExistNHIC; - bool? isRecordLockedByCurrentUser; - String? lastNameAr; - String? lastNameEn; + String healthId; + String idNumber; + String idType; + bool isHijri; + int isInstertedOrUpdated; + int isNull; + int isPatientExistNHIC; + bool isRecordLockedByCurrentUser; + String lastNameAr; + String lastNameEn; dynamic listActiveAccessToken; - String? maritalStatus; - String? maritalStatusCode; - String? nationalDateOfBirth; - String? nationality; - String? nationalityCode; - String? occupation; + String maritalStatus; + String maritalStatusCode; + String nationalDateOfBirth; + String nationality; + String nationalityCode; + String occupation; dynamic pCDTransactionDataResultList; dynamic pCDGetVidaPatientForManualVerificationList; dynamic pCDNHICHMGPatientDetailsMatchCalulationList; - int? pCDReturnValue; - String? patientStatus; - String? placeofBirth; + int pCDReturnValue; + String patientStatus; + String placeofBirth; dynamic practitionerStatusCode; dynamic practitionerStatusDescAr; dynamic practitionerStatusDescEn; - int? rowCount; - String? secondNameAr; - String? secondNameEn; - String? thirdNameAr; - String? thirdNameEn; + int rowCount; + String secondNameAr; + String secondNameEn; + String thirdNameAr; + String thirdNameEn; dynamic yakeenVidaPatientDataStatisticsByPatientIdList; dynamic yakeenVidaPatientDataStatisticsList; dynamic yakeenVidaPatientDataStatisticsPrefferedList; dynamic accessToken; - int? categoryCode; + int categoryCode; dynamic categoryNameAr; dynamic categoryNameEn; - int? constraintCode; + int constraintCode; dynamic constraintNameAr; dynamic constraintNameEn; dynamic content; @@ -84,99 +84,99 @@ class GetPatientInfoResponseModel { dynamic licenseStatusDescEn; dynamic organizations; dynamic registrationNumber; - int? specialtyCode; + int specialtyCode; dynamic specialtyNameAr; dynamic specialtyNameEn; GetPatientInfoResponseModel( {this.date, - this.languageID, - this.serviceName, - this.time, - this.androidLink, - this.authenticationTokenID, - this.data, - this.dataw, - this.dietType, - this.errorCode, - this.errorEndUserMessage, - this.errorEndUserMessageN, - this.errorMessage, - this.errorType, - this.foodCategory, - this.iOSLink, - this.isAuthenticated, - this.mealOrderStatus, - this.mealType, - this.messageStatus, - this.numberOfResultRecords, - this.patientBlodType, - this.successMsg, - this.successMsgN, - this.vidaUpdatedResponse, - this.accessTokenObject, - this.age, - this.clientIdentifierId, - this.createdBy, - this.dateOfBirth, - this.firstNameAr, - this.firstNameEn, - this.gender, - this.genderAr, - this.genderEn, - this.healthId, - this.idNumber, - this.idType, - this.isHijri, - this.isInstertedOrUpdated, - this.isNull, - this.isPatientExistNHIC, - this.isRecordLockedByCurrentUser, - this.lastNameAr, - this.lastNameEn, - this.listActiveAccessToken, - this.maritalStatus, - this.maritalStatusCode, - this.nationalDateOfBirth, - this.nationality, - this.nationalityCode, - this.occupation, - this.pCDTransactionDataResultList, - this.pCDGetVidaPatientForManualVerificationList, - this.pCDNHICHMGPatientDetailsMatchCalulationList, - this.pCDReturnValue, - this.patientStatus, - this.placeofBirth, - this.practitionerStatusCode, - this.practitionerStatusDescAr, - this.practitionerStatusDescEn, - this.rowCount, - this.secondNameAr, - this.secondNameEn, - this.thirdNameAr, - this.thirdNameEn, - this.yakeenVidaPatientDataStatisticsByPatientIdList, - this.yakeenVidaPatientDataStatisticsList, - this.yakeenVidaPatientDataStatisticsPrefferedList, - this.accessToken, - this.categoryCode, - this.categoryNameAr, - this.categoryNameEn, - this.constraintCode, - this.constraintNameAr, - this.constraintNameEn, - this.content, - this.errorList, - this.licenseExpiryDate, - this.licenseIssuedDate, - this.licenseStatusCode, - this.licenseStatusDescAr, - this.licenseStatusDescEn, - this.organizations, - this.registrationNumber, - this.specialtyCode, - this.specialtyNameAr, - this.specialtyNameEn}); + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.vidaUpdatedResponse, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.isRecordLockedByCurrentUser, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationalDateOfBirth, + this.nationality, + this.nationalityCode, + this.occupation, + this.pCDTransactionDataResultList, + this.pCDGetVidaPatientForManualVerificationList, + this.pCDNHICHMGPatientDetailsMatchCalulationList, + this.pCDReturnValue, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.rowCount, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.yakeenVidaPatientDataStatisticsByPatientIdList, + this.yakeenVidaPatientDataStatisticsList, + this.yakeenVidaPatientDataStatisticsPrefferedList, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.errorList, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); GetPatientInfoResponseModel.fromJson(Map json) { date = json['Date']; @@ -233,9 +233,9 @@ class GetPatientInfoResponseModel { occupation = json['Occupation']; pCDTransactionDataResultList = json['PCDTransactionDataResultList']; pCDGetVidaPatientForManualVerificationList = - json['PCD_GetVidaPatientForManualVerificationList']; + json['PCD_GetVidaPatientForManualVerificationList']; pCDNHICHMGPatientDetailsMatchCalulationList = - json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; + json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; pCDReturnValue = json['PCD_ReturnValue']; patientStatus = json['PatientStatus']; placeofBirth = json['PlaceofBirth']; @@ -248,11 +248,11 @@ class GetPatientInfoResponseModel { thirdNameAr = json['ThirdNameAr']; thirdNameEn = json['ThirdNameEn']; yakeenVidaPatientDataStatisticsByPatientIdList = - json['YakeenVidaPatientDataStatisticsByPatientIdList']; + json['YakeenVidaPatientDataStatisticsByPatientIdList']; yakeenVidaPatientDataStatisticsList = - json['YakeenVidaPatientDataStatisticsList']; + json['YakeenVidaPatientDataStatisticsList']; yakeenVidaPatientDataStatisticsPrefferedList = - json['YakeenVidaPatientDataStatisticsPrefferedList']; + json['YakeenVidaPatientDataStatisticsPrefferedList']; accessToken = json['accessToken']; categoryCode = json['categoryCode']; categoryNameAr = json['categoryNameAr']; diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart index a73ecb0b..83ff53d7 100644 --- a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart @@ -1,42 +1,42 @@ class PatientRegistrationModel { - Patientobject? patientobject; - String? patientIdentificationID; - String? patientMobileNumber; - String? logInTokenID; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; + Patientobject patientobject; + String patientIdentificationID; + String patientMobileNumber; + String logInTokenID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; Null sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - String? tokenID; - String? dOB; - int? isHijri; - String? healthId; - String? zipCode; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + String dOB; + int isHijri; + String healthId; + String zipCode; PatientRegistrationModel( {this.patientobject, - this.patientIdentificationID, - this.patientMobileNumber, - this.logInTokenID, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.dOB, - this.isHijri, - this.healthId, - this.zipCode}); + this.patientIdentificationID, + this.patientMobileNumber, + this.logInTokenID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.dOB, + this.isHijri, + this.healthId, + this.zipCode}); PatientRegistrationModel.fromJson(Map json) { patientobject = json['Patientobject'] != null @@ -64,7 +64,7 @@ class PatientRegistrationModel { Map toJson() { final Map data = new Map(); if (this.patientobject != null) { - data['Patientobject'] = this.patientobject!.toJson(); + data['Patientobject'] = this.patientobject.toJson(); } data['PatientIdentificationID'] = this.patientIdentificationID; data['PatientMobileNumber'] = this.patientMobileNumber; @@ -88,50 +88,50 @@ class PatientRegistrationModel { } class Patientobject { - bool? tempValue; - int? patientIdentificationType; - String? patientIdentificationNo; - int? mobileNumber; - int? patientOutSA; - String? firstNameN; - String? middleNameN; - String? lastNameN; - String? firstName; - String? middleName; - String? lastName; - String? strDateofBirth; - String? dateofBirth; - int? gender; - String? nationalityID; - String? dateofBirthN; - String? emailAddress; - String? sourceType; - String? preferredLanguage; - String? marital; - String? eHealthIDField; + bool tempValue; + int patientIdentificationType; + String patientIdentificationNo; + int mobileNumber; + int patientOutSA; + String firstNameN; + String middleNameN; + String lastNameN; + String firstName; + String middleName; + String lastName; + String strDateofBirth; + String dateofBirth; + int gender; + String nationalityID; + String dateofBirthN; + String emailAddress; + String sourceType; + String preferredLanguage; + String marital; + String eHealthIDField; Patientobject( {this.tempValue, - this.patientIdentificationType, - this.patientIdentificationNo, - this.mobileNumber, - this.patientOutSA, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.firstName, - this.middleName, - this.lastName, - this.strDateofBirth, - this.dateofBirth, - this.gender, - this.nationalityID, - this.dateofBirthN, - this.emailAddress, - this.sourceType, - this.preferredLanguage, - this.marital, - this.eHealthIDField}); + this.patientIdentificationType, + this.patientIdentificationNo, + this.mobileNumber, + this.patientOutSA, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.firstName, + this.middleName, + this.lastName, + this.strDateofBirth, + this.dateofBirth, + this.gender, + this.nationalityID, + this.dateofBirthN, + this.emailAddress, + this.sourceType, + this.preferredLanguage, + this.marital, + this.eHealthIDField}); Patientobject.fromJson(Map json) { tempValue = json['TempValue']; diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart index af08661f..8244a95f 100644 --- a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -1,54 +1,54 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { - int? patientMobileNumber; - String? mobileNo; - int? projectOutSA; - int? loginType; - String? zipCode; - bool? isRegister; - String? logInTokenID; - int? searchType; - int? patientID; - int? nationalID; - int? patientIdentificationID; - int? oTPSendType; - int? languageID; - double? versionID; - int? channel; - String? iPAdress; - String? generalid; - int? patientOutSA; + int patientMobileNumber; + String mobileNo; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + int nationalID; + int patientIdentificationID; + int oTPSendType; + int languageID; + double versionID; + int channel; + String iPAdress; + String generalid; + int patientOutSA; Null sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - String? dOB; - int? isHijri; - String? healthId; + bool isDentalAllowedBackend; + int deviceTypeID; + String dOB; + int isHijri; + String healthId; SendActivationCodeByOTPNotificationTypeForRegistrationModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.oTPSendType, - this.languageID, - this.versionID, - this.channel, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( Map json) { diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index 881f318a..c47a813a 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class Prescriptions { - String? setupID; - int? projectID; - int? patientID; - int? appointmentNo; - String? appointmentDate; - String? doctorName; - String? clinicDescription; - String? name; - int? episodeID; - int? actualDoctorRate; - int? admission; - int? clinicID; - String? companyName; - String? despensedStatus; - DateTime? dischargeDate; - int? dischargeNo; - int? doctorID; - String? doctorImageURL; - int? doctorRate; - String? doctorTitle; - int? gender; - String? genderDescription; - bool? isActiveDoctorProfile; - bool? isDoctorAllowVedioCall; - bool? isExecludeDoctor; - bool? isInOutPatient; - bool? isLiveCareAppointment; - String? isInOutPatientDescription; - String? isInOutPatientDescriptionN; - bool? isInsurancePatient; - String? nationalityFlagURL; - int? noOfPatientsRate; - String? qR; - List? speciality; + String setupID; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + String doctorName; + String clinicDescription; + String name; + int episodeID; + int actualDoctorRate; + int admission; + int clinicID; + String companyName; + String despensedStatus; + DateTime dischargeDate; + int dischargeNo; + int doctorID; + String doctorImageURL; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + bool isLiveCareAppointment; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isInsurancePatient; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + List speciality; Prescriptions( {this.setupID, @@ -69,10 +69,9 @@ class Prescriptions { this.nationalityFlagURL, this.noOfPatientsRate, this.qR, - this.speciality, - this.isLiveCareAppointment}); + this.speciality,this.isLiveCareAppointment}); - Prescriptions.fromJson(Map json) { + Prescriptions.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -106,11 +105,11 @@ class Prescriptions { noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; @@ -150,10 +149,10 @@ class Prescriptions { } class PrescriptionsList { - String? filterName = ""; - List prescriptionsList =[]; + String filterName = ""; + List prescriptionsList = List(); - PrescriptionsList({this.filterName, required Prescriptions prescriptions}) { + PrescriptionsList({this.filterName, Prescriptions prescriptions}) { prescriptionsList.add(prescriptions); } } diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart index 4644131e..8ba07f2a 100644 --- a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart @@ -1,40 +1,40 @@ class GetMedicationForInPatientModel { - String? setupID; - int? projectID; - int? admissionNo; - int? patientID; - int? orderNo; - int? prescriptionNo; - int? lineItemNo; - String? prescriptionDatetime; - int? itemID; - int? directionID; - int? refillID; - String? dose; - int? unitofMeasurement; - String? startDatetime; - String? stopDatetime; - int? noOfDoses; - int? routeId; - String? comments; - int? reviewedPharmacist; + String setupID; + int projectID; + int admissionNo; + int patientID; + int orderNo; + int prescriptionNo; + int lineItemNo; + String prescriptionDatetime; + int itemID; + int directionID; + int refillID; + String dose; + int unitofMeasurement; + String startDatetime; + String stopDatetime; + int noOfDoses; + int routeId; + String comments; + int reviewedPharmacist; dynamic reviewedPharmacistDatetime; dynamic discountinueDatetime; dynamic rescheduleDatetime; - int? status; - String? statusDescription; - int? createdBy; - String? createdOn; + int status; + String statusDescription; + int createdBy; + String createdOn; dynamic editedBy; dynamic editedOn; dynamic strength; - String? pHRItemDescription; - String? pHRItemDescriptionN; - String? doctorName; - String? uomDescription; - String? routeDescription; - String? directionDescription; - String? refillDescription; + String pHRItemDescription; + String pHRItemDescriptionN; + String doctorName; + String uomDescription; + String routeDescription; + String directionDescription; + String refillDescription; GetMedicationForInPatientModel( {this.setupID, diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart index 71c1305a..7c906643 100644 --- a/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart @@ -1,16 +1,16 @@ class GetMedicationForInPatientRequestModel { - bool? isDentalAllowedBackend; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? deviceTypeID; - String? tokenID; - int? patientID; - int? admissionNo; - String? sessionID; - int? projectID; + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; GetMedicationForInPatientRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/core/model/Prescriptions/in_patient_prescription_model.dart b/lib/core/model/Prescriptions/in_patient_prescription_model.dart index 3f67e659..f6e88bf7 100644 --- a/lib/core/model/Prescriptions/in_patient_prescription_model.dart +++ b/lib/core/model/Prescriptions/in_patient_prescription_model.dart @@ -1,5 +1,5 @@ class InPatientPrescriptionRequestModel { - String? vidaAuthTokenID; + String vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart index c6b013d3..3adaef7e 100644 --- a/lib/core/model/Prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -1,28 +1,28 @@ class PharmacyPrescriptions { - String? expiryDate; + String expiryDate; dynamic sellingPrice; - int?quantity; - int?itemID; - int?locationID; - int?projectID; - String ?setupID; - String ?locationDescription; - dynamic locationDescriptionN; - String ? itemDescription; - dynamic itemDescriptionN; - String ? alias; - int ? locationTypeID; - int ? barcode; - dynamic companybarcode; - int ? cityID; - String? cityName; - int ? distanceInKilometers; - String? latitude; - int ?locationType; - String? longitude; - String ?phoneNumber; - String ? projectImageURL; - dynamic sortOrder; + int quantity; + int itemID; + int locationID; + int projectID; + String setupID; + String locationDescription; + Null locationDescriptionN; + String itemDescription; + Null itemDescriptionN; + String alias; + int locationTypeID; + int barcode; + Null companybarcode; + int cityID; + String cityName; + int distanceInKilometers; + String latitude; + int locationType; + String longitude; + String phoneNumber; + String projectImageURL; + Null sortOrder; PharmacyPrescriptions( {this.expiryDate, diff --git a/lib/core/model/Prescriptions/post_prescrition_req_model.dart b/lib/core/model/Prescriptions/post_prescrition_req_model.dart index 9609a0df..06a524ed 100644 --- a/lib/core/model/Prescriptions/post_prescrition_req_model.dart +++ b/lib/core/model/Prescriptions/post_prescrition_req_model.dart @@ -1,10 +1,10 @@ class PostPrescriptionReqModel { - String ?vidaAuthTokenID; - int? clinicID; - int? episodeID; - int? appointmentNo; - int? patientMRN; - List ?prescriptionRequestModel; + String vidaAuthTokenID; + int clinicID; + int episodeID; + int appointmentNo; + int patientMRN; + List prescriptionRequestModel; PostPrescriptionReqModel( {this.vidaAuthTokenID, @@ -21,9 +21,9 @@ class PostPrescriptionReqModel { appointmentNo = json['AppointmentNo']; patientMRN = json['PatientMRN']; if (json['prescriptionRequestModel'] != null) { - prescriptionRequestModel =[]; + prescriptionRequestModel = new List(); json['prescriptionRequestModel'].forEach((v) { - prescriptionRequestModel!.add(new PrescriptionRequestModel.fromJson(v)); + prescriptionRequestModel.add(new PrescriptionRequestModel.fromJson(v)); }); } } @@ -37,25 +37,25 @@ class PostPrescriptionReqModel { data['PatientMRN'] = this.patientMRN; if (this.prescriptionRequestModel != null) { data['prescriptionRequestModel'] = - this.prescriptionRequestModel!.map((v) => v.toJson()).toList(); + this.prescriptionRequestModel.map((v) => v.toJson()).toList(); } return data; } } class PrescriptionRequestModel { - int ? itemId; - String? doseStartDate; - int ?duration; - double? dose; - int ?doseUnitId; - int ?route; - int ?frequency; - int ?doseTime; - bool ?covered; - bool ?approvalRequired; - String ?remarks; - String ?icdcode10Id; + int itemId; + String doseStartDate; + int duration; + double dose; + int doseUnitId; + int route; + int frequency; + int doseTime; + bool covered; + bool approvalRequired; + String remarks; + String icdcode10Id; PrescriptionRequestModel({ this.itemId, diff --git a/lib/core/model/Prescriptions/prescription_in_patient.dart b/lib/core/model/Prescriptions/prescription_in_patient.dart index f32556bc..c66bc8a4 100644 --- a/lib/core/model/Prescriptions/prescription_in_patient.dart +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -1,50 +1,50 @@ class PrescriotionInPatient { - int ?admissionNo; - int ?authorizedBy; + int admissionNo; + int authorizedBy; dynamic bedNo; - String? comments; - int ?createdBy; - String ?createdByName; + String comments; + int createdBy; + String createdByName; dynamic createdByNameN; - String ?createdOn; - String ?direction; - int ?directionID; + String createdOn; + String direction; + int directionID; dynamic directionN; - String ?dose; - int ?editedBy; + String dose; + int editedBy; dynamic iVDiluentLine; - int ?iVDiluentType; + int iVDiluentType; dynamic iVDiluentVolume; dynamic iVRate; dynamic iVStability; - String? itemDescription; - int? itemID; - int? lineItemNo; - int? locationId; - int? noOfDoses; - int? orderNo; - int? patientID; - String ?pharmacyRemarks; - String ?prescriptionDatetime; - int ?prescriptionNo; - String? processedBy; - int ?projectID; - int ?refillID; - String ?refillType; + String itemDescription; + int itemID; + int lineItemNo; + int locationId; + int noOfDoses; + int orderNo; + int patientID; + String pharmacyRemarks; + String prescriptionDatetime; + int prescriptionNo; + String processedBy; + int projectID; + int refillID; + String refillType; dynamic refillTypeN; - int ?reviewedPharmacist; + int reviewedPharmacist; dynamic roomId; - String ?route; - int ?routeId; + String route; + int routeId; dynamic routeN; dynamic setupID; - String ?startDatetime; - int ?status; - String ?statusDescription; + String startDatetime; + int status; + String statusDescription; dynamic statusDescriptionN; - String ?stopDatetime; - int ?unitofMeasurement; - String? unitofMeasurementDescription; + String stopDatetime; + int unitofMeasurement; + String unitofMeasurementDescription; dynamic unitofMeasurementDescriptionN; PrescriotionInPatient( diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 89959394..92574c66 100644 --- a/lib/core/model/Prescriptions/prescription_model.dart +++ b/lib/core/model/Prescriptions/prescription_model.dart @@ -1,5 +1,5 @@ class PrescriptionModel { - List? entityList; + List entityList; dynamic rowcount; dynamic statusMessage; @@ -7,9 +7,9 @@ class PrescriptionModel { PrescriptionModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class PrescriptionModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index 4b5d574a..006a6fad 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -1,48 +1,48 @@ class PrescriptionReport { - String? address; - dynamic? appodynamicmentNo; - String? clinic; - String? companyName; - dynamic? days; - String? doctorName; + String address; + dynamic appodynamicmentNo; + String clinic; + String companyName; + dynamic days; + String doctorName; var doseDailyQuantity; - String? frequency; - dynamic? frequencyNumber; - String? image; - String? imageExtension; - String? imageSRCUrl; - String? imageString; - String? imageThumbUrl; - String? isCovered; - String? itemDescription; - dynamic? itemID; - String? orderDate; - dynamic? patientID; - String? patientName; - String? phoneOffice1; - String? prescriptionQR; - dynamic? prescriptionTimes; - String? productImage; - String? productImageBase64; - String? productImageString; - dynamic? projectID; - String? projectName; - String? remarks; - String? route; - String? sKU; - dynamic? scaleOffset; - String? startDate; + String frequency; + dynamic frequencyNumber; + String image; + String imageExtension; + String imageSRCUrl; + String imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + dynamic itemID; + String orderDate; + dynamic patientID; + String patientName; + String phoneOffice1; + String prescriptionQR; + dynamic prescriptionTimes; + String productImage; + String productImageBase64; + String productImageString; + dynamic projectID; + String projectName; + String remarks; + String route; + String sKU; + dynamic scaleOffset; + String startDate; - String? patientAge; - String? patientGender; - String? phoneOffice; - dynamic? doseTimingID; - dynamic? frequencyID; - dynamic? routeID; - String? name; - String? itemDescriptionN; - String? routeN; - String? frequencyN; + String patientAge; + String patientGender; + String phoneOffice; + dynamic doseTimingID; + dynamic frequencyID; + dynamic routeID; + String name; + String itemDescriptionN; + String routeN; + String frequencyN; PrescriptionReport({ this.address, diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index 96f811de..01b9a5c9 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,38 +1,37 @@ class PrescriptionReportEnh { - String ? address; + String address; dynamic appodynamicmentNo; - int ? appointmentNo; - String ? clinic; + String clinic; dynamic companyName; - int ? days; - String ? doctorName; - int ? doseDailyQuantity; - String ? frequency; - int ? frequencyNumber; + dynamic days; + String doctorName; + dynamic doseDailyQuantity; + String frequency; + dynamic frequencyNumber; dynamic image; dynamic imageExtension; - String ? imageSRCUrl; - dynamic imageString ; - String ? imageThumbUrl; - String ? isCovered; - String ? itemDescription; - dynamic ? itemID; - String ? orderDate; - dynamic ? patientID; - String ? patientName; - String ? phoneOffice1; + String imageSRCUrl; + dynamic imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + dynamic itemID; + String orderDate; + dynamic patientID; + String patientName; + String phoneOffice1; dynamic prescriptionQR; - dynamic ? prescriptionTimes; + dynamic prescriptionTimes; dynamic productImage; dynamic productImageBase64; - String ? productImageString; - dynamic ? projectID; - String ? projectName; - String ? remarks; - String ? route; - String ? sKU; - dynamic ? scaleOffset; - String ? startDate; + String productImageString; + dynamic projectID; + String projectName; + String remarks; + String route; + String sKU; + dynamic scaleOffset; + String startDate; PrescriptionReportEnh( {this.address, diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index 1177431d..a45878d8 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,5 +1,5 @@ class PrescriptionReqModel { - String ?vidaAuthTokenID; + String vidaAuthTokenID; dynamic patientMRN; dynamic appNo; dynamic admissionNo; diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index afe38aa1..f51420ec 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -1,32 +1,32 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionsOrder { - int? iD; + int iD; dynamic patientID; - bool? patientOutSA; - bool? isOutPatient; - int? projectID; - int? nearestProjectID; - double? longitude; - double? latitude; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; dynamic appointmentNo; dynamic dischargeID; - int? lineItemNo; - int? status; + int lineItemNo; + int status; dynamic description; dynamic descriptionN; - DateTime? createdOn; - int? serviceID; - int? createdBy; - DateTime? editedOn; - int? editedBy; - int? channel; + DateTime createdOn; + int serviceID; + int createdBy; + DateTime editedOn; + int editedBy; + int channel; dynamic clientRequestID; - bool? returnedToQueue; + bool returnedToQueue; dynamic pickupDateTime; dynamic pickupLocationName; dynamic dropoffLocationName; - int? realRRTHaveTransactions; + int realRRTHaveTransactions; dynamic nearestProjectDescription; dynamic nearestProjectDescriptionN; dynamic projectDescription; @@ -34,35 +34,35 @@ class PrescriptionsOrder { PrescriptionsOrder( {this.iD, - this.patientID, - this.patientOutSA, - this.isOutPatient, - this.projectID, - this.nearestProjectID, - this.longitude, - this.latitude, - this.appointmentNo, - this.dischargeID, - this.lineItemNo, - this.status, - this.description, - this.descriptionN, - this.createdOn, - this.serviceID, - this.createdBy, - this.editedOn, - this.editedBy, - this.channel, - this.clientRequestID, - this.returnedToQueue, - this.pickupDateTime, - this.pickupLocationName, - this.dropoffLocationName, - this.realRRTHaveTransactions, - this.nearestProjectDescription, - this.nearestProjectDescriptionN, - this.projectDescription, - this.projectDescriptionN}); + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); PrescriptionsOrder.fromJson(Map json) { iD = json['ID']; diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index 7b453b9b..739bb838 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -1,32 +1,32 @@ class RequestGetListPharmacyForPrescriptions { - int? latitude; - int? longitude; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; - String? sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - int? itemID; + int latitude; + int longitude; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int itemID; RequestGetListPharmacyForPrescriptions( {this.latitude, - this.longitude, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.itemID}); + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); - RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { latitude = json['Latitude']; longitude = json['Longitude']; versionID = json['VersionID']; diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index b7ade7d4..c8323740 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -1,46 +1,46 @@ class RequestPrescriptionReport { - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; - String? sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - int? patientID; - String? tokenID; - int? patientTypeID; - int? patientType; - int? appointmentNo; - String? setupID; - int? episodeID; - int? clinicID; - int? projectID; - int? dischargeNo; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int episodeID; + int clinicID; + int projectID; + int dischargeNo; RequestPrescriptionReport( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID, - this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); - RequestPrescriptionReport.fromJson(Map json) { + RequestPrescriptionReport.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index fc048a95..4905fc2a 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -1,46 +1,45 @@ class RequestPrescriptionReportEnh { - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; - String? sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - int? patientID; - String? tokenID; - int? patientTypeID; - int? patientType; - int? appointmentNo; - String? setupID; - int? dischargeNo; - int? episodeID; - int? clinicID; - int? projectID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int dischargeNo; + int episodeID; + int clinicID; + int projectID; RequestPrescriptionReportEnh( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID, - this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID,this.dischargeNo}); - RequestPrescriptionReportEnh.fromJson(Map json) { + RequestPrescriptionReportEnh.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 94fe46cc..1ab5a990 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,45 +1,45 @@ class AdmissionRequest { - late int? patientMRN; - late int? admitToClinic; - late bool? isPregnant; - late int pregnancyWeeks; - late int pregnancyType; - late int noOfBabies; - late int? mrpDoctorID; - late String? admissionDate; - late int? expectedDays; - late int? admissionType; - late int admissionLocationID; - late int roomCategoryID; - late int? wardID; - late bool? isSickLeaveRequired; - late String sickLeaveComments; - late bool isTransport; - late String transportComments; - late bool isPhysioAppointmentNeeded; - late String physioAppointmentComments; - late bool isOPDFollowupAppointmentNeeded; - late String opdFollowUpComments; - late bool? isDietType; - late int? dietType; - late String? dietRemarks; - late bool isPhysicalActivityModification; - late String physicalActivityModificationComments; - late int orStatus; - late String? mainLineOfTreatment; - late int? estimatedCost; - late String? elementsForImprovement; - late bool isPackagePatient; - late String complications; - late String otherDepartmentInterventions; - late String otherProcedures; - late String pastMedicalHistory; - late String pastSurgicalHistory; - late List? admissionRequestDiagnoses; - late List? admissionRequestProcedures; - late int? appointmentNo; - late int? episodeID; - late int? admissionRequestNo; + int patientMRN; + int admitToClinic; + bool isPregnant; + int pregnancyWeeks; + int pregnancyType; + int noOfBabies; + int mrpDoctorID; + String admissionDate; + int expectedDays; + int admissionType; + int admissionLocationID; + int roomCategoryID; + int wardID; + bool isSickLeaveRequired; + String sickLeaveComments; + bool isTransport; + String transportComments; + bool isPhysioAppointmentNeeded; + String physioAppointmentComments; + bool isOPDFollowupAppointmentNeeded; + String opdFollowUpComments; + bool isDietType; + int dietType; + String dietRemarks; + bool isPhysicalActivityModification; + String physicalActivityModificationComments; + int orStatus; + String mainLineOfTreatment; + int estimatedCost; + String elementsForImprovement; + bool isPackagePatient; + String complications; + String otherDepartmentInterventions; + String otherProcedures; + String pastMedicalHistory; + String pastSurgicalHistory; + List admissionRequestDiagnoses; + List admissionRequestProcedures; + int appointmentNo; + int episodeID; + int admissionRequestNo; AdmissionRequest( {this.patientMRN, @@ -110,7 +110,8 @@ class AdmissionRequest { dietType = json['dietType']; dietRemarks = json['dietRemarks']; isPhysicalActivityModification = json['isPhysicalActivityModification']; - physicalActivityModificationComments = json['physicalActivityModificationComments']; + physicalActivityModificationComments = + json['physicalActivityModificationComments']; orStatus = json['orStatus']; mainLineOfTreatment = json['mainLineOfTreatment']; estimatedCost = json['estimatedCost']; @@ -122,17 +123,17 @@ class AdmissionRequest { pastMedicalHistory = json['pastMedicalHistory']; pastSurgicalHistory = json['pastSurgicalHistory']; if (json['admissionRequestDiagnoses'] != null) { - admissionRequestDiagnoses = []; + admissionRequestDiagnoses = new List(); json['admissionRequestDiagnoses'].forEach((v) { - admissionRequestDiagnoses!.add(v); + admissionRequestDiagnoses.add(v); // admissionRequestDiagnoses // .add(new AdmissionRequestDiagnoses.fromJson(v)); }); } if (json['admissionRequestProcedures'] != null) { - admissionRequestProcedures = []; + admissionRequestProcedures = new List(); json['admissionRequestProcedures'].forEach((v) { - admissionRequestProcedures!.add(v); + admissionRequestProcedures.add(v); // admissionRequestProcedures // .add(new AdmissionRequestProcedures.fromJson(v)); }); @@ -163,13 +164,16 @@ class AdmissionRequest { data['transportComments'] = this.transportComments; data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded; data['physioAppointmentComments'] = this.physioAppointmentComments; - data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded; + data['isOPDFollowupAppointmentNeeded'] = + this.isOPDFollowupAppointmentNeeded; data['opdFollowUpComments'] = this.opdFollowUpComments; data['isDietType'] = this.isDietType; data['dietType'] = this.dietType; data['dietRemarks'] = this.dietRemarks; - data['isPhysicalActivityModification'] = this.isPhysicalActivityModification; - data['physicalActivityModificationComments'] = this.physicalActivityModificationComments; + data['isPhysicalActivityModification'] = + this.isPhysicalActivityModification; + data['physicalActivityModificationComments'] = + this.physicalActivityModificationComments; data['orStatus'] = this.orStatus; data['mainLineOfTreatment'] = this.mainLineOfTreatment; data['estimatedCost'] = this.estimatedCost; @@ -185,7 +189,8 @@ class AdmissionRequest { // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); } if (this.admissionRequestProcedures != null) { - data['admissionRequestProcedures'] = this.admissionRequestProcedures!.map((v) => v.toJson()).toList(); + data['admissionRequestProcedures'] = + this.admissionRequestProcedures.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/core/model/admissionRequest/clinic-model.dart b/lib/core/model/admissionRequest/clinic-model.dart index e5a03264..05d34645 100644 --- a/lib/core/model/admissionRequest/clinic-model.dart +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -1,16 +1,16 @@ class Clinic { - late int? clinicGroupID; - late String? clinicGroupName; - late int? clinicID; - late String? clinicNameArabic; - late String? clinicNameEnglish; + int clinicGroupID; + String clinicGroupName; + int clinicID; + String clinicNameArabic; + String clinicNameEnglish; Clinic( {this.clinicGroupID, - this.clinicGroupName, - this.clinicID, - this.clinicNameArabic, - this.clinicNameEnglish}); + this.clinicGroupName, + this.clinicID, + this.clinicNameArabic, + this.clinicNameEnglish}); Clinic.fromJson(Map json) { clinicGroupID = json['clinicGroupID']; @@ -29,4 +29,5 @@ class Clinic { data['clinicNameEnglish'] = this.clinicNameEnglish; return data; } -} + +} \ No newline at end of file diff --git a/lib/core/model/admissionRequest/ward-model.dart b/lib/core/model/admissionRequest/ward-model.dart index 8f7b9fe5..606758d3 100644 --- a/lib/core/model/admissionRequest/ward-model.dart +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -1,9 +1,9 @@ class WardModel{ - late String ? description; - late String ? descriptionN; - late int ? floorID; - late bool ? isActive; + String description; + String descriptionN; + int floorID; + bool isActive; WardModel( {this.description, this.descriptionN, this.floorID, this.isActive}); diff --git a/lib/core/model/auth/activation_Code_req_model.dart b/lib/core/model/auth/activation_Code_req_model.dart index 13d64f6a..85d7f1d3 100644 --- a/lib/core/model/auth/activation_Code_req_model.dart +++ b/lib/core/model/auth/activation_Code_req_model.dart @@ -1,12 +1,12 @@ class ActivationCodeModel { - late int? channel; - late int? loginDoctorID; - late int? languageID; - late double? versionID; - late int? memberID; - late int? facilityId; - late String? generalid; - late String? otpSendType; + int channel; + int languageID; + int loginDoctorID; + double versionID; + int memberID; + int facilityId; + String generalid; + String otpSendType; ActivationCodeModel( {this.channel, diff --git a/lib/core/model/auth/activation_code_for_verification_screen_model.dart b/lib/core/model/auth/activation_code_for_verification_screen_model.dart index 51fb5ab3..dae31f8c 100644 --- a/lib/core/model/auth/activation_code_for_verification_screen_model.dart +++ b/lib/core/model/auth/activation_code_for_verification_screen_model.dart @@ -1,19 +1,18 @@ class ActivationCodeForVerificationScreenModel { - late int? oTPSendType; - late String? mobileNumber; - late String? zipCode; - late int? channel; - late int? loginDoctorID; - late int? languageID; - late double? versionID; - late int? memberID; - late int? facilityId; - late String? generalid; - late int? isMobileFingerPrint; - late String? vidaAuthTokenID; - late String? vidaRefreshTokenID; - late String? iMEI; - + int oTPSendType; + String mobileNumber; + String zipCode; + int channel; + int loginDoctorID; + int languageID; + double versionID; + int memberID; + int facilityId; + String generalid; + int isMobileFingerPrint; + String vidaAuthTokenID; + String vidaRefreshTokenID; + String iMEI; ActivationCodeForVerificationScreenModel( {this.oTPSendType, this.mobileNumber, diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index 3fa2f69b..e39518e6 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { - late String? authenticationTokenID; - late List? listDoctorsClinic; - List? listDoctorProfile; - late MemberInformation? memberInformation; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; + String authenticationTokenID; + List listDoctorsClinic; + List listDoctorProfile; + MemberInformation memberInformation; + String vidaAuthTokenID; + String vidaRefreshTokenID; CheckActivationCodeForDoctorAppResponseModel( {this.authenticationTokenID, @@ -20,16 +20,16 @@ class CheckActivationCodeForDoctorAppResponseModel { Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { - listDoctorsClinic = []; + listDoctorsClinic = new List(); json['List_DoctorsClinic'].forEach((v) { - listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); + listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); }); } if (json['List_DoctorProfile'] != null) { - listDoctorProfile = []; + listDoctorProfile = new List(); json['List_DoctorProfile'].forEach((v) { - listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); + listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; @@ -45,27 +45,27 @@ class CheckActivationCodeForDoctorAppResponseModel { data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { data['List_DoctorsClinic'] = - this.listDoctorsClinic!.map((v) => v.toJson()).toList(); + this.listDoctorsClinic.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { data['List_DoctorProfile'] = - this.listDoctorProfile!.map((v) => v.toJson()).toList(); + this.listDoctorProfile.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { - data['memberInformation'] = this.memberInformation!.toJson(); + data['memberInformation'] = this.memberInformation.toJson(); } return data; } } class ListDoctorsClinic { - late dynamic setupID; - late int? projectID; - late int? doctorID; - late int? clinicID; - late bool? isActive; - late String? clinicName; + Null setupID; + int projectID; + int doctorID; + int clinicID; + bool isActive; + String clinicName; ListDoctorsClinic( {this.setupID, @@ -97,15 +97,15 @@ class ListDoctorsClinic { } class MemberInformation { - late List? clinics; - late int? doctorId; - late String? email; - late int? employeeId; - late int? memberId; - late dynamic memberName; - late dynamic memberNameArabic; - late String? preferredLanguage; - late List? roles; + List clinics; + int doctorId; + String email; + int employeeId; + int memberId; + Null memberName; + Null memberNameArabic; + String preferredLanguage; + List roles; MemberInformation( {this.clinics, @@ -120,9 +120,9 @@ class MemberInformation { MemberInformation.fromJson(Map json) { if (json['clinics'] != null) { - clinics = []; + clinics = new List(); json['clinics'].forEach((v) { - clinics!.add(new Clinics.fromJson(v)); + clinics.add(new Clinics.fromJson(v)); }); } doctorId = json['doctorId']; @@ -133,9 +133,9 @@ class MemberInformation { memberNameArabic = json['memberNameArabic']; preferredLanguage = json['preferredLanguage']; if (json['roles'] != null) { - roles = []; + roles = new List(); json['roles'].forEach((v) { - roles!.add(new Roles.fromJson(v)); + roles.add(new Roles.fromJson(v)); }); } } @@ -143,7 +143,7 @@ class MemberInformation { Map toJson() { final Map data = new Map(); if (this.clinics != null) { - data['clinics'] = this.clinics!.map((v) => v.toJson()).toList(); + data['clinics'] = this.clinics.map((v) => v.toJson()).toList(); } data['doctorId'] = this.doctorId; data['email'] = this.email; @@ -153,16 +153,16 @@ class MemberInformation { data['memberNameArabic'] = this.memberNameArabic; data['preferredLanguage'] = this.preferredLanguage; if (this.roles != null) { - data['roles'] = this.roles!.map((v) => v.toJson()).toList(); + data['roles'] = this.roles.map((v) => v.toJson()).toList(); } return data; } } class Clinics { - late bool? defaultClinic; - late int? id; - late String? name; + bool defaultClinic; + int id; + String name; Clinics({this.defaultClinic, this.id, this.name}); @@ -182,8 +182,8 @@ class Clinics { } class Roles { - late String? name; - late int? roleId; + String name; + int roleId; Roles({this.name, this.roleId}); diff --git a/lib/core/model/auth/check_activation_code_request_model.dart b/lib/core/model/auth/check_activation_code_request_model.dart index fee596fe..94502a71 100644 --- a/lib/core/model/auth/check_activation_code_request_model.dart +++ b/lib/core/model/auth/check_activation_code_request_model.dart @@ -1,24 +1,24 @@ class CheckActivationCodeRequestModel { - String? mobileNumber; - String? zipCode; - int? doctorID; - int? memberID; - int? loginDoctorID; - String? password; - String? facilityId; - String? iPAdress; - int? channel; - int? languageID; - int? projectID; - double? versionID; - String? generalid; - String? logInTokenID; - String? activationCode; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; - String? iMEI; - bool? isForSilentLogin; - int? oTPSendType; + String mobileNumber; + String zipCode; + int doctorID; + int memberID; + int loginDoctorID; + String password; + String facilityId; + String iPAdress; + int channel; + int languageID; + int projectID; + double versionID; + String generalid; + String logInTokenID; + String activationCode; + String vidaAuthTokenID; + String vidaRefreshTokenID; + String iMEI; + bool isForSilentLogin; + int oTPSendType; CheckActivationCodeRequestModel( {this.mobileNumber, this.zipCode, diff --git a/lib/core/model/auth/imei_details.dart b/lib/core/model/auth/imei_details.dart index 95ff1e74..eb37e736 100644 --- a/lib/core/model/auth/imei_details.dart +++ b/lib/core/model/auth/imei_details.dart @@ -1,34 +1,33 @@ class GetIMEIDetailsModel { - late int? iD; - late String? iMEI; - late int? logInTypeID; - late bool? outSA; - late String? mobile; - late dynamic identificationNo; - late int? doctorID; - late String? doctorName; - late String? doctorNameN; - late int? clinicID; - late String? clinicDescription; - late dynamic clinicDescriptionN; - late int? projectID; - late String? projectName; - late String? genderDescription; - late dynamic genderDescriptionN; - late String? titleDescription; - late dynamic titleDescriptionN; - late dynamic zipCode; - late String? createdOn; - late dynamic createdBy; - late String? editedOn; - late dynamic editedBy; - late bool? biometricEnabled; - late dynamic preferredLanguage; - late bool? isActive; - late String? vidaAuthTokenID; - late String? vidaRefreshTokenID; - late String? password; - + int iD; + String iMEI; + int logInTypeID; + bool outSA; + String mobile; + dynamic identificationNo; + int doctorID; + String doctorName; + String doctorNameN; + int clinicID; + String clinicDescription; + dynamic clinicDescriptionN; + int projectID; + String projectName; + String genderDescription; + dynamic genderDescriptionN; + String titleDescription; + dynamic titleDescriptionN; + dynamic zipCode; + String createdOn; + dynamic createdBy; + String editedOn; + dynamic editedBy; + bool biometricEnabled; + dynamic preferredLanguage; + bool isActive; + String vidaAuthTokenID; + String vidaRefreshTokenID; + String password; GetIMEIDetailsModel( {this.iD, this.iMEI, diff --git a/lib/core/model/auth/insert_imei_model.dart b/lib/core/model/auth/insert_imei_model.dart index 5e54b127..25e22b7a 100644 --- a/lib/core/model/auth/insert_imei_model.dart +++ b/lib/core/model/auth/insert_imei_model.dart @@ -1,37 +1,37 @@ class InsertIMEIDetailsModel { - late String? iMEI; - late int ?logInTypeID; - late dynamic outSA; - late String? mobile; - late dynamic identificationNo; - late int ?doctorID; - late String? doctorName; - late String ?doctorNameN; - late int ?clinicID; - late String ?clinicDescription; - late dynamic clinicDescriptionN; - late String ?projectName; - late String ?genderDescription; - late dynamic genderDescriptionN; - late String ?titleDescription; - late dynamic titleDescriptionN; - late bool ?bioMetricEnabled; - late dynamic preferredLanguage; - late bool ?isActive; - late int ?editedBy; - late int ?projectID; - late String ?tokenID; - late int ?languageID; - late String ?stamp; - late String ?iPAdress; - late double ?versionID; - late int ?channel; - late String ?sessionID; - late bool ?isLoginForDoctorApp; - late int ?patientOutSA; - late String ?vidaAuthTokenID; - late String ?vidaRefreshTokenID; - late dynamic password; + String iMEI; + int logInTypeID; + dynamic outSA; + String mobile; + dynamic identificationNo; + int doctorID; + String doctorName; + String doctorNameN; + int clinicID; + String clinicDescription; + Null clinicDescriptionN; + String projectName; + String genderDescription; + Null genderDescriptionN; + String titleDescription; + Null titleDescriptionN; + bool bioMetricEnabled; + Null preferredLanguage; + bool isActive; + int editedBy; + int projectID; + String tokenID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String sessionID; + bool isLoginForDoctorApp; + int patientOutSA; + String vidaAuthTokenID; + String vidaRefreshTokenID; + dynamic password; InsertIMEIDetailsModel( {this.iMEI, this.logInTypeID, diff --git a/lib/core/model/auth/new_login_information_response_model.dart b/lib/core/model/auth/new_login_information_response_model.dart index c834580b..117060e4 100644 --- a/lib/core/model/auth/new_login_information_response_model.dart +++ b/lib/core/model/auth/new_login_information_response_model.dart @@ -1,13 +1,13 @@ class NewLoginInformationModel { - late int? doctorID; - late List? listMemberInformation; - late String ?logInTokenID; - late String ?mobileNumber; - late dynamic sELECTDeviceIMEIbyIMEIList; - late int ?userID; - late String ?zipCode; - late bool ?isActiveCode; - late bool ?isSMSSent; + int doctorID; + List listMemberInformation; + String logInTokenID; + String mobileNumber; + Null sELECTDeviceIMEIbyIMEIList; + int userID; + String zipCode; + bool isActiveCode; + bool isSMSSent; NewLoginInformationModel( {this.doctorID, @@ -23,9 +23,9 @@ class NewLoginInformationModel { NewLoginInformationModel.fromJson(Map json) { doctorID = json['DoctorID']; if (json['List_MemberInformation'] != null) { - listMemberInformation = []; + listMemberInformation = new List(); json['List_MemberInformation'].forEach((v) { - listMemberInformation!.add(new ListMemberInformation.fromJson(v)); + listMemberInformation.add(new ListMemberInformation.fromJson(v)); }); } logInTokenID = json['LogInTokenID']; @@ -42,7 +42,7 @@ class NewLoginInformationModel { data['DoctorID'] = this.doctorID; if (this.listMemberInformation != null) { data['List_MemberInformation'] = - this.listMemberInformation!.map((v) => v.toJson()).toList(); + this.listMemberInformation.map((v) => v.toJson()).toList(); } data['LogInTokenID'] = this.logInTokenID; data['MobileNumber'] = this.mobileNumber; @@ -56,17 +56,17 @@ class NewLoginInformationModel { } class ListMemberInformation { - late dynamic setupID; - late int ? memberID; - late String ? memberName; - late dynamic memberNameN; - late String ? preferredLang; - late String ? pIN; - late String ? saltHash; - late int ? referenceID; - late int ? employeeID; - late int ? roleID; - late int ? projectid; + Null setupID; + int memberID; + String memberName; + Null memberNameN; + String preferredLang; + String pIN; + String saltHash; + int referenceID; + int employeeID; + int roleID; + int projectid; ListMemberInformation( {this.setupID, diff --git a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart index db971954..ceaf4c65 100644 --- a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart @@ -1,8 +1,8 @@ class SendActivationCodeForDoctorAppResponseModel { - String? logInTokenID; - String? verificationCode; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; + String logInTokenID; + String verificationCode; + String vidaAuthTokenID; + String vidaRefreshTokenID; SendActivationCodeForDoctorAppResponseModel( {this.logInTokenID, diff --git a/lib/core/model/calculate_box_request_model.dart b/lib/core/model/calculate_box_request_model.dart index 24e75bb7..80281854 100644 --- a/lib/core/model/calculate_box_request_model.dart +++ b/lib/core/model/calculate_box_request_model.dart @@ -1,9 +1,9 @@ class CalculateBoxQuantityRequestModel { - int? itemCode; - double? strength; - int? frequency; - int? duration; - String? vidaAuthTokenID; + int itemCode; + double strength; + int frequency; + int duration; + String vidaAuthTokenID; CalculateBoxQuantityRequestModel( {this.itemCode, diff --git a/lib/core/model/diabetic_chart/DiabeticType.dart b/lib/core/model/diabetic_chart/DiabeticType.dart index 8a9cfbe1..26641e61 100644 --- a/lib/core/model/diabetic_chart/DiabeticType.dart +++ b/lib/core/model/diabetic_chart/DiabeticType.dart @@ -1,7 +1,7 @@ class DiabeticType { - int? value; - String? nameEn; - String? nameAr; + int value; + String nameEn; + String nameAr; DiabeticType({this.value, this.nameEn, this.nameAr}); diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart index 34a8e997..7fad3106 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart @@ -1,22 +1,22 @@ class GetDiabeticChartValuesRequestModel { - int? deviceTypeID; - int? patientID; - int? resultType; - int? admissionNo; - String? setupID; - bool? patientOutSA; - int? patientType; - int? patientTypeID; + int deviceTypeID; + int patientID; + int resultType; + int admissionNo; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; GetDiabeticChartValuesRequestModel( {this.deviceTypeID, - this.patientID, - this.resultType, - this.admissionNo, - this.setupID, - this.patientOutSA, - this.patientType, - this.patientTypeID}); + this.patientID, + this.resultType, + this.admissionNo, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); GetDiabeticChartValuesRequestModel.fromJson(Map json) { deviceTypeID = json['DeviceTypeID']; diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart index 1e5dd8fd..fa2c1ca2 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart @@ -1,18 +1,18 @@ class GetDiabeticChartValuesResponseModel { - String? resultType; - int? admissionNo; - String? dateChart; - int? resultValue; - int? createdBy; - String? createdOn; + String resultType; + int admissionNo; + String dateChart; + int resultValue; + int createdBy; + String createdOn; GetDiabeticChartValuesResponseModel( {this.resultType, - this.admissionNo, - this.dateChart, - this.resultValue, - this.createdBy, - this.createdOn}); + this.admissionNo, + this.dateChart, + this.resultValue, + this.createdBy, + this.createdOn}); GetDiabeticChartValuesResponseModel.fromJson(Map json) { resultType = json['ResultType']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart index bea61fc9..310cfb50 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart @@ -1,16 +1,16 @@ class GetDiagnosisForInPatientRequestModel { - int? patientID; - int? admissionNo; - String? setupID; - int? patientType; - int? patientTypeID; + int patientID; + int admissionNo; + String setupID; + int patientType; + int patientTypeID; GetDiagnosisForInPatientRequestModel( {this.patientID, - this.admissionNo, - this.setupID, - this.patientType, - this.patientTypeID}); + this.admissionNo, + this.setupID, + this.patientType, + this.patientTypeID}); GetDiagnosisForInPatientRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart index 491ac591..1ec48964 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -1,27 +1,26 @@ class GetDiagnosisForInPatientResponseModel { - String? iCDCode10ID; - int? diagnosisTypeID; - int? conditionID; - bool? complexDiagnosis; - String? asciiDesc; - int? createdBy; - String? createdOn; - int? editedBy; - String? editedOn; - String? createdByName; - String? editedByName; + String iCDCode10ID; + int diagnosisTypeID; + int conditionID; + bool complexDiagnosis; + String asciiDesc; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String createdByName; + String editedByName; GetDiagnosisForInPatientResponseModel( {this.iCDCode10ID, - this.diagnosisTypeID, - this.conditionID, - this.complexDiagnosis, - this.asciiDesc, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.createdByName}); + this.diagnosisTypeID, + this.conditionID, + this.complexDiagnosis, + this.asciiDesc, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, this.createdByName}); GetDiagnosisForInPatientResponseModel.fromJson(Map json) { iCDCode10ID = json['ICDCode10ID']; diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 550f8ca8..8a5f1bc1 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -1,13 +1,13 @@ class GetHospitalsRequestModel { - int ?languageID; - String? stamp; - String? iPAdress; - double? versionID; - int ?channel; - String? tokenID; - String? sessionID; - bool ?isLoginForDoctorApp; - String ?memberID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + String memberID; GetHospitalsRequestModel( {this.languageID, diff --git a/lib/core/model/hospitals/get_hospitals_response_model.dart b/lib/core/model/hospitals/get_hospitals_response_model.dart index 1109b58b..edbc3fe5 100644 --- a/lib/core/model/hospitals/get_hospitals_response_model.dart +++ b/lib/core/model/hospitals/get_hospitals_response_model.dart @@ -1,7 +1,7 @@ class GetHospitalsResponseModel { - String? facilityGroupId; - int ?facilityId; - String ?facilityName; + String facilityGroupId; + int facilityId; + String facilityName; GetHospitalsResponseModel( {this.facilityGroupId, this.facilityId, this.facilityName}); diff --git a/lib/core/model/hospitals_model.dart b/lib/core/model/hospitals_model.dart index f2c89cfb..b09807d6 100644 --- a/lib/core/model/hospitals_model.dart +++ b/lib/core/model/hospitals_model.dart @@ -1,20 +1,20 @@ class HospitalsModel { - String? desciption; + String desciption; dynamic desciptionN; - int? iD; - String? legalName; - String? legalNameN; - String? name; + int iD; + String legalName; + String legalNameN; + String name; dynamic nameN; - String? phoneNumber; - String? setupID; - int? distanceInKilometers; - bool ?isActive; - String? latitude; - String? longitude; - int? mainProjectID; + String phoneNumber; + String setupID; + int distanceInKilometers; + bool isActive; + String latitude; + String longitude; + int mainProjectID; dynamic projectOutSA; - bool ?usingInDoctorApp; + bool usingInDoctorApp; HospitalsModel({this.desciption, this.desciptionN, @@ -33,7 +33,7 @@ class HospitalsModel { this.projectOutSA, this.usingInDoctorApp}); - HospitalsModel.fromJson(Map json) { + HospitalsModel.fromJson(Map json) { desciption = json['Desciption']; desciptionN = json['DesciptionN']; iD = json['ID']; @@ -52,8 +52,8 @@ class HospitalsModel { usingInDoctorApp = json['UsingInDoctorApp']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Desciption'] = this.desciption; data['DesciptionN'] = this.desciptionN; data['ID'] = this.iD; diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index 69e88a2e..a3717c42 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -1,11 +1,11 @@ class ApporvalDetails { - int? approvalNo; + int approvalNo; - String? procedureName; + String procedureName; //String procedureNameN; - String ?status; + String status; - String ?isInvoicedDesc; + String isInvoicedDesc; ApporvalDetails( {this.approvalNo, this.procedureName, this.status, this.isInvoicedDesc}); @@ -35,35 +35,35 @@ class ApporvalDetails { } class InsuranceApprovalModel { - List ?apporvalDetails; - double ?versionID; - int ? channel; - int ? languageID; - String ? iPAdress; - String ? generalid; - int ? patientOutSA; - String ? sessionID; - bool ? isDentalAllowedBackend; - int ? deviceTypeID; - int ? patientID; - String ? tokenID; - int ? patientTypeID; - int ? patientType; - int ? eXuldAPPNO; - int ? projectID; - String ? doctorName; - String ? clinicName; - String ? patientDescription; - int ? approvalNo; - String ?approvalStatusDescption; - int ? unUsedCount; - String ? doctorImage; - String ? projectName; + List apporvalDetails; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int eXuldAPPNO; + int projectID; + String doctorName; + String clinicName; + String patientDescription; + int approvalNo; + String approvalStatusDescption; + int unUsedCount; + String doctorImage; + String projectName; //String companyName; - String ? expiryDate; - String ? rceiptOn; - int ?appointmentNo; + String expiryDate; + String rceiptOn; + int appointmentNo; InsuranceApprovalModel( {this.versionID, @@ -126,9 +126,9 @@ class InsuranceApprovalModel { doctorImage = json['DoctorImageURL']; clinicName = json['ClinicName']; if (json['ApporvalDetails'] != null) { - apporvalDetails =[]; + apporvalDetails = new List(); json['ApporvalDetails'].forEach((v) { - apporvalDetails!.add(new ApporvalDetails.fromJson(v)); + apporvalDetails.add(new ApporvalDetails.fromJson(v)); }); } appointmentNo = json['AppointmentNo']; diff --git a/lib/core/model/insurance/insurance_approval_in_patient_model.dart b/lib/core/model/insurance/insurance_approval_in_patient_model.dart index 722d34c7..f185a8bf 100644 --- a/lib/core/model/insurance/insurance_approval_in_patient_model.dart +++ b/lib/core/model/insurance/insurance_approval_in_patient_model.dart @@ -1,36 +1,36 @@ class InsuranceApprovalInPatientModel { - String? setupID; - int? projectID; - int? approvalNo; - int? status; - String? approvalDate; - int? patientType; - int? patientID; - int? companyID; - bool? subCategoryID; - int? doctorID; - int? clinicID; - int? approvalType; - int? inpatientApprovalSubType; + String setupID; + int projectID; + int approvalNo; + int status; + String approvalDate; + int patientType; + int patientID; + int companyID; + bool subCategoryID; + int doctorID; + int clinicID; + int approvalType; + int inpatientApprovalSubType; dynamic isApprovalOnGross; - String? companyApprovalNo; + String companyApprovalNo; dynamic progNoteOrderNo; - String? submitOn; - String? receiptOn; - String? expiryDate; - int? admissionNo; - int? admissionRequestNo; - String? approvalStatusDescption; + String submitOn; + String receiptOn; + String expiryDate; + int admissionNo; + int admissionRequestNo; + String approvalStatusDescption; dynamic approvalStatusDescptionN; dynamic remarks; - List? apporvalDetails; - String? clinicName; + List apporvalDetails; + String clinicName; dynamic companyName; - String? doctorName; - String? projectName; - int? totaUnUsedCount; - int? unUsedCount; - String? doctorImage; + String doctorName; + String projectName; + int totaUnUsedCount; + int unUsedCount; + String doctorImage; InsuranceApprovalInPatientModel( {this.setupID, @@ -93,9 +93,9 @@ class InsuranceApprovalInPatientModel { approvalStatusDescptionN = json['ApprovalStatusDescptionN']; remarks = json['Remarks']; if (json['ApporvalDetails'] != null) { - apporvalDetails = []; + apporvalDetails = new List(); json['ApporvalDetails'].forEach((v) { - apporvalDetails!.add(new ApporvalDetails.fromJson(v)); + apporvalDetails.add(new ApporvalDetails.fromJson(v)); }); } clinicName = json['ClinicName']; @@ -135,7 +135,7 @@ class InsuranceApprovalInPatientModel { data['Remarks'] = this.remarks; if (this.apporvalDetails != null) { data['ApporvalDetails'] = - this.apporvalDetails!.map((v) => v.toJson()).toList(); + this.apporvalDetails.map((v) => v.toJson()).toList(); } data['ClinicName'] = this.clinicName; data['CompanyName'] = this.companyName; @@ -148,35 +148,35 @@ class InsuranceApprovalInPatientModel { } class ApporvalDetails { - dynamic setupID; - dynamic projectID; - int? approvalNo; - dynamic lineItemNo; - dynamic orderType; - dynamic procedureID; - dynamic toothNo; - dynamic price; - dynamic approvedAmount; - dynamic unapprovedPatientShare; - dynamic waivedAmount; - dynamic discountType; - dynamic discountValue; - dynamic shareType; - dynamic patientShareTypeValue; - dynamic companyShareTypeValue; - dynamic patientShare; - dynamic companyShare; - dynamic deductableAmount; - String? disapprovedRemarks; - dynamic progNoteOrderNo; - dynamic progNoteLineItemNo; - dynamic invoiceTransactionType; - dynamic invoiceNo; - String? procedureName; - String? procedureNameN; - String? status; - dynamic isInvoiced; - String? isInvoicedDesc; + Null setupID; + Null projectID; + int approvalNo; + Null lineItemNo; + Null orderType; + Null procedureID; + Null toothNo; + Null price; + Null approvedAmount; + Null unapprovedPatientShare; + Null waivedAmount; + Null discountType; + Null discountValue; + Null shareType; + Null patientShareTypeValue; + Null companyShareTypeValue; + Null patientShare; + Null companyShare; + Null deductableAmount; + String disapprovedRemarks; + Null progNoteOrderNo; + Null progNoteLineItemNo; + Null invoiceTransactionType; + Null invoiceNo; + String procedureName; + String procedureNameN; + String status; + Null isInvoiced; + String isInvoicedDesc; ApporvalDetails( {this.setupID, diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart index 7fc4432f..ecb4ae65 100644 --- a/lib/core/model/labs/LabOrderResult.dart +++ b/lib/core/model/labs/LabOrderResult.dart @@ -1,23 +1,23 @@ class LabOrderResult { - String? description; + String description; dynamic femaleInterpretativeData; - int ?gender; - int? lineItemNo; + int gender; + int lineItemNo; dynamic maleInterpretativeData; dynamic notes; - String ?packageID; - int ?patientID; - String ? projectID; - String ? referanceRange; - String ? resultValue; - String ? sampleCollectedOn; - String ? sampleReceivedOn; - String ? setupID; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; dynamic superVerifiedOn; - String? testCode; - String? uOM; - String? verifiedOn; - String? verifiedOnDateTime; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; LabOrderResult( {this.description, diff --git a/lib/core/model/labs/LabResultHistory.dart b/lib/core/model/labs/LabResultHistory.dart index 4d4221e1..7c4221ca 100644 --- a/lib/core/model/labs/LabResultHistory.dart +++ b/lib/core/model/labs/LabResultHistory.dart @@ -1,54 +1,54 @@ class LabResultHistory { - String? description; - String? femaleInterpretativeData; - int? gender; - bool? isCertificateAllowed; - int? lineItemNo; - String? maleInterpretativeData; - String? notes; - int? orderLineItemNo; - int? orderNo; - String? packageID; - int? patientID; - String? projectID; - String? referanceRange; - String? resultValue; - int? resultValueBasedLineItemNo; - String? resultValueFlag; - String? sampleCollectedOn; - String? sampleReceivedOn; - String? setupID; - String? superVerifiedOn; - String? testCode; - String? uOM; - String? verifiedOn; - String? verifiedOnDateTime; + String description; + String femaleInterpretativeData; + int gender; + bool isCertificateAllowed; + int lineItemNo; + String maleInterpretativeData; + String notes; + int orderLineItemNo; + int orderNo; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + int resultValueBasedLineItemNo; + String resultValueFlag; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + String superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; LabResultHistory( {this.description, - this.femaleInterpretativeData, - this.gender, - this.isCertificateAllowed, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.orderLineItemNo, - this.orderNo, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.resultValueBasedLineItemNo, - this.resultValueFlag, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.isCertificateAllowed, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.orderLineItemNo, + this.orderNo, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.resultValueBasedLineItemNo, + this.resultValueFlag, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResultHistory.fromJson(Map json) { description = json['Description']; @@ -105,4 +105,4 @@ class LabResultHistory { data['VerifiedOnDateTime'] = this.verifiedOnDateTime; return data; } -} +} \ No newline at end of file diff --git a/lib/core/model/labs/all_special_lab_result_model.dart b/lib/core/model/labs/all_special_lab_result_model.dart index a177e16e..ffdc5ee5 100644 --- a/lib/core/model/labs/all_special_lab_result_model.dart +++ b/lib/core/model/labs/all_special_lab_result_model.dart @@ -5,51 +5,51 @@ class AllSpecialLabResultModel { dynamic appointmentDate; dynamic appointmentNo; dynamic appointmentTime; - String? clinicDescription; - String? clinicDescriptionEnglish; + String clinicDescription; + String clinicDescriptionEnglish; dynamic clinicDescriptionN; dynamic clinicID; dynamic createdOn; - double? decimalDoctorRate; + double decimalDoctorRate; dynamic doctorID; - String? doctorImageURL; - String? doctorName; - String? doctorNameEnglish; + String doctorImageURL; + String doctorName; + String doctorNameEnglish; dynamic doctorNameN; dynamic doctorRate; dynamic doctorStarsRate; - String? doctorTitle; + String doctorTitle; dynamic gender; - String? genderDescription; - bool? inOutPatient; - String? invoiceNo; - bool? isActiveDoctorProfile; - bool? isDoctorAllowVedioCall; - bool? isExecludeDoctor; - bool? isInOutPatient; + String genderDescription; + bool inOutPatient; + String invoiceNo; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; - bool? isLiveCareAppointment; - bool? isRead; - bool? isSendEmail; - String? moduleID; - String? nationalityFlagURL; + bool isLiveCareAppointment; + bool isRead; + bool isSendEmail; + String moduleID; + String nationalityFlagURL; dynamic noOfPatientsRate; dynamic orderDate; - String? orderNo; + String orderNo; dynamic patientID; - String? projectID; - String? projectName; + String projectID; + String projectName; dynamic projectNameN; - String? qR; - String? resultData; - String? resultDataHTML; + String qR; + String resultData; + String resultDataHTML; dynamic resultDataTxt; - String? setupID; + String setupID; //List speciality; dynamic status; dynamic statusDesc; - String? strOrderDate; + String strOrderDate; AllSpecialLabResultModel( {this.actualDoctorRate, diff --git a/lib/core/model/labs/all_special_lab_result_request.dart b/lib/core/model/labs/all_special_lab_result_request.dart index 950f0e96..d5df1405 100644 --- a/lib/core/model/labs/all_special_lab_result_request.dart +++ b/lib/core/model/labs/all_special_lab_result_request.dart @@ -1,18 +1,18 @@ class AllSpecialLabResultRequestModel { - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; - String? sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - String? tokenID; - int? patientTypeID; - int? patientType; - int? patientID; - int? projectID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + int patientTypeID; + int patientType; + int patientID; + int projectID; AllSpecialLabResultRequestModel( {this.versionID, diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 0cc48aef..ee9f981d 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,24 +1,24 @@ class LabResult { - String? description; + String description; dynamic femaleInterpretativeData; - int? gender; - int? lineItemNo; + int gender; + int lineItemNo; dynamic maleInterpretativeData; - String? notes; - String? packageID; - int? patientID; - String? projectID; - String? referanceRange; - String? resultValue; - String? sampleCollectedOn; - String? sampleReceivedOn; - String? setupID; - String? maxValue; - String? minValue; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String maxValue; + String minValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; dynamic superVerifiedOn; - String? testCode; - String? uOM; - String? verifiedOn; + String testCode; + String uOM; + String verifiedOn; dynamic verifiedOnDateTime; LabResult( @@ -96,9 +96,9 @@ class LabResult { int checkResultStatus() { try { - var max = double.tryParse(maxValue!) ?? null; - var min = double.tryParse(minValue!) ?? null; - var result = double.tryParse(resultValue!) ?? null; + var max = double.tryParse(maxValue) ?? null; + var min = double.tryParse(minValue) ?? null; + var result = double.tryParse(resultValue) ?? null; if (max != null && min != null && result != null) { if (result > max) { return 1; @@ -110,17 +110,18 @@ class LabResult { } else { return 0; } - } catch (e) { + }catch (e){ return 0; } + } } class LabResultList { String filterName = ""; - List patientLabResultList = []; + List patientLabResultList = List(); - LabResultList({required this.filterName, required LabResult lab}) { + LabResultList({this.filterName, LabResult lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 08f81f16..af60f86f 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -1,40 +1,40 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientLabOrders { - int ?actualDoctorRate; - String ?clinicDescription; - String ?clinicDescriptionEnglish; - dynamic clinicDescriptionN; - int ?clinicID; - int ?doctorID; - String? doctorImageURL; - String ?doctorName; - String ?doctorNameEnglish; - dynamic doctorNameN; - int ?doctorRate; - String ?doctorTitle; - int ?gender; - String ?genderDescription; - String ?invoiceNo; - bool ?isActiveDoctorProfile; - bool ?isDoctorAllowVedioCall; - bool ?isExecludeDoctor; - bool ?isInOutPatient; - String ?isInOutPatientDescription; - String ?isInOutPatientDescriptionN; - bool ?isRead; - String ?nationalityFlagURL; - int ?noOfPatientsRate; - DateTime? orderDate; - String ?orderNo; - String ?patientID; - String ?projectID; - String ?projectName; - dynamic projectNameN; - String ?qR; - String ?setupID; - List ?speciality; - bool ?isLiveCareAppointment; + int actualDoctorRate; + String clinicDescription; + String clinicDescriptionEnglish; + Null clinicDescriptionN; + int clinicID; + int doctorID; + String doctorImageURL; + String doctorName; + String doctorNameEnglish; + Null doctorNameN; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + String invoiceNo; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isRead; + String nationalityFlagURL; + int noOfPatientsRate; + DateTime orderDate; + String orderNo; + String patientID; + String projectID; + String projectName; + Null projectNameN; + String qR; + String setupID; + List speciality; + bool isLiveCareAppointment; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -149,10 +149,10 @@ class PatientLabOrders { class PatientLabOrdersList { String filterName = ""; - List patientLabOrdersList = []; + List patientLabOrdersList = List(); PatientLabOrdersList( - {required this.filterName, required PatientLabOrders patientDoctorAppointment}) { + {this.filterName, PatientLabOrders patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart index f86dd56f..2fbcb832 100644 --- a/lib/core/model/labs/patient_lab_special_result.dart +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -1,9 +1,9 @@ class PatientLabSpecialResult { - String ?invoiceNo; - String ?moduleID; - String ? resultData; - String ? resultDataHTML; - dynamic resultDataTxt; + String invoiceNo; + String moduleID; + String resultData; + String resultDataHTML; + Null resultDataTxt; PatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart index 4f746277..ce9263ef 100644 --- a/lib/core/model/labs/request_patient_lab_orders.dart +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -1,17 +1,17 @@ class RequestPatientLabOrders { - double? versionID; - int ?channel; - int ?languageID; - String? iPAdress; - String ?generalid; - int? patientOutSA; - String? sessionID; - bool ?isDentalAllowedBackend; - int ?deviceTypeID; - int ?patientID; - String ?tokenID; - int ?patientTypeID; - int ?patientType; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; RequestPatientLabOrders( {this.versionID, diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index 100f92b5..b48cf0e1 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,22 +1,22 @@ class RequestPatientLabSpecialResult { - String? invoiceNo; - String? orderNo; - String? setupID; - String? projectID; - int ?clinicID; - double? versionID; - int ?channel; - int ?languageID; - String? iPAdress; - String ?generalid; - int ?patientOutSA; - String ?sessionID; - bool ?isDentalAllowedBackend; - int ?deviceTypeID; - int ?patientID; - String? tokenID; - int ?patientTypeID; - int ?patientType; + String invoiceNo; + String orderNo; + String setupID; + String projectID; + int clinicID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; RequestPatientLabSpecialResult( {this.invoiceNo, diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 66f5e2a0..118da906 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -1,56 +1,56 @@ class RequestSendLabReportEmail { - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; - String? sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - int? patientID; - String? tokenID; - int? patientTypeID; - int? patientType; - String? to; - String? dateofBirth; - String? patientIditificationNum; - String? patientMobileNumber; - String? patientName; - String? setupID; - String? projectName; - String? clinicName; - String? doctorName; - String? projectID; - String? invoiceNo; - String? orderDate; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + String to; + String dateofBirth; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + String setupID; + String projectName; + String clinicName; + String doctorName; + String projectID; + String invoiceNo; + String orderDate; RequestSendLabReportEmail( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.to, - this.dateofBirth, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.setupID, - this.projectName, - this.clinicName, - this.doctorName, - this.projectID, - this.invoiceNo, - this.orderDate}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index 28d70805..11f27b95 100644 --- a/lib/core/model/live_care/AlternativeServicesList.dart +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; class AlternativeService { - int? serviceID; - String? serviceName; - bool? isSelected; + int serviceID; + String serviceName; + bool isSelected; AlternativeService( {this.serviceID, this.serviceName, this.isSelected = false}); @@ -23,7 +23,7 @@ class AlternativeService { } class AlternativeServicesList with ChangeNotifier { - late List _alternativeServicesList; + List _alternativeServicesList; getServicesList(){ return _alternativeServicesList; diff --git a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart index a99c9649..dc1f25b3 100644 --- a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart +++ b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart @@ -1,7 +1,7 @@ class PendingPatientERForDoctorAppRequestModel { - bool ? outSA; - int ? doctorID; - String ? sErServiceID; + bool outSA; + int doctorID; + String sErServiceID; PendingPatientERForDoctorAppRequestModel( {this.outSA, this.doctorID, this.sErServiceID}); diff --git a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart index f96016d7..1d63e885 100644 --- a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart +++ b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart @@ -1,12 +1,11 @@ class AddPatientToDoctorListRequestModel { - int? vCID; - String? tokenID; - String? generalid; - int? doctorId; - bool? isOutKsa; + int vCID; + String tokenID; + String generalid; + int doctorId; + bool isOutKsa; - AddPatientToDoctorListRequestModel( - {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); + AddPatientToDoctorListRequestModel({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); AddPatientToDoctorListRequestModel.fromJson(Map json) { vCID = json['VC_ID']; 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 index 90ea0ff1..e14d4223 100644 --- a/lib/core/model/live_care/live_care_login_reguest_model.dart +++ b/lib/core/model/live_care/live_care_login_reguest_model.dart @@ -1,9 +1,9 @@ class LiveCareUserLoginRequestModel { - String? tokenID; - String? generalid; - int? doctorId; - int? isOutKsa; - int? isLogin; + String tokenID; + String generalid; + int doctorId; + int isOutKsa; + int isLogin; LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin}); diff --git a/lib/core/model/medical_report/medical_file_model.dart b/lib/core/model/medical_report/medical_file_model.dart index 53737499..deebb2af 100644 --- a/lib/core/model/medical_report/medical_file_model.dart +++ b/lib/core/model/medical_report/medical_file_model.dart @@ -1,14 +1,14 @@ class MedicalFileModel { - List? entityList; + List entityList; dynamic statusMessage; MedicalFileModel({this.entityList, this.statusMessage}); MedicalFileModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } statusMessage = json['statusMessage']; @@ -17,7 +17,7 @@ class MedicalFileModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['statusMessage'] = this.statusMessage; return data; @@ -25,15 +25,15 @@ class MedicalFileModel { } class EntityList { - List? timelines; + List timelines; EntityList({this.timelines}); EntityList.fromJson(Map json) { if (json['Timelines'] != null) { - timelines = []; + timelines = new List(); json['Timelines'].forEach((v) { - timelines!.add(new Timelines.fromJson(v)); + timelines.add(new Timelines.fromJson(v)); }); } } @@ -41,25 +41,25 @@ class EntityList { Map toJson() { final Map data = new Map(); if (this.timelines != null) { - data['Timelines'] = this.timelines!.map((v) => v.toJson()).toList(); + data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); } return data; } } class Timelines { - int? clinicId; - String? clinicName; - String? date; - int? doctorId; - String? doctorImage; - String? doctorName; - int? encounterNumber; - String? encounterType; - int? projectID; - String? projectName; - String? setupID; - List? timeLineEvents; + int clinicId; + String clinicName; + String date; + int doctorId; + String doctorImage; + String doctorName; + int encounterNumber; + String encounterType; + int projectID; + String projectName; + String setupID; + List timeLineEvents; Timelines( {this.clinicId, @@ -88,9 +88,9 @@ class Timelines { projectName = json['ProjectName']; setupID = json['SetupID']; if (json['TimeLineEvents'] != null) { - timeLineEvents = []; + timeLineEvents = new List(); json['TimeLineEvents'].forEach((v) { - timeLineEvents!.add(new TimeLineEvents.fromJson(v)); + timeLineEvents.add(new TimeLineEvents.fromJson(v)); }); } } @@ -110,25 +110,25 @@ class Timelines { data['SetupID'] = this.setupID; if (this.timeLineEvents != null) { data['TimeLineEvents'] = - this.timeLineEvents!.map((v) => v.toJson()).toList(); + this.timeLineEvents.map((v) => v.toJson()).toList(); } return data; } } class TimeLineEvents { - List? admissions; - String? colorClass; - List? consulations; + List admissions; + String colorClass; + List consulations; TimeLineEvents({this.admissions, this.colorClass, this.consulations}); TimeLineEvents.fromJson(Map json) { colorClass = json['ColorClass']; if (json['Consulations'] != null) { - consulations = []; + consulations = new List(); json['Consulations'].forEach((v) { - consulations!.add(new Consulations.fromJson(v)); + consulations.add(new Consulations.fromJson(v)); }); } } @@ -138,38 +138,38 @@ class TimeLineEvents { data['ColorClass'] = this.colorClass; if (this.consulations != null) { - data['Consulations'] = this.consulations!.map((v) => v.toJson()).toList(); + data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); } return data; } } class Consulations { - int? admissionNo; - String? appointmentDate; - int? appointmentNo; - String? appointmentType; - String? clinicID; - String? clinicName; - int? doctorID; - String? doctorName; - String? endTime; - String? episodeDate; - int? episodeID; - int? patientID; - int? projectID; - String? projectName; - String? remarks; - String? setupID; - String? startTime; - String? visitFor; - String? visitType; - String? dispalyName; - List? lstAssessments; - List? lstPhysicalExam; - List? lstProcedure; - List? lstMedicalHistory; - List? lstCheifComplaint; + int admissionNo; + String appointmentDate; + int appointmentNo; + String appointmentType; + String clinicID; + String clinicName; + int doctorID; + String doctorName; + String endTime; + String episodeDate; + int episodeID; + int patientID; + int projectID; + String projectName; + String remarks; + String setupID; + String startTime; + String visitFor; + String visitType; + String dispalyName; + List lstAssessments; + List lstPhysicalExam; + List lstProcedure; + List lstMedicalHistory; + List lstCheifComplaint; Consulations( {this.admissionNo, @@ -220,33 +220,33 @@ class Consulations { visitType = json['VisitType']; dispalyName = json['dispalyName']; if (json['lstAssessments'] != null) { - lstAssessments = []; + lstAssessments = new List(); json['lstAssessments'].forEach((v) { - lstAssessments!.add(new LstAssessments.fromJson(v)); + lstAssessments.add(new LstAssessments.fromJson(v)); }); } if (json['lstCheifComplaint'] != null) { - lstCheifComplaint = []; + lstCheifComplaint = new List(); json['lstCheifComplaint'].forEach((v) { - lstCheifComplaint!.add(new LstCheifComplaint.fromJson(v)); + lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); }); } if (json['lstPhysicalExam'] != null) { - lstPhysicalExam = []; + lstPhysicalExam = new List(); json['lstPhysicalExam'].forEach((v) { - lstPhysicalExam!.add(new LstPhysicalExam.fromJson(v)); + lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); }); } if (json['lstProcedure'] != null) { - lstProcedure = []; + lstProcedure = new List(); json['lstProcedure'].forEach((v) { - lstProcedure!.add(new LstProcedure.fromJson(v)); + lstProcedure.add(new LstProcedure.fromJson(v)); }); } if (json['lstMedicalHistory'] != null) { - lstMedicalHistory = []; + lstMedicalHistory = new List(); json['lstMedicalHistory'].forEach((v) { - lstMedicalHistory!.add(new LstMedicalHistory.fromJson(v)); + lstMedicalHistory.add(new LstMedicalHistory.fromJson(v)); }); } } @@ -275,40 +275,40 @@ class Consulations { data['dispalyName'] = this.dispalyName; if (this.lstAssessments != null) { data['lstAssessments'] = - this.lstAssessments!.map((v) => v.toJson()).toList(); + this.lstAssessments.map((v) => v.toJson()).toList(); } if (this.lstCheifComplaint != null) { data['lstCheifComplaint'] = - this.lstCheifComplaint!.map((v) => v.toJson()).toList(); + this.lstCheifComplaint.map((v) => v.toJson()).toList(); } if (this.lstPhysicalExam != null) { data['lstPhysicalExam'] = - this.lstPhysicalExam!.map((v) => v.toJson()).toList(); + this.lstPhysicalExam.map((v) => v.toJson()).toList(); } if (this.lstProcedure != null) { - data['lstProcedure'] = this.lstProcedure!.map((v) => v.toJson()).toList(); + data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); } if (this.lstMedicalHistory != null) { data['lstMedicalHistory'] = - this.lstMedicalHistory!.map((v) => v.toJson()).toList(); + this.lstMedicalHistory.map((v) => v.toJson()).toList(); } return data; } } class LstCheifComplaint { - int? appointmentNo; - String? cCDate; - String? chiefComplaint; - String? currentMedication; - int? episodeID; - String? hOPI; - int? patientID; - String? patientType; - int? projectID; - String? projectName; - String? setupID; - String? dispalyName; + int appointmentNo; + String cCDate; + String chiefComplaint; + String currentMedication; + int episodeID; + String hOPI; + int patientID; + String patientType; + int projectID; + String projectName; + String setupID; + String dispalyName; LstCheifComplaint( {this.appointmentNo, @@ -358,19 +358,19 @@ class LstCheifComplaint { } class LstAssessments { - int? appointmentNo; - String? condition; - String? description; - int? episodeID; - String? iCD10; - int? patientID; - String? patientType; - int? projectID; - String? projectName; - String? remarks; - String? setupID; - String? type; - String? dispalyName; + int appointmentNo; + String condition; + String description; + int episodeID; + String iCD10; + int patientID; + String patientType; + int projectID; + String projectName; + String remarks; + String setupID; + String type; + String dispalyName; LstAssessments( {this.appointmentNo, @@ -423,19 +423,19 @@ class LstAssessments { } class LstPhysicalExam { - String? abnormal; - int? appointmentNo; - int? episodeID; - String? examDesc; - String? examID; - String? examType; - int? patientID; - String? patientType; - int? projectID; - String? projectName; - String? remarks; - String? setupID; - String? dispalyName; + String abnormal; + int appointmentNo; + int episodeID; + String examDesc; + String examID; + String examType; + int patientID; + String patientType; + int projectID; + String projectName; + String remarks; + String setupID; + String dispalyName; LstPhysicalExam( {this.abnormal, @@ -488,17 +488,17 @@ class LstPhysicalExam { } class LstProcedure { - int? appointmentNo; - int? episodeID; - String? orderDate; - int? patientID; - String? patientType; - String? procName; - String? procedureId; - int? projectID; - String? projectName; - String? setupID; - String? dispalyName; + int appointmentNo; + int episodeID; + String orderDate; + int patientID; + String patientType; + String procName; + String procedureId; + int projectID; + String projectName; + String setupID; + String dispalyName; LstProcedure( {this.appointmentNo, @@ -545,17 +545,17 @@ class LstProcedure { } class LstMedicalHistory { - int? appointmentNo; - String? checked; - int? episodeID; - String? history; - int? patientID; - String? patientType; - int? projectID; - String? projectName; - String? remarks; - String? setupID; - String? dispalyName; + int appointmentNo; + String checked; + int episodeID; + String history; + int patientID; + String patientType; + int projectID; + String projectName; + String remarks; + String setupID; + String dispalyName; LstMedicalHistory( {this.appointmentNo, diff --git a/lib/core/model/medical_report/medical_file_request_model.dart b/lib/core/model/medical_report/medical_file_request_model.dart index 01a2abf2..8703141a 100644 --- a/lib/core/model/medical_report/medical_file_request_model.dart +++ b/lib/core/model/medical_report/medical_file_request_model.dart @@ -1,7 +1,7 @@ class MedicalFileRequestModel { - int ?patientMRN; - String ?vidaAuthTokenID; - String ?iPAdress; + int patientMRN; + String vidaAuthTokenID; + String iPAdress; MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID,this.iPAdress}); diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index 5d1709ca..ce076705 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -1,23 +1,23 @@ class CreateNoteModel { - int? visitType; - int? admissionNo; - int? projectID; - int? patientTypeID; - int? patientID; - int? clinicID; - String? notes; - int ?createdBy; - int ?editedBy; - String ?nursingRemarks; - int ?languageID; - String? stamp; - String ?iPAdress; - double ?versionID; - int ?channel; - String ?tokenID; - String? sessionID; - bool ?isLoginForDoctorApp; - bool ?patientOutSA; + int visitType; + int admissionNo; + int projectID; + int patientTypeID; + int patientID; + int clinicID; + String notes; + int createdBy; + int editedBy; + String nursingRemarks; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; CreateNoteModel( {this.visitType, diff --git a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart index b7fd7aa5..4335053c 100644 --- a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart @@ -1,18 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; class GetNursingProgressNoteRequestModel { - int? patientID; - int? admissionNo; - int? patientTypeID; - int? patientType; - String? setupID; + int patientID; + int admissionNo; + int patientTypeID; + int patientType; + String setupID; GetNursingProgressNoteRequestModel( - {this.patientID, - this.admissionNo, - this.patientTypeID = 1, - this.patientType = 1, - this.setupID}); + {this.patientID, this.admissionNo, this.patientTypeID = 1, this.patientType = 1, this.setupID }); GetNursingProgressNoteRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart index aaf9c7ab..fb7fbcec 100644 --- a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart @@ -1,14 +1,14 @@ class GetNursingProgressNoteResposeModel { - String? notes; + String notes; dynamic conditionType; - int? createdBy; - String? createdOn; + int createdBy; + String createdOn; dynamic editedBy; dynamic editedOn; - String? createdByName; + String createdByName; - String? editedByName; + String editedByName; GetNursingProgressNoteResposeModel( {this.notes, diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 713de924..797f9b6d 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -1,24 +1,24 @@ class NoteModel { - String? setupID; - int ?projectID; - int ?patientID; - int ?patientType; - String ?admissionNo; - int ?lineItemNo; - int ?visitType; - String ?notes; - String ?assessmentDate; - String ?visitTime; - int ?status; - String ?nursingRemarks; - String ?createdOn; - String ?editedOn; - int ?createdBy; - int ?admissionClinicID; - String ?admissionClinicName; - dynamic doctorClinicName; - String ?doctorName; - String ?visitTypeDesc; + String setupID; + int projectID; + int patientID; + int patientType; + String admissionNo; + int lineItemNo; + int visitType; + String notes; + String assessmentDate; + String visitTime; + int status; + String nursingRemarks; + String createdOn; + String editedOn; + int createdBy; + int admissionClinicID; + String admissionClinicName; + Null doctorClinicName; + String doctorName; + String visitTypeDesc; NoteModel( {this.setupID, diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index a3189e39..20fd4b86 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -1,40 +1,40 @@ class UpdateNoteReqModel { - int? projectID; - int? createdBy; - int? admissionNo; - int? lineItemNo; - String? notes; - bool? verifiedNote; - bool? cancelledNote; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; + int projectID; + int createdBy; + int admissionNo; + int lineItemNo; + String notes; + bool verifiedNote; + bool cancelledNote; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; UpdateNoteReqModel( {this.projectID, - this.createdBy, - this.admissionNo, - this.lineItemNo, - this.notes, - this.verifiedNote, - this.cancelledNote, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.createdBy, + this.admissionNo, + this.lineItemNo, + this.notes, + this.verifiedNote, + this.cancelledNote, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); UpdateNoteReqModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 970d48cb..401fd1a7 100644 --- a/lib/core/model/patient_muse/PatientMuseResultsModel.dart +++ b/lib/core/model/patient_muse/PatientMuseResultsModel.dart @@ -1,19 +1,19 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatientMuseResultsModel { - int ?rowID; - String? setupID; - int ?projectID; - String? orderNo; - int? lineItemNo; - int? patientType; - int? patientID; - String ?procedureID; + int rowID; + String setupID; + int projectID; + String orderNo; + int lineItemNo; + int patientType; + int patientID; + String procedureID; dynamic reportData; - String? imageURL; - String? createdBy; - String? createdOn; - DateTime? createdOnDateTime; + String imageURL; + String createdBy; + String createdOn; + DateTime createdOnDateTime; PatientMuseResultsModel( {this.rowID, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index c2c1bab8..dcb9b31c 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -1,19 +1,19 @@ class PatientSearchRequestModel { - int? doctorID; - String? firstName; - String? middleName; - String? lastName; - String? patientMobileNumber; - String? patientIdentificationID; - int? patientID; - String? from; - String? to; - int? searchType; - int? projectID; - String? mobileNo; - String? identificationNo; - int? nursingStationID; - int? clinicID = 0; + int doctorID; + String firstName; + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; + int patientID; + String from; + String to; + int searchType; + int projectID; + String mobileNo; + String identificationNo; + int nursingStationID; + int clinicID = 0; PatientSearchRequestModel( {this.doctorID, diff --git a/lib/core/model/procedure/ControlsModel.dart b/lib/core/model/procedure/ControlsModel.dart index e14c7768..b3e8ae9c 100644 --- a/lib/core/model/procedure/ControlsModel.dart +++ b/lib/core/model/procedure/ControlsModel.dart @@ -1,6 +1,6 @@ class Controls { - String ?code; - String ?controlValue; + String code; + String controlValue; Controls({this.code, this.controlValue}); diff --git a/lib/core/model/procedure/Procedure_template_request_model.dart b/lib/core/model/procedure/Procedure_template_request_model.dart index abd6a2b3..698178e3 100644 --- a/lib/core/model/procedure/Procedure_template_request_model.dart +++ b/lib/core/model/procedure/Procedure_template_request_model.dart @@ -1,31 +1,31 @@ class ProcedureTempleteRequestModel { - int? doctorID; - String? firstName; - String? middleName; - String? lastName; - String? patientMobileNumber; - String? patientIdentificationID; - int? patientID; - String? from; - String? to; - int? searchType; - String? mobileNo; - String? identificationNo; - int? editedBy; - int? projectID; - int? clinicID; - String? tokenID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; - int? deviceTypeID; + int doctorID; + String firstName; + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; + int patientID; + String from; + String to; + int searchType; + String mobileNo; + String identificationNo; + int editedBy; + int projectID; + int clinicID; + String tokenID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + String vidaAuthTokenID; + String vidaRefreshTokenID; + int deviceTypeID; ProcedureTempleteRequestModel( {this.doctorID, @@ -56,7 +56,7 @@ class ProcedureTempleteRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteRequestModel.fromJson(Map json) { + ProcedureTempleteRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; middleName = json['MiddleName']; diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index e4df9963..9e6f847f 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -1,26 +1,26 @@ class CategoriseProcedureModel { - List ?entityList; - int ?rowcount; + List entityList; + int rowcount; dynamic statusMessage; CategoriseProcedureModel( - {this.entityList, this.rowcount, this.statusMessage}); + {this.entityList, this.rowcount, this.statusMessage}); - CategoriseProcedureModel.fromJson(Map json) { + CategoriseProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,20 +29,20 @@ class CategoriseProcedureModel { } class EntityList { - bool ?allowedClinic; - String ? category; - String ? categoryID; - String ? genderValidation; - String ? group; - String ? orderedValidation; + bool allowedClinic; + String category; + String categoryID; + String genderValidation; + String group; + String orderedValidation; dynamic price; - String ? procedureId; - String ? procedureName; - String ? specialPermission; - String ? subGroup; - String ? template; - String ? remarks; - String ? type; + String procedureId; + String procedureName; + String specialPermission; + String subGroup; + String template; + String remarks; + String type; EntityList( {this.allowedClinic, @@ -60,7 +60,7 @@ class EntityList { this.remarks, this.type}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -75,8 +75,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_ordered_procedure_model.dart b/lib/core/model/procedure/get_ordered_procedure_model.dart index 5b0d4695..c3c7718f 100644 --- a/lib/core/model/procedure/get_ordered_procedure_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_model.dart @@ -1,26 +1,26 @@ class GetOrderedProcedureModel { - List? entityList; - int? rowcount; + List entityList; + int rowcount; dynamic statusMessage; GetOrderedProcedureModel( {this.entityList, this.rowcount, this.statusMessage}); - GetOrderedProcedureModel.fromJson(Map json) { + GetOrderedProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,31 +29,31 @@ class GetOrderedProcedureModel { } class EntityList { - String? achiCode; - String? appointmentDate; - int? appointmentNo; - int? categoryID; - String? clinicDescription; - String? cptCode; - int? createdBy; - String? createdOn; - String? doctorName; - bool? isApprovalCreated; - bool? isApprovalRequired; - bool? isCovered; - bool? isInvoiced; - bool? isReferralInvoiced; - bool? isUncoveredByDoctor; - int? lineItemNo; - String? orderDate; - int? orderNo; - int? orderType; - String? procedureId; - String? procedureName; - String? remarks; - String? status; - String? template; - int? doctorID; + String achiCode; + String appointmentDate; + int appointmentNo; + int categoryID; + String clinicDescription; + String cptCode; + int createdBy; + String createdOn; + String doctorName; + bool isApprovalCreated; + bool isApprovalRequired; + bool isCovered; + bool isInvoiced; + bool isReferralInvoiced; + bool isUncoveredByDoctor; + int lineItemNo; + String orderDate; + int orderNo; + int orderType; + String procedureId; + String procedureName; + String remarks; + String status; + String template; + int doctorID; EntityList( {this.achiCode, @@ -82,7 +82,7 @@ class EntityList { this.template, this.doctorID}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { achiCode = json['achiCode']; doctorID = json['doctorID']; appointmentDate = json['appointmentDate']; @@ -110,8 +110,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['achiCode'] = this.achiCode; data['doctorID'] = this.doctorID; data['appointmentDate'] = this.appointmentDate; diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index dbfb75cd..5178ab14 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,10 +1,9 @@ class GetOrderedProcedureRequestModel { - String? vidaAuthTokenID; - int? patientMRN; - int? appointmentNo; + String vidaAuthTokenID; + int patientMRN; + int appointmentNo; - GetOrderedProcedureRequestModel( - {this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); + GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); GetOrderedProcedureRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/core/model/procedure/get_procedure_model.dart b/lib/core/model/procedure/get_procedure_model.dart index 516c8e42..5c83b49b 100644 --- a/lib/core/model/procedure/get_procedure_model.dart +++ b/lib/core/model/procedure/get_procedure_model.dart @@ -1,25 +1,25 @@ class GetProcedureModel { - List? entityList; - int? rowcount; + List entityList; + int rowcount; dynamic statusMessage; GetProcedureModel({this.entityList, this.rowcount, this.statusMessage}); - GetProcedureModel.fromJson(Map json) { + GetProcedureModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; statusMessage = json['statusMessage']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -28,18 +28,18 @@ class GetProcedureModel { } class EntityList { - bool? allowedClinic; - String? category; - String? categoryID; - String? genderValidation; - String? group; - String? orderedValidation; + bool allowedClinic; + String category; + String categoryID; + String genderValidation; + String group; + String orderedValidation; dynamic price; - String? procedureId; - String? procedureName; - String? specialPermission; - String? subGroup; - String? template; + String procedureId; + String procedureName; + String specialPermission; + String subGroup; + String template; EntityList( {this.allowedClinic, @@ -55,7 +55,7 @@ class EntityList { this.subGroup, this.template}); - EntityList.fromJson(Map json) { + EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; category = json['category']; categoryID = json['categoryID']; @@ -70,8 +70,8 @@ class EntityList { template = json['template']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allowedClinic'] = this.allowedClinic; data['category'] = this.category; data['categoryID'] = this.categoryID; diff --git a/lib/core/model/procedure/get_procedure_req_model.dart b/lib/core/model/procedure/get_procedure_req_model.dart index 832fbadb..6202a520 100644 --- a/lib/core/model/procedure/get_procedure_req_model.dart +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -1,11 +1,11 @@ class GetProcedureReqModel { - int? clinicId; - int? patientMRN; - int? pageSize; - int? pageIndex; - List ?search; + int clinicId; + int patientMRN; + int pageSize; + int pageIndex; + List search; dynamic category; - String ?vidaAuthTokenID; + String vidaAuthTokenID; GetProcedureReqModel( {this.clinicId, diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart index 44ef9775..b12563f8 100644 --- a/lib/core/model/procedure/post_procedure_req_model.dart +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -1,11 +1,11 @@ import 'ControlsModel.dart'; class PostProcedureReqModel { - int? patientMRN; - int? appointmentNo; - int? episodeID; - List ?procedures; - String ?vidaAuthTokenID; + int patientMRN; + int appointmentNo; + int episodeID; + List procedures; + String vidaAuthTokenID; PostProcedureReqModel( {this.patientMRN, @@ -19,9 +19,9 @@ class PostProcedureReqModel { appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; if (json['Procedures'] != null) { - procedures = []; + procedures = new List(); json['Procedures'].forEach((v) { - procedures!.add(new Procedures.fromJson(v)); + procedures.add(new Procedures.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; @@ -33,7 +33,7 @@ class PostProcedureReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeID; if (this.procedures != null) { - data['Procedures'] = this.procedures!.map((v) => v.toJson()).toList(); + data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -41,9 +41,9 @@ class PostProcedureReqModel { } class Procedures { - String ?procedure; - String ?category; - List ?controls; + String procedure; + String category; + List controls; Procedures({this.procedure, this.category, this.controls}); @@ -51,9 +51,9 @@ class Procedures { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = []; + controls = new List(); json['Controls'].forEach((v) { - controls!.add(new Controls.fromJson(v)); + controls.add(new Controls.fromJson(v)); }); } } @@ -63,7 +63,7 @@ class Procedures { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/procedure/procedure_category_list_model.dart b/lib/core/model/procedure/procedure_category_list_model.dart index 50048080..849e84e5 100644 --- a/lib/core/model/procedure/procedure_category_list_model.dart +++ b/lib/core/model/procedure/procedure_category_list_model.dart @@ -1,6 +1,6 @@ class ProcedureCategoryListModel { - List? entityList; - int? rowcount; + List entityList; + int rowcount; dynamic statusMessage; ProcedureCategoryListModel( @@ -8,9 +8,9 @@ class ProcedureCategoryListModel { ProcedureCategoryListModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -20,7 +20,7 @@ class ProcedureCategoryListModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -29,8 +29,8 @@ class ProcedureCategoryListModel { } class EntityList { - int? categoryId; - String? categoryName; + int categoryId; + String categoryName; EntityList({this.categoryId, this.categoryName}); diff --git a/lib/core/model/procedure/procedure_templateModel.dart b/lib/core/model/procedure/procedure_templateModel.dart index 38a05693..3b12d646 100644 --- a/lib/core/model/procedure/procedure_templateModel.dart +++ b/lib/core/model/procedure/procedure_templateModel.dart @@ -1,13 +1,13 @@ class ProcedureTempleteModel { - String? setupID; - int? projectID; - int? clinicID; - int? doctorID; - int? templateID; - String? templateName; - bool? isActive; - int? createdBy; - String? createdOn; + String setupID; + int projectID; + int clinicID; + int doctorID; + int templateID; + String templateName; + bool isActive; + int createdBy; + String createdOn; dynamic editedBy; dynamic editedOn; diff --git a/lib/core/model/procedure/procedure_template_details_model.dart b/lib/core/model/procedure/procedure_template_details_model.dart index 13316fa8..1fc797ae 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -1,29 +1,29 @@ class ProcedureTempleteDetailsModel { - String? setupID; - int? projectID; - int? clinicID; - int? doctorID; - int? templateID; - String? templateName; - String? procedureID; - bool ?isActive; - int? createdBy; - String? createdOn; + String setupID; + int projectID; + int clinicID; + int doctorID; + int templateID; + String templateName; + String procedureID; + bool isActive; + int createdBy; + String createdOn; dynamic editedBy; dynamic editedOn; - String? procedureName; - String? procedureNameN; - String? alias; - String? aliasN; - String? categoryID; - String? subGroupID; - String? categoryDescription; - String? categoryDescriptionN; - String? categoryAlias; + String procedureName; + String procedureNameN; + String alias; + String aliasN; + String categoryID; + String subGroupID; + String categoryDescription; + String categoryDescriptionN; + String categoryAlias; dynamic riskCategoryID; - String? type = "1"; - String? remarks; - int? selectedType = 0; + String type = "1"; + String remarks; + int selectedType = 0; ProcedureTempleteDetailsModel( {this.setupID, @@ -52,7 +52,7 @@ class ProcedureTempleteDetailsModel { this.type = "1", this.selectedType = 0}); - ProcedureTempleteDetailsModel.fromJson(Map json) { + ProcedureTempleteDetailsModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; clinicID = json['ClinicID']; @@ -77,8 +77,8 @@ class ProcedureTempleteDetailsModel { categoryAlias = json['CategoryAlias']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['ClinicID'] = this.clinicID; @@ -105,12 +105,12 @@ class ProcedureTempleteDetailsModel { } } class ProcedureTempleteDetailsModelList { - List procedureTemplate =[]; - String? templateName; - int? templateId; + List procedureTemplate = List(); + String templateName; + int templateId; ProcedureTempleteDetailsModelList( - {this.templateName, this.templateId, required ProcedureTempleteDetailsModel template}) { + {this.templateName, this.templateId, ProcedureTempleteDetailsModel template}) { procedureTemplate.add(template); } } diff --git a/lib/core/model/procedure/procedure_template_details_request_model.dart b/lib/core/model/procedure/procedure_template_details_request_model.dart index c5504cdd..6df6fc73 100644 --- a/lib/core/model/procedure/procedure_template_details_request_model.dart +++ b/lib/core/model/procedure/procedure_template_details_request_model.dart @@ -1,32 +1,32 @@ class ProcedureTempleteDetailsRequestModel { - int? doctorID; - String? firstName; - int? templateID; - String? middleName; - String? lastName; - String? patientMobileNumber; - String? patientIdentificationID; - int? patientID; - String? from; - String? to; - int? searchType; - String? mobileNo; - String? identificationNo; - int? editedBy; - int? projectID; - int? clinicID; - String? tokenID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; - int? deviceTypeID; + int doctorID; + String firstName; + int templateID; + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; + int patientID; + String from; + String to; + int searchType; + String mobileNo; + String identificationNo; + int editedBy; + int projectID; + int clinicID; + String tokenID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + String vidaAuthTokenID; + String vidaRefreshTokenID; + int deviceTypeID; ProcedureTempleteDetailsRequestModel( {this.doctorID, @@ -58,7 +58,7 @@ class ProcedureTempleteDetailsRequestModel { this.vidaRefreshTokenID, this.deviceTypeID}); - ProcedureTempleteDetailsRequestModel.fromJson(Map json) { + ProcedureTempleteDetailsRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; firstName = json['FirstName']; templateID = json['TemplateID']; diff --git a/lib/core/model/procedure/procedure_valadate_model.dart b/lib/core/model/procedure/procedure_valadate_model.dart index 431d369a..3a3e23cf 100644 --- a/lib/core/model/procedure/procedure_valadate_model.dart +++ b/lib/core/model/procedure/procedure_valadate_model.dart @@ -1,6 +1,6 @@ class ProcedureValadteModel { - List? entityList; - int? rowcount; + List entityList; + int rowcount; dynamic statusMessage; dynamic success; @@ -9,9 +9,9 @@ class ProcedureValadteModel { ProcedureValadteModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -22,7 +22,7 @@ class ProcedureValadteModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; @@ -32,8 +32,8 @@ class ProcedureValadteModel { } class EntityList { - String? procedureId; - List? warringMessages; + String procedureId; + List warringMessages; EntityList({this.procedureId, this.warringMessages}); diff --git a/lib/core/model/procedure/procedure_valadate_request_model.dart b/lib/core/model/procedure/procedure_valadate_request_model.dart index 581ff41f..0b872b93 100644 --- a/lib/core/model/procedure/procedure_valadate_request_model.dart +++ b/lib/core/model/procedure/procedure_valadate_request_model.dart @@ -1,9 +1,9 @@ class ProcedureValadteRequestModel { - String? vidaAuthTokenID; - int? patientMRN; - int? appointmentNo; - int? episodeID; - List? procedure; + String vidaAuthTokenID; + int patientMRN; + int appointmentNo; + int episodeID; + List procedure; ProcedureValadteRequestModel( {this.vidaAuthTokenID, diff --git a/lib/core/model/procedure/update_procedure_request_model.dart b/lib/core/model/procedure/update_procedure_request_model.dart index a6b92d16..aee39879 100644 --- a/lib/core/model/procedure/update_procedure_request_model.dart +++ b/lib/core/model/procedure/update_procedure_request_model.dart @@ -1,13 +1,13 @@ import 'ControlsModel.dart'; class UpdateProcedureRequestModel { - int? orderNo; - int? patientMRN; - int? appointmentNo; - int? episodeID; - int? lineItemNo; - ProcedureDetail? procedureDetail; - String? vidaAuthTokenID; + int orderNo; + int patientMRN; + int appointmentNo; + int episodeID; + int lineItemNo; + ProcedureDetail procedureDetail; + String vidaAuthTokenID; UpdateProcedureRequestModel( {this.orderNo, @@ -38,7 +38,7 @@ class UpdateProcedureRequestModel { data['EpisodeID'] = this.episodeID; data['LineItemNo'] = this.lineItemNo; if (this.procedureDetail != null) { - data['procedureDetail'] = this.procedureDetail!.toJson(); + data['procedureDetail'] = this.procedureDetail.toJson(); } data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; @@ -46,9 +46,9 @@ class UpdateProcedureRequestModel { } class ProcedureDetail { - String? procedure; - String? category; - List? controls; + String procedure; + String category; + List controls; ProcedureDetail({this.procedure, this.category, this.controls}); @@ -56,9 +56,9 @@ class ProcedureDetail { procedure = json['Procedure']; category = json['Category']; if (json['Controls'] != null) { - controls = []; + controls = new List(); json['Controls'].forEach((v) { - controls!.add(new Controls.fromJson(v)); + controls.add(new Controls.fromJson(v)); }); } } @@ -68,7 +68,7 @@ class ProcedureDetail { data['Procedure'] = this.procedure; data['Category'] = this.category; if (this.controls != null) { - data['Controls'] = this.controls!.map((v) => v.toJson()).toList(); + data['Controls'] = this.controls.map((v) => v.toJson()).toList(); } return data; } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 4c16151c..e09f269a 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -8,17 +8,17 @@ class FinalRadiology { dynamic invoiceNo; dynamic doctorID; dynamic clinicID; - DateTime? orderDate; - DateTime ?reportDate; + DateTime orderDate; + DateTime reportDate; dynamic reportData; dynamic imageURL; dynamic procedureID; dynamic appodynamicmentNo; dynamic dIAPacsURL; - bool? isRead; + bool isRead; dynamic readOn; var admissionNo; - bool ?isInOutPatient; + bool isInOutPatient; dynamic actualDoctorRate; dynamic clinicDescription; dynamic dIAPACSURL; @@ -28,8 +28,8 @@ class FinalRadiology { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool? isActiveDoctorProfile; - bool ?isExecludeDoctor; + bool isActiveDoctorProfile; + bool isExecludeDoctor; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; dynamic nationalityFlagURL; @@ -39,10 +39,10 @@ class FinalRadiology { dynamic qR; dynamic reportDataHTML; dynamic reportDataTextdynamic; - List? speciality; - bool ?isCVI; - bool ?isRadMedicalReport; - bool ?isLiveCareAppodynamicment; + List speciality; + bool isCVI; + bool isRadMedicalReport; + bool isLiveCareAppodynamicment; FinalRadiology( {this.setupID, @@ -186,9 +186,9 @@ class FinalRadiology { class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = []; + List finalRadiologyList = List(); - FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) { + FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { finalRadiologyList.add(finalRadiology); } } diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart index b42bc723..9e3458d5 100644 --- a/lib/core/model/radiology/request_patient_rad_orders_details.dart +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -1,24 +1,24 @@ class RequestPatientRadOrdersDetails { - int? projectID; - int? orderNo; - int? invoiceNo; - String? setupID; - String? procedureID; - bool? isMedicalReport; - bool? isCVI; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; - String? sessionID; - bool? isDentalAllowedBackend; - int? deviceTypeID; - int? patientID; - String? tokenID; - int? patientTypeID; - int? patientType; + int projectID; + int orderNo; + int invoiceNo; + String setupID; + String procedureID; + bool isMedicalReport; + bool isCVI; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; RequestPatientRadOrdersDetails( {this.projectID, @@ -42,7 +42,7 @@ class RequestPatientRadOrdersDetails { this.patientTypeID, this.patientType}); - RequestPatientRadOrdersDetails.fromJson(Map json) { + RequestPatientRadOrdersDetails.fromJson(Map json) { projectID = json['ProjectID']; orderNo = json['OrderNo']; invoiceNo = json['InvoiceNo']; @@ -65,8 +65,8 @@ class RequestPatientRadOrdersDetails { patientType = json['PatientType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; data['InvoiceNo'] = this.invoiceNo; diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 3b9e961a..6d68653d 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -1,30 +1,30 @@ class RequestSendRadReportEmail { - int? channel; - String? clinicName; - String? dateofBirth; - int? deviceTypeID; - String? doctorName; - String? generalid; - int? invoiceNo; - String? iPAdress; - bool ?isDentalAllowedBackend; - int? languageID; - String? orderDate; - int? patientID; - String? patientIditificationNum; - String? patientMobileNumber; - String? patientName; - int? patientOutSA; - int? patientType; - int? patientTypeID; - int? projectID; - String? projectName; - String? radResult; - String? sessionID; - String? setupID; - String? to; - String? tokenID; - double? versionID; + int channel; + String clinicName; + String dateofBirth; + int deviceTypeID; + String doctorName; + String generalid; + int invoiceNo; + String iPAdress; + bool isDentalAllowedBackend; + int languageID; + String orderDate; + int patientID; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + int patientOutSA; + int patientType; + int patientTypeID; + int projectID; + String projectName; + String radResult; + String sessionID; + String setupID; + String to; + String tokenID; + double versionID; RequestSendRadReportEmail( {this.channel, @@ -54,7 +54,7 @@ class RequestSendRadReportEmail { this.tokenID, this.versionID}); - RequestSendRadReportEmail.fromJson(Map json) { + RequestSendRadReportEmail.fromJson(Map json) { channel = json['Channel']; clinicName = json['ClinicName']; dateofBirth = json['DateofBirth']; @@ -83,8 +83,8 @@ class RequestSendRadReportEmail { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Channel'] = this.channel; data['ClinicName'] = this.clinicName; data['DateofBirth'] = this.dateofBirth; diff --git a/lib/core/model/referral/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart index d104ccae..dff63bfc 100644 --- a/lib/core/model/referral/DischargeReferralPatient.dart +++ b/lib/core/model/referral/DischargeReferralPatient.dart @@ -2,56 +2,56 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class DischargeReferralPatient { dynamic rowID; - int? projectID; - int? lineItemNo; - int? doctorID; - int? patientID; - String? doctorName; + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; dynamic doctorNameN; - String? firstName; - String? middleName; - String? lastName; + String firstName; + String middleName; + String lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int? gender; - String? dateofBirth; - String? mobileNumber; - String? emailAddress; - String? patientIdentificationNo; - int? patientType; - String? admissionNo; - String? admissionDate; - String? roomID; - String? bedID; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; dynamic nursingStationID; dynamic description; - String? nationalityName; + String nationalityName; dynamic nationalityNameN; - int? referralDoctor; - int? referringDoctor; - int? referralClinic; - int? referringClinic; - int? referralStatus; - DateTime ?referralDate; - String? referringDoctorRemarks; - String? referredDoctorRemarks; - String? referralResponseOn; - int? priority; - int? frequency; - String? mAXResponseTime; - String? dischargeDate; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + DateTime referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + String mAXResponseTime; + String dischargeDate; dynamic clinicID; - String? age; - String? clinicDescription; - String? frequencyDescription; - String? genderDescription; - bool?isDoctorLate; - bool? isDoctorResponse; - String? nursingStationName; - String? priorityDescription; - String? referringClinicDescription; - String? referringDoctorName; + String age; + String clinicDescription; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referringDoctorName; DischargeReferralPatient( {this.rowID, @@ -106,7 +106,7 @@ class DischargeReferralPatient { this.referringClinicDescription, this.referringDoctorName}); - DischargeReferralPatient.fromJson(Map json) { + DischargeReferralPatient.fromJson(Map json) { rowID = json['RowID']; projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; @@ -160,8 +160,8 @@ class DischargeReferralPatient { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 6f68a6d7..4f00f455 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -2,75 +2,75 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { dynamic rowID; - int? projectID; - int? lineItemNo; - int? doctorID; - int? patientID; - String? doctorName; + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; dynamic doctorNameN; - String? firstName; - String? middleName; - String? lastName; + String firstName; + String middleName; + String lastName; dynamic firstNameN; dynamic middleNameN; dynamic lastNameN; - int? gender; - String? dateofBirth; - String? mobileNumber; - String? emailAddress; - String? patientIdentificationNo; - int? patientType; - String? admissionNo; - String? admissionDate; - String? roomID; - String? bedID; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; dynamic nursingStationID; dynamic description; - String? nationalityName; + String nationalityName; dynamic nationalityNameN; - String? clinicDescription; - String? clinicDescriptionN; - int? referralDoctor; - int? referringDoctor; - int? referralClinic; - int? referringClinic; - int? referralStatus; - DateTime? referralDate; - String? referringDoctorRemarks; - String? referredDoctorRemarks; - String? referralResponseOn; - int? priority; - int? frequency; - String? mAXResponseTime; - int? episodeID; - int? appointmentNo; - String? appointmentDate; - int? appointmentType; - int? patientMRN; - String? createdOn; - int? clinicID; - String? nationalityID; - String? age; - String? doctorImageURL; - String? frequencyDescription; - String? genderDescription; - bool? isDoctorLate; - bool? isDoctorResponse; - String? nationalityFlagURL; - String? nursingStationName; - String? priorityDescription; - String? referringClinicDescription; - String? referringDoctorName; - int? referalStatus; - String? sourceSetupID; - int? sourceProjectId; - String? targetSetupID; - int? targetProjectId; - int? targetClinicID; - int? targetDoctorID; - int? sourceAppointmentNo; - int? targetAppointmentNo; - String? remarksFromSource; + String clinicDescription; + String clinicDescriptionN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + DateTime referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + String mAXResponseTime; + int episodeID; + int appointmentNo; + String appointmentDate; + int appointmentType; + int patientMRN; + String createdOn; + int clinicID; + String nationalityID; + String age; + String doctorImageURL; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nationalityFlagURL; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referringDoctorName; + int referalStatus; + String sourceSetupID; + int sourceProjectId; + String targetSetupID; + int targetProjectId; + int targetClinicID; + int targetDoctorID; + int sourceAppointmentNo; + int targetAppointmentNo; + String remarksFromSource; MyReferralPatientModel( {this.rowID, @@ -113,38 +113,29 @@ class MyReferralPatientModel { this.referralResponseOn, this.priority, this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.referalStatus, - this.sourceSetupID, - this.sourceAppointmentNo, - this.sourceProjectId, - this.targetProjectId, - this.targetAppointmentNo, - this.targetClinicID, - this.targetSetupID, - this.targetDoctorID, - this.remarksFromSource}); + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID, this.remarksFromSource}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; referalStatus = json['ReferalStatus']; projectID = json['ProjectID']; @@ -228,10 +219,11 @@ class MyReferralPatientModel { sourceAppointmentNo = json['SourceAppointmentNo']; targetAppointmentNo = json['TargetAppointmentNo']; remarksFromSource = json['RemarksFromSource']; + } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['ReferalStatus'] = this.referalStatus; data['ProjectID'] = this.projectID; @@ -306,6 +298,6 @@ class MyReferralPatientModel { } get patientName { - return this.firstName! + " " + this.lastName!; + return this.firstName + " " + this.lastName; } } diff --git a/lib/core/model/referral/MyReferralPatientRequestModel.dart b/lib/core/model/referral/MyReferralPatientRequestModel.dart index 885653a1..08b98a99 100644 --- a/lib/core/model/referral/MyReferralPatientRequestModel.dart +++ b/lib/core/model/referral/MyReferralPatientRequestModel.dart @@ -1,27 +1,27 @@ 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; + 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, diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index 0e0bc161..b3ad1f03 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -1,56 +1,56 @@ class ReferralRequest { - String? roomID; - String? referralClinic; - String? referralDoctor; - int? createdBy; - int? editedBy; - int? patientID; - int? patientTypeID; - int? referringClinic; - int? referringDoctor; - int? projectID; - int? admissionNo; - String? referringDoctorRemarks; - String? priority; - String? frequency; - String? extension; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + String roomID; + String referralClinic; + String referralDoctor; + int createdBy; + int editedBy; + int patientID; + int patientTypeID; + int referringClinic; + int referringDoctor; + int projectID; + int admissionNo; + String referringDoctorRemarks; + String priority; + String frequency; + String extension; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; ReferralRequest( {this.roomID, - this.referralClinic, - this.referralDoctor, - this.createdBy, - this.editedBy, - this.patientID, - this.patientTypeID, - this.referringClinic, - this.referringDoctor, - this.projectID, - this.admissionNo, - this.referringDoctorRemarks, - this.priority, - this.frequency, - this.extension, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.referralClinic, + this.referralDoctor, + this.createdBy, + this.editedBy, + this.patientID, + this.patientTypeID, + this.referringClinic, + this.referringDoctor, + this.projectID, + this.admissionNo, + this.referringDoctorRemarks, + this.priority, + this.frequency, + this.extension, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - ReferralRequest.fromJson(Map json) { + ReferralRequest.fromJson(Map json) { roomID = json['RoomID']; referralClinic = json['ReferralClinic']; referralDoctor = json['ReferralDoctor']; diff --git a/lib/core/model/referral/add_referred_remarks_request.dart b/lib/core/model/referral/add_referred_remarks_request.dart index 5b7edbc6..14089513 100644 --- a/lib/core/model/referral/add_referred_remarks_request.dart +++ b/lib/core/model/referral/add_referred_remarks_request.dart @@ -1,19 +1,19 @@ 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; + 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, diff --git a/lib/core/model/search_drug/get_medication_response_model.dart b/lib/core/model/search_drug/get_medication_response_model.dart index 24079b5e..a42a8b47 100644 --- a/lib/core/model/search_drug/get_medication_response_model.dart +++ b/lib/core/model/search_drug/get_medication_response_model.dart @@ -1,13 +1,13 @@ class GetMedicationResponseModel { - String? description; - String? genericName; - int ?itemId; - String? keywords; + String description; + String genericName; + int itemId; + String keywords; dynamic price; dynamic quantity; dynamic mediSpanGPICode; - bool ?isNarcotic; - String? uom; + bool isNarcotic; + String uom; GetMedicationResponseModel( {this.description, this.genericName, @@ -19,7 +19,7 @@ class GetMedicationResponseModel { this.uom, this.mediSpanGPICode}); - GetMedicationResponseModel.fromJson(Map json) { + GetMedicationResponseModel.fromJson(Map json) { description = json['Description']; genericName = json['GenericName']; itemId = json['ItemId']; @@ -31,8 +31,8 @@ class GetMedicationResponseModel { uom = json['uom']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['Description'] = this.description; data['GenericName'] = this.genericName; data['ItemId'] = this.itemId; diff --git a/lib/core/model/search_drug/item_by_medicine_model.dart b/lib/core/model/search_drug/item_by_medicine_model.dart index a95988db..0a93a4f1 100644 --- a/lib/core/model/search_drug/item_by_medicine_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_model.dart @@ -1,27 +1,27 @@ class ItemByMedicineModel { - List? frequencies; - List ?routes; - List? strengths; + List frequencies; + List routes; + List strengths; ItemByMedicineModel({this.frequencies, this.routes, this.strengths}); ItemByMedicineModel.fromJson(Map json) { if (json['frequencies'] != null) { - frequencies = []; + frequencies = new List(); json['frequencies'].forEach((v) { - frequencies!.add(new Frequencies.fromJson(v)); + frequencies.add(new Frequencies.fromJson(v)); }); } if (json['routes'] != null) { - routes = []; + routes = new List(); json['routes'].forEach((v) { - routes!.add(new Routes.fromJson(v)); + routes.add(new Routes.fromJson(v)); }); } if (json['strengths'] != null) { - strengths = []; + strengths = new List(); json['strengths'].forEach((v) { - strengths!.add(new Strengths.fromJson(v)); + strengths.add(new Strengths.fromJson(v)); }); } } @@ -29,22 +29,22 @@ class ItemByMedicineModel { Map toJson() { final Map data = new Map(); if (this.frequencies != null) { - data['frequencies'] = this.frequencies!.map((v) => v.toJson()).toList(); + data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList(); } if (this.routes != null) { - data['routes'] = this.routes!.map((v) => v.toJson()).toList(); + data['routes'] = this.routes.map((v) => v.toJson()).toList(); } if (this.strengths != null) { - data['strengths'] = this.strengths!.map((v) => v.toJson()).toList(); + data['strengths'] = this.strengths.map((v) => v.toJson()).toList(); } return data; } } class Frequencies { - String? description; - bool? isDefault; - int ?parameterCode; + String description; + bool isDefault; + int parameterCode; Frequencies({this.description, this.isDefault, this.parameterCode}); @@ -64,9 +64,9 @@ class Frequencies { } class Strengths { - String? description; - bool ?isDefault; - int ?parameterCode; + String description; + bool isDefault; + int parameterCode; Strengths({this.description, this.isDefault, this.parameterCode}); @@ -86,9 +86,9 @@ class Strengths { } class Routes { - String ?description; - bool ?isDefault; - int ?parameterCode; + String description; + bool isDefault; + int parameterCode; Routes({this.description, this.isDefault, this.parameterCode}); diff --git a/lib/core/model/search_drug/item_by_medicine_request_model.dart b/lib/core/model/search_drug/item_by_medicine_request_model.dart index 7ec3e21e..7460044b 100644 --- a/lib/core/model/search_drug/item_by_medicine_request_model.dart +++ b/lib/core/model/search_drug/item_by_medicine_request_model.dart @@ -1,6 +1,6 @@ class ItemByMedicineRequestModel { - String ?vidaAuthTokenID; - int ?medicineCode; + String vidaAuthTokenID; + int medicineCode; ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode}); diff --git a/lib/core/model/search_drug/search_drug_model.dart b/lib/core/model/search_drug/search_drug_model.dart index aa7739a2..396526c1 100644 --- a/lib/core/model/search_drug/search_drug_model.dart +++ b/lib/core/model/search_drug/search_drug_model.dart @@ -1,15 +1,15 @@ class SearchDrugModel { - List? entityList; - int ?rowcount; + List entityList; + int rowcount; dynamic statusMessage; SearchDrugModel({this.entityList, this.rowcount, this.statusMessage}); SearchDrugModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = []; + entityList = new List(); json['entityList'].forEach((v) { - entityList!.add(new EntityList.fromJson(v)); + entityList.add(new EntityList.fromJson(v)); }); } rowcount = json['rowcount']; @@ -19,7 +19,7 @@ class SearchDrugModel { Map toJson() { final Map data = new Map(); if (this.entityList != null) { - data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; diff --git a/lib/core/model/search_drug/search_drug_request_model.dart b/lib/core/model/search_drug/search_drug_request_model.dart index 8c725c86..b64e7d18 100644 --- a/lib/core/model/search_drug/search_drug_request_model.dart +++ b/lib/core/model/search_drug/search_drug_request_model.dart @@ -1,5 +1,5 @@ class SearchDrugRequestModel { - List ?search; + List search; // String vidaAuthTokenID; SearchDrugRequestModel({this.search}); diff --git a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart index 8087481c..26bb76bd 100644 --- a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart @@ -1,16 +1,12 @@ class GetSickLeaveDoctorRequestModel { - int? patientMRN; - String? appointmentNo; - int? status; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; + int patientMRN; + String appointmentNo; + int status; + String vidaAuthTokenID; + String vidaRefreshTokenID; GetSickLeaveDoctorRequestModel( - {this.patientMRN, - this.appointmentNo, - this.status, - this.vidaAuthTokenID, - this.vidaRefreshTokenID}); + {this.patientMRN, this.appointmentNo, this.status, this.vidaAuthTokenID, this.vidaRefreshTokenID}); GetSickLeaveDoctorRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index cca30c3d..1e79833c 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -21,13 +21,13 @@ class SickLeavePatientModel { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool? isActiveDoctorProfile; - bool? isDoctorAllowVedioCall; - bool? isExecludeDoctor; - bool? isInOutPatient; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; - bool? isLiveCareAppointment; + bool isLiveCareAppointment; dynamic noOfPatientsRate; dynamic patientName; dynamic projectName; @@ -84,7 +84,7 @@ class SickLeavePatientModel { this.remarks, this.status}); - SickLeavePatientModel.fromJson(Map json) { + SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; isExtendedLeave = json['isExtendedLeave']; noOfDays = json['noOfDays']; @@ -121,14 +121,14 @@ class SickLeavePatientModel { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); strRequestDate = json['StrRequestDate']; startDate = json['StartDate'] ?? json['startDate']; endDate = json['EndDate']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['status'] = this.status; data['isExtendedLeave'] = this.isExtendedLeave; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index 9987c4ff..69b18f41 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -1,17 +1,17 @@ class SickLeavePatientRequestModel { - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? patientOutSA; - int? deviceTypeID; - int? patientType; - int? patientTypeID; - String? tokenID; - int? patientID; - int? patientMRN; - String? sessionID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + int deviceTypeID; + int patientType; + int patientTypeID; + String tokenID; + int patientID; + int patientMRN; + String sessionID; SickLeavePatientRequestModel( {this.versionID, @@ -28,7 +28,7 @@ class SickLeavePatientRequestModel { this.sessionID, this.patientMRN}); - SickLeavePatientRequestModel.fromJson(Map json) { + SickLeavePatientRequestModel.fromJson(Map json) { versionID = json['VersionID']; patientMRN = json['PatientMRN']; channel = json['Channel']; diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index b5ffb318..0ad669ab 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -7,7 +7,7 @@ class AnalyticsService { FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics); - Future logEvent({required String eventCategory, required String eventAction}) async { + Future logEvent({@required String eventCategory, @required String eventAction}) async { await _analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 182adb6c..5690c01e 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -3,24 +3,24 @@ import 'package:flutter/material.dart'; class NavigationService { final GlobalKey navigatorKey = new GlobalKey(); - Future navigateTo(String routeName,{required Object arguments}) { - return navigatorKey.currentState!.pushNamed(routeName,arguments: arguments); + Future navigateTo(String routeName,{Object arguments}) { + return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); } - Future pushReplacementNamed(String routeName,{required Object arguments}) { - return navigatorKey.currentState!.pushReplacementNamed(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); + return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); } Future pushAndRemoveUntil(Route newRoute) { - return navigatorKey.currentState!.pushAndRemoveUntil(newRoute,(asd)=>false); + return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); } pop() { - return navigatorKey.currentState!.pop(); + return navigatorKey.currentState.pop(); } } \ No newline at end of file diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 5f29325a..236bcd42 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -9,8 +9,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; class PatientRegistrationService extends BaseService { - late GetPatientInfoResponseModel getPatientInfoResponseModel; - late String logInTokenID; + GetPatientInfoResponseModel getPatientInfoResponseModel; + String logInTokenID; checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -39,12 +39,13 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - { - required int otpType, - required PatientRegistrationViewModel model, - required CheckPatientForRegistrationModel + {SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel, + int otpType, + PatientRegistrationViewModel model, + CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { - SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel = + registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( oTPSendType: otpType, patientIdentificationID: checkPatientForRegistrationModel diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 697b78e3..31cc2cd6 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -16,17 +16,17 @@ import '../../locator.dart'; import '../../routes.dart'; import 'NavigationService.dart'; -class VideoCallService extends BaseService{ - - late StartCallRes startCallRes; - late PatiantInformtion patient; - LiveCarePatientServices _liveCarePatientServices = locator(); +class VideoCallService extends BaseService { + StartCallRes startCallRes; + PatiantInformtion patient; + LiveCarePatientServices _liveCarePatientServices = + locator(); openVideo(StartCallRes startModel, PatiantInformtion patientModel, bool isRecording,VoidCallback onCallConnected, VoidCallback onCallDisconnected) async { this.startCallRes = startModel; this.patient = patientModel; - DoctorProfileModel? doctorProfile = + DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( // TODO MOSA TEST @@ -44,23 +44,23 @@ class VideoCallService extends BaseService{ : "-"), tokenID: await sharedPref.getString(TOKEN), generalId: GENERAL_ID, - doctorId: doctorProfile!.doctorID, + doctorId: doctorProfile.doctorID, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, onCallConnected: onCallConnected, onCallDisconnected: onCallDisconnected, onCallEnd: () { - WidgetsBinding.instance!.addPostFrameCallback((_) async { + WidgetsBinding.instance.addPostFrameCallback((_) async { GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); endCall( - patient.vcId!, + patient.vcId, false, ).then((value) { GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); if (hasError) { DrAppToastMsg.showErrorToast(error); } else @@ -72,15 +72,15 @@ class VideoCallService extends BaseService{ }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); endCall( - patient.vcId!, + patient.vcId, sessionStatusModel.sessionStatus == 3, ).then((value) { GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); if (hasError) { DrAppToastMsg.showErrorToast(error); } else { @@ -98,13 +98,13 @@ class VideoCallService extends BaseService{ hasError = false; await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile!.doctorID; + 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!; + error = _liveCarePatientServices.error; } } } diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index 7771bea6..49e89881 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -17,29 +17,28 @@ class AuthenticationService extends BaseService { List get dashboardItemsList => _imeiDetails; NewLoginInformationModel _loginInfo = NewLoginInformationModel(); NewLoginInformationModel get loginInfo => _loginInfo; - SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = - SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); - SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => - _activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = - SendActivationCodeForDoctorAppResponseModel(); + SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = - CheckActivationCodeForDoctorAppResponseModel(); + CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); - CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => - _checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; Map _insertDeviceImeiRes = {}; List _doctorProfilesList = []; List get doctorProfilesList => _doctorProfilesList; + + + Future selectDeviceImei(imei) async { try { - await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SELECT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { _imeiDetails = []; response['List_DoctorDeviceDetails'].forEach((v) { _imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); @@ -50,7 +49,7 @@ class AuthenticationService extends BaseService { }, body: {"IMEI": imei, "TokenID": "@dm!n"}); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } @@ -58,7 +57,8 @@ class AuthenticationService extends BaseService { hasError = false; _loginInfo = NewLoginInformationModel(); try { - await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(LOGIN_URL, + onSuccess: (dynamic response, int statusCode) { _loginInfo = NewLoginInformationModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -66,8 +66,9 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } + } Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async { @@ -76,81 +77,88 @@ class AuthenticationService extends BaseService { try { await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) { - _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } + } - Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { + Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel)async { hasError = false; _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } - Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { + Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel)async { hasError = false; _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: checkActivationCodeRequestModel.toJson()); + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } + } - Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async { + + Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel)async { hasError = false; - // insertIMEIDetailsModel.tokenID = "@dm!n"; + // insertIMEIDetailsModel.tokenID = "@dm!n"; _insertDeviceImeiRes = {}; try { - await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { - _insertDeviceImeiRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: insertIMEIDetailsModel.toJson()); + await baseAppClient.post(INSERT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + _insertDeviceImeiRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } - Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async { + Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel)async { hasError = false; try { - await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { - _doctorProfilesList.clear(); - response['DoctorProfileList'].forEach((v) { - _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: profileReqModel.toJson()); + await baseAppClient.post(GET_DOC_PROFILES, + onSuccess: (dynamic response, int statusCode) { + _doctorProfilesList.clear(); + response['DoctorProfileList'].forEach((v) { + _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: profileReqModel.toJson()); } catch (error) { hasError = true; - super.error = error as String?; + super.error = error; } } } diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 05d1d1ab..58526da7 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,16 +1,15 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.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/util/dr_app_shared_pref.dart'; class BaseService { - String ?error; + String error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel ?doctorProfile; + DoctorProfileModel doctorProfile; List patientArrivalList = []; @@ -19,20 +18,24 @@ class BaseService { } //TODO add the user login model when we need it - Future ? getDoctorProfile({bool isGetProfile = false}) async { + Future getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile!; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile!; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } return null; } else { @@ -40,38 +43,5 @@ class BaseService { } } - Future getPatientArrivalList(String date,{String? fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ - hasError = false; - Map body = Map(); - body['From'] = fromDate == null ? date : fromDate; - body['To'] = date; - body['PageIndex'] = 0; - body['PageSize'] = 0; - if(patientMrn != -1){ - body['PatientMRN'] = patientMrn; - } - if(appointmentNo != -1){ - body['AppointmentNo'] = appointmentNo; - } - - await baseAppClient.post( - ARRIVED_PATIENT_URL, - onSuccess: (dynamic response, int statusCode) { - patientArrivalList.clear(); - - if(response['patientArrivalList']['entityList'] != null){ - response['patientArrivalList']['entityList'].forEach((v) { - PatiantInformtion item = PatiantInformtion.fromJson(v); - patientArrivalList.add(item); - }); - } - }, - onFailure: (String error, int statusCode) { - hasError = true; - this.error = error; - }, - body: body, - ); - } } diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index 5516923a..ad3ec887 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -9,7 +9,7 @@ class DashboardService extends BaseService { bool hasVirtualClinic = false; - String ?sServiceID; + String sServiceID; Future getDashboard() async { hasError = false; diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index a06a8974..b21768f9 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -4,15 +4,15 @@ 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 inPatientList = []; + List myInPatientList = List(); + List inPatientList = List(); Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); // if (isMyInpatient) { - // requestModel.doctorID = doctorProfile!.doctorID!; + // requestModel.doctorID = doctorProfile.doctorID; // } else { requestModel.doctorID = 0; //} @@ -26,7 +26,7 @@ class ScanQrService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile!.doctorID!) { + if (patient.doctorId == doctorProfile.doctorID) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index efa24209..f8a7579d 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -4,7 +4,8 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { - List hospitals = []; + +List hospitals =List(); Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 6566a57d..2b353016 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { - List myDischargedPatients = []; + List myDischargedPatients = List(); - List myDischargeReferralPatients = []; + List myDischargeReferralPatients = List(); Future getDischargedPatient() async { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile!.doctorID; + body['DoctorID'] = doctorProfile.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -28,7 +28,8 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargedPatients.clear(); - await baseAppClient.post(GET_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_DISCHARGE_PATIENT, + onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargePatient'] != null) { response['List_MyDischargePatient'].forEach((v) { myDischargedPatients.add(PatiantInformtion.fromJson(v)); @@ -44,7 +45,7 @@ class DischargedPatientService extends BaseService { hasError = false; Map body = Map(); await getDoctorProfile(isGetProfile: true); - body['DoctorID'] = doctorProfile!.doctorID; + body['DoctorID'] = doctorProfile.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; body['LastName'] = "0"; @@ -60,7 +61,8 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargeReferralPatients.clear(); - await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, + onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargeReferralPatient'] != null) { response['List_MyDischargeReferralPatient'].forEach((v) { myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index b390556d..10af0ea2 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -30,7 +30,8 @@ class LiveCarePatientServices extends BaseService { var transferToAdminResponse = {}; var isLoginResponse = {}; - late StartCallRes _startCallRes; + StartCallRes _startCallRes; + StartCallRes get startCallRes => _startCallRes; Future getPendingPatientERForDoctorApp( @@ -47,7 +48,7 @@ class LiveCarePatientServices extends BaseService { /// add new items. localPatientList.forEach((element) { - if ((_patientList.singleWhere((it) => it.patientId == element.patientId)) == null) { + if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { _patientList.add(element); } }); @@ -55,7 +56,7 @@ class LiveCarePatientServices extends BaseService { /// remove items. List removedPatientList = []; _patientList.forEach((element) { - if ((localPatientList.singleWhere((it) => it.patientId == element.patientId)) == null) { + if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { removedPatientList.add(element); } }); @@ -99,10 +100,7 @@ class LiveCarePatientServices extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: { - "VC_ID": vcID, - "AltServiceList": altServiceList,"generalid": GENERAL_ID - }, isLiveCare: _isLive); + }, body: {"VC_ID": vcID, "AltServiceList": altServiceList, "generalid": GENERAL_ID}, isLiveCare: _isLive); } Future transferToAdmin(int vcID, String notes) async { @@ -124,15 +122,15 @@ class LiveCarePatientServices extends BaseService { await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) { transferToAdminResponse = response; }, onFailure: (String error, int statusCode) { - hasError =true; + hasError = true; super.error = error; }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async { + Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { hasError = false; await getDoctorProfile(); - isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID!; + isLoginRequestModel.doctorId = super.doctorProfile.doctorID; await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { @@ -155,12 +153,12 @@ class LiveCarePatientServices extends BaseService { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future addPatientToDoctorList({required int vcID}) async { + Future addPatientToDoctorList({int vcID}) async { hasError = false; await getDoctorProfile(); AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; @@ -173,11 +171,11 @@ class LiveCarePatientServices extends BaseService { }, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive); } - Future removePatientFromDoctorList({required int vcID}) async { + Future removePatientFromDoctorList({int vcID}) async { hasError = false; AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); await getDoctorProfile(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index f1185786..35729def 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -6,14 +6,14 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; class MyReferralInPatientService extends BaseService { - List myReferralPatients = []; + List myReferralPatients = List(); Future getMyReferralPatientService() async { hasError = false; await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile!.doctorID!, + doctorID: doctorProfile.doctorID, firstName: "0", middleName: "0", lastName: "0", @@ -48,7 +48,7 @@ class MyReferralInPatientService extends BaseService { await getDoctorProfile(); MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile!.doctorID!, + doctorID: doctorProfile.doctorID, firstName: "0", middleName: "0", lastName: "0", @@ -82,13 +82,13 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); - _requestAddReferredDoctorRemarks.projectID = referral.projectID!; + _requestAddReferredDoctorRemarks.projectID = referral.projectID; _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; - _requestAddReferredDoctorRemarks.patientID = referral.patientID!; - _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor!; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.patientID = referral.patientID; + _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; await baseAppClient.post( ADD_REFERRED_DOCTOR_REMARKS, body: _requestAddReferredDoctorRemarks.toJson(), @@ -104,17 +104,17 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( - editedBy: doctorProfile!.doctorID!, - projectID: doctorProfile!.projectID!, + editedBy: doctorProfile.doctorID, + projectID: doctorProfile.projectID, referredDoctorRemarks: referredDoctorRemarks, referalStatus: referralStatus); - _requestAddReferredDoctorRemarks.projectID = referral.projectID!; + _requestAddReferredDoctorRemarks.projectID = referral.projectID; //TODO Check this in case out patient - _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!); - _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; + _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; - _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; _requestAddReferredDoctorRemarks.referalStatus = referralStatus; // _requestAddReferredDoctorRemarks.patientID = referral.patientID; diff --git a/lib/core/service/patient/PatientMuseService.dart b/lib/core/service/patient/PatientMuseService.dart index 893b6260..c34de9e0 100644 --- a/lib/core/service/patient/PatientMuseService.dart +++ b/lib/core/service/patient/PatientMuseService.dart @@ -3,15 +3,16 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsMod import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientMuseService extends BaseService { - List patientMuseResultsModelList = []; + List patientMuseResultsModelList = List(); - getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { + getECGPatient({int patientType, int patientOutSA, int patientID}) async { Map body = Map(); body['PatientType'] = patientType == 7 ? 1 : patientType; body['PatientOutSA'] = patientOutSA; body['PatientID'] = patientID; hasError = false; - await baseAppClient.post(GET_ECG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ECG, + onSuccess: (dynamic response, int statusCode) { patientMuseResultsModelList.clear(); response['HIS_GetPatientMuseResultsList'].forEach((v) { patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 25469dc2..69e2a810 100644 --- a/lib/core/service/patient/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -4,16 +4,16 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { Future referralPatient( - {int? admissionNo, - String? roomID, - int? referralClinic, - int? referralDoctor, - int? patientID, - int? patientTypeID, - int? priority, - int? frequency, - String? referringDoctorRemarks, - String? extension}) async { + {int admissionNo, + String roomID, + int referralClinic, + int referralDoctor, + int patientID, + int patientTypeID, + int priority, + int frequency, + String referringDoctorRemarks, + String extension}) async { await getDoctorProfile(); ReferralRequest referralRequest = ReferralRequest(); referralRequest.admissionNo = admissionNo; @@ -25,11 +25,11 @@ class ReferralService extends BaseService { referralRequest.priority = priority.toString(); referralRequest.frequency = frequency.toString(); referralRequest.referringDoctorRemarks = referringDoctorRemarks; - referralRequest.referringClinic = doctorProfile!.clinicID; - referralRequest.referringDoctor = doctorProfile!.doctorID; + referralRequest.referringClinic = doctorProfile.clinicID; + referralRequest.referringDoctor = doctorProfile.doctorID; referralRequest.extension = extension; - referralRequest.editedBy = doctorProfile!.doctorID; - referralRequest.createdBy = doctorProfile!.doctorID; + referralRequest.editedBy = doctorProfile.doctorID; + referralRequest.createdBy = doctorProfile.doctorID; referralRequest.patientOutSA = false; await baseAppClient.post( diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 5d4caa50..5b659631 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -15,7 +15,7 @@ import '../base/lookup-service.dart'; class PatientReferralService extends LookupService { List projectsList = []; List clinicsList = []; - List doctorsList = []; + List doctorsList = List(); List listMyReferredPatientModel = []; List pendingReferralList = []; List patientReferralList = []; @@ -57,7 +57,8 @@ class PatientReferralService extends LookupService { Map body = Map(); body['isSameBranch'] = false; - await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_REFERRAL_FACILITIES, + onSuccess: (response, statusCode) async { projectsList = response['ProjectInfo']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -84,7 +85,8 @@ class PatientReferralService extends LookupService { Future getClinicsList(int projectId) async { hasError = false; - ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = + ClinicByProjectIdRequest(); _clinicByProjectIdRequest.projectID = projectId; await baseAppClient.post( @@ -102,9 +104,11 @@ class PatientReferralService extends LookupService { ); } - Future getDoctorsList(PatiantInformtion patient, int clinicId, int branchId) async { + Future getDoctorsList( + PatiantInformtion patient, int clinicId, int branchId) async { hasError = false; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = + DoctorsByClinicIdRequest(); _doctorsByClinicIdRequest.projectID = branchId; _doctorsByClinicIdRequest.clinicID = clinicId; @@ -125,8 +129,9 @@ class PatientReferralService extends LookupService { Future getMyReferredPatient() async { hasError = false; - RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - DoctorProfileModel? doctorProfile = await getDoctorProfile(); + RequestMyReferralPatientModel _requestMyReferralPatient = + RequestMyReferralPatientModel(); + DoctorProfileModel doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_PATIENT, @@ -136,7 +141,8 @@ class PatientReferralService extends LookupService { response['List_MyReferredPatient'].forEach((v) { MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); if (doctorProfile != null) { - item.isReferralDoctorSameBranch = doctorProfile.projectID == item.projectID; + item.isReferralDoctorSameBranch = + doctorProfile.projectID == item.projectID; } else { item.isReferralDoctorSameBranch = false; } @@ -156,7 +162,7 @@ class PatientReferralService extends LookupService { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - DoctorProfileModel? doctorProfile = await getDoctorProfile(); + DoctorProfileModel doctorProfile = await getDoctorProfile(); await baseAppClient.post( GET_MY_REFERRED_OUT_PATIENT, @@ -184,10 +190,10 @@ class PatientReferralService extends LookupService { Future getPendingReferralList() async { hasError = false; - DoctorProfileModel? doctorProfile = await getDoctorProfile(); + DoctorProfileModel doctorProfile = await getDoctorProfile(); Map body = Map(); // body['ClinicID'] = 0; - body['DoctorID'] = doctorProfile!.doctorID; + body['DoctorID'] = doctorProfile.doctorID; await baseAppClient.post( GET_PENDING_REFERRAL_PATIENT, @@ -196,7 +202,8 @@ class PatientReferralService extends LookupService { response['PendingReferralList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = + item.targetProjectId == item.sourceProjectId; pendingReferralList.add(item); }); }, @@ -221,7 +228,8 @@ class PatientReferralService extends LookupService { response['ReferralList']['entityList'].forEach((v) { PendingReferral item = PendingReferral.fromJson(v); - item.isReferralDoctorSameBranch = item.targetProjectId == item.sourceProjectId; + item.isReferralDoctorSameBranch = + item.targetProjectId == item.sourceProjectId; patientReferralList.add(item); }); }, @@ -234,9 +242,10 @@ class PatientReferralService extends LookupService { ); } - Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async { + Future responseReferral( + MyReferralPatientModel referralPatient, bool isAccepted) async { hasError = false; - DoctorProfileModel? doctorProfile = await getDoctorProfile(); + DoctorProfileModel doctorProfile = await getDoctorProfile(); Map body = Map(); body['PatientMRN'] = referralPatient.patientID; @@ -246,7 +255,7 @@ class PatientReferralService extends LookupService { body['IsAccepted'] = isAccepted; body['PatientName'] = referralPatient.patientName; body['ReferralResponse'] = referralPatient.remarksFromSource; - body['DoctorName'] = doctorProfile!.doctorName; + body['DoctorName'] = doctorProfile.doctorName; await baseAppClient.post( RESPONSE_PENDING_REFERRAL_PATIENT, @@ -261,14 +270,15 @@ class PatientReferralService extends LookupService { ); } - 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 { hasError = false; Map body = Map(); List physiotheraphyGoalsList = []; listOfPhysiotherapyGoals.forEach((element) { - physiotheraphyGoalsList.add({"goalId": element.id, "remarks": element.remarks}); + physiotheraphyGoalsList + .add({"goalId": element.id, "remarks": element.remarks}); }); body['PatientMRN'] = patient.patientMRN ?? patient.patientId; @@ -317,7 +327,8 @@ class PatientReferralService extends LookupService { ); } - Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks( + MyReferredPatientModel referredPatient) async { hasError = false; Map body = Map(); diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index 32b27ae1..bc7f1283 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -4,15 +4,16 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { - List inPatientList = []; - List myInPatientList = []; + List inPatientList = List(); + List myInPatientList = List(); - Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient) async { + Future getInPatientList( + PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(isGetProfile: true); if (isMyInpatient) { - requestModel.doctorID = doctorProfile!.doctorID; + requestModel.doctorID = doctorProfile.doctorID; } else { requestModel.doctorID = 0; } @@ -26,7 +27,7 @@ class PatientInPatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile!.doctorID) { + if(patient.doctorId == doctorProfile.doctorID){ myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 0e05c628..f79e342c 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -30,8 +30,8 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_mode class PatientService extends BaseService { List _patientVitalSignList = []; List patientVitalSignOrderdSubList = []; - List inPatientList = []; - List myInPatientList = []; + List inPatientList = List(); + List myInPatientList = List(); List get patientVitalSignList => _patientVitalSignList; @@ -99,7 +99,7 @@ class PatientService extends BaseService { DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest(); ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); - ReferToDoctorRequest? _referToDoctorRequest; + ReferToDoctorRequest _referToDoctorRequest; Future getPatientList(patient, patientType, {isView}) async { hasError = false; @@ -157,7 +157,7 @@ class PatientService extends BaseService { await getDoctorProfile(); if (isMyInpatient) { - requestModel.doctorID = doctorProfile!.doctorID!; + requestModel.doctorID = doctorProfile.doctorID; } else { requestModel.doctorID = 0; } @@ -171,7 +171,7 @@ class PatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if (patient.doctorId == doctorProfile!.doctorID!) { + if (patient.doctorId == doctorProfile.doctorID) { myInPatientList.add(patient); } }); @@ -420,39 +420,39 @@ class PatientService extends BaseService { // TODO send the total model insted of each parameter Future referToDoctor( - {String? selectedDoctorID, - String? selectedClinicID, - int? admissionNo, - String? extension, - String? priority, - String? frequency, - String? referringDoctorRemarks, - int? patientID, - int? patientTypeID, - String? roomID, - int? projectID}) async { + {String selectedDoctorID, + String selectedClinicID, + int admissionNo, + String extension, + String priority, + String frequency, + String referringDoctorRemarks, + int patientID, + int patientTypeID, + String roomID, + int projectID}) async { hasError = false; // TODO Change it to use it when we implement authentication user Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel? doctorProfile = new DoctorProfileModel.fromJson(profile); - int? doctorID = doctorProfile.doctorID; - int? clinicId = doctorProfile.clinicID; + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + int doctorID = doctorProfile.doctorID; + int clinicId = doctorProfile.clinicID; _referToDoctorRequest = ReferToDoctorRequest( - projectID: projectID!, - admissionNo: admissionNo!, - roomID: roomID!, + projectID: projectID, + admissionNo: admissionNo, + roomID: roomID, referralClinic: selectedClinicID.toString(), referralDoctor: selectedDoctorID.toString(), - createdBy: doctorID!, + createdBy: doctorID, editedBy: doctorID, - patientID: patientID!, - patientTypeID: patientTypeID!, - referringClinic: clinicId!, + patientID: patientID, + patientTypeID: patientTypeID, + referringClinic: clinicId, referringDoctor: doctorID, - referringDoctorRemarks: referringDoctorRemarks!, - priority: priority!, - frequency: frequency!, - extension: extension!, + referringDoctorRemarks: referringDoctorRemarks, + priority: priority, + frequency: frequency, + extension: extension, ); await baseAppClient.post( PATIENT_PROGRESS_NOTE_URL, @@ -461,7 +461,7 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body: _referToDoctorRequest!.toJson(), + body: _referToDoctorRequest.toJson(), ); } diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index 782e220f..a92ef0eb 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -18,8 +18,7 @@ class DischargeSummaryService extends BaseService { _allDischargeSummaryList; Future getPendingDischargeSummary( - {required GetDischargeSummaryReqModel - getDischargeSummaryReqModel}) async { + {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { @@ -37,7 +36,7 @@ class DischargeSummaryService extends BaseService { } Future getAllDischargeSummary( - {GetDischargeSummaryReqModel? getDischargeSummaryReqModel}) async { + {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { @@ -50,6 +49,6 @@ class DischargeSummaryService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getDischargeSummaryReqModel!.toJson()); + }, body: getDischargeSummaryReqModel.toJson()); } } diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index 3a39a4b8..7ac4ade7 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -11,11 +11,12 @@ class OperationReportService extends BaseService { List get reservationList => _reservationList; List _operationDetailsList = []; - List get operationDetailsList => - _operationDetailsList; + List get operationDetailsList => _operationDetailsList; - Future getReservations({required int patientId}) async { - GetReservationsRequestModel getReservationsRequestModel = + Future getReservations( + {GetReservationsRequestModel getReservationsRequestModel, + int patientId}) async { + getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); hasError = false; @@ -34,9 +35,10 @@ class OperationReportService extends BaseService { }, body: getReservationsRequestModel.toJson()); } - Future getOperationReportDetails({ - required GetOperationDetailsRequestModel getOperationReportRequestModel, - }) async { + Future getOperationReportDetails( + {GetOperationDetailsRequestModel getOperationReportRequestModel, + }) async { + hasError = false; await baseAppClient.post(GET_OPERATION_DETAILS, onSuccess: (dynamic response, int statusCode) { @@ -44,8 +46,7 @@ class OperationReportService extends BaseService { _operationDetailsList.clear(); response['List_OperationDetails'].forEach( (v) { - _operationDetailsList - .add(GetOperationDetailsResponseModel.fromJson(v)); + _operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart index bc952162..c97f8426 100644 --- a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart +++ b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart @@ -222,7 +222,6 @@ class AdmissionRequestService extends LookupService { POST_ADMISSION_REQUEST, onSuccess: (dynamic response, int statusCode) { print(response["admissionResponse"]["success"]); - AdmissionRequest admissionRequest = AdmissionRequest.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 2a1574f4..2bb9dac7 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -7,28 +7,37 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class InsuranceCardService extends BaseService { InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( - isDentalAllowedBackend: false, patientTypeID: 1, patientType: 1, eXuldAPPNO: 0, projectID: 0); - InsuranceApprovalInPatientRequestModel _insuranceApprovalInPatientRequestModel = + isDentalAllowedBackend: false, + patientTypeID: 1, + patientType: 1, + eXuldAPPNO: 0, + projectID: 0); + InsuranceApprovalInPatientRequestModel + _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel(); - List _insuranceApproval = []; + List _insuranceApproval = List(); List get insuranceApproval => _insuranceApproval; - List _insuranceApprovalInPatient = []; - List get insuranceApprovalInPatient => _insuranceApprovalInPatient; + List _insuranceApprovalInPatient = List(); + List get insuranceApprovalInPatient => + _insuranceApprovalInPatient; - Future getInsuranceApprovalInPatient({int? mrn}) async { - _insuranceApprovalInPatientRequestModel = InsuranceApprovalInPatientRequestModel( - patientID: mrn!, + Future getInsuranceApprovalInPatient({int mrn}) async { + _insuranceApprovalInPatientRequestModel = + InsuranceApprovalInPatientRequestModel( + patientID: mrn, patientTypeID: 1, ); hasError = false; insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_INSURANCE_IN_PATIENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_INSURANCE_IN_PATIENT, + onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['List_ApprovalMain_InPatient'].forEach((prescriptions) { - insuranceApprovalInPatient.add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); + insuranceApprovalInPatient + .add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -36,7 +45,8 @@ class InsuranceCardService extends BaseService { }, body: _insuranceApprovalInPatientRequestModel.toJson()); } - Future getInsuranceApproval(PatiantInformtion patient, {int? appointmentNo, int? projectId}) async { + Future getInsuranceApproval(PatiantInformtion patient, + {int appointmentNo, int projectId}) async { hasError = false; // _cardList.clear(); // if (appointmentNo != null) { @@ -49,8 +59,8 @@ class InsuranceCardService extends BaseService { _insuranceApprovalModel.projectID = 0; // } - await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, + patient: patient, onSuccess: (dynamic response, int statusCode) { print(response['HIS_Approval_List'].length); _insuranceApproval.clear(); _insuranceApproval.length = 0; diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 84861d5b..0a10eb31 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -13,8 +13,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { - List patientLabOrdersList = []; - List _allSpecialLab = []; + List patientLabOrdersList = List(); + List _allSpecialLab = List(); List get allSpecialLab => _allSpecialLab; AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(); @@ -25,7 +25,7 @@ class LabsService extends BaseService { String url = ""; if (isInpatient) { await getDoctorProfile(); - body['ProjectID'] = doctorProfile!.projectID; + body['ProjectID'] = doctorProfile.projectID; url = GET_PATIENT_LAB_OREDERS; } else { body['isDentalAllowedBackend'] = false; @@ -53,17 +53,17 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - List patientLabSpecialResult = []; - List labResultList = []; - List labOrdersResultsList = []; - List labOrdersResultHistoryList = []; + List patientLabSpecialResult = List(); + List labResultList = List(); + List labOrdersResultsList = List(); + List labOrdersResultHistoryList = List(); Future getLaboratoryResult( - {String? projectID, - int? clinicID, - String? invoiceNo, - String? orderNo, - PatiantInformtion? patient, + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient, bool isInpatient = false}) async { hasError = false; @@ -74,7 +74,7 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient!, + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); @@ -87,25 +87,25 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async { + Future getPatientLabResult({PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { hasError = false; String url = ""; - if (isInpatient!) { + if (isInpatient) { url = GET_PATIENT_LAB_RESULTS; } else { url = GET_Patient_LAB_RESULT; } Map body = Map(); - body['InvoiceNo'] = patientLabOrder!.invoiceNo; + body['InvoiceNo'] = patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - await baseAppClient.postPatient(url, patient: patient!, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; labResultList = []; @@ -128,7 +128,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResults( - {PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { + {PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -140,7 +140,7 @@ class LabsService extends BaseService { } body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; - await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient!, + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { @@ -154,7 +154,7 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders? patientLabOrder}) async { + Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; @@ -179,7 +179,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResultHistoryByDescription( - {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -201,7 +201,7 @@ class LabsService extends BaseService { }, body: body); } - Future getAllSpecialLabResult({required int mrn}) async { + Future getAllSpecialLabResult({int mrn}) async { _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( patientID: mrn, patientType: 1, diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 1af15e10..dfb9c3ae 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -13,11 +13,10 @@ class PatientMedicalReportService extends BaseService { Map body = Map(); await getDoctorProfile(); body['AdmissionNo'] = patient.admissionNo; - body['SetupID'] = doctorProfile!.setupID; - body['ProjectID'] = doctorProfile!.projectID; + body['SetupID'] = doctorProfile.setupID; + body['ProjectID'] = doctorProfile.projectID; medicalReportList = []; await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { - if (response['DAPP_ListMedicalReportList'] != null) { response['DAPP_ListMedicalReportList'].forEach((v) { medicalReportList.add(MedicalReportModel.fromJson(v)); @@ -94,7 +93,7 @@ class PatientMedicalReportService extends BaseService { ? body['SetupID'] : SETUP_ID : SETUP_ID; - body['AdmissionNo'] = int.parse(patient!.admissionNo!); + body['AdmissionNo'] = int.parse(patient.admissionNo); body['MedicalReportHTML'] = htmlText; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 295d38ac..42cdafc6 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/medical_report/medical_file_reques import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { - List _medicalFileList = []; + List _medicalFileList = List(); List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( @@ -13,13 +13,15 @@ class MedicalFileService extends BaseService { "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", ); - Future getMedicalFile({int? mrn}) async { + Future getMedicalFile({int mrn}) async { _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); _fileRequestModel.iPAdress = "9.9.9.9"; hasError = false; _medicalFileList.clear(); - await baseAppClient.post(GET_MEDICAL_FILE, onSuccess: (dynamic response, int statusCode) { - _medicalFileList.add(MedicalFileModel.fromJson(response['PatientFileList'])); + await baseAppClient.post(GET_MEDICAL_FILE, + onSuccess: (dynamic response, int statusCode) { + _medicalFileList + .add(MedicalFileModel.fromJson(response['PatientFileList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index 4a672412..ffbcae9b 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -16,9 +16,9 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionService extends LookupService { - List _prescriptionList = []; + List _prescriptionList = List(); List get prescriptionList => _prescriptionList; - List _drugsList = []; + List _drugsList = List(); List get drugsList => _drugsList; List doctorsList = []; List allMedicationList = []; @@ -31,22 +31,27 @@ class PrescriptionService extends LookupService { dynamic boxQuantity; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); - ItemByMedicineRequestModel _itemByMedicineRequestModel = ItemByMedicineRequestModel(); + ItemByMedicineRequestModel _itemByMedicineRequestModel = + ItemByMedicineRequestModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( //search: ["Acetaminophen"], search: ["Amoxicillin"], ); - CalculateBoxQuantityRequestModel _boxQuantityRequestModel = CalculateBoxQuantityRequestModel(); + CalculateBoxQuantityRequestModel _boxQuantityRequestModel = + CalculateBoxQuantityRequestModel(); - PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); + PostPrescriptionReqModel _postPrescriptionReqModel = + PostPrescriptionReqModel(); - Future getItem({int? itemID}) async { - _itemByMedicineRequestModel = ItemByMedicineRequestModel(medicineCode: itemID); + Future getItem({int itemID}) async { + _itemByMedicineRequestModel = + ItemByMedicineRequestModel(medicineCode: itemID); hasError = false; - await baseAppClient.post(GET_ITEM_BY_MEDICINE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ITEM_BY_MEDICINE, + onSuccess: (dynamic response, int statusCode) { itemMedicineList = []; itemMedicineList = response['listItemByMedicineCode']['frequencies']; itemMedicineListRoute = response['listItemByMedicineCode']['routes']; @@ -57,9 +62,11 @@ class PrescriptionService extends LookupService { }, body: _itemByMedicineRequestModel.toJson()); } - Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -71,26 +78,29 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int? mrn}) async { + Future getPrescription({int mrn}) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, ); hasError = false; _prescriptionList.clear(); - await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { - _prescriptionList.add(PrescriptionModel.fromJson(response['PrescriptionList'])); + await baseAppClient.post(GET_PRESCRIPTION_LIST, + onSuccess: (dynamic response, int statusCode) { + _prescriptionList + .add(PrescriptionModel.fromJson(response['PrescriptionList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _prescriptionReqModel.toJson()); } - Future getDrugs({String? drugName}) async { - _drugRequestModel = SearchDrugRequestModel(search: [drugName!]); + Future getDrugs({String drugName}) async { + _drugRequestModel = SearchDrugRequestModel(search: [drugName]); hasError = false; - await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, + onSuccess: (dynamic response, int statusCode) { doctorsList = []; doctorsList = response['MedicationList']['entityList']; }, onFailure: (String error, int statusCode) { @@ -102,7 +112,8 @@ class PrescriptionService extends LookupService { Future getMedicationList({String drug = ''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; - await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEARCH_DRUG, + onSuccess: (dynamic response, int statusCode) { allMedicationList = []; response['MedicationList']['entityList'].forEach((v) { allMedicationList.add(GetMedicationResponseModel.fromJson(v)); @@ -113,7 +124,8 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future postPrescription(PostPrescriptionReqModel postProcedureReqModel) async { + Future postPrescription( + PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -129,7 +141,8 @@ class PrescriptionService extends LookupService { ); } - Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel) async { + Future updatePrescription( + PostPrescriptionReqModel updatePrescriptionReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( @@ -145,8 +158,12 @@ class PrescriptionService extends LookupService { ); } - Future getDrugToDrug(VitalSignData vital, List lstAssessments, - List allergy, PatiantInformtion patient, List prescription) async { + Future getDrugToDrug( + VitalSignData vital, + List lstAssessments, + List allergy, + PatiantInformtion patient, + List prescription) async { // Map request = { // "Prescription": { // "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, @@ -201,9 +218,10 @@ class PrescriptionService extends LookupService { "Prescription": { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', - "Age": AppDateUtils.convertDateFromServerFormat(patient.dateofBirth!, 'dd/MM/yyyy') + "Age": AppDateUtils.convertDateFromServerFormat( + patient.dateofBirth, 'dd/MM/yyyy') }, - "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg}, + "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, "objPrescriptionItems": prescription, "objAllergies": getAllergiesObj(allergy), "objDiagnosis": getDiagnosisObj(lstAssessments), @@ -213,22 +231,29 @@ class PrescriptionService extends LookupService { }; hasError = false; - await baseAppClient.post(DRUG_TO_DRUG, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(DRUG_TO_DRUG, + onSuccess: (dynamic response, int statusCode) { drugToDrug = []; - drugToDrug = response['DrugToDrugResponse']['objPrescriptionCheckerResult']; + drugToDrug = + response['DrugToDrugResponse']['objPrescriptionCheckerResult']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: request); } - Future calculateBoxQuantity({int? freq, int? duration, int? itemCode, double? strength}) async { - _boxQuantityRequestModel = - CalculateBoxQuantityRequestModel(frequency: freq, duration: duration, itemCode: itemCode, strength: strength); + Future calculateBoxQuantity( + {int freq, int duration, int itemCode, double strength}) async { + _boxQuantityRequestModel = CalculateBoxQuantityRequestModel( + frequency: freq, + duration: duration, + itemCode: itemCode, + strength: strength); hasError = false; - await baseAppClient.post(GET_BOX_QUANTITY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_BOX_QUANTITY, + onSuccess: (dynamic response, int statusCode) { boxQuantity = response['BoxQuantity']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -240,7 +265,10 @@ class PrescriptionService extends LookupService { var allergiesObj = []; allergies.forEach((element) { allergiesObj.add({ - "objProperties": {'Id': element.allergyDiseaseId, 'Name': element.allergyDiseaseName} + "objProperties": { + 'Id': element.allergyDiseaseId, + 'Name': element.allergyDiseaseName + } }); }); return allergiesObj; diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index bf3100c5..06de5a74 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -17,16 +17,16 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { - List prescriptionsList = []; - List medicationForInPatient = []; - List prescriptionsOrderList = []; - List prescriptionInPatientList = []; + List prescriptionsList = List(); + List medicationForInPatient = List(); + List prescriptionsOrderList = List(); + List prescriptionInPatientList = List(); InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(); GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel(); - Future getPrescriptionInPatient({int? mrn, String? adn}) async { + Future getPrescriptionInPatient({int mrn, String adn}) async { _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( patientMRN: mrn, admissionNo: adn, @@ -62,11 +62,11 @@ class PrescriptionsService extends BaseService { RequestPrescriptionReport _requestPrescriptionReport = RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false); - List prescriptionReportList = []; + List prescriptionReportList = List(); - Future getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { + Future getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { hasError = false; - _requestPrescriptionReport.dischargeNo = prescriptions!.dischargeNo; + _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; _requestPrescriptionReport.projectID = prescriptions.projectID; _requestPrescriptionReport.clinicID = prescriptions.clinicID; _requestPrescriptionReport.setupID = prescriptions.setupID; @@ -74,11 +74,11 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; await baseAppClient.postPatient( - prescriptions.isInOutPatient! ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient!, onSuccess: (dynamic response, int statusCode) { + prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); prescriptionReportEnhList.clear(); - if (prescriptions.isInOutPatient!) { + if (prescriptions.isInOutPatient) { response['ListPRM'].forEach((prescriptions) { prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); @@ -100,12 +100,12 @@ class PrescriptionsService extends BaseService { longitude: 0, isDentalAllowedBackend: false, ); - List pharmacyPrescriptionsList = []; + List pharmacyPrescriptionsList = List(); - Future getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { + Future getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient!, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); response['PharmList'].forEach((prescriptions) { pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions)); @@ -120,13 +120,13 @@ class PrescriptionsService extends BaseService { isDentalAllowedBackend: false, ); - List prescriptionReportEnhList = []; + List prescriptionReportEnhList = List(); - Future getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { + Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { ///This logic copy from the old app from class [order-history.component.ts] in line 45 bool isInPatient = false; prescriptionsList.forEach((element) { - if (prescriptionsOrder!.appointmentNo == "0") { + if (prescriptionsOrder.appointmentNo == "0") { if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.clinicID = element.clinicID; @@ -134,7 +134,7 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient!; + isInPatient = element.isInOutPatient; } } else { if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) { @@ -144,7 +144,7 @@ class PrescriptionsService extends BaseService { _requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient!; + isInPatient = element.isInOutPatient; ///call inpGetPrescriptionReport } @@ -154,7 +154,7 @@ class PrescriptionsService extends BaseService { hasError = false; await baseAppClient.postPatient(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient!, onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportEnhList.clear(); if (isInPatient) { @@ -192,9 +192,9 @@ class PrescriptionsService extends BaseService { hasError = false; _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel( isDentalAllowedBackend: false, - admissionNo: int.parse(patient!.admissionNo!), + admissionNo: int.parse(patient.admissionNo), tokenID: "@dm!n", - projectID: patient!.projectId!, + projectID: patient.projectId, ); await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, onSuccess: (dynamic response, int statusCode) { 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 5708b6b3..56a92de5 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -14,20 +14,20 @@ import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ProcedureService extends BaseService { - List _procedureList = []; + List _procedureList = List(); List get procedureList => _procedureList; - List _valadteProcedureList = []; + List _valadteProcedureList = List(); List get valadteProcedureList => _valadteProcedureList; - List _categoriesList = []; + List _categoriesList = List(); List get categoriesList => _categoriesList; - List procedureslist = []; + List procedureslist = List(); List categoryList = []; - // List _templateList = []; + // List _templateList = List(); // List get templateList => _templateList; - List templateList = []; + List templateList = List(); - List _templateDetailsList = []; + List _templateDetailsList = List(); List get templateDetailsList => _templateDetailsList; GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(); @@ -59,7 +59,7 @@ class ProcedureService extends BaseService { //search: ["DENTAL"], ); - Future getProcedureTemplate({int? doctorId, int? projectId, int? clinicId, String? categoryID}) async { + Future getProcedureTemplate({int doctorId, int projectId, int clinicId, String categoryID}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( // tokenID: "@dm!n", patientID: 0, @@ -72,7 +72,7 @@ class ProcedureService extends BaseService { templateList.clear(); response['DAPP_TemplateGetList'].forEach((template) { ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); - if (categoryID != null ) { + if (categoryID != null) { if (categoryID == templateElement.categoryID) { templateList.add(templateElement); } @@ -80,13 +80,16 @@ class ProcedureService extends BaseService { templateList.add(templateElement); } }); + // response['HIS_ProcedureTemplateList'].forEach((template) { + // _templateList.add(ProcedureTempleteModel.fromJson(template)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _procedureTempleteRequestModel.toJson()); } - Future getProcedureTemplateDetails({int? doctorId, int? projectId, int? clinicId, int? templateId}) async { + Future getProcedureTemplateDetails({int doctorId, int projectId, int clinicId, int templateId}) async { _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0); hasError = false; @@ -104,7 +107,7 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int? mrn, required int appointmentNo}) async { + Future getProcedure({int mrn, int appointmentNo}) async { _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel( patientMRN: mrn, ); @@ -130,7 +133,7 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async { + Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( search: ["$categoryName"], patientMRN: patientId, 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 7ebbd348..f10f2253 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -6,17 +6,17 @@ import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class RadiologyService extends BaseService { - List finalRadiologyList = []; + List finalRadiologyList = List(); String url = ''; - Future getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient!, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 6efeba18..070fd862 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -18,7 +18,7 @@ class SickLeaveService extends BaseService { List get getReasons => reasonse; List reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = []; + List _getAllsickLeave = List(); List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -29,8 +29,8 @@ class SickLeaveService extends BaseService { dynamic _postReschedule; - List getAllSickLeavePatient = []; - List getAllSickLeaveDoctor = []; + List getAllSickLeavePatient = List(); + List getAllSickLeaveDoctor = List(); SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(); @@ -164,7 +164,7 @@ class SickLeaveService extends BaseService { _getReScheduleLeave.sort((a, b) { var adate = a.dateTimeFrom; //before -> var adate = a.date; var bdate = b.dateTimeFrom; //var bdate = b.date; - return -adate!.compareTo(bdate!); + return -adate.compareTo(bdate); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index dbdb3855..ec127f8b 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -34,7 +34,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; - int? episodeID; + int episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -55,7 +55,8 @@ class SOAPService extends LookupService { Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { hasError = false; - await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_EPISODE, + onSuccess: (dynamic response, int statusCode) { print("Success"); episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) { @@ -79,28 +80,33 @@ class SOAPService extends LookupService { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; - await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ALLERGY, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error!+ "\n"+error; + super.error = super.error+ "\n"+error; }, body: postAllergyRequestModel.toJson()); } - Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postHistories( + PostHistoriesRequestModel postHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(POST_HISTORY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_HISTORY, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error =super.error! + "\n"+error; + super.error =super.error + "\n"+error; }, body: postHistoriesRequestModel.toJson()); } - Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + Future postChiefComplaint( + PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; super.error =""; - await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -108,9 +114,11 @@ class SOAPService extends LookupService { }, body: postChiefComplaintRequestModel.toJson()); } - Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam( + PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { hasError = false; - await baseAppClient.post(POST_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -118,9 +126,11 @@ class SOAPService extends LookupService { }, body: postPhysicalExamRequestModel.toJson()); } - Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote( + PostProgressNoteRequestModel postProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(POST_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -128,9 +138,11 @@ class SOAPService extends LookupService { }, body: postProgressNoteRequestModel.toJson()); } - Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment( + PostAssessmentRequestModel postAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(POST_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -141,7 +153,8 @@ class SOAPService extends LookupService { Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ALLERGY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ALLERGY, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -149,20 +162,24 @@ class SOAPService extends LookupService { }, body: patchAllergyRequestModel.toJson()); } - Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { + Future patchHistories( + PostHistoriesRequestModel patchHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_HISTORY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_HISTORY, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error! +"\n"+error; + super.error = super.error +"\n"+error; }, body: patchHistoriesRequestModel.toJson()); } - Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + Future patchChiefComplaint( + PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { hasError = false; super.error =""; - await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -170,9 +187,11 @@ class SOAPService extends LookupService { }, body: patchChiefComplaintRequestModel.toJson()); } - Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam( + PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -180,9 +199,11 @@ class SOAPService extends LookupService { }, body: patchPhysicalExamRequestModel.toJson()); } - Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote( + PostProgressNoteRequestModel patchProgressNoteRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -190,9 +211,11 @@ class SOAPService extends LookupService { }, body: patchProgressNoteRequestModel.toJson()); } - Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment( + PatchAssessmentReqModel patchAssessmentRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATCH_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -203,7 +226,8 @@ class SOAPService extends LookupService { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post(GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALLERGY, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAllergiesList.clear(); @@ -216,9 +240,11 @@ class SOAPService extends LookupService { }, body: generalGetReqForSOAP.toJson()); } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, + {bool isFirst = false}) async { hasError = false; - await baseAppClient.post(GET_HISTORY, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_HISTORY, + onSuccess: (dynamic response, int statusCode) { print("Success"); if (isFirst) patientHistoryList.clear(); response['List_History']['entityList'].forEach((v) { @@ -230,9 +256,11 @@ class SOAPService extends LookupService { }, body: getHistoryReqModel.toJson()); } - Future getPatientChiefComplaint(GetChiefComplaintReqModel getChiefComplaintReqModel) async { + Future getPatientChiefComplaint( + GetChiefComplaintReqModel getChiefComplaintReqModel) async { hasError = false; - await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientChiefComplaintList.clear(); response['List_ChiefComplaint']['entityList'].forEach((v) { @@ -244,9 +272,11 @@ class SOAPService extends LookupService { }, body: getChiefComplaintReqModel.toJson()); } - Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam( + GetPhysicalExamReqModel getPhysicalExamReqModel) async { hasError = false; - await baseAppClient.post(GET_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { patientPhysicalExamList.clear(); response['PhysicalExamList']['entityList'].forEach((v) { patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); @@ -257,9 +287,11 @@ class SOAPService extends LookupService { }, body: getPhysicalExamReqModel.toJson()); } - Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote( + GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { hasError = false; - await baseAppClient.post(GET_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientProgressNoteList.clear(); response['ProgressNoteList']['entityList'].forEach((v) { @@ -271,9 +303,11 @@ class SOAPService extends LookupService { }, body: getGetProgressNoteReqModel.toJson()); } - Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; - await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 2028ed6b..53fa257e 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -8,11 +8,11 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { - late List patientChiefComplaintList; - late List patientVitalSignsHistory; + List patientChiefComplaintList; + List patientVitalSignsHistory; List patientAssessmentList = []; List orderProcedureList = []; - PrescriptionModel? prescriptionList; + PrescriptionModel prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; @@ -22,13 +22,14 @@ class UcafService extends LookupService { body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - patientChiefComplaintList = []; - await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { + patientChiefComplaintList = null; + await baseAppClient.post(GET_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { print("Success"); if (patientChiefComplaintList != null) { patientChiefComplaintList.clear(); } else { - patientChiefComplaintList = []; + patientChiefComplaintList = new List(); } response['List_ChiefComplaint']['entityList'].forEach((v) { patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); @@ -39,7 +40,8 @@ class UcafService extends LookupService { }, body: body); } - Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + Future getInPatientVitalSignHistory( + PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; @@ -50,14 +52,14 @@ class UcafService extends LookupService { body['InOutPatientType'] = 2; } - patientVitalSignsHistory = []; + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = []; + patientVitalSignsHistory = new List(); } if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { @@ -73,7 +75,8 @@ class UcafService extends LookupService { ); } - Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory( + PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientId; // patient.patientMRN @@ -86,14 +89,14 @@ class UcafService extends LookupService { body['From'] = fromDate; body['To'] = toDate; - patientVitalSignsHistory = []; + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = []; + patientVitalSignsHistory = new List(); } if (response['VitalSignsHistory'] != null) { response['VitalSignsHistory'].forEach((v) { @@ -116,7 +119,8 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { print("Success"); patientAssessmentList.clear(); response['AssessmentList']['entityList'].forEach((v) { @@ -138,8 +142,10 @@ class UcafService extends LookupService { hasError = false; prescriptionList = null; - await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { - prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']); + await baseAppClient.post(GET_PRESCRIPTION_LIST, + onSuccess: (dynamic response, int statusCode) { + prescriptionList = + PrescriptionModel.fromJson(response['PrescriptionList']); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -153,7 +159,8 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ORDER_PROCEDURE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ORDER_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { print("Success"); orderProcedureList.clear(); response['OrderedProcedureList']['entityList'].forEach((v) { @@ -171,7 +178,8 @@ class UcafService extends LookupService { body['PatientMRN'] = patient.patientMRN; body['AppointmentNo'] = patient.appointmentNo; - await baseAppClient.post(POST_UCAF, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_UCAF, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart index a6bf9649..1c07aa48 100644 --- a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart +++ b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class VitalSignsService extends BaseService { - VitalSignData? patientVitalSigns; + VitalSignData patientVitalSigns; List patientVitalSignsHistory = []; Future getPatientVitalSign(PatiantInformtion patient) async { @@ -21,7 +21,8 @@ class VitalSignsService extends BaseService { if (response['VitalSignsList'] != null) { if (response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0) { - patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); + patientVitalSigns = VitalSignData.fromJson( + response['VitalSignsList']['entityList'][0]); } } }, @@ -33,7 +34,8 @@ class VitalSignsService extends BaseService { ); } - Future getPatientVitalSignsHistory(PatiantInformtion patient, String fromDate, String toDate) async { + Future getPatientVitalSignsHistory( + PatiantInformtion patient, String fromDate, String toDate) async { patientVitalSigns = null; hasError = false; Map body = Map(); @@ -52,14 +54,14 @@ class VitalSignsService extends BaseService { body['ProjectID'] = patient.projectId; } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -82,16 +84,22 @@ class VitalSignsService extends BaseService { // body['InOutPatientType'] = 2; // } - await baseAppClient.postPatient(GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, body: body, patient: patient); + + await baseAppClient.postPatient( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + });} + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, + body: body, + patient: patient + ); } } diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index 527f3d20..e6f35bb8 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -6,17 +6,17 @@ import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_m import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; class PendingOrderService extends BaseService { - List _pendingOrderList = []; + List _pendingOrderList = List(); List get pendingOrderList => _pendingOrderList; - List _admissionOrderList = []; + List _admissionOrderList = List(); List get admissionOrderList => _admissionOrderList; Future getPendingOrders( - { - required int patientId, - required int admissionNo}) async { - PendingOrderRequestModel pendingOrderRequestModel = PendingOrderRequestModel( + {PendingOrderRequestModel pendingOrderRequestModel, + int patientId, + int admissionNo}) async { + pendingOrderRequestModel = PendingOrderRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, @@ -40,10 +40,10 @@ class PendingOrderService extends BaseService { } Future getAdmissionOrders( - { - required int patientId, - required int admissionNo}) async { - AdmissionOrdersRequestModel admissionOrdersRequestModel = AdmissionOrdersRequestModel( + {AdmissionOrdersRequestModel admissionOrdersRequestModel, + int patientId, + int admissionNo}) async { + admissionOrdersRequestModel = AdmissionOrdersRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 4d1ea631..9df347e2 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -6,9 +6,11 @@ import '../../locator.dart'; import 'base_view_model.dart'; class DischargedPatientViewModel extends BaseViewModel { - DischargedPatientService _dischargedPatientService = locator(); + DischargedPatientService _dischargedPatientService = + locator(); - List get myDischargedPatient => _dischargedPatientService.myDischargedPatients; + List get myDischargedPatient => + _dischargedPatientService.myDischargedPatients; List filterData = []; @@ -17,9 +19,9 @@ class DischargedPatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < myDischargedPatient.length; i++) { - String firstName = myDischargedPatient[i].firstName!.toUpperCase(); - String lastName = myDischargedPatient[i].lastName!.toUpperCase(); - String mobile = myDischargedPatient[i].mobileNumber!.toUpperCase(); + String firstName = myDischargedPatient[i].firstName.toUpperCase(); + String lastName = myDischargedPatient[i].lastName.toUpperCase(); + String mobile = myDischargedPatient[i].mobileNumber.toUpperCase(); String patientID = myDischargedPatient[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || @@ -40,7 +42,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.getDischargedPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error!; + error = _dischargedPatientService.error; setState(ViewState.Error); } else { filterData = myDischargedPatient; @@ -52,7 +54,7 @@ class DischargedPatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error!; + error = _dischargedPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index edc57abd..46f48d35 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -16,12 +16,12 @@ class InsuranceViewModel extends BaseViewModel { _insuranceCardService.insuranceApprovalInPatient; Future getInsuranceApproval(PatiantInformtion patient, - {int ? appointmentNo, int? projectId}) async { + {int appointmentNo, int projectId}) async { error = ""; setState(ViewState.Busy); if (appointmentNo != null) await _insuranceCardService.getInsuranceApproval(patient, - appointmentNo: appointmentNo, projectId: projectId!); + appointmentNo: appointmentNo, projectId: projectId); else await _insuranceCardService.getInsuranceApproval(patient); if (_insuranceCardService.hasError) { @@ -31,13 +31,13 @@ class InsuranceViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getInsuranceInPatient({required int mrn}) async { + Future getInsuranceInPatient({int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _insuranceCardService.getInsuranceApprovalInPatient(mrn: mrn); if (_insuranceCardService.hasError) { - error = _insuranceCardService.error!; + error = _insuranceCardService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 54ae3ab8..53feedd1 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -35,7 +35,7 @@ class LiveCarePatientViewModel extends BaseViewModel { PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false); await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { @@ -47,7 +47,7 @@ class LiveCarePatientViewModel extends BaseViewModel { Future endCall(int vCID, bool isPatient) async { await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile!.doctorID; + endCallReq.doctorId = doctorProfile.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; @@ -55,7 +55,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -67,33 +67,33 @@ class LiveCarePatientViewModel extends BaseViewModel { return token; } - Future startCall({required int vCID, required bool isReCall}) async { + Future startCall({int vCID, bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); await getDoctorProfile(); - startCallReq.clinicId = super.doctorProfile!.clinicID!; + startCallReq.clinicId = super.doctorProfile.clinicID; startCallReq.vCID = vCID; //["VC_ID"]; startCallReq.isrecall = isReCall; - startCallReq.doctorId = doctorProfile!.doctorID!; + startCallReq.doctorId = doctorProfile.doctorID; startCallReq.isOutKsa = false; //["IsOutKSA"]; - startCallReq.projectName = doctorProfile!.projectName!; - startCallReq.docotrName = doctorProfile!.doctorName!; - startCallReq.clincName = doctorProfile!.clinicDescription!; - startCallReq.docSpec = doctorProfile!.doctorTitleForProfile!; + startCallReq.projectName = doctorProfile.projectName; + startCallReq.docotrName = doctorProfile.doctorName; + startCallReq.clincName = doctorProfile.clinicDescription; + startCallReq.docSpec = doctorProfile.doctorTitleForProfile; startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); await _liveCarePatientServices.startCall(startCallReq); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - setSelectedCheckboxValues(AlternativeService? service, bool? isSelected) { - int index = alternativeServicesList.indexOf(service!); - if (index != -1) alternativeServicesList[index].isSelected = isSelected!; + setSelectedCheckboxValues(AlternativeService service, bool isSelected) { + int index = alternativeServicesList.indexOf(service); + if (index != -1) alternativeServicesList[index].isSelected = isSelected; notifyListeners(); } @@ -107,7 +107,7 @@ class LiveCarePatientViewModel extends BaseViewModel { await _liveCarePatientServices.endCallWithCharge(vcID, selectedServices); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -116,10 +116,10 @@ class LiveCarePatientViewModel extends BaseViewModel { } List getSelectedAlternativeServices() { - List selectedServices = []; + List selectedServices = List(); for (AlternativeService service in alternativeServicesList) { - if (service.isSelected!) { - selectedServices.add(service.serviceID!); + if (service.isSelected) { + selectedServices.add(service.serviceID); } } return selectedServices; @@ -129,7 +129,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.getAlternativeServices(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -140,7 +140,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.transferToAdmin(vcID, notes); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -152,7 +152,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.sendSMSInstruction(vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { await getPendingPatientERForDoctorApp(); @@ -165,9 +165,9 @@ class LiveCarePatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { - String fullName = _liveCarePatientServices.patientList[i].fullName!.toUpperCase(); + String fullName = _liveCarePatientServices.patientList[i].fullName.toUpperCase(); String patientID = _liveCarePatientServices.patientList[i].patientId.toString(); - String mobile = _liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase(); + String mobile = _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) { filterData.add(_liveCarePatientServices.patientList[i]); @@ -184,14 +184,14 @@ class LiveCarePatientViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); - userLoginRequestModel.isOutKsa = (doctorProfile!.projectID! == 2 || doctorProfile!.projectID! == 3) ? 1 : 0; + 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!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -235,7 +235,7 @@ class LiveCarePatientViewModel extends BaseViewModel { ); } - updateInCallPatient({required PatiantInformtion patient, appointmentNo}) { + updateInCallPatient({PatiantInformtion patient, appointmentNo}) { _liveCarePatientServices.patientList.forEach((e) { if (e.patientId == patient.patientId) { e.episodeNo = 0; @@ -252,7 +252,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.addPatientToDoctorList(vcID: vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -264,7 +264,7 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _liveCarePatientServices.removePatientFromDoctorList(vcID: vcID); if (_liveCarePatientServices.hasError) { - error = _liveCarePatientServices.error!; + error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 996766ec..e7d343b4 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -18,7 +18,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportList(patient); if (_service.hasError) { - error = _service.error!; + error = _service.error; setState(ViewState.ErrorLocal); // ViewState.Error } else setState(ViewState.Idle); @@ -28,17 +28,17 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.getMedicalReportTemplate(); if (_service.hasError) { - error = _service.error!; + error = _service.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { - setState(ViewState.BusyLocal); + setState(ViewState.Busy); await _service.insertMedicalReport(patient, htmlText); if (_service.hasError) { - error = _service.error!; + error = _service.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -48,7 +48,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.verifyMedicalReport(patient, medicalReport); if (_service.hasError) { - error = _service.error!; + error = _service.error; setState(ViewState.ErrorLocal); } else await getMedicalReportList(patient); @@ -59,7 +59,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _service.addMedicalReport(patient, htmlText); if (_service.hasError) { - error = _service.error!; + error = _service.error; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else @@ -68,11 +68,11 @@ class PatientMedicalReportViewModel extends BaseViewModel { } } - Future updateMedicalReport(PatiantInformtion patient, String htmlText, int? limitNumber, String? invoiceNumber) async { + Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { setState(ViewState.Busy); - await _service.updateMedicalReport(patient, htmlText, limitNumber!, invoiceNumber!); + await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); if (_service.hasError) { - error = _service.error!; + error = _service.error; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 80f917b7..312d6ebb 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -8,13 +8,17 @@ import '../../locator.dart'; class PatientMuseViewModel extends BaseViewModel { PatientMuseService _patientMuseService = locator(); - List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; + List get patientMuseResultsModelList => + _patientMuseService.patientMuseResultsModelList; - getECGPatient({int? patientType, int? patientOutSA, int? patientID}) async { + getECGPatient({int patientType, int patientOutSA, int patientID}) async { setState(ViewState.Busy); - await _patientMuseService.getECGPatient(patientID: patientID, patientOutSA: patientOutSA, patientType: patientType); + await _patientMuseService.getECGPatient( + patientID: patientID, + patientOutSA: patientOutSA, + patientType: patientType); if (_patientMuseService.hasError) { - error = _patientMuseService.error!; + error = _patientMuseService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 31d84608..866f99a8 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -18,7 +18,7 @@ class PatientRegistrationViewModel extends BaseViewModel { GetPatientInfoResponseModel get getPatientInfoResponseModel => _patientRegistrationService.getPatientInfoResponseModel; - late CheckPatientForRegistrationModel checkPatientForRegistrationModel; + CheckPatientForRegistrationModel checkPatientForRegistrationModel; Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -30,7 +30,7 @@ class PatientRegistrationViewModel extends BaseViewModel { await _patientRegistrationService .checkPatientForRegistration(registrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -135,17 +135,17 @@ class PatientRegistrationViewModel extends BaseViewModel { // await _patientRegistrationService. // getPatientInfo(getPatientInfoRequestModel); // if (_patientRegistrationService.hasError) { - // error = _patientRegistrationService.error!; + // error = _patientRegistrationService.error; // setState(ViewState.ErrorLocal); // } else setState(ViewState.Idle); } Future sendActivationCodeByOTPNotificationType( - {required SendActivationCodeByOTPNotificationTypeForRegistrationModel + {SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - required int otpType, - required PatientRegistrationViewModel user}) async { + int otpType, + PatientRegistrationViewModel user}) async { setState(ViewState.BusyLocal); print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel); @@ -155,7 +155,7 @@ class PatientRegistrationViewModel extends BaseViewModel { model: this, checkPatientForRegistrationModel: checkPatientForRegistrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -191,7 +191,7 @@ class PatientRegistrationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientRegistrationService.checkActivationCode(model); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -201,7 +201,7 @@ class PatientRegistrationViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientRegistrationService.registrationPatient(registrationModel); if (_patientRegistrationService.hasError) { - error = _patientRegistrationService.error!; + error = _patientRegistrationService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index b54bdce0..5acc6f07 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -25,8 +25,8 @@ class PatientSearchViewModel extends BaseViewModel { List filterData = []; - DateTime? selectedFromDate; - DateTime? selectedToDate; + DateTime selectedFromDate; + DateTime selectedToDate; int firstSubsetIndex = 0; int inPatientPageSize = 20; @@ -40,11 +40,11 @@ class PatientSearchViewModel extends BaseViewModel { filterData = []; for (var i = 0; i < _outPatientService.patientList.length; i++) { String firstName = - _outPatientService.patientList[i].firstName!.toUpperCase(); + _outPatientService.patientList[i].firstName.toUpperCase(); String lastName = - _outPatientService.patientList[i].lastName!.toUpperCase(); + _outPatientService.patientList[i].lastName.toUpperCase(); String mobile = - _outPatientService.patientList[i].mobileNumber!.toUpperCase(); + _outPatientService.patientList[i].mobileNumber.toUpperCase(); String patientID = _outPatientService.patientList[i].patientId.toString(); @@ -70,10 +70,10 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.Busy); } await getDoctorProfile(isGetProfile: true); - patientSearchRequestModel.doctorID = doctorProfile!.doctorID; + patientSearchRequestModel.doctorID = doctorProfile.doctorID; await _outPatientService.getOutPatient(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error!; + error = _outPatientService.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -99,7 +99,7 @@ class PatientSearchViewModel extends BaseViewModel { await _outPatientService .getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { - error = _outPatientService.error!; + error = _outPatientService.error; setState(ViewState.Error); } else { filterData = _outPatientService.patientList; @@ -109,10 +109,10 @@ class PatientSearchViewModel extends BaseViewModel { getPatientBasedOnDate( {item, - PatientSearchRequestModel? patientSearchRequestModel, - PatientType? selectedPatientType, - bool? isSearchWithKeyInfo, - OutPatientFilterType? outPatientFilterType}) async { + PatientSearchRequestModel patientSearchRequestModel, + PatientType selectedPatientType, + bool isSearchWithKeyInfo, + OutPatientFilterType outPatientFilterType}) async { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { @@ -120,9 +120,9 @@ class PatientSearchViewModel extends BaseViewModel { DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); selectedToDate = DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); - dateTo = AppDateUtils.convertDateToFormat(selectedToDate!, 'yyyy-MM-dd'); + dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); dateFrom = - AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); + AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, @@ -144,7 +144,7 @@ class PatientSearchViewModel extends BaseViewModel { 'yyyy-MM-dd'); } PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.patientID = patientSearchRequestModel!.patientID; + currentModel.patientID = patientSearchRequestModel.patientID; currentModel.firstName = patientSearchRequestModel.firstName; currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; @@ -163,8 +163,8 @@ class PatientSearchViewModel extends BaseViewModel { List get myIinPatientList => _inPatientService.myInPatientList; - List filteredInPatientItems = []; - List filteredMyInPatientItems = []; + List filteredInPatientItems = List(); + List filteredMyInPatientItems = List(); Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isLocalBusy = false}) async { @@ -177,7 +177,7 @@ class PatientSearchViewModel extends BaseViewModel { if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { - error = _inPatientService.error!; + error = _inPatientService.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -190,10 +190,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - sortInPatient( - {bool isDes = false, - required bool isAllClinic, - required bool isMyInPatient}) { + sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) { if (isMyInPatient ? myIinPatientList.length > 0 : isAllClinic @@ -206,12 +203,12 @@ class PatientSearchViewModel extends BaseViewModel { : [...filteredInPatientItems]; if (isDes) localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => b - .admissionDateWithDateTimeForm! - .compareTo(a.admissionDateWithDateTimeForm!)); + .admissionDateWithDateTimeForm + .compareTo(a.admissionDateWithDateTimeForm)); else localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => a - .admissionDateWithDateTimeForm! - .compareTo(b.admissionDateWithDateTimeForm!)); + .admissionDateWithDateTimeForm + .compareTo(b.admissionDateWithDateTimeForm)); if (isMyInPatient) { filteredMyInPatientItems.clear(); filteredMyInPatientItems.addAll(localInPatient); @@ -256,7 +253,7 @@ class PatientSearchViewModel extends BaseViewModel { InpatientClinicList.clear(); inPatientList.forEach((element) { if (!InpatientClinicList.contains(element.clinicDescription)) { - InpatientClinicList.add(element!.clinicDescription!); + InpatientClinicList.add(element.clinicDescription); } }); } @@ -284,7 +281,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - filterByHospital({required int hospitalId}) { + filterByHospital({int hospitalId}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].projectId == hospitalId) { @@ -294,7 +291,7 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } - filterByClinic({required String clinicName}) { + filterByClinic({String clinicName}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].clinicDescription == clinicName) { @@ -310,7 +307,7 @@ class PatientSearchViewModel extends BaseViewModel { } void filterSearchResults(String query, - {required bool isAllClinic, required bool isMyInPatient}) { + {bool isAllClinic, bool isMyInPatient}) { var strExist = query.length > 0 ? true : false; if (isMyInPatient) { @@ -322,13 +319,13 @@ class PatientSearchViewModel extends BaseViewModel { filteredMyInPatientItems.clear(); for (var i = 0; i < localFilteredMyInPatientItems.length; i++) { String firstName = - localFilteredMyInPatientItems[i].firstName!.toUpperCase(); + localFilteredMyInPatientItems[i].firstName.toUpperCase(); String lastName = - localFilteredMyInPatientItems[i].lastName!.toUpperCase(); + localFilteredMyInPatientItems[i].lastName.toUpperCase(); String mobile = - localFilteredMyInPatientItems[i].mobileNumber!.toUpperCase(); + localFilteredMyInPatientItems[i].mobileNumber.toUpperCase(); String patientID = - localFilteredMyInPatientItems[i].patientId!.toString(); + localFilteredMyInPatientItems[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) || @@ -348,9 +345,9 @@ class PatientSearchViewModel extends BaseViewModel { if (strExist) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { - String firstName = inPatientList[i].firstName!.toUpperCase(); - String lastName = inPatientList[i].lastName!.toUpperCase(); - String mobile = inPatientList[i].mobileNumber!.toUpperCase(); + String firstName = inPatientList[i].firstName.toUpperCase(); + String lastName = inPatientList[i].lastName.toUpperCase(); + String mobile = inPatientList[i].mobileNumber.toUpperCase(); String patientID = inPatientList[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || @@ -375,11 +372,11 @@ class PatientSearchViewModel extends BaseViewModel { filteredInPatientItems.clear(); for (var i = 0; i < localFilteredInPatientItems.length; i++) { String firstName = - localFilteredInPatientItems[i].firstName!.toUpperCase(); + localFilteredInPatientItems[i].firstName.toUpperCase(); String lastName = - localFilteredInPatientItems[i].lastName!.toUpperCase(); + localFilteredInPatientItems[i].lastName.toUpperCase(); String mobile = - localFilteredInPatientItems[i].mobileNumber!.toUpperCase(); + localFilteredInPatientItems[i].mobileNumber.toUpperCase(); String patientID = localFilteredInPatientItems[i].patientId.toString(); @@ -410,7 +407,7 @@ class PatientSearchViewModel extends BaseViewModel { } await _specialClinicsService.getSpecialClinicalCareMappingList(clinicId); if (_specialClinicsService.hasError) { - error = _specialClinicsService.error!; + error = _specialClinicsService.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 0e45825e..83cd43e3 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -47,41 +47,54 @@ class SOAPViewModel extends BaseViewModel { List get allergiesList => _SOAPService.allergiesList; - List get allergySeverityList => _SOAPService.allergySeverityList; + List get allergySeverityList => + _SOAPService.allergySeverityList; List get historyFamilyList => _SOAPService.historyFamilyList; - List get historyMedicalList => _SOAPService.historyMedicalList; + List get historyMedicalList => + _SOAPService.historyMedicalList; List get historySportList => _SOAPService.historySportList; List get historySocialList => _SOAPService.historySocialList; - List get historySurgicalList => _SOAPService.historySurgicalList; + List get historySurgicalList => + _SOAPService.historySurgicalList; - List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList]; + List get mergeHistorySurgicalWithHistorySportList => + [...historySurgicalList, ...historySportList]; - List get physicalExaminationList => _SOAPService.physicalExaminationList; + List get physicalExaminationList => + _SOAPService.physicalExaminationList; - List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; + List get listOfDiagnosisType => + _SOAPService.listOfDiagnosisType; - List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; + List get listOfDiagnosisCondition => + _SOAPService.listOfDiagnosisCondition; List get listOfICD10 => _SOAPService.listOfICD10; - List get patientChiefComplaintList => _SOAPService.patientChiefComplaintList; + List get patientChiefComplaintList => + _SOAPService.patientChiefComplaintList; - List get patientAllergiesList => _SOAPService.patientAllergiesList; + List get patientAllergiesList => + _SOAPService.patientAllergiesList; - List get patientHistoryList => _SOAPService.patientHistoryList; + List get patientHistoryList => + _SOAPService.patientHistoryList; - List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; + List get patientPhysicalExamList => + _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => _SOAPService.patientProgressNoteList; + List get patientProgressNoteList => + _SOAPService.patientProgressNoteList; - List get patientAssessmentList => _SOAPService.patientAssessmentList; + List get patientAssessmentList => + _SOAPService.patientAssessmentList; - int? get episodeID => _SOAPService.episodeID; + int get episodeID => _SOAPService.episodeID; bool isAddProgress = true; bool isAddExamInProgress = true; @@ -98,9 +111,10 @@ class SOAPViewModel extends BaseViewModel { get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; - List get allMedicationList => _prescriptionService.allMedicationList; + List get allMedicationList => + _prescriptionService.allMedicationList; - late SubjectiveCallBack subjectiveCallBack; + SubjectiveCallBack subjectiveCallBack; setSubjectiveCallBack(SubjectiveCallBack callBack) { this.subjectiveCallBack = callBack; @@ -110,7 +124,7 @@ class SOAPViewModel extends BaseViewModel { subjectiveCallBack.nextFunction(model); } - late ObjectiveCallBack objectiveCallBack; + ObjectiveCallBack objectiveCallBack; setObjectiveCallBack(ObjectiveCallBack callBack) { this.objectiveCallBack = callBack; @@ -120,7 +134,7 @@ class SOAPViewModel extends BaseViewModel { objectiveCallBack.nextFunction(model); } - late AssessmentCallBack assessmentCallBack; + AssessmentCallBack assessmentCallBack; setAssessmentCallBack(AssessmentCallBack callBack) { this.assessmentCallBack = callBack; @@ -130,7 +144,7 @@ class SOAPViewModel extends BaseViewModel { assessmentCallBack.nextFunction(model); } - late PlanCallBack planCallBack; + PlanCallBack planCallBack; setPlanCallBack(PlanCallBack callBack) { this.planCallBack = callBack; @@ -144,22 +158,21 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { + Future getMasterLookup(MasterKeysService masterKeys, + {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.Busy); } else setState(ViewState.Busy); await _SOAPService.getMasterLookup(masterKeys); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -169,8 +182,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.postEpisode(postEpisodeReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -183,41 +195,40 @@ class SOAPViewModel extends BaseViewModel { await _SOAPService.postEpisodeForInPatient( postEpisodeForInpatientRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam( + PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote( + PostProgressNoteRequestModel postProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postProgressNote(postProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment( + PostAssessmentRequestModel postAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAssessment(postAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -228,44 +239,43 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote( + PostProgressNoteRequestModel patchProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment( + PatchAssessmentReqModel patchAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchAssessment(patchAssessmentRequestModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async { + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, + {isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else @@ -277,16 +287,21 @@ class SOAPViewModel extends BaseViewModel { String getAllergicNames(isArabic) { String allergiesString = ''; patientAllergiesList.forEach((element) { - MasterKeyModel? selectedAllergy = getOneMasterKey( - masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked!) - allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , '; + MasterKeyModel selectedAllergy = getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); + if (selectedAllergy != null && element.isChecked) + allergiesString += + (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + + ' , '; }); return allergiesString; } - Future getPatientPhysicalExam(PatiantInformtion patientInfo, + Future getPatientPhysicalExam( + PatiantInformtion patientInfo, ) async { GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( patientMRN: patientInfo.patientMRN, @@ -299,37 +314,36 @@ class SOAPViewModel extends BaseViewModel { patientInfo.appointmentNo.toString(), ), ); - if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty) - getPhysicalExamReqModel.admissionNo = int.parse(patientInfo!.admissionNo!); + if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) + getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); else getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote( + GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientAssessment(getAssessmentReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; - + error = _SOAPService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -339,7 +353,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMedicationList(); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -350,11 +364,11 @@ class SOAPViewModel extends BaseViewModel { GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel( patientID: patient.patientId, - admissionNo: int.parse(patient!.admissionNo!), + admissionNo: int.parse(patient.admissionNo), patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { - error = _SOAPService.error!; + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else { patient.episodeNo = _SOAPService.episodeID; @@ -363,11 +377,13 @@ class SOAPViewModel extends BaseViewModel { } // ignore: missing_return - MasterKeyModel? getOneMasterKey({@required MasterKeysService? masterKeys, dynamic id, int? typeId}) { + MasterKeyModel getOneMasterKey( + {@required MasterKeysService masterKeys, dynamic id, int typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -376,7 +392,8 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.HistoryFamily: List result = historyFamilyList.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -384,7 +401,8 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistoryMedical: List result = historyMedicalList.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -392,7 +410,8 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySocial: List result = historySocialList.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -400,7 +419,8 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySports: List result = historySocialList.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -416,7 +436,8 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.PhysicalExamination: List result = physicalExaminationList.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -424,7 +445,8 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.AllergySeverity: List result = allergySeverityList.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -439,7 +461,8 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.DiagnosisType: List result = listOfDiagnosisType.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -447,7 +470,8 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.DiagnosisCondition: List result = listOfDiagnosisCondition.where((element) { - return element.id == id && element.typeId == masterKeys!.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -480,9 +504,10 @@ class SOAPViewModel extends BaseViewModel { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( admissionNo: - patientInfo!.admissionNo != + patientInfo + .admissionNo != null - ? int.parse(patientInfo!.admissionNo!) + ? int.parse(patientInfo.admissionNo) : null, patientMRN: patientInfo.patientMRN, appointmentNo: patientInfo.appointmentNo != null @@ -583,7 +608,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError) { - error = _SOAPService.error!; + error = _SOAPService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -643,7 +668,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError || _prescriptionService.hasError) { - error = _SOAPService.error! + _prescriptionService.error!; + error = _SOAPService.error + _prescriptionService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -683,7 +708,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (allowSetState) { if (_SOAPService.hasError) { - error = _SOAPService.error!; + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -707,7 +732,7 @@ class SOAPViewModel extends BaseViewModel { } if (_SOAPService.hasError) { - error = _SOAPService.error!; + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -715,11 +740,11 @@ class SOAPViewModel extends BaseViewModel { postSubjectServices( {patientInfo, - required String complaintsText, - required String medicationText, - required String illnessText, - required List myHistoryList, - required List myAllergiesList}) async { + String complaintsText, + String medicationText, + String illnessText, + List myHistoryList, + List myAllergiesList}) async { var services; PostChiefComplaintRequestModel postChiefComplaintRequestModel = @@ -765,7 +790,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services); if (_SOAPService.hasError) { - error = _SOAPService.error!; + error = _SOAPService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -773,9 +798,9 @@ class SOAPViewModel extends BaseViewModel { PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( {patientInfo, - required String complaintsText, - required String medicationText, - required String illnessText}) { + String complaintsText, + String medicationText, + String illnessText}) { return new PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) @@ -793,13 +818,13 @@ class SOAPViewModel extends BaseViewModel { } PostHistoriesRequestModel createPostHistoriesRequestModel( - {patientInfo, required List myHistoryList}) { + {patientInfo, List myHistoryList}) { PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( + postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: patientInfo.appointmentNo, @@ -821,7 +846,7 @@ class SOAPViewModel extends BaseViewModel { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, @@ -830,9 +855,9 @@ class SOAPViewModel extends BaseViewModel { appointmentNo: patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile!.doctorID, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile!.doctorID, + editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), isChecked: allergy.isChecked, isUpdatedByNurse: false)); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 4110b079..cad5fa87 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -26,7 +26,9 @@ 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'; @@ -43,39 +45,39 @@ class AuthenticationViewModel extends BaseViewModel { NewLoginInformationModel get loginInfo => _authService.loginInfo; - List get doctorProfilesList => - _authService.doctorProfilesList; + List get doctorProfilesList => _authService.doctorProfilesList; SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => - _authService.activationCodeVerificationScreenRes; + get activationCodeVerificationScreenRes => + _authService.activationCodeVerificationScreenRes; SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => - _authService.activationCodeForDoctorAppRes; + get activationCodeForDoctorAppRes => + _authService.activationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => - _authService.checkActivationCodeForDoctorAppRes; + get checkActivationCodeForDoctorAppRes => + _authService.checkActivationCodeForDoctorAppRes; - NewLoginInformationModel? loggedUser; - GetIMEIDetailsModel? user; + NewLoginInformationModel loggedUser; + GetIMEIDetailsModel user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - late List _availableBiometrics; - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; + List _availableBiometrics; + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); bool isLogin = false; bool unverified = false; bool isFromLogin = false; APP_STATUS appStatus = APP_STATUS.LOADING; - String localToken = ""; - AuthenticationViewModel() { + String localToken =""; + AuthenticationViewModel({bool checkDeviceInfo = false}) { getDeviceInfoFromFirebase(); getDoctorProfile(); } + /// Insert Device IMEI Future insertDeviceImei(token) async { var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); @@ -90,168 +92,155 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; profileInfo['MobileNo'] = - loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; - InsertIMEIDetailsModel insertIMEIDetailsModel = - InsertIMEIDetailsModel.fromJson(profileInfo); - insertIMEIDetailsModel.genderDescription = - profileInfo['Gender_Description']; - insertIMEIDetailsModel.genderDescriptionN = - profileInfo['Gender_DescriptionN']; - insertIMEIDetailsModel.genderDescriptionN = - profileInfo['Gender_DescriptionN']; + loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); + insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; + insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; + insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; - insertIMEIDetailsModel.titleDescriptionN = - profileInfo['Title_DescriptionN']; + insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] - : user!.doctorID; - insertIMEIDetailsModel.outSA = - loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; - insertIMEIDetailsModel.vidaAuthTokenID = - await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + : user.doctorID; + insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; + insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID =await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } + /// first step login Future login(UserModel userInfo) async { setState(ViewState.BusyLocal); await _authService.login(userInfo); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else { - sharedPref.setInt(PROJECT_ID, userInfo.projectID!); + sharedPref.setInt(PROJECT_ID, userInfo.projectID); loggedUser = loginInfo; saveObjToString(LOGGED_IN_USER, loginInfo); sharedPref.remove(LAST_LOGIN_USER); - sharedPref.setString(TOKEN, loginInfo.logInTokenID!); + sharedPref.setString(TOKEN, loginInfo.logInTokenID); setState(ViewState.Idle); } } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen( - AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen( AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); ActivationCodeForVerificationScreenModel activationCodeModel = - ActivationCodeForVerificationScreenModel( - iMEI: user!.iMEI, - facilityId: user!.projectID, - memberID: user!.doctorID, - loginDoctorID: int.parse(user!.editedBy.toString()), - zipCode: user!.outSA == true ? '971' : '966', - mobileNumber: user!.mobile, - oTPSendType: authMethodType.getTypeIdService(), - isMobileFingerPrint: 1, - vidaAuthTokenID: user!.vidaAuthTokenID, - vidaRefreshTokenID: user!.vidaRefreshTokenID); - await _authService - .sendActivationCodeVerificationScreen(activationCodeModel); + ActivationCodeForVerificationScreenModel( + iMEI: user.iMEI, + facilityId: user.projectID, + memberID: user.doctorID, + loginDoctorID: int.parse(user.editedBy.toString()), + zipCode: user.outSA == true ? '971' : '966', + mobileNumber: user.mobile, + oTPSendType: authMethodType.getTypeIdService(), + isMobileFingerPrint: 1, + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); + await _authService.sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } /// send activation code for silent login - Future sendActivationCodeForDoctorApp( - {required AuthMethodTypes authMethodType, - required String password}) async { + Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password }) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( - facilityId: projectID, - memberID: loggedUser!.listMemberInformation![0].memberID, - loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, - otpSendType: authMethodType.getTypeIdService().toString(), - ); + facilityId: projectID, + memberID: loggedUser.listMemberInformation[0].memberID, + loginDoctorID: loggedUser.listMemberInformation[0].employeeID, + otpSendType: authMethodType.getTypeIdService().toString(), + ); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString( - TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!); + await sharedPref.setString(TOKEN, + _authService.activationCodeForDoctorAppRes.logInTokenID); setState(ViewState.Idle); } } + /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp( - {required String activationCode, bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp({String activationCode,bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = - new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, - mobileNumber: - loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null - ? await sharedPref.getInt(PROJECT_ID) - : user!.projectID, - logInTokenID: await sharedPref.getString(TOKEN), - activationCode: activationCode, - memberID: userInfo.userID != null - ? int.parse(userInfo!.userID!) - : user!.doctorID, - password: userInfo.password, - facilityId: userInfo.projectID != null - ? userInfo.projectID.toString() - : user!.projectID.toString(), - oTPSendType: await sharedPref.getInt(OTP_TYPE), - iMEI: localToken, - loginDoctorID: userInfo.userID != null - ? int.parse(userInfo!.userID!) - : user! - .editedBy, // loggedUser.listMemberInformation[0].employeeID, - isForSilentLogin: isSilentLogin, - generalid: "Cs2020@2016\$2958"); - await _authService - .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); + new CheckActivationCodeRequestModel( + zipCode: + loggedUser != null ? loggedUser.zipCode :user.zipCode, + mobileNumber: + loggedUser != null ? loggedUser.mobileNumber : user.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null + ? await sharedPref.getInt(PROJECT_ID) + : user.projectID, + logInTokenID: await sharedPref.getString(TOKEN), + activationCode: activationCode ?? '0000', + memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID , + password: userInfo.password, + facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(), + oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin:isSilentLogin, + generalid: "Cs2020@2016\$2958"); + await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else { - await setDataAfterSendActivationSuccess( - checkActivationCodeForDoctorAppRes); + await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel = - GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error!; + error = _hospitalsService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } + /// get type name based on id. getType(type, context) { switch (type) { case 1: - return TranslationBase.of(context).verifySMS; + return TranslationBase + .of(context) + .verifySMS; break; case 3: - return TranslationBase.of(context).verifyFingerprint; + return TranslationBase + .of(context) + .verifyFingerprint; break; case 4: - return TranslationBase.of(context).verifyFaceID; + return TranslationBase + .of(context) + .verifyFaceID; break; case 2: return TranslationBase.of(context).verifyWhatsApp; @@ -263,16 +252,14 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess( - CheckActivationCodeForDoctorAppResponseModel - sendActivationCodeForDoctorAppResponseModel) async { - // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); - await sharedPref.setString(TOKEN, - sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); + setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel)async { + // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + await sharedPref.setString(TOKEN, + sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); } saveObjToString(String key, value) async { @@ -310,12 +297,10 @@ class AuthenticationViewModel extends BaseViewModel { clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, - languageID: 2); - - ///TODO change the lan + languageID: 2);///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else { localSetDoctorProfile(doctorProfilesList.first); @@ -326,26 +311,32 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { sharedPref.setString( - TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); + TOKEN, + checkActivationCodeForDoctorAppRes.authenticationTokenID); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { + checkActivationCodeForDoctorAppRes.listDoctorProfile + .isNotEmpty) { localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); + checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); } else { sharedPref.setObj( - CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); + CLINIC_NAME, + checkActivationCodeForDoctorAppRes.listDoctorsClinic); ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); + checkActivationCodeForDoctorAppRes.listDoctorsClinic[0] + .toJson()); await getDoctorProfileBasedOnClinic(clinic); } } /// check specific biometric if it available or not - Future checkIfBiometricAvailable(BiometricType biometricType) async { + Future checkIfBiometricAvailable(BiometricType biometricType) async { bool isAvailable = false; await _getAvailableBiometrics(); - for (var i = 0; i < _availableBiometrics.length; i++) { - if (biometricType == _availableBiometrics[i]) isAvailable = true; + if (_availableBiometrics != null) { + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; + } } return isAvailable; } @@ -359,31 +350,30 @@ class AuthenticationViewModel extends BaseViewModel { } } - /// call firebase service to check if the user already login in before or not /// call firebase service to check if the user already login in before or not getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestPermission(); + _firebaseMessaging.requestNotificationPermissions(); } - setState(ViewState.Busy); + setState(ViewState.Busy); var token = await _firebaseMessaging.getToken(); if (localToken == "") { - localToken = token!; + localToken = token; await _authService.selectDeviceImei(localToken); if (_authService.hasError) { - error = _authService.error!; + error = _authService.error; setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user = _authService.dashboardItemsList[0]; + user =_authService.dashboardItemsList[0]; sharedPref.setObj( LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString( - VIDA_REFRESH_TOKEN_ID, user!.vidaRefreshTokenID!); - await sharedPref.setString( - VIDA_AUTH_TOKEN_ID, user!.vidaAuthTokenID!); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + user.vidaRefreshTokenID); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, + user.vidaAuthTokenID); this.unverified = true; } setState(ViewState.Idle); @@ -398,9 +388,9 @@ class AuthenticationViewModel extends BaseViewModel { if (state == ViewState.Busy) { appStatus = APP_STATUS.LOADING; } else { - if (this.doctorProfile != null) + if(this.doctorProfile !=null) appStatus = APP_STATUS.AUTHENTICATED; - else if (this.unverified) { + else if (this.unverified) { appStatus = APP_STATUS.UNVERIFIED; } else if (this.isLogin) { appStatus = APP_STATUS.AUTHENTICATED; @@ -410,13 +400,12 @@ class AuthenticationViewModel extends BaseViewModel { } return appStatus; } - - setAppStatus(APP_STATUS status) { + setAppStatus(APP_STATUS status){ this.appStatus = status; notifyListeners(); } - setUnverified(bool unverified, {bool isFromLogin = false}) { + setUnverified(bool unverified,{bool isFromLogin = false}){ this.unverified = unverified; this.isFromLogin = isFromLogin; notifyListeners(); @@ -424,21 +413,24 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { + + localToken = ""; - String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - this.isFromLogin = isFromLogin; - appStatus = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + String lang = await sharedPref.getString(APP_Language); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + appStatus = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); } - deleteUser() { + deleteUser(){ user = null; unverified = false; isLogin = false; } + } diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index f4d052cf..d50a8d5a 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; class BaseViewModel extends ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - DoctorProfileModel ? doctorProfile; + DoctorProfileModel doctorProfile; ViewState _state = ViewState.Idle; bool isInternetConnection = true; @@ -25,19 +25,23 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future ?getDoctorProfile({bool isGetProfile = false}) async { + Future getDoctorProfile({bool isGetProfile = false}) async { if (isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } } if (doctorProfile == null) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - doctorProfile = DoctorProfileModel.fromJson(profile); - if (doctorProfile != null) { - return doctorProfile; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } } return null; } else { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 2a064296..04e63dd9 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -13,24 +13,26 @@ import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); DashboardService _dashboardService = locator(); SpecialClinicsService _specialClinicsService = locator(); DoctorReplyService _doctorReplyService = locator(); - List get dashboardItemsList => _dashboardService.dashboardItemsList; + List get dashboardItemsList => + _dashboardService.dashboardItemsList; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; - String? get sServiceID => _dashboardService.sServiceID; + String get sServiceID => _dashboardService.sServiceID; int get notRepliedCount => _doctorReplyService.notRepliedCount; -List get specialClinicalCareList => + List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; - Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { + Future startHomeScreenServices(ProjectViewModel projectsProvider, + AuthenticationViewModel authProvider) async { setState(ViewState.Busy); await getDoctorProfile(isGetProfile: true); @@ -42,7 +44,7 @@ List get specialClinicalCareList => ]); if (_dashboardService.hasError) { - error = _dashboardService.error!; + error = _dashboardService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -51,11 +53,17 @@ List get specialClinicalCareList => } Future setFirebaseNotification(AuthenticationViewModel authProvider) async { - _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); + _firebaseMessaging.requestNotificationPermissions( + const IosNotificationSettings( + sound: true, badge: true, alert: true, provisional: true)); + _firebaseMessaging.onIosSettingsRegistered + .listen((IosNotificationSettings settings) { + print("Settings registered: $settings"); + }); - _firebaseMessaging.getToken().then((String? token) async { + _firebaseMessaging.getToken().then((String token) async { if (token != '') { - // DEVICE_TOKEN = token!; + // DEVICE_TOKEN = token; authProvider.insertDeviceImei(token); } }); @@ -75,35 +83,36 @@ List get specialClinicalCareList => setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); // if (_specialClinicsService.hasError) { - // error = _specialClinicsService.error!; + // error = _specialClinicsService.error; // setState(ViewState.Error); // } else // setState(ViewState.Idle); } - Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic( + int clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( - doctorID: doctorProfile!.doctorID, + doctorID: doctorProfile.doctorID, clinicID: clinicId, - projectID: doctorProfile!.projectID, + projectID: doctorProfile.projectID, ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error!; + error = authProvider.error; } } getPatientCount(DashboardModel inPatientCount) { int value = 0; - inPatientCount.summaryoptions!.forEach((result) => {value += result.value!}); + inPatientCount.summaryoptions.forEach((result) => {value += result.value}); return value.toString(); } - GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId) { - GetSpecialClinicalCareListResponseModel? special; + GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) { + GetSpecialClinicalCareListResponseModel special; specialClinicalCareList.forEach((element) { if (element.clinicID == clinicId) { special = element; @@ -118,7 +127,7 @@ List get specialClinicalCareList => await getDoctorProfile(); await _doctorReplyService.getNotRepliedCount(); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error!; + error = _doctorReplyService.error; setState(ViewState.ErrorLocal); } else { notifyListeners(); diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index de03c6e3..707fb805 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -34,7 +34,7 @@ class DoctorReplayViewModel extends BaseViewModel { await _doctorReplyService.getDoctorReply(_requestDoctorReply, clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error!; + error = _doctorReplyService.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -52,13 +52,13 @@ class DoctorReplayViewModel extends BaseViewModel { transactionNo: model.transactionNo.toString(), doctorResponse: response, infoStatus: 6, - createdBy: this.doctorProfile!.doctorID!, - infoEnteredBy: this.doctorProfile!.doctorID!, + createdBy: this.doctorProfile.doctorID, + infoEnteredBy: this.doctorProfile.doctorID, setupID: "010266"); setState(ViewState.BusyLocal); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); if (_doctorReplyService.hasError) { - error = _doctorReplyService.error!; + error = _doctorReplyService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/hospitals_view_model.dart b/lib/core/viewModel/hospitals_view_model.dart index f2b2abe9..c0ce1bc4 100644 --- a/lib/core/viewModel/hospitals_view_model.dart +++ b/lib/core/viewModel/hospitals_view_model.dart @@ -1,21 +1,25 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; +import 'package:flutter/cupertino.dart'; import '../../locator.dart'; import 'base_view_model.dart'; + class HospitalViewModel extends BaseViewModel { HospitalsService _hospitalsService = locator(); - + // List get imeiDetails => _authService.dashboardItemsList; + // get loginInfo => _authService.loginInfo; Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel = - GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; setState(ViewState.Busy); await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { - error = _hospitalsService.error!; + error = _hospitalsService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 05393f33..d83aee2a 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -20,8 +20,8 @@ class LabsViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get allSpecialLabList => _labsService.allSpecialLab; - List _patientLabOrdersListClinic = []; - List _patientLabOrdersListHospital = []; + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); List get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; @@ -32,7 +32,7 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, true); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { @@ -46,7 +46,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListClinic - .add(PatientLabOrdersList(filterName: element.clinicDescription!, patientDoctorAppointment: element)); + .add(PatientLabOrdersList(filterName: element.clinicDescription, patientDoctorAppointment: element)); } // doctor list sort via project @@ -62,7 +62,7 @@ class LabsViewModel extends BaseViewModel { .add(element); } else { _patientLabOrdersListHospital - .add(PatientLabOrdersList(filterName: element.projectName!, patientDoctorAppointment: element)); + .add(PatientLabOrdersList(filterName: element.projectName, patientDoctorAppointment: element)); } }); @@ -79,19 +79,19 @@ class LabsViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = []; + List labResultLists = List(); List get labResultListsCoustom { return labResultLists; } getLaboratoryResult( - {required String projectID, - required int clinicID, - required String invoiceNo, - required String orderNo, - required PatiantInformtion patient, - required bool isInpatient}) async { + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient, + bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, @@ -101,21 +101,19 @@ class LabsViewModel extends BaseViewModel { patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientLabResult({required PatientLabOrders patientLabOrder, - required PatiantInformtion patient, - required bool isInpatient}) async { + getPatientLabResult({PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult( patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -130,25 +128,23 @@ class LabsViewModel extends BaseViewModel { if (patientLabOrdersClinic.length != 0) { labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { - labResultLists.add(LabResultList(filterName: element.testCode!, lab: element)); + labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); } }); } - getPatientLabOrdersResults({required PatientLabOrders patientLabOrder, - required String procedure, - required PatiantInformtion patient}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) + if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true; }); } @@ -158,31 +154,31 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResultHistoryByDescription( - {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResultHistoryByDescription( patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async { + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; } else DrAppToastMsg.showSuccesToast(mes); } - Future getAllSpecialLabResult({required int patientId}) async { + Future getAllSpecialLabResult({int patientId}) async { setState(ViewState.Busy); await _labsService.getAllSpecialLabResult(mrn: patientId); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index cb734073..555e19cf 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -1,16 +1,16 @@ class GetRescheduleLeavesResponse { - int? clinicId; + int clinicId; var coveringDoctorId; - String? date; - String? dateTimeFrom; - String? dateTimeTo; - int? doctorId; - int? reasonId; - int? requisitionNo; - int? requisitionType; - int? status; - String? createdOn; - String? statusDescription; + String date; + String dateTimeFrom; + String dateTimeTo; + int doctorId; + int reasonId; + int requisitionNo; + int requisitionType; + int status; + String createdOn; + String statusDescription; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, @@ -25,7 +25,7 @@ class GetRescheduleLeavesResponse { this.createdOn, this.statusDescription}); - GetRescheduleLeavesResponse.fromJson(Map json) { + GetRescheduleLeavesResponse.fromJson(Map json) { clinicId = json['clinicId']; coveringDoctorId = json['coveringDoctorId']; date = json['date']; @@ -40,8 +40,8 @@ class GetRescheduleLeavesResponse { statusDescription = json['statusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['clinicId'] = this.clinicId; data['coveringDoctorId'] = this.coveringDoctorId; data['date'] = this.date; diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index eb96e687..de586e1e 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -16,7 +16,7 @@ class LiveCareViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); List liveCarePendingList = []; - late StartCallRes inCallResponse; + StartCallRes inCallResponse; var transferToAdmin = {}; var endCallResponse = {}; bool isFinished = true; diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 406a4617..08e8ce90 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -11,13 +11,13 @@ class MedicalFileViewModel extends BaseViewModel { List get medicalFileList => _medicalFileService.medicalFileList; - Future getMedicalFile({required int mrn}) async { + Future getMedicalFile({int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _medicalFileService.getMedicalFile(mrn: mrn); if (_medicalFileService.hasError) { - error = _medicalFileService.error!; + error = _medicalFileService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index f95702a5..8ccf1a70 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -18,7 +18,7 @@ class MedicineViewModel extends BaseViewModel { ProcedureService _procedureService = locator(); PrescriptionService _prescriptionService = locator(); List get procedureTemplate => _procedureService.templateList; - List templateList = []; + List templateList = List(); get pharmacyItemsList => _medicineService.pharmacyItemsList; get searchText => _medicineService.searchText; get pharmaciesList => _medicineService.pharmaciesList; @@ -42,13 +42,13 @@ class MedicineViewModel extends BaseViewModel { List get itemMedicineListRoute => _prescriptionService.itemMedicineListRoute; List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; - Future getItem({required int itemID}) async { + Future getItem({int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -70,12 +70,12 @@ class MedicineViewModel extends BaseViewModel { print(templateList.length.toString()); } - Future getProcedureTemplate({required String categoryID}) async { + Future getProcedureTemplate({String categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -83,13 +83,13 @@ class MedicineViewModel extends BaseViewModel { } } - Future getPrescription({required int mrn}) async { + Future getPrescription({int mrn}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -99,17 +99,17 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); if (_medicineService.hasError) { - error = _medicineService.error!; + error = _medicineService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getMedicationList({String? drug}) async { + Future getMedicationList({String drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug!); + await _prescriptionService.getMedicationList(drug: drug); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -119,7 +119,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getPatientAssessment(getAssessmentReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -129,7 +129,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationStrength); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -139,7 +139,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationRoute); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -149,7 +149,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationIndications); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -159,7 +159,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDoseTime); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -169,7 +169,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationFrequency); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -179,19 +179,18 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDuration); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getBoxQuantity( - {required int itemCode, required int duration, required double strength, required int freq}) async { + Future getBoxQuantity({int itemCode, int duration, double strength, int freq}) async { setState(ViewState.Busy); await _prescriptionService.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -201,7 +200,7 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Busy); await _medicineService.getPharmaciesList(itemId); if (_medicineService.hasError) { - error = _medicineService.error!; + error = _medicineService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 8e1cbca0..0868b601 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -39,7 +39,7 @@ class AdmissionRequestViewModel extends BaseViewModel { List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes; - late AdmissionRequest admissionRequestData; + AdmissionRequest admissionRequestData; Future getSpecialityList() async { await getMasterLookup(MasterKeysService.Speciality); @@ -53,7 +53,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getClinics(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -63,7 +63,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDoctorsList(clinicId); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -73,7 +73,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getFloors(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -83,7 +83,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getWardList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -93,7 +93,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getRoomCategories(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -103,7 +103,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDiagnosisTypesList(); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -120,7 +120,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getDietTypesList(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -130,7 +130,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getICDCodes(patientMrn); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -140,7 +140,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.Busy); await _admissionRequestService.makeAdmissionRequest(admissionRequestData); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -150,7 +150,7 @@ class AdmissionRequestViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _admissionRequestService.getMasterLookup(keysService); if (_admissionRequestService.hasError) { - error = _admissionRequestService.error!; + error = _admissionRequestService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index b74c7d25..93635629 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -26,6 +26,7 @@ class PatientReferralViewModel extends BaseViewModel { MyReferralInPatientService _myReferralService = locator(); DischargedPatientService _dischargedPatientService = locator(); + List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; @@ -53,7 +54,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPatientReferral(patient); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else { if (patientReferral.length == 0) { @@ -68,7 +69,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getMasterLookup(masterKeys); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else await getBranches(); @@ -78,7 +79,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getReferralFacilities(); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -90,7 +91,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getClinicsList(projectId); await _referralPatientService.getProjectInfo(projectId); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -100,7 +101,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.ErrorLocal); } else { doctorsList.clear(); @@ -112,7 +113,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getDoctorBranch() async { - DoctorProfileModel? doctorProfile = await getDoctorProfile(); + DoctorProfileModel doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName}; return _selectedBranch; @@ -127,7 +128,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -140,7 +141,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _referralPatientService.getMyReferredOutPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -154,7 +155,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getPendingReferralList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -167,7 +168,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error!; + error = _myReferralService.error; if (localBusy) setState(ViewState.ErrorLocal); else @@ -183,7 +184,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.getMyReferralOutPatientService(); if (_myReferralService.hasError) { - error = _myReferralService.error!; + error = _myReferralService.error; if (localBusy) setState(ViewState.ErrorLocal); else @@ -196,7 +197,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { - error = _myReferralService.error!; + error = _myReferralService.error; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); @@ -206,7 +207,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.responseReferral(referralPatient, isAccepted); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -217,7 +218,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -225,21 +226,21 @@ class PatientReferralViewModel extends BaseViewModel { } Future makeInPatientReferral( - {required PatiantInformtion patient, - required int projectID, - required int clinicID, - required int doctorID, - required int frequencyCode, - required int priority, - required String referralDate, - required String remarks, - required String ext}) async { + {PatiantInformtion patient, + int projectID, + int clinicID, + int doctorID, + int frequencyCode, + int priority, + String referralDate, + String remarks, + String ext}) async { setState(ViewState.Busy); await _referralService.referralPatient( patientID: patient.patientId, roomID: patient.roomId, referralClinic: clinicID, - admissionNo: int.parse(patient.admissionNo!), + admissionNo: int.parse(patient.admissionNo), referralDoctor: doctorID, patientTypeID: patient.patientType, referringDoctorRemarks: remarks, @@ -248,7 +249,7 @@ class PatientReferralViewModel extends BaseViewModel { extension: ext, ); if (_referralService.hasError) { - error = _referralService.error!; + error = _referralService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -261,7 +262,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.getReferralFrequencyList(); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -271,7 +272,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.ErrorLocal); } else { getMyReferredPatient(); @@ -283,7 +284,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _dischargedPatientService.gtMyDischargeReferralPatient(); if (_dischargedPatientService.hasError) { - error = _dischargedPatientService.error!; + error = _dischargedPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -292,15 +293,15 @@ class PatientReferralViewModel extends BaseViewModel { String getReferralStatusNameByCode(int statusCode, BuildContext context) { switch (statusCode) { case 1: - return TranslationBase.of(context).referralStatusHold??"" /*pending*/; + return TranslationBase.of(context).referralStatusHold /*pending*/; case 2: - return TranslationBase.of(context).referralStatusActive??"" /* accepted*/; + return TranslationBase.of(context).referralStatusActive /* accepted*/; case 4: - return TranslationBase.of(context).referralStatusCancelled ??""/*rejected*/; + return TranslationBase.of(context).referralStatusCancelled /*rejected*/; case 46: - return TranslationBase.of(context).referralStatusCompleted??"" /*accepted*/; + return TranslationBase.of(context).referralStatusCompleted /*accepted*/; case 63: - return TranslationBase.of(context).rejected ?? "" /*referralStatusNotSeen*/; + return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; default: return "-"; } @@ -336,51 +337,51 @@ class PatientReferralViewModel extends BaseViewModel { PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID!; - patient.doctorName = referredPatient.doctorName!; + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName!; - patient.middleName = referredPatient.middleName!; - patient.lastName = referredPatient.lastName!; - patient.gender = referredPatient.gender!; - patient.dateofBirth = referredPatient.dateofBirth!; - patient.mobileNumber = referredPatient.mobileNumber!; - patient.emailAddress = referredPatient.emailAddress!; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; - patient.patientType = referredPatient.patientType!; - patient.admissionNo = referredPatient.admissionNo!; - patient.admissionDate = referredPatient.admissionDate!; - patient.roomId = referredPatient.roomID!; - patient.bedId = referredPatient.bedID!; - patient.nationalityName = referredPatient.nationalityName!; - patient.nationalityFlagURL = referredPatient.nationalityFlagURL!; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; + patient.nationalityFlagURL = referredPatient.nationalityFlagURL; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription!; + patient.clinicDescription = referredPatient.clinicDescription; return patient; } PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); - patient.doctorId = referredPatient.doctorID!; - patient.doctorName = referredPatient.doctorName!; + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; patient.patientId = referredPatient.patientID; - patient.firstName = referredPatient.firstName!; - patient.middleName = referredPatient.middleName!; - patient.lastName = referredPatient.lastName!; - patient.gender = referredPatient.gender!; - patient.dateofBirth = referredPatient.dateofBirth!; - patient.mobileNumber = referredPatient.mobileNumber!; - patient.emailAddress = referredPatient.emailAddress!; - patient.patientIdentificationNo = referredPatient.patientIdentificationNo!; - patient.patientType = referredPatient.patientType!; - patient.admissionNo = referredPatient.admissionNo!; - patient.admissionDate = referredPatient.admissionDate!; - patient.roomId = referredPatient.roomID!; - patient.bedId = referredPatient.bedID!; - patient.nationalityName = referredPatient.nationalityName!; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; - patient.clinicDescription = referredPatient.clinicDescription!; + patient.clinicDescription = referredPatient.clinicDescription; return patient; } @@ -388,7 +389,7 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Busy); await _myReferralService.replayReferred(referredDoctorRemarks, referral, referralStatus); if (_myReferralService.hasError) { - error = _myReferralService.error!; + error = _myReferralService.error; setState(ViewState.ErrorLocal); } else getMyReferralPatientService(); diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 6ca5f94f..809c154f 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -18,23 +18,27 @@ import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => + _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; + List get patientVitalSignsHistory => + _ucafService.patientVitalSignsHistory; - List get patientAssessmentList => _ucafService.patientAssessmentList; + List get patientAssessmentList => + _ucafService.patientAssessmentList; List get diagnosisTypes => _ucafService.listOfDiagnosisType; - List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; + List get diagnosisConditions => + _ucafService.listOfDiagnosisCondition; - PrescriptionModel? get prescriptionList => _ucafService.prescriptionList; + PrescriptionModel get prescriptionList => _ucafService.prescriptionList; List get orderProcedures => _ucafService.orderProcedureList; - late Function saveUCAFOnTap; + Function saveUCAFOnTap; - late String selectedLanguage; + String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -45,8 +49,8 @@ class UcafViewModel extends BaseViewModel { resetDataInFirst({bool firstPage = true}) { if(firstPage){ - _ucafService.patientVitalSignsHistory = []; - _ucafService.patientChiefComplaintList = []; + _ucafService.patientVitalSignsHistory = null; + _ucafService.patientChiefComplaintList = null; } _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; @@ -62,39 +66,48 @@ class UcafViewModel extends BaseViewModel { String from; String to; - - from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - - to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + if (from == null || from == "0") { + from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } + if (to == null || to == "0") { + to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { - error = _ucafService.error!; + error = _ucafService.error; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { - if (heightCm == "0" || heightCm == 'null') { + if (heightCm == "0" || heightCm == null || heightCm == 'null') { heightCm = element.heightCm.toString(); } - if (weightKg == "0" || weightKg == 'null') { + if (weightKg == "0" || weightKg == null || weightKg == 'null') { weightKg = element.weightKg.toString(); } - if (bodyMax == "0" || bodyMax == 'null') { + if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || + temperatureCelcius == null || + temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || + respirationBeatPerMinute == null || + respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = + element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { + if (bloodPressure == "0 / 0" || + bloodPressure == null || + bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } }); @@ -108,18 +121,19 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.getPatientAssessment(patient); if (_ucafService.hasError) { - error = _ucafService.error!; + error = _ucafService.error; setState(ViewState.Error); } else { if (patientAssessmentList.isNotEmpty) { if (diagnosisConditions.length == 0) { - await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition); + await _ucafService + .getMasterLookup(MasterKeysService.DiagnosisCondition); } if (diagnosisTypes.length == 0) { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); } if (_ucafService.hasError) { - error = _ucafService.error!; + error = _ucafService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -134,7 +148,7 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.getOrderProcedures(patient); if (_ucafService.hasError) { - error = _ucafService.error!; + error = _ucafService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -147,7 +161,7 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.getPrescription(patient); if (_ucafService.hasError) { - error = _ucafService.error!; + error = _ucafService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -155,11 +169,13 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel? findMasterDataById({required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel findMasterDataById( + {@required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { - return element.id == id && element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -167,7 +183,8 @@ class UcafViewModel extends BaseViewModel { return null; case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { - return element.id == id && element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -182,7 +199,7 @@ class UcafViewModel extends BaseViewModel { // setState(ViewState.Busy); await _ucafService.postUCAF(patient); if (_ucafService.hasError) { - error = _ucafService.error!; + error = _ucafService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); // but with empty list diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 83148044..bab2ff9f 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -11,9 +11,10 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel { VitalSignsService _vitalSignService = locator(); - VitalSignData? get patientVitalSigns => _vitalSignService.patientVitalSigns; + VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; - List get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory; + List get patientVitalSignsHistory => + _vitalSignService.patientVitalSignsHistory; String heightCm = "0"; String weightKg = "0"; @@ -34,14 +35,15 @@ class VitalSignsViewModel extends BaseViewModel { setState(ViewState.Busy); await _vitalSignService.getPatientVitalSign(patient); if (_vitalSignService.hasError) { - error = _vitalSignService.error!; + error = _vitalSignService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to, bool isInPatient) async { + Future getPatientVitalSignHistory(PatiantInformtion patient, String from, + String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -57,7 +59,7 @@ class VitalSignsViewModel extends BaseViewModel { } if (_vitalSignService.hasError) { - error = _vitalSignService.error!; + error = _vitalSignService.error; setState(ViewState.Error); } else { patientVitalSignsHistory.forEach((element) { @@ -70,29 +72,50 @@ class VitalSignsViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || + temperatureCelcius == null || + temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || + respirationBeatPerMinute == null || + respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = + element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { + if (bloodPressure == "0 / 0" || + bloodPressure == null || + bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } - if (oxygenation == "0" || oxygenation == null || oxygenation == 'null') { - oxygenation = "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ + if (oxygenation == "0" || + oxygenation == null || + oxygenation == 'null') { + oxygenation = + "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/ } if (painScore == null || painScore == "-") { - painScore = element.painScoreDesc.toString() != 'null' ? element.painScoreDesc.toString() : "-"; - painLocation = element.painLocation.toString() != 'null' ? element.painLocation.toString() : "-"; - painCharacter = element.painCharacter.toString() != 'null' ? element.painCharacter.toString() : "-"; - painDuration = element.painDuration.toString() != 'null' ? element.painDuration.toString() : "-"; - isPainDone = - element.isPainManagementDone.toString() != 'null' ? element.isPainManagementDone.toString() : "-"; - painFrequency = element.painFrequency.toString() != 'null' ? element.painFrequency.toString() : "-"; + painScore = element.painScoreDesc.toString() != 'null' + ? element.painScoreDesc.toString() + : "-"; + painLocation = element.painLocation.toString() != 'null' + ? element.painLocation.toString() + : "-"; + painCharacter = element.painCharacter.toString() != 'null' + ? element.painCharacter.toString() + : "-"; + painDuration = element.painDuration.toString() != 'null' + ? element.painDuration.toString() + : "-"; + isPainDone = element.isPainManagementDone.toString() != 'null' + ? element.isPainManagementDone.toString() + : "-"; + painFrequency = element.painFrequency.toString() != 'null' + ? element.painFrequency.toString() + : "-"; } }); setState(ViewState.Idle); @@ -140,6 +163,5 @@ class VitalSignsViewModel extends BaseViewModel { } else if (temperatureCelciusMethod == 5) { return "Temporal"; } - return ""; } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 2eb9772f..1d5f087a 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -83,7 +83,7 @@ class PatientViewModel extends BaseViewModel { isView: isView); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -95,7 +95,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResultOrders(patient); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -105,7 +105,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getOutPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -115,7 +115,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getInPatientPrescriptions(patient); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -125,7 +125,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPrescriptionReport(patient); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -135,7 +135,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientRadiology(patient); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -145,7 +145,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getLabResult(labOrdersResModel); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -155,7 +155,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getPatientInsuranceApprovals(patient); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -170,7 +170,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getPatientProgressNote(patient); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { @@ -184,7 +184,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.updatePatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -194,7 +194,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.createPatientProgressNote(req); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -204,7 +204,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getClinicsList(); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else { { @@ -218,7 +218,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _patientService.getDoctorsList(clinicId); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.ErrorLocal); } else { { @@ -246,7 +246,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getReferralFrequancyList(); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -260,17 +260,17 @@ class PatientViewModel extends BaseViewModel { } Future referToDoctor( - {required String selectedDoctorID, - required String selectedClinicID, - required int admissionNo, - required String extension, - required String priority, - required String frequency, - required String referringDoctorRemarks, - required int patientID, - required int patientTypeID, - required String roomID, - required int projectID}) async { + {String selectedDoctorID, + String selectedClinicID, + int admissionNo, + String extension, + String priority, + String frequency, + String referringDoctorRemarks, + int patientID, + int patientTypeID, + String roomID, + int projectID}) async { setState(ViewState.BusyLocal); await _patientService.referToDoctor( selectedClinicID: selectedClinicID, @@ -285,7 +285,7 @@ class PatientViewModel extends BaseViewModel { roomID: roomID, projectID: projectID); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -295,7 +295,7 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Busy); await _patientService.getArrivedList(); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -308,7 +308,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getInPatient(requestModel, false); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.ErrorLocal); } else { // setDefaultInPatientList(); @@ -323,7 +323,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getNursingProgressNote(requestModel); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -337,7 +337,7 @@ class PatientViewModel extends BaseViewModel { await _patientService.getDiagnosisForInPatient(requestModel); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -355,14 +355,14 @@ class PatientViewModel extends BaseViewModel { GetDiabeticChartValuesRequestModel requestModel = GetDiabeticChartValuesRequestModel( patientID: patient.patientId, - admissionNo: int.parse(patient!.admissionNo!), + admissionNo: int.parse(patient.admissionNo), patientTypeID: 1, patientType: 1, resultType: resultType, setupID: "010266"); await _patientService.getDiabeticChartValues(requestModel); if (_patientService.hasError) { - error = _patientService.error!; + error = _patientService.error; if (isLocalBusy) setState(ViewState.ErrorLocal); else diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index e89345ee..3f3e92be 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -15,26 +15,26 @@ class PendingOrdersViewModel extends BaseViewModel { List get admissionOrderList => _pendingOrderService.admissionOrderList; - Future getPendingOrders({required int patientId, required int admissionNo}) async { + Future getPendingOrders({int patientId, int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getPendingOrders( patientId: patientId, admissionNo: admissionNo); if (_pendingOrderService.hasError) { - error = _pendingOrderService.error!; + error = _pendingOrderService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - Future getAdmissionOrders({required int patientId, required int admissionNo}) async { + Future getAdmissionOrders({int patientId, int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getAdmissionOrders( patientId: patientId, admissionNo: admissionNo); if (_pendingOrderService.hasError) { - error = _pendingOrderService.error!; + error = _pendingOrderService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 53b95099..96645618 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -38,8 +38,8 @@ class PrescriptionViewModel extends BaseViewModel { List get itemMedicineList => _prescriptionService.itemMedicineList; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = []; - List _prescriptionsOrderListHospital = []; + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); List get prescriptionReportList => _prescriptionsService.prescriptionReportList; @@ -68,25 +68,25 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getItem({int? itemID}) async { + Future getItem({int itemID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getPrescription({int? mrn}) async { + Future getPrescription({int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -98,7 +98,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.postPrescription(postProcedureReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -106,11 +106,11 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getMedicationList({String? drug}) async { + Future getMedicationList({String drug}) async { setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug!); + await _prescriptionService.getMedicationList(drug: drug); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -122,7 +122,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.updatePrescription(updatePrescriptionReqModel); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else { await getPrescription(mrn: mrn); @@ -130,13 +130,13 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getDrugs({String? drugName}) async { + Future getDrugs({String drugName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getDrugs(drugName: drugName); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -148,7 +148,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionService.getDrugToDrug(vital, lstAssessments, allergy, patient, prescription); if (_prescriptionService.hasError) { - error = _prescriptionService.error!; + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -159,22 +159,22 @@ class PrescriptionViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { + getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { + getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -214,11 +214,11 @@ class PrescriptionViewModel extends BaseViewModel { }); } - getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -228,18 +228,18 @@ class PrescriptionViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getPrescriptions(PatiantInformtion patient, {String? patientType}) async { + getPrescriptions(PatiantInformtion patient, {String patientType}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -256,7 +256,7 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Busy); await _prescriptionsService.getMedicationForInPatient(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index b1a23a14..2548a59c 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -17,8 +17,8 @@ class PrescriptionsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; PrescriptionsService _prescriptionsService = locator(); - List _prescriptionsOrderListClinic = []; - List _prescriptionsOrderListHospital = []; + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); List get prescriptionReportList => _prescriptionsService.prescriptionReportList; @@ -32,13 +32,13 @@ class PrescriptionsViewModel extends BaseViewModel { List get medicationForInPatient => _prescriptionsService.medicationForInPatient; - List _medicationForInPatient = []; + List _medicationForInPatient = List(); getPrescriptions(PatiantInformtion patient) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.Error); } else { _filterList(); @@ -51,7 +51,7 @@ class PrescriptionsViewModel extends BaseViewModel { _getPrescriptionsOrders() async { await _prescriptionsService.getPrescriptionsOrders(); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -96,33 +96,33 @@ class PrescriptionsViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport({Prescriptions? prescriptions, @required PatiantInformtion? patient}) async { + getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { + getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { + getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -132,7 +132,7 @@ class PrescriptionsViewModel extends BaseViewModel { getMedicationForInPatient(PatiantInformtion patient) async { await _prescriptionsService.getMedicationForInPatient(patient); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error!; + error = _prescriptionsService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 4de6bbe3..b576b7a4 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -40,8 +40,8 @@ class ProcedureViewModel extends BaseViewModel { List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); LabsService _labsService = locator(); - List _finalRadiologyListClinic = []; - List _finalRadiologyListHospital = []; + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; @@ -53,22 +53,22 @@ class ProcedureViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get procedureTemplate => _procedureService.templateList; - List templateList = []; + List templateList = List(); List get procedureTemplateDetails => _procedureService.templateDetailsList; - List _patientLabOrdersListClinic = []; - List _patientLabOrdersListHospital = []; + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); - Future getProcedure({int? mrn, String? patientType, int? appointmentNo}) async { + Future getProcedure({int mrn, String patientType, int appointmentNo}) async { hasError = false; await getDoctorProfile(); //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo!); + await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -77,14 +77,14 @@ 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); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -96,18 +96,18 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.getCategory(); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getProcedureTemplate({String? categoryID}) async { + Future getProcedureTemplate({String categoryID}) async { hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else { setTemplateListDependOnId(); @@ -133,14 +133,14 @@ class ProcedureViewModel extends BaseViewModel { int tempId = 0; - Future getProcedureTemplateDetails({int? templateId}) async { - tempId = templateId!; + Future getProcedureTemplateDetails({int templateId}) async { + tempId = templateId; hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _procedureService.getProcedureTemplateDetails(templateId: templateId); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -152,10 +152,10 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.postProcedure(postProcedureReqModel); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else { - await getProcedure(mrn: mrn, appointmentNo: null); + await getProcedure(mrn: mrn); setState(ViewState.Idle); } } @@ -166,31 +166,31 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _procedureService.valadteProcedure(procedureValadteRequestModel); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - Future updateProcedure({UpdateProcedureRequestModel? updateProcedureRequestModel, int? mrn}) async { + Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.updateProcedure(updateProcedureRequestModel!); + await _procedureService.updateProcedure(updateProcedureRequestModel); if (_procedureService.hasError) { - error = _procedureService.error!; + error = _procedureService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error!; + error = _radiologyService.error; if (patientType == "7") setState(ViewState.ErrorLocal); else @@ -232,12 +232,12 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error!; + error = _radiologyService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -252,7 +252,7 @@ class ProcedureViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = []; + List labResultLists = List(); List get labResultListsCoustom { return labResultLists; @@ -262,7 +262,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient, isInpatient); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); @@ -270,30 +270,30 @@ class ProcedureViewModel extends BaseViewModel { } getLaboratoryResult( - {String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient}) async { + {String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; setState(ViewState.Error); } else { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) + if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true; }); } @@ -302,35 +302,35 @@ class ProcedureViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { - error = _labsService.error!; + error = _labsService.error; } else DrAppToastMsg.showSuccesToast(mes); } Future preparePostProcedure( - {String? remarks, - String? orderType, - PatiantInformtion? patient, - List? entityList, - ProcedureType? procedureType}) async { + {String remarks, + String orderType, + PatiantInformtion patient, + List entityList, + ProcedureType procedureType}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); - procedureValadteRequestModel.patientMRN = patient!.patientMRN; + procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = []; + List controlsProcedure = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - entityList!.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId!]; - List controls = []; + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); controls.add( Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); @@ -344,8 +344,8 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.procedures = controlsProcedure; await valadteProcedure(procedureValadteRequestModel); if (state == ViewState.Idle) { - if (valadteProcedureList[0].entityList!.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN!); + if (valadteProcedureList[0].entityList.length == 0) { + await postProcedure(postProcedureReqModel, patient.patientMRN); if (state == ViewState.ErrorLocal) { Helpers.showErrorToast(error); @@ -358,7 +358,7 @@ class ProcedureViewModel extends BaseViewModel { Helpers.showErrorToast(error); getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { - Helpers.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages); + Helpers.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); } } } else { diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index 250f7cb7..9db5a6dd 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -14,44 +14,37 @@ class DischargeSummaryViewModel extends BaseViewModel { List get pendingDischargeSummaryList => _dischargeSummaryService.pendingDischargeSummaryList; + List get allDisChargeSummaryList => _dischargeSummaryService.allDischargeSummaryList; - Future getPendingDischargeSummary({ - required int patientId, - required int admissionNo, - }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = - GetDischargeSummaryReqModel( - admissionNo: admissionNo, patientID: patientId); + + Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getPendingDischargeSummary( - getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { - error = _dischargeSummaryService.error!; + error = _dischargeSummaryService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - Future getAllDischargeSummary({ - int? patientId, - int? admissionNo, - }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = - GetDischargeSummaryReqModel( - admissionNo: admissionNo!, patientID: patientId!); + + + Future getAllDischargeSummary({int patientId, int admissionNo, }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getAllDischargeSummary( - getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { - error = _dischargeSummaryService.error!; + error = _dischargeSummaryService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } + } diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart index 1d37bc16..e3f4f430 100644 --- a/lib/core/viewModel/profile/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -23,7 +23,7 @@ class OperationReportViewModel extends BaseViewModel { setState(ViewState.Busy); await _operationReportService.getReservations(patientId: patientId); if (_operationReportService.hasError) { - error = _operationReportService.error!; + error = _operationReportService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -36,7 +36,7 @@ class OperationReportViewModel extends BaseViewModel { GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" ); await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel); if (_operationReportService.hasError) { - error = _operationReportService.error!; + error = _operationReportService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); @@ -51,7 +51,7 @@ class OperationReportViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _operationReportService.updateOperationReport(createUpdateOperationReport); if (_operationReportService.hasError) { - error = _operationReportService.error!; + error = _operationReportService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 087f5019..e7b7a80f 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -17,8 +17,8 @@ Helpers helpers = Helpers(); class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); - late Locale _appLocale = Locale(currentLanguage); - String currentLanguage = 'en'; + Locale _appLocale; + String currentLanguage = 'ar'; bool _isArabic = false; bool isInternetConnection = true; List doctorClinicsList = []; @@ -30,11 +30,13 @@ class ProjectViewModel with ChangeNotifier { Locale get appLocal => _appLocale; bool get isArabic => _isArabic; - late StreamSubscription subscription; + StreamSubscription subscription; ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { + subscription = Connectivity() + .onConnectivityChanged + .listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -52,7 +54,7 @@ class ProjectViewModel with ChangeNotifier { void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); - _appLocale = Locale(currentLanguage); + _appLocale = Locale(currentLanguage ?? 'en'); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true @@ -92,7 +94,8 @@ class ProjectViewModel with ChangeNotifier { try { dynamic localRes; - await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, + onSuccess: (dynamic response, int statusCode) { doctorClinicsList = []; response['List_DoctorsClinic'].forEach((v) { doctorClinicsList.add(new ClinicModel.fromJson(v)); @@ -112,11 +115,7 @@ class ProjectViewModel with ChangeNotifier { void getProfile() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ClinicModel clinicModel = ClinicModel( - doctorID: doctorProfile.doctorID, - clinicID: doctorProfile.clinicID, - projectID: doctorProfile.projectID, - ); + ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,); await Provider.of(AppGlobal.CONTEX, listen: false) .getDoctorProfileBasedOnClinic(clinicModel); diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 8fbbfc7c..d656de6c 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -12,46 +12,57 @@ class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; RadiologyService _radiologyService = locator(); - List _finalRadiologyListClinic = []; - List _finalRadiologyListHospital = []; + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); List get finalRadiologyList => - filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, + {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, + isInPatient: isInPatient); if (_radiologyService.hasError) { - error = _radiologyService.error!; + error = _radiologyService.error; setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = _finalRadiologyListClinic - .where((elementClinic) => elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + _finalRadiologyListClinic[ + finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListClinic - .add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic.add(FinalRadiologyList( + filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = _finalRadiologyListHospital - .where( - (elementClinic) => elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])] + _finalRadiologyListHospital[finalRadiologyListHospital + .indexOf(finalRadiologyListHospital[0])] .finalRadiologyList .add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList( + filterName: element.projectName, finalRadiology: element)); } }); @@ -61,12 +72,19 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, @required PatiantInformtion? patient}) async { + getRadImageURL( + {int invoiceNo, + int lineItem, + int projectId, + @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); + invoiceNo: invoiceNo, + lineItem: lineItem, + projectId: projectId, + patient: patient); if (_radiologyService.hasError) { - error = _radiologyService.error!; + error = _radiologyService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index c8993da0..892284e2 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -6,25 +6,28 @@ import '../../locator.dart'; import 'base_view_model.dart'; class ReferralPatientViewModel extends BaseViewModel { - ReferralPatientService _referralPatientService = locator(); + ReferralPatientService _referralPatientService = + locator(); - List get listMyReferralPatientModel => _referralPatientService.listMyReferralPatientModel; + List get listMyReferralPatientModel => + _referralPatientService.listMyReferralPatientModel; Future getMyReferralPatient() async { setState(ViewState.Busy); await _referralPatientService.getMyReferralPatient(); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { + Future replay( + String referredDoctorRemarks, MyReferralPatientModel model) async { setState(ViewState.BusyLocal); await _referralPatientService.replay(referredDoctorRemarks, model); if (_referralPatientService.hasError) { - error = _referralPatientService.error!; + error = _referralPatientService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index 02f98ef7..b49078c7 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -15,7 +15,7 @@ class ScanQrViewModel extends BaseViewModel { await _scanQrService.getInPatient(requestModel, isMyInpatient); if (_scanQrService.hasError) { - error = _scanQrService.error!; + error = _scanQrService.error; setState(ViewState.ErrorLocal); } else { diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 681d7321..3ee64c9b 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -8,13 +8,14 @@ import 'base_view_model.dart'; class ScheduleViewModel extends BaseViewModel { ScheduleService _scheduleService = locator(); - List get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => + _scheduleService.listDoctorWorkingHoursTable; Future getDoctorSchedule() async { setState(ViewState.Busy); await _scheduleService.getDoctorSchedule(); if (_scheduleService.hasError) { - error = _scheduleService.error!; + error = _scheduleService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 181f5c94..7a7f4575 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -34,11 +34,12 @@ class SickLeaveViewModel extends BaseViewModel { ..._sickLeaveService.getAllSickLeavePatient, ..._sickLeaveService.getAllSickLeaveDoctor ]; + Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.BusyLocal); await _sickLeaveService.addSickLeave(addSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -48,7 +49,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await _sickLeaveService.extendSickLeave(extendSickLeaveRequest); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -58,7 +59,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getStatistics(appoNo, patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -68,7 +69,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeave(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -81,7 +82,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeavePatient(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.ErrorLocal); } else @@ -98,7 +99,7 @@ class SickLeaveViewModel extends BaseViewModel { final results = await Future.wait(services); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; // if (isLocalBusy) setState(ViewState.ErrorLocal); // else @@ -112,7 +113,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getSickLeaveDoctor(patientMRN); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -122,7 +123,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getRescheduleLeave(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -132,7 +133,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getOffTime(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -142,7 +143,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.getReasonsByID(id: id); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -152,8 +153,8 @@ class SickLeaveViewModel extends BaseViewModel { //setState(ViewState.Busy); await _sickLeaveService.getCoveringDoctors(); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; -// setState(ViewState.Error); + error = _sickLeaveService.error; + // setState(ViewState.Error); } //else // setState(ViewState.Idle); @@ -164,7 +165,7 @@ class SickLeaveViewModel extends BaseViewModel { await _sickLeaveService.addReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.Error); } else setState(ViewState.Idle); @@ -174,7 +175,7 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Busy); await _sickLeaveService.updateReschedule(request); if (_sickLeaveService.hasError) { - error = _sickLeaveService.error!; + error = _sickLeaveService.error; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 2c375a7a..a73be2e3 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// * MFG Labs, Copyright (C) 2012 by Daniel Bruce /// Author: MFG Labs /// License: SIL (http://scripts.sil.org/OFL) @@ -23,8 +23,8 @@ import 'package:flutter/widgets.dart'; class DoctorApp { DoctorApp._(); - static const _kFontFam = 'DoctorApp'; - static const String? _kFontPkg = null; + static const _kFontFam = 'DoctorApp'; + static const String _kFontPkg = null; static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); @@ -192,7 +192,6 @@ class DoctorApp { static const IconData verify_finger = IconData(0xe8a4, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_whtsapp = IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_sms = IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); - /// static const IconData 124 = IconData(0xe8a7, fontFamily: _kFontFam, fontPackage: _kFontPkg); ///static const IconData 123 = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData obese_bmi_r_1 = IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 1f168dab..72b5c857 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -6,6 +6,7 @@ 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'; import 'package:flutter/material.dart'; @@ -16,7 +17,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State { int currentTab = 0; - late PageController pageController; + PageController pageController; _changeCurrentTab(int tab) { setState(() { @@ -39,11 +40,14 @@ class _LandingPageState extends State { elevation: 0, backgroundColor: Colors.grey[100], //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: currentTab != 0 ? Text(getText(currentTab).toUpperCase()) : SizedBox(), + title: currentTab != 0 + ? Text(getText(currentTab).toUpperCase()) + : SizedBox(), leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Image.asset('assets/images/menu.png', height: 50, width: 50), + icon: Image.asset('assets/images/menu.png', + height: 50, width: 50), iconSize: 15, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), @@ -94,7 +98,7 @@ class MyAppbar extends StatelessWidget with PreferredSizeWidget { @override final Size preferredSize; - MyAppbar({Key? key}) + MyAppbar({Key key}) : preferredSize = Size.fromHeight(0.0), super(key: key); @override diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/models/SOAP/Allergy_model.dart index 3e0e9cbc..c3493832 100644 --- a/lib/models/SOAP/Allergy_model.dart +++ b/lib/models/SOAP/Allergy_model.dart @@ -1,32 +1,32 @@ class AllergyModel { - int? allergyDiseaseId; - String? allergyDiseaseName; - int? allergyDiseaseType; - int? appointmentNo; - int? createdBy; - String? createdByName; - String? createdOn; - int? episodeID; - bool? isChecked; - bool? isUpdatedByNurse; - int? severity; - String? severityName; + int allergyDiseaseId; + String allergyDiseaseName; + int allergyDiseaseType; + int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + int episodeID; + bool isChecked; + bool isUpdatedByNurse; + int severity; + String severityName; AllergyModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName}); - AllergyModel.fromJson(Map json) { + AllergyModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; allergyDiseaseName = json['allergyDiseaseName']; allergyDiseaseType = json['allergyDiseaseType']; @@ -41,8 +41,8 @@ class AllergyModel { severityName = json['severityName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['allergyDiseaseId'] = this.allergyDiseaseId; data['allergyDiseaseName'] = this.allergyDiseaseName; data['allergyDiseaseType'] = this.allergyDiseaseType; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 25c38d8f..f04fd8d4 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -1,12 +1,13 @@ class GetChiefComplaintReqModel { - int? patientMRN; - int? appointmentNo; - int? episodeId; - int? episodeID; + int patientMRN; + int appointmentNo; + int episodeId; + int episodeID; dynamic doctorID; - int? admissionNo; + int admissionNo; - GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); + GetChiefComplaintReqModel( + {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -14,7 +15,7 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; - admissionNo = json['admissionNo']; + admissionNo = json['admissionNo']; } Map toJson() { diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart index f8a48ed0..85ada324 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -1,32 +1,32 @@ class GetChiefComplaintResModel { - int? appointmentNo; - String? ccdate; - String? chiefComplaint; - String? clinicDescription; - int? clinicID; - String? currentMedication; - int? doctorID; - String? doctorName; - int? episodeId; - String? hopi; - int? patientMRN; - int? status; + int appointmentNo; + String ccdate; + String chiefComplaint; + String clinicDescription; + int clinicID; + String currentMedication; + int doctorID; + String doctorName; + int episodeId; + String hopi; + int patientMRN; + int status; GetChiefComplaintResModel( {this.appointmentNo, - this.ccdate, - this.chiefComplaint, - this.clinicDescription, - this.clinicID, - this.currentMedication, - this.doctorID, - this.doctorName, - this.episodeId, - this.hopi, - this.patientMRN, - this.status}); + this.ccdate, + this.chiefComplaint, + this.clinicDescription, + this.clinicID, + this.currentMedication, + this.doctorID, + this.doctorName, + this.episodeId, + this.hopi, + this.patientMRN, + this.status}); - GetChiefComplaintResModel.fromJson(Map json) { + GetChiefComplaintResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; ccdate = json['ccdate']; chiefComplaint = json['chiefComplaint']; @@ -41,8 +41,8 @@ class GetChiefComplaintResModel { status = json['status']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; data['ccdate'] = this.ccdate; data['chiefComplaint'] = this.chiefComplaint; diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 65ba7d6b..70e76313 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -1,7 +1,7 @@ class GeneralGetReqForSOAP { - int? patientMRN; - int? appointmentNo; - int? episodeId; + int patientMRN; + int appointmentNo; + int episodeId; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart index 745b169a..1eeca63e 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -1,32 +1,31 @@ class GetAllergiesResModel { - int? allergyDiseaseId; - String? allergyDiseaseName; - int? allergyDiseaseType; - int? appointmentNo; - int? createdBy; - String? createdByName; - String? createdOn; - int? episodeID; - bool? isChecked; - bool? isUpdatedByNurse; - int? severity; - String? severityName; - String? remarks; + int allergyDiseaseId; + String allergyDiseaseName; + int allergyDiseaseType; + int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + int episodeID; + bool isChecked; + bool isUpdatedByNurse; + int severity; + String severityName; + String remarks; GetAllergiesResModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName, - this.remarks = ''}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName, this.remarks=''}); GetAllergiesResModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index fffe4f92..965382b5 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -1,22 +1,22 @@ class GetAssessmentReqModel { - int? patientMRN; - int? appointmentNo; - String? episodeID; - String? from; - String? to; - int? clinicID; + int patientMRN; + int appointmentNo; + String episodeID; + String from; + String to; + int clinicID; dynamic doctorID; dynamic editedBy; GetAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/models/SOAP/GetAssessmentResModel.dart index fb92f994..4d1b1b68 100644 --- a/lib/models/SOAP/GetAssessmentResModel.dart +++ b/lib/models/SOAP/GetAssessmentResModel.dart @@ -1,36 +1,36 @@ class GetAssessmentResModel { - int? appointmentNo; - String? asciiDesc; - String? clinicDescription; - int? clinicID; - bool? complexDiagnosis; - int? conditionID; - int? createdBy; - String? createdOn; - int? diagnosisTypeID; - int? doctorID; - String? doctorName; - int? episodeId; - String? icdCode10ID; - int? patientMRN; - String? remarks; + int appointmentNo; + String asciiDesc; + String clinicDescription; + int clinicID; + bool complexDiagnosis; + int conditionID; + int createdBy; + String createdOn; + int diagnosisTypeID; + int doctorID; + String doctorName; + int episodeId; + String icdCode10ID; + int patientMRN; + String remarks; GetAssessmentResModel( {this.appointmentNo, - this.asciiDesc, - this.clinicDescription, - this.clinicID, - this.complexDiagnosis, - this.conditionID, - this.createdBy, - this.createdOn, - this.diagnosisTypeID, - this.doctorID, - this.doctorName, - this.episodeId, - this.icdCode10ID, - this.patientMRN, - this.remarks}); + this.asciiDesc, + this.clinicDescription, + this.clinicID, + this.complexDiagnosis, + this.conditionID, + this.createdBy, + this.createdOn, + this.diagnosisTypeID, + this.doctorID, + this.doctorName, + this.episodeId, + this.icdCode10ID, + this.patientMRN, + this.remarks}); GetAssessmentResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 0a36bb94..1da4a8bf 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -1,22 +1,22 @@ class GetGetProgressNoteReqModel { - int? patientMRN; - int? appointmentNo; - String? episodeID; - String? from; - String? to; - int? clinicID; + int patientMRN; + int appointmentNo; + String episodeID; + String from; + String to; + int clinicID; dynamic doctorID; dynamic editedBy; GetGetProgressNoteReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetGetProgressNoteReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -27,6 +27,7 @@ class GetGetProgressNoteReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; + } Map toJson() { diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index e5923ac8..4ae7ed8c 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,28 +1,28 @@ -class GetPatientProgressNoteResModel { - int? appointmentNo; - int? createdBy; - String? createdByName; - String? createdOn; - String? dName; - String? editedByName; - String? editedOn; - int? episodeId; - String? mName; - int? patientMRN; - String? planNote; +class GetPatientProgressNoteResModel { + int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + String dName; + String editedByName; + String editedOn; + int episodeId; + String mName; + int patientMRN; + String planNote; GetPatientProgressNoteResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.dName, - this.editedByName, - this.editedOn, - this.episodeId, - this.mName, - this.patientMRN, - this.planNote}); + this.createdBy, + this.createdByName, + this.createdOn, + this.dName, + this.editedByName, + this.editedOn, + this.episodeId, + this.mName, + this.patientMRN, + this.planNote}); GetPatientProgressNoteResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index b4a5f404..720b6342 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -1,11 +1,11 @@ class GetHistoryReqModel { - int? patientMRN; - int? historyType; - String? episodeID; - String? from; - String? to; - int? clinicID; - int? appointmentNo; + int patientMRN; + int historyType; + String episodeID; + String from; + String to; + int clinicID; + int appointmentNo; dynamic editedBy; dynamic doctorID; @@ -30,6 +30,7 @@ class GetHistoryReqModel { doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; editedBy = json['EditedBy']; + } Map toJson() { diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/models/SOAP/GetHistoryResModel.dart index 9773aea8..c4b4f129 100644 --- a/lib/models/SOAP/GetHistoryResModel.dart +++ b/lib/models/SOAP/GetHistoryResModel.dart @@ -1,20 +1,20 @@ class GetHistoryResModel { - int? appointmentNo; - int? episodeId; - int? historyId; - int? historyType; - bool? isChecked; - int? patientMRN; - String? remarks; + int appointmentNo; + int episodeId; + int historyId; + int historyType; + bool isChecked; + int patientMRN; + String remarks; GetHistoryResModel( {this.appointmentNo, - this.episodeId, - this.historyId, - this.historyType, - this.isChecked, - this.patientMRN, - this.remarks}); + this.episodeId, + this.historyId, + this.historyType, + this.isChecked, + this.patientMRN, + this.remarks}); GetHistoryResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index 952e3a5c..c97189b1 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,44 +1,44 @@ class GetPhysicalExamResModel { - int? appointmentNo; - int? createdBy; - String? createdByName; - String? createdOn; - dynamic editedBy; - String? editedByName; - String? editedOn; - int? episodeId; - int? examId; - String? examName; - int? examType; - int? examinationType; - String? examinationTypeName; - bool? isAbnormal; - bool? isNew; - bool? isNormal; - bool? notExamined; - int? patientMRN; - String? remarks; + int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + Null editedBy; + String editedByName; + String editedOn; + int episodeId; + int examId; + String examName; + int examType; + int examinationType; + String examinationTypeName; + bool isAbnormal; + bool isNew; + bool isNormal; + bool notExamined; + int patientMRN; + String remarks; GetPhysicalExamResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedOn, - this.episodeId, - this.examId, - this.examName, - this.examType, - this.examinationType, - this.examinationTypeName, - this.isAbnormal, - this.isNew, - this.isNormal, - this.notExamined, - this.patientMRN, - this.remarks}); + this.createdBy, + this.createdByName, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedOn, + this.episodeId, + this.examId, + this.examName, + this.examType, + this.examinationType, + this.examinationTypeName, + this.isAbnormal, + this.isNew, + this.isNormal, + this.notExamined, + this.patientMRN, + this.remarks}); GetPhysicalExamResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index ea2d8f97..710dafd1 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,10 +1,10 @@ class GetPhysicalExamReqModel { - int? patientMRN; - int? appointmentNo; - int? admissionNo; - String? episodeID; - String? from; - String? to; + int patientMRN; + int appointmentNo; + int admissionNo; + String episodeID; + String from; + String to; dynamic editedBy; dynamic doctorID; diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/models/SOAP/PatchAssessmentReqModel.dart index c52a6a51..8cbf5cb7 100644 --- a/lib/models/SOAP/PatchAssessmentReqModel.dart +++ b/lib/models/SOAP/PatchAssessmentReqModel.dart @@ -1,24 +1,24 @@ class PatchAssessmentReqModel { - int? patientMRN; - int? appointmentNo; - int? episodeID; - String? icdcode10Id; - String? prevIcdCode10ID; - int? conditionId; - int? diagnosisTypeId; - bool? complexDiagnosis; - String? remarks; + int patientMRN; + int appointmentNo; + int episodeID; + String icdcode10Id; + String prevIcdCode10ID; + int conditionId; + int diagnosisTypeId; + bool complexDiagnosis; + String remarks; PatchAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.icdcode10Id, - this.prevIcdCode10ID, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + this.appointmentNo, + this.episodeID, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); PatchAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart index 75402036..6d3ee45a 100644 --- a/lib/models/SOAP/PostEpisodeReqModel.dart +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -1,10 +1,14 @@ class PostEpisodeReqModel { - int? appointmentNo; - int? patientMRN; - int? doctorID; - String? vidaAuthTokenID; + int appointmentNo; + int patientMRN; + int doctorID; + String vidaAuthTokenID; - PostEpisodeReqModel({this.appointmentNo, this.patientMRN, this.doctorID, this.vidaAuthTokenID}); + PostEpisodeReqModel( + {this.appointmentNo, + this.patientMRN, + this.doctorID, + this.vidaAuthTokenID}); PostEpisodeReqModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/models/SOAP/get_Allergies_request_model.dart index 25177e3e..7676d530 100644 --- a/lib/models/SOAP/get_Allergies_request_model.dart +++ b/lib/models/SOAP/get_Allergies_request_model.dart @@ -1,11 +1,16 @@ class GetAllergiesRequestModel { - String? vidaAuthTokenID; - int? patientMRN; - int? appointmentNo; - int? episodeId; - String? doctorID; + String vidaAuthTokenID; + int patientMRN; + int appointmentNo; + int episodeId; + String doctorID; - GetAllergiesRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); + GetAllergiesRequestModel( + {this.vidaAuthTokenID, + this.patientMRN, + this.appointmentNo, + this.episodeId, + this.doctorID}); GetAllergiesRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart index 4d5efc98..2b49066e 100644 --- a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart +++ b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart @@ -1,7 +1,7 @@ class GetEpisodeForInpatientReqModel { - int? patientID; - int? patientTypeID; - int? admissionNo; + int patientID; + int patientTypeID; + int admissionNo; GetEpisodeForInpatientReqModel( {this.patientID, this.patientTypeID, this.admissionNo}); diff --git a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart index b9ea104e..2dff7a60 100644 --- a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart +++ b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart @@ -1,7 +1,7 @@ class PostEpisodeForInpatientRequestModel { - int? admissionNo; - int? patientID; - int? patientTypeID; + int admissionNo; + int patientID; + int patientTypeID; PostEpisodeForInpatientRequestModel( {this.admissionNo, this.patientID, this.patientTypeID = 1}); diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart index 0f1a4c5a..a1c32039 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/models/SOAP/master_key_model.dart @@ -1,6 +1,6 @@ class MasterKeyModel { - String? alias; - String? aliasN; + String alias; + String aliasN; dynamic code; dynamic description; dynamic detail1; @@ -8,31 +8,31 @@ class MasterKeyModel { dynamic detail3; dynamic detail4; dynamic detail5; - int? groupID; - int? id; - String? nameAr; - String? nameEn; + int groupID; + int id; + String nameAr; + String nameEn; dynamic remarks; - int? typeId; - String? valueList; + int typeId; + String valueList; MasterKeyModel( {this.alias, - this.aliasN, - this.code, - this.description, - this.detail1, - this.detail2, - this.detail3, - this.detail4, - this.detail5, - this.groupID, - this.id, - this.nameAr, - this.nameEn, - this.remarks, - this.typeId, - this.valueList}); + this.aliasN, + this.code, + this.description, + this.detail1, + this.detail2, + this.detail3, + this.detail4, + this.detail5, + this.groupID, + this.id, + this.nameAr, + this.nameEn, + this.remarks, + this.typeId, + this.valueList}); MasterKeyModel.fromJson(Map json) { alias = json['alias']; diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart index 24865e44..4e134a07 100644 --- a/lib/models/SOAP/order-procedure.dart +++ b/lib/models/SOAP/order-procedure.dart @@ -1,54 +1,55 @@ class OrderProcedure { - String? achiCode; - String? appointmentDate; - int? appointmentNo; - int? categoryID; - String? clinicDescription; - String? cptCode; - int? createdBy; - String? createdOn; - String? doctorName; - bool? isApprovalCreated; - bool? isApprovalRequired; - bool? isCovered; - bool? isInvoiced; - bool? isReferralInvoiced; - bool? isUncoveredByDoctor; - int? lineItemNo; - String? orderDate; - int? orderNo; - int? orderType; - String? procedureId; - String? procedureName; - String? remarks; - String? status; - String? template; + + String achiCode; + String appointmentDate; + int appointmentNo; + int categoryID; + String clinicDescription; + String cptCode; + int createdBy; + String createdOn; + String doctorName; + bool isApprovalCreated; + bool isApprovalRequired; + bool isCovered; + bool isInvoiced; + bool isReferralInvoiced; + bool isUncoveredByDoctor; + int lineItemNo; + String orderDate; + int orderNo; + int orderType; + String procedureId; + String procedureName; + String remarks; + String status; + String template; OrderProcedure( {this.achiCode, - this.appointmentDate, - this.appointmentNo, - this.categoryID, - this.clinicDescription, - this.cptCode, - this.createdBy, - this.createdOn, - this.doctorName, - this.isApprovalCreated, - this.isApprovalRequired, - this.isCovered, - this.isInvoiced, - this.isReferralInvoiced, - this.isUncoveredByDoctor, - this.lineItemNo, - this.orderDate, - this.orderNo, - this.orderType, - this.procedureId, - this.procedureName, - this.remarks, - this.status, - this.template}); + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template}); OrderProcedure.fromJson(Map json) { achiCode = json['achiCode']; @@ -105,4 +106,5 @@ class OrderProcedure { data['template'] = this.template; return data; } -} + +} \ No newline at end of file diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/models/SOAP/post_allergy_request_model.dart index 9488a965..6783d885 100644 --- a/lib/models/SOAP/post_allergy_request_model.dart +++ b/lib/models/SOAP/post_allergy_request_model.dart @@ -1,13 +1,16 @@ class PostAllergyRequestModel { - List? listHisProgNotePatientAllergyDiseaseVM; + List + listHisProgNotePatientAllergyDiseaseVM; PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); PostAllergyRequestModel.fromJson(Map json) { if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { - listHisProgNotePatientAllergyDiseaseVM = []; + listHisProgNotePatientAllergyDiseaseVM = + new List(); json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { - listHisProgNotePatientAllergyDiseaseVM!.add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); + listHisProgNotePatientAllergyDiseaseVM + .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); }); } } @@ -15,42 +18,44 @@ class PostAllergyRequestModel { Map toJson() { final Map data = new Map(); if (this.listHisProgNotePatientAllergyDiseaseVM != null) { - data['listHisProgNotePatientAllergyDiseaseVM'] = - this.listHisProgNotePatientAllergyDiseaseVM!.map((v) => v.toJson()).toList(); + data['listHisProgNotePatientAllergyDiseaseVM'] = this + .listHisProgNotePatientAllergyDiseaseVM + .map((v) => v.toJson()) + .toList(); } return data; } } class ListHisProgNotePatientAllergyDiseaseVM { - int? patientMRN; - int? allergyDiseaseType; - int? allergyDiseaseId; - int? episodeId; - int? appointmentNo; - int? severity; - bool? isChecked; - bool? isUpdatedByNurse; - String? remarks; - int? createdBy; - String? createdOn; - int? editedBy; - String? editedOn; + int patientMRN; + int allergyDiseaseType; + int allergyDiseaseId; + int episodeId; + int appointmentNo; + int severity; + bool isChecked; + bool isUpdatedByNurse; + String remarks; + int createdBy; + String createdOn; + int editedBy; + String editedOn; ListHisProgNotePatientAllergyDiseaseVM( {this.patientMRN, - this.allergyDiseaseType, - this.allergyDiseaseId, - this.episodeId, - this.appointmentNo, - this.severity, - this.isChecked, - this.isUpdatedByNurse, - this.remarks, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn}); + this.allergyDiseaseType, + this.allergyDiseaseId, + this.episodeId, + this.appointmentNo, + this.severity, + this.isChecked, + this.isUpdatedByNurse, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); ListHisProgNotePatientAllergyDiseaseVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart index 3222f248..af577671 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -1,19 +1,23 @@ class PostAssessmentRequestModel { - int? patientMRN; - int? appointmentNo; - int? episodeId; - List? icdCodeDetails; + int patientMRN; + int appointmentNo; + int episodeId; + List icdCodeDetails; - PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.icdCodeDetails}); + PostAssessmentRequestModel( + {this.patientMRN, + this.appointmentNo, + this.episodeId, + this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; if (json['icdCodeDetails'] != null) { - icdCodeDetails = []; + icdCodeDetails = new List(); json['icdCodeDetails'].forEach((v) { - icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -24,20 +28,26 @@ class PostAssessmentRequestModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeId; if (this.icdCodeDetails != null) { - data['icdCodeDetails'] = this.icdCodeDetails!.map((v) => v.toJson()).toList(); + data['icdCodeDetails'] = + this.icdCodeDetails.map((v) => v.toJson()).toList(); } return data; } } class IcdCodeDetails { - String? icdcode10Id; - int? conditionId; - int? diagnosisTypeId; - bool? complexDiagnosis; - String? remarks; + String icdcode10Id; + int conditionId; + int diagnosisTypeId; + bool complexDiagnosis; + String remarks; - IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks}); + IcdCodeDetails( + {this.icdcode10Id, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); IcdCodeDetails.fromJson(Map json) { icdcode10Id = json['icdcode10Id']; diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index 56b97a92..682342df 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -1,14 +1,14 @@ class PostChiefComplaintRequestModel { - int? appointmentNo; - int? episodeID; - int? patientMRN; - int? admissionNo; - String? chiefComplaint; - String? hopi; - String? currentMedication; - bool? ispregnant; - bool? isLactation; - int? numberOfWeeks; + int appointmentNo; + int episodeID; + int patientMRN; + int admissionNo; + String chiefComplaint; + String hopi; + String currentMedication; + bool ispregnant; + bool isLactation; + int numberOfWeeks; dynamic doctorID; dynamic editedBy; diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index 89b6586d..d8be3fb2 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,14 +1,14 @@ class PostHistoriesRequestModel { - List? listMedicalHistoryVM; + List listMedicalHistoryVM; dynamic doctorID; PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { - listMedicalHistoryVM = []; + listMedicalHistoryVM = new List(); json['listMedicalHistoryVM'].forEach((v) { - listMedicalHistoryVM!.add(new ListMedicalHistoryVM.fromJson(v)); + listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); }); } doctorID = json['DoctorID']; @@ -17,7 +17,8 @@ class PostHistoriesRequestModel { Map toJson() { final Map data = new Map(); if (this.listMedicalHistoryVM != null) { - data['listMedicalHistoryVM'] = this.listMedicalHistoryVM!.map((v) => v.toJson()).toList(); + data['listMedicalHistoryVM'] = + this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); } data['DoctorID'] = this.doctorID; return data; @@ -25,22 +26,22 @@ class PostHistoriesRequestModel { } class ListMedicalHistoryVM { - int? patientMRN; - int? historyType; - int? historyId; - int? episodeId; - int? appointmentNo; - bool? isChecked; - String? remarks; + int patientMRN; + int historyType; + int historyId; + int episodeId; + int appointmentNo; + bool isChecked; + String remarks; ListMedicalHistoryVM( {this.patientMRN, - this.historyType, - this.historyId, - this.episodeId, - this.appointmentNo, - this.isChecked, - this.remarks}); + this.historyType, + this.historyId, + this.episodeId, + this.appointmentNo, + this.isChecked, + this.remarks}); ListMedicalHistoryVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 95baafda..f056f168 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,15 +1,16 @@ class PostPhysicalExamRequestModel { List - ? listHisProgNotePhysicalExaminationVM; + listHisProgNotePhysicalExaminationVM; PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { if (json['listHisProgNotePhysicalExaminationVM'] != null) { listHisProgNotePhysicalExaminationVM = - []; + new List(); json['listHisProgNotePhysicalExaminationVM'].forEach((v) { - listHisProgNotePhysicalExaminationVM!.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); + listHisProgNotePhysicalExaminationVM + .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); }); } } @@ -19,7 +20,7 @@ class PostPhysicalExamRequestModel { if (this.listHisProgNotePhysicalExaminationVM != null) { data['listHisProgNotePhysicalExaminationVM'] = this .listHisProgNotePhysicalExaminationVM - !.map((v) => v.toJson()) + .map((v) => v.toJson()) .toList(); } return data; @@ -27,31 +28,32 @@ class PostPhysicalExamRequestModel { } class ListHisProgNotePhysicalExaminationVM { - int? episodeId; - int? appointmentNo; - int? admissionNo; - int? examType; - int? examId; - int? patientMRN; - bool? isNormal; - bool? isAbnormal; - bool? notExamined; - String? examName; - String? examinationTypeName; - int? examinationType; - String? remarks; - bool? isNew; - int? createdBy; - String? createdOn; - String? createdByName; - int? editedBy; - String? editedOn; - String? editedByName; + int episodeId; + int appointmentNo; + int admissionNo; + int examType; + int examId; + int patientMRN; + bool isNormal; + bool isAbnormal; + bool notExamined; + String examName; + String examinationTypeName; + int examinationType; + String remarks; + bool isNew; + int createdBy; + String createdOn; + String createdByName; + int editedBy; + String editedOn; + String editedByName; ListHisProgNotePhysicalExaminationVM( {this.episodeId, this.appointmentNo, - this.admissionNo,this.examType, + this.admissionNo, + this.examType, this.examId, this.patientMRN, this.isNormal, @@ -72,7 +74,9 @@ class ListHisProgNotePhysicalExaminationVM { ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { episodeId = json['episodeId']; appointmentNo = json['appointmentNo']; - admissionNo = json['AdmissionNo'];examType = json['examType']; + admissionNo = json['AdmissionNo']; + + examType = json['examType']; examId = json['examId']; patientMRN = json['patientMRN']; isNormal = json['isNormal']; @@ -95,7 +99,8 @@ class ListHisProgNotePhysicalExaminationVM { final Map data = new Map(); data['episodeId'] = this.episodeId; data['appointmentNo'] = this.appointmentNo; - data['admissionNo'] = this.admissionNo;data['examType'] = this.examType; + data['admissionNo'] = this.admissionNo; + data['examType'] = this.examType; data['examId'] = this.examId; data['patientMRN'] = this.patientMRN; data['isNormal'] = this.isNormal; diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index da603bee..2925819d 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -1,13 +1,18 @@ class PostProgressNoteRequestModel { - int? appointmentNo; - int? episodeId; - int? patientMRN; - String? planNote; + int appointmentNo; + int episodeId; + int patientMRN; + String planNote; dynamic doctorID; dynamic editedBy; PostProgressNoteRequestModel( - {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote, this.doctorID, this.editedBy}); + {this.appointmentNo, + this.episodeId, + this.patientMRN, + this.planNote, + this.doctorID, + this.editedBy}); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/models/SOAP/selected_items/my_selected_allergy.dart index 01d47b22..512a4f64 100644 --- a/lib/models/SOAP/selected_items/my_selected_allergy.dart +++ b/lib/models/SOAP/selected_items/my_selected_allergy.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAllergy { - MasterKeyModel? selectedAllergySeverity; - MasterKeyModel? selectedAllergy; - String? remark; - bool? isChecked; - bool? isExpanded; - bool? isLocal; - int? createdBy; - bool? hasValidationError; + MasterKeyModel selectedAllergySeverity; + MasterKeyModel selectedAllergy; + String remark; + bool isChecked; + bool isExpanded; + bool isLocal; + int createdBy; + bool hasValidationError; MySelectedAllergy( {this.selectedAllergySeverity, @@ -19,4 +19,5 @@ class MySelectedAllergy { this.isLocal = true, this.createdBy, this.hasValidationError = false}); + } diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/models/SOAP/selected_items/my_selected_assement.dart index acadceda..01572e6d 100644 --- a/lib/models/SOAP/selected_items/my_selected_assement.dart +++ b/lib/models/SOAP/selected_items/my_selected_assement.dart @@ -1,26 +1,24 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedAssessment { - MasterKeyModel? selectedICD; - MasterKeyModel? selectedDiagnosisCondition; - MasterKeyModel? selectedDiagnosisType; - String? remark; - int? appointmentId; - int? createdBy; - String? createdOn; - int? doctorID; - String? doctorName; - String? icdCode10ID; + MasterKeyModel selectedICD; + MasterKeyModel selectedDiagnosisCondition; + MasterKeyModel selectedDiagnosisType; + String remark; + int appointmentId; + int createdBy; + String createdOn; + int doctorID; + String doctorName; + String icdCode10ID; MySelectedAssessment( {this.selectedICD, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, - this.appointmentId, - this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); + this.remark, this.appointmentId, this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); } diff --git a/lib/models/SOAP/selected_items/my_selected_history.dart b/lib/models/SOAP/selected_items/my_selected_history.dart index 177fb46e..3769c418 100644 --- a/lib/models/SOAP/selected_items/my_selected_history.dart +++ b/lib/models/SOAP/selected_items/my_selected_history.dart @@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class MySelectedHistory { MasterKeyModel selectedHistory; String remark; - bool? isChecked; - bool? isLocal; + bool isChecked; + bool isLocal; MySelectedHistory( {this.selectedHistory, this.remark, this.isChecked, this.isLocal = true}); diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/models/admisson_orders/admission_orders_model.dart index 01539342..a0891a02 100644 --- a/lib/models/admisson_orders/admission_orders_model.dart +++ b/lib/models/admisson_orders/admission_orders_model.dart @@ -1,15 +1,15 @@ class AdmissionOrdersModel { - int? procedureID; - String? procedureName; - String? procedureNameN; - int? orderNo; - int? doctorID; - int? clinicID; - String? createdOn; - int? createdBy; - String? editedOn; - int? editedBy; - String? createdByName; + int procedureID; + String procedureName; + String procedureNameN; + int orderNo; + int doctorID; + int clinicID; + String createdOn; + int createdBy; + String editedOn; + int editedBy; + String createdByName; AdmissionOrdersModel( {this.procedureID, diff --git a/lib/models/admisson_orders/admission_orders_request_model.dart b/lib/models/admisson_orders/admission_orders_request_model.dart index 4b6296e5..897bb8f8 100644 --- a/lib/models/admisson_orders/admission_orders_request_model.dart +++ b/lib/models/admisson_orders/admission_orders_request_model.dart @@ -1,20 +1,20 @@ class AdmissionOrdersRequestModel { - bool? isDentalAllowedBackend; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? deviceTypeID; - String? tokenID; - int? patientID; - int? admissionNo; - String? sessionID; - int? projectID; - String? setupID; - bool? patientOutSA; - int? patientType; - int? patientTypeID; + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; AdmissionOrdersRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/models/countriesModel.dart b/lib/models/countriesModel.dart index 79ba027e..89797fab 100644 --- a/lib/models/countriesModel.dart +++ b/lib/models/countriesModel.dart @@ -16,10 +16,10 @@ // } class Countries { - String? name; - String? nameAr; - String? code; - String? countryCode; + String name; + String nameAr; + String code; + String countryCode; Countries({this.name, this.nameAr, this.code, this.countryCode}); diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/models/dashboard/dashboard_model.dart index 5719b06b..0e03e899 100644 --- a/lib/models/dashboard/dashboard_model.dart +++ b/lib/models/dashboard/dashboard_model.dart @@ -1,7 +1,7 @@ class DashboardModel { - String? kPIName; - int? displaySequence; - List? summaryoptions; + String kPIName; + int displaySequence; + List summaryoptions; DashboardModel({this.kPIName, this.displaySequence, this.summaryoptions}); @@ -9,9 +9,9 @@ class DashboardModel { kPIName = json['KPIName']; displaySequence = json['displaySequence']; if (json['summaryoptions'] != null) { - summaryoptions = []; + summaryoptions = new List(); json['summaryoptions'].forEach((v) { - summaryoptions!.add(new Summaryoptions.fromJson(v)); + summaryoptions.add(new Summaryoptions.fromJson(v)); }); } } @@ -21,20 +21,21 @@ class DashboardModel { data['KPIName'] = this.kPIName; data['displaySequence'] = this.displaySequence; if (this.summaryoptions != null) { - data['summaryoptions'] = this.summaryoptions!.map((v) => v.toJson()).toList(); + data['summaryoptions'] = + this.summaryoptions.map((v) => v.toJson()).toList(); } return data; } } class Summaryoptions { - String? kPIParameter; - String? captionColor; - bool? isCaptionBold; - bool? isValueBold; - int? order; - int? value; - String? valueColor; + String kPIParameter; + String captionColor; + bool isCaptionBold; + bool isValueBold; + int order; + int value; + String valueColor; Summaryoptions( {this.kPIParameter, 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 index c732fa71..ec19abb0 100644 --- a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart +++ b/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart @@ -1,9 +1,9 @@ class GetSpecialClinicalCareListResponseModel { - int? projectID; - int? clinicID; - String? clinicDescription; - String? clinicDescriptionN; - bool? isActive; + int projectID; + int clinicID; + String clinicDescription; + String clinicDescriptionN; + bool isActive; GetSpecialClinicalCareListResponseModel( {this.projectID, 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 index a69f812f..287f40f1 100644 --- 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 @@ -1,10 +1,10 @@ class GetSpecialClinicalCareMappingListResponseModel { - int? mappingProjectID; - int? clinicID; - int? nursingStationID; - bool? isActive; - int? projectID; - String? description; + int mappingProjectID; + int clinicID; + int nursingStationID; + bool isActive; + int projectID; + String description; GetSpecialClinicalCareMappingListResponseModel( {this.mappingProjectID, diff --git a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart index cc643e3f..2d2c14ad 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart @@ -1,14 +1,11 @@ class GetDischargeSummaryReqModel { - int? patientID; - int? admissionNo; - int? patientType; - int? patientTypeID; + int patientID; + int admissionNo; + int patientType; + int patientTypeID; GetDischargeSummaryReqModel( - {this.patientID, - this.admissionNo, - this.patientType = 1, - this.patientTypeID = 1}); + {this.patientID, this.admissionNo, this.patientType = 1, this.patientTypeID=1}); GetDischargeSummaryReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart index 214acc97..10ddab00 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -1,33 +1,33 @@ class GetDischargeSummaryResModel { - String? setupID; - int? projectID; - int? dischargeNo; - String? dischargeDate; - int? admissionNo; - int? assessmentNo; - int? patientType; - int? patientID; - int? clinicID; - int? doctorID; - String? finalDiagnosis; - String? persentation; - String? pastHistory; - String? planOfCare; - String? investigations; - String? followupPlan; - String? conditionOnDischarge; - String? significantFindings; - String? planedProcedure; - int? daysStayed; - String? remarks; - String? eRCare; - int? status; - bool? isActive; - int? createdBy; - String? createdOn; - int? editedBy; - String? editedOn; - bool? isPatientDied; + String setupID; + int projectID; + int dischargeNo; + String dischargeDate; + int admissionNo; + int assessmentNo; + int patientType; + int patientID; + int clinicID; + int doctorID; + String finalDiagnosis; + String persentation; + String pastHistory; + String planOfCare; + String investigations; + String followupPlan; + String conditionOnDischarge; + String significantFindings; + String planedProcedure; + int daysStayed; + String remarks; + String eRCare; + int status; + bool isActive; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + bool isPatientDied; dynamic isMedicineApproved; dynamic isOpenBillDischarge; dynamic activatedDate; @@ -36,16 +36,16 @@ class GetDischargeSummaryResModel { dynamic patientCodition; dynamic others; dynamic reconciliationInstruction; - String? dischargeInstructions; - String? reason; + String dischargeInstructions; + String reason; dynamic dischargeDisposition; dynamic hospitalID; - String? createdByName; + String createdByName; dynamic createdByNameN; - String? editedByName; + String editedByName; dynamic editedByNameN; - String? clinicName; - String? projectName; + String clinicName; + String projectName; GetDischargeSummaryResModel( {this.setupID, diff --git a/lib/models/doctor/clinic_model.dart b/lib/models/doctor/clinic_model.dart index 690837fe..e5eb8eee 100644 --- a/lib/models/doctor/clinic_model.dart +++ b/lib/models/doctor/clinic_model.dart @@ -6,14 +6,20 @@ *@desc: Clinic Model */ class ClinicModel { - dynamic setupID; - int? projectID; - int? doctorID; - int? clinicID; - bool? isActive; - String? clinicName; + Null setupID; + int projectID; + int doctorID; + int clinicID; + bool isActive; + String clinicName; - ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); + ClinicModel( + {this.setupID, + this.projectID, + this.doctorID, + this.clinicID, + this.isActive, + this.clinicName}); ClinicModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index f0221c34..c2f5b0dd 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -1,45 +1,45 @@ class DoctorProfileModel { - int? doctorID; - String? doctorName; - dynamic doctorNameN; - int? clinicID; - String? clinicDescription; - dynamic clinicDescriptionN; - dynamic licenseExpiry; - int? employmentType; + int doctorID; + String doctorName; + Null doctorNameN; + int clinicID; + String clinicDescription; + Null clinicDescriptionN; + Null licenseExpiry; + int employmentType; dynamic setupID; - int? projectID; - String? projectName; - String? nationalityID; - String? nationalityName; - dynamic nationalityNameN; - int? gender; - String? genderDescription; - dynamic genderDescriptionN; - dynamic doctorTitle; - dynamic projectNameN; - bool? isAllowWaitList; - String? titleDescription; - dynamic titleDescriptionN; - dynamic isRegistered; - dynamic isDoctorDummy; - bool? isActive; - dynamic isDoctorAppointmentDisplayed; - bool? doctorClinicActive; - dynamic isbookingAllowed; - String? doctorCases; - dynamic doctorPicture; - String? doctorProfileInfo; - List? specialty; - int? actualDoctorRate; - String? doctorImageURL; - int? doctorRate; - String? doctorTitleForProfile; - bool? isAppointmentAllowed; - String? nationalityFlagURL; - int? noOfPatientsRate; - String? qR; - int? serviceID; + int projectID; + String projectName; + String nationalityID; + String nationalityName; + Null nationalityNameN; + int gender; + String genderDescription; + Null genderDescriptionN; + Null doctorTitle; + Null projectNameN; + bool isAllowWaitList; + String titleDescription; + Null titleDescriptionN; + Null isRegistered; + Null isDoctorDummy; + bool isActive; + Null isDoctorAppointmentDisplayed; + bool doctorClinicActive; + Null isbookingAllowed; + String doctorCases; + Null doctorPicture; + String doctorProfileInfo; + List specialty; + int actualDoctorRate; + String doctorImageURL; + int doctorRate; + String doctorTitleForProfile; + bool isAppointmentAllowed; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + int serviceID; DoctorProfileModel( {this.doctorID, @@ -84,7 +84,7 @@ class DoctorProfileModel { this.qR, this.serviceID}); - DoctorProfileModel.fromJson(Map json) { + DoctorProfileModel.fromJson(Map json) { doctorID = json['DoctorID']; doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; @@ -110,26 +110,26 @@ class DoctorProfileModel { isRegistered = json['IsRegistered']; isDoctorDummy = json['IsDoctorDummy']; isActive = json['IsActive']; - isDoctorAppointmentDisplayed = json['IsDoctorAppoint?mentDisplayed']; + isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; doctorClinicActive = json['DoctorClinicActive']; isbookingAllowed = json['IsbookingAllowed']; doctorCases = json['DoctorCases']; doctorPicture = json['DoctorPicture']; doctorProfileInfo = json['DoctorProfileInfo']; - specialty = json['Specialty'].cast(); + specialty = json['Specialty'].cast(); actualDoctorRate = json['ActualDoctorRate']; doctorImageURL = json['DoctorImageURL']; doctorRate = json['DoctorRate']; doctorTitleForProfile = json['DoctorTitleForProfile']; - isAppointmentAllowed = json['IsAppoint?mentAllowed']; + isAppointmentAllowed = json['IsAppointmentAllowed']; nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; serviceID = json['ServiceID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorID'] = this.doctorID; data['DoctorName'] = this.doctorName; data['DoctorNameN'] = this.doctorNameN; @@ -155,7 +155,7 @@ class DoctorProfileModel { data['IsRegistered'] = this.isRegistered; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsActive'] = this.isActive; - data['IsDoctorAppoint?mentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; data['DoctorClinicActive'] = this.doctorClinicActive; data['IsbookingAllowed'] = this.isbookingAllowed; data['DoctorCases'] = this.doctorCases; @@ -166,7 +166,7 @@ class DoctorProfileModel { data['DoctorImageURL'] = this.doctorImageURL; data['DoctorRate'] = this.doctorRate; data['DoctorTitleForProfile'] = this.doctorTitleForProfile; - data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; data['NationalityFlagURL'] = this.nationalityFlagURL; data['NoOfPatientsRate'] = this.noOfPatientsRate; data['QR'] = this.qR; diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index fa6f53a6..4712d285 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,11 +1,12 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class ListDoctorWorkingHoursTable { - DateTime? date; - String? dayName; - String? workingHours; - String? projectName; - String? clinicName; + DateTime date; + String dayName; + String workingHours; + String projectName; + String clinicName; + ListDoctorWorkingHoursTable({ this.date, @@ -34,7 +35,7 @@ class ListDoctorWorkingHoursTable { } class WorkingHours { - String? from; - String? to; + String from; + String to; WorkingHours({this.from, this.to}); } diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index 0e630c5f..656a43dd 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,75 +1,74 @@ class ListGtMyPatientsQuestions { - Null rowID; - String? setupID; - int? projectID; - int? transactionNo; - int? patientType; - int? patientID; - int? doctorID; - int? requestType; - String? requestDate; - String? requestTime; - String? remarks; - int? status; - int? createdBy; - String? createdOn; - int? editedBy; - String? editedOn; - String? patientName; + String setupID; + int projectID; + int transactionNo; + int patientType; + int patientID; + int doctorID; + int requestType; + String requestDate; + String requestTime; + String remarks; + int status; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String patientName; Null patientNameN; - int? gender; - String? dateofBirth; - String? mobileNumber; - String? emailAddress; - int? infoStatus; - String? infoDesc; - String? doctorResponse; - dynamic? responseDate; - int? memberID; - String? memberName; - String? memberNameN; - String? age; - String? genderDescription; - bool? isVidaCall; - String? requestTypeDescription; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + int infoStatus; + String infoDesc; + String doctorResponse; + dynamic responseDate; + int memberID; + String memberName; + String memberNameN; + String age; + String genderDescription; + bool isVidaCall; + String requestTypeDescription; ListGtMyPatientsQuestions( {this.rowID, this.setupID, - this.projectID, - this.transactionNo, - this.patientType, - this.patientID, - this.doctorID, - this.requestType, - this.requestDate, - this.requestTime, - this.remarks, - this.status, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.patientName, - this.patientNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.infoStatus, + this.projectID, + this.transactionNo, + this.patientType, + this.patientID, + this.doctorID, + this.requestType, + this.requestDate, + this.requestTime, + this.remarks, + this.status, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.patientName, + this.patientNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.infoStatus, this.infoDesc, this.doctorResponse, this.responseDate, this.memberID, - this.memberName, - this.memberNameN, - this.age, - this.genderDescription, - this.isVidaCall, + this.memberName, + this.memberNameN, + this.age, + this.genderDescription, + this.isVidaCall, this.requestTypeDescription}); - ListGtMyPatientsQuestions.fromJson(Map json) { + ListGtMyPatientsQuestions.fromJson(Map json) { rowID = json['RowID']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -105,8 +104,8 @@ class ListGtMyPatientsQuestions { requestTypeDescription = json['RequestTypeDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['RowID'] = this.rowID; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 147809ea..115f389d 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -6,19 +6,19 @@ *@desc: ProfileReqModel */ class ProfileReqModel { - int? projectID; - int? clinicID; - int? doctorID; - bool? isRegistered; - bool? license; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; + int projectID; + int clinicID; + int doctorID; + bool isRegistered; + bool license; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; ProfileReqModel( {this.projectID, @@ -29,7 +29,7 @@ class ProfileReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - // this.versionID = 5.5, + // this.versionID=5.5, this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.tokenID, diff --git a/lib/models/doctor/replay/request_create_doctor_response.dart b/lib/models/doctor/replay/request_create_doctor_response.dart index 0544ef05..49e421d9 100644 --- a/lib/models/doctor/replay/request_create_doctor_response.dart +++ b/lib/models/doctor/replay/request_create_doctor_response.dart @@ -1,24 +1,24 @@ class CreateDoctorResponseModel { - String? setupID; - int? projectID; - String? transactionNo; - int? infoEnteredBy; - int? infoStatus; - int? createdBy; - int? editedBy; - String? doctorResponse; - int? doctorID; + String setupID; + int projectID; + String transactionNo; + int infoEnteredBy; + int infoStatus; + int createdBy; + int editedBy; + String doctorResponse; + int doctorID; CreateDoctorResponseModel( {this.setupID, - this.projectID, - this.transactionNo, - this.infoEnteredBy, - this.infoStatus, - this.createdBy, - this.editedBy, - this.doctorResponse, - this.doctorID}); + this.projectID, + this.transactionNo, + this.infoEnteredBy, + this.infoStatus, + this.createdBy, + this.editedBy, + this.doctorResponse, + this.doctorID}); CreateDoctorResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/replay/request_doctor_reply.dart b/lib/models/doctor/replay/request_doctor_reply.dart index 8283801a..82384586 100644 --- a/lib/models/doctor/replay/request_doctor_reply.dart +++ b/lib/models/doctor/replay/request_doctor_reply.dart @@ -1,21 +1,21 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestDoctorReply { - int? projectID; - int? doctorID; - int? transactionNo; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? pageIndex; - int? pageSize; - int? infoStatus; + int projectID; + int doctorID; + int transactionNo; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int pageIndex; + int pageSize; + int infoStatus; RequestDoctorReply( {this.projectID, @@ -34,7 +34,7 @@ class RequestDoctorReply { this.infoStatus, this.pageSize}); - RequestDoctorReply.fromJson(Map json) { + RequestDoctorReply.fromJson(Map json) { projectID = json['ProjectID']; doctorID = json['DoctorID']; transactionNo = json['TransactionNo']; @@ -68,7 +68,8 @@ class RequestDoctorReply { data['PatientOutSA'] = this.patientOutSA; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; - if (this.infoStatus != null) data['InfoStatus'] = this.infoStatus; + if(this.infoStatus != null) + data['InfoStatus'] = this.infoStatus; return data; } } diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/models/doctor/request_add_referred_doctor_remarks.dart index e4d3ecdb..b396c47f 100644 --- a/lib/models/doctor/request_add_referred_doctor_remarks.dart +++ b/lib/models/doctor/request_add_referred_doctor_remarks.dart @@ -1,40 +1,41 @@ import 'package:doctor_app_flutter/config/config.dart'; class RequestAddReferredDoctorRemarks { - int? projectID; - String? admissionNo; - int? lineItemNo; - String? referredDoctorRemarks; - int? editedBy; - int? patientID; - int? referringDoctor; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int projectID; + String admissionNo; + int lineItemNo; + String referredDoctorRemarks; + int editedBy; + int patientID; + int referringDoctor; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + RequestAddReferredDoctorRemarks( {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel = CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA}); + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel= CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA}); RequestAddReferredDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index decd97e6..ae7b80aa 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -1,18 +1,20 @@ + + class RequestSchedule { - int? projectID; - int? clinicID; - int? doctorID; - int? doctorWorkingHoursDays; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; + int projectID; + int clinicID; + int doctorID; + int doctorWorkingHoursDays; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; RequestSchedule( {this.projectID, diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/models/doctor/statstics_for_certain_doctor_request.dart index 8b810fe0..08fa03f3 100644 --- a/lib/models/doctor/statstics_for_certain_doctor_request.dart +++ b/lib/models/doctor/statstics_for_certain_doctor_request.dart @@ -1,13 +1,18 @@ class StatsticsForCertainDoctorRequest { - bool? outSA; - int? doctorID; - String? tokenID; - int? channel; - int? projectID; - String? generalid; + bool outSA; + int doctorID; + String tokenID; + int channel; + int projectID; + String generalid; StatsticsForCertainDoctorRequest( - {this.outSA, this.doctorID, this.tokenID, this.channel, this.projectID, this.generalid}); + {this.outSA, + this.doctorID, + this.tokenID, + this.channel, + this.projectID, + this.generalid}); StatsticsForCertainDoctorRequest.fromJson(Map json) { outSA = json['OutSA']; diff --git a/lib/models/doctor/user_model.dart b/lib/models/doctor/user_model.dart index 66768c8a..95035f8d 100644 --- a/lib/models/doctor/user_model.dart +++ b/lib/models/doctor/user_model.dart @@ -1,16 +1,16 @@ class UserModel { - String? userID; - String? password; - int? projectID; - int? languageID; - String? iPAdress; - double? versionID; - int? channel; - String? sessionID; - String? tokenID; - String? stamp; - bool? isLoginForDoctorApp; - int? patientOutSA; + String userID; + String password; + int projectID; + int languageID; + String iPAdress; + double versionID; + int channel; + String sessionID; + String tokenID; + String stamp; + bool isLoginForDoctorApp; + int patientOutSA; UserModel( {this.userID, diff --git a/lib/models/doctor/verify_referral_doctor_remarks.dart b/lib/models/doctor/verify_referral_doctor_remarks.dart index 97c00390..b9bfce0a 100644 --- a/lib/models/doctor/verify_referral_doctor_remarks.dart +++ b/lib/models/doctor/verify_referral_doctor_remarks.dart @@ -1,54 +1,54 @@ import 'package:doctor_app_flutter/config/config.dart'; class VerifyReferralDoctorRemarks { - int? projectID; - String? admissionNo; - int? lineItemNo; - String? referredDoctorRemarks; - int? editedBy; - int? patientID; - int? referringDoctor; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - String? firstName; + int projectID; + String admissionNo; + int lineItemNo; + String referredDoctorRemarks; + int editedBy; + int patientID; + int referringDoctor; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + String firstName; - String? middleName; - String? lastName; - String? patientMobileNumber; - String? patientIdentificationID; + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; - VerifyReferralDoctorRemarks({ - this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel = CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - }); + VerifyReferralDoctorRemarks( + {this.projectID, + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel= CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA, + this.firstName, + this.middleName, + this.lastName, + this.patientMobileNumber, + this.patientIdentificationID, + }); - VerifyReferralDoctorRemarks.fromJson(Map json) { + VerifyReferralDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; lineItemNo = json['LineItemNo']; @@ -65,15 +65,18 @@ class VerifyReferralDoctorRemarks { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; - firstName = json["FirstName"]; - middleName = json["MiddleName"]; - lastName = json["LastName"]; - patientMobileNumber = json["PatientMobileNumber"]; - patientIdentificationID = json["PatientIdentificationID"]; + firstName= json["FirstName"]; + middleName= json["MiddleName"]; + lastName= json["LastName"]; + patientMobileNumber= json["PatientMobileNumber"]; + patientIdentificationID = json["PatientIdentificationID"]; + + + } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; data['LineItemNo'] = this.lineItemNo; diff --git a/lib/models/livecare/end_call_req.dart b/lib/models/livecare/end_call_req.dart index e3cc2722..7a1ae8eb 100644 --- a/lib/models/livecare/end_call_req.dart +++ b/lib/models/livecare/end_call_req.dart @@ -1,11 +1,12 @@ class EndCallReq { - int? vCID; - String? tokenID; - String? generalid; - int? doctorId; - bool? isDestroy; + int vCID; + String tokenID; + String generalid; + int doctorId; + bool isDestroy; - EndCallReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); + EndCallReq( + {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isDestroy}); EndCallReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/livecare/get_panding_req_list.dart b/lib/models/livecare/get_panding_req_list.dart index 2ed2638a..719b9134 100644 --- a/lib/models/livecare/get_panding_req_list.dart +++ b/lib/models/livecare/get_panding_req_list.dart @@ -1,11 +1,16 @@ class LiveCarePendingListRequest { - PatientData? patientData; - int? doctorID; - String? sErServiceID; - int? projectID; - int? sourceID; - - LiveCarePendingListRequest({this.patientData, this.doctorID, this.sErServiceID, this.projectID, this.sourceID}); + PatientData patientData; + int doctorID; + String sErServiceID; + int projectID; + int sourceID; + + LiveCarePendingListRequest( + {this.patientData, + this.doctorID, + this.sErServiceID, + this.projectID, + this.sourceID}); LiveCarePendingListRequest.fromJson(Map json) { patientData = new PatientData.fromJson(json['PatientData']); @@ -18,7 +23,7 @@ class LiveCarePendingListRequest { Map toJson() { final Map data = new Map(); - data['PatientData'] = this.patientData!.toJson(); + data['PatientData'] = this.patientData.toJson(); data['DoctorID'] = this.doctorID; data['SErServiceID'] = this.sErServiceID; data['ProjectID'] = this.projectID; @@ -28,9 +33,9 @@ class LiveCarePendingListRequest { } class PatientData { - bool? isOutKSA; + bool isOutKSA; - PatientData({required this.isOutKSA}); + PatientData({this.isOutKSA}); PatientData.fromJson(Map json) { isOutKSA = json['IsOutKSA']; diff --git a/lib/models/livecare/get_pending_res_list.dart b/lib/models/livecare/get_pending_res_list.dart index 85d62d35..b45c53b9 100644 --- a/lib/models/livecare/get_pending_res_list.dart +++ b/lib/models/livecare/get_pending_res_list.dart @@ -1,43 +1,43 @@ class LiveCarePendingListResponse { dynamic acceptedBy; dynamic acceptedOn; - int? age; + int age; dynamic appointmentNo; - String? arrivalTime; - String? arrivalTimeD; - int? callStatus; - String? clientRequestID; - String? clinicName; + String arrivalTime; + String arrivalTimeD; + int callStatus; + String clientRequestID; + String clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - String? dateOfBirth; - String? deviceToken; - String? deviceType; + String dateOfBirth; + String deviceToken; + String deviceType; dynamic doctorName; - String? editOn; - String? gender; - bool? isFollowUP; + String editOn; + String gender; + bool isFollowUP; dynamic isFromVida; - int? isLoginB; - bool? isOutKSA; - int? isRejected; - String? language; - double? latitude; - double? longitude; - String? mobileNumber; + int isLoginB; + bool isOutKSA; + int isRejected; + String language; + double latitude; + double longitude; + String mobileNumber; dynamic openSession; dynamic openTokenID; - String? patientID; - String? patientName; - int? patientStatus; - String? preferredLanguage; - int? projectID; - double? scoring; - int? serviceID; + String patientID; + String patientName; + int patientStatus; + String preferredLanguage; + int projectID; + double scoring; + int serviceID; dynamic tokenID; - int? vCID; - String? voipToken; + int vCID; + String voipToken; LiveCarePendingListResponse( {this.acceptedBy, @@ -80,11 +80,11 @@ class LiveCarePendingListResponse { this.vCID, this.voipToken}); - LiveCarePendingListResponse.fromJson(Map json) { + LiveCarePendingListResponse.fromJson(Map json) { acceptedBy = json['AcceptedBy']; acceptedOn = json['AcceptedOn']; age = json['Age']; - appointmentNo = json['Appoint?mentNo']; + appointmentNo = json['AppointmentNo']; arrivalTime = json['ArrivalTime']; arrivalTimeD = json['ArrivalTimeD']; callStatus = json['CallStatus']; @@ -122,12 +122,12 @@ class LiveCarePendingListResponse { voipToken = json['VoipToken']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AcceptedBy'] = this.acceptedBy; data['AcceptedOn'] = this.acceptedOn; data['Age'] = this.age; - data['Appoint?mentNo'] = this.appointmentNo; + data['AppointmentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; data['ArrivalTimeD'] = this.arrivalTimeD; data['CallStatus'] = this.callStatus; diff --git a/lib/models/livecare/session_status_model.dart b/lib/models/livecare/session_status_model.dart index 18d5ae6b..7e7a3e43 100644 --- a/lib/models/livecare/session_status_model.dart +++ b/lib/models/livecare/session_status_model.dart @@ -1,10 +1,14 @@ class SessionStatusModel { - bool? isAuthenticated; - int? messageStatus; - String? result; - int? sessionStatus; + bool isAuthenticated; + int messageStatus; + String result; + int sessionStatus; - SessionStatusModel({this.isAuthenticated, this.messageStatus, this.result, this.sessionStatus}); + SessionStatusModel( + {this.isAuthenticated, + this.messageStatus, + this.result, + this.sessionStatus}); SessionStatusModel.fromJson(Map json) { isAuthenticated = json['IsAuthenticated']; diff --git a/lib/models/livecare/start_call_req.dart b/lib/models/livecare/start_call_req.dart index cdc8c924..b3ceabb5 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/models/livecare/start_call_req.dart @@ -1,15 +1,15 @@ class StartCallReq { - String ?clincName; - int ?clinicId; - String ?docSpec; - String? docotrName; - int ?doctorId; - String? generalid; - bool? isOutKsa; - bool ? isrecall; - String? projectName; - String ?tokenID; - int ?vCID; + String clincName; + int clinicId; + String docSpec; + String docotrName; + int doctorId; + String generalid; + bool isOutKsa; + bool isrecall; + String projectName; + String tokenID; + int vCID; StartCallReq( {this.clincName, diff --git a/lib/models/livecare/start_call_res.dart b/lib/models/livecare/start_call_res.dart index c4b0d224..44921d5f 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/models/livecare/start_call_res.dart @@ -1,21 +1,21 @@ class StartCallRes { - String? result; - String? openSessionID; - String? openTokenID; - bool? isAuthenticated; - int? messageStatus; - String? appointmentNo; - bool? isRecording; + String result; + String openSessionID; + String openTokenID; + bool isAuthenticated; + int messageStatus; + String appointmentNo; + bool isRecording; - StartCallRes({ - this.result, - this.openSessionID, - this.openTokenID, - this.isAuthenticated, - this.appointmentNo, - this.messageStatus, - this.isRecording = true, - }); + StartCallRes( + {this.result, + this.openSessionID, + this.openTokenID, + this.isAuthenticated, + this.appointmentNo, + this.messageStatus, + this.isRecording = true, + }); StartCallRes.fromJson(Map json) { result = json['Result']; diff --git a/lib/models/livecare/transfer_to_admin.dart b/lib/models/livecare/transfer_to_admin.dart index 291528b9..841f5e7d 100644 --- a/lib/models/livecare/transfer_to_admin.dart +++ b/lib/models/livecare/transfer_to_admin.dart @@ -1,12 +1,18 @@ class TransferToAdminReq { - int? vCID; - String? tokenID; - String? generalid; - int? doctorId; - bool? isOutKsa; - String? notes; + int vCID; + String tokenID; + String generalid; + int doctorId; + bool isOutKsa; + String notes; - TransferToAdminReq({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.notes}); + TransferToAdminReq( + {this.vCID, + this.tokenID, + this.generalid, + this.doctorId, + this.isOutKsa, + this.notes}); TransferToAdminReq.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/models/operation_report/create_update_operation_report_request_model.dart b/lib/models/operation_report/create_update_operation_report_request_model.dart index cecbce0b..f6d72b1b 100644 --- a/lib/models/operation_report/create_update_operation_report_request_model.dart +++ b/lib/models/operation_report/create_update_operation_report_request_model.dart @@ -1,54 +1,54 @@ class CreateUpdateOperationReportRequestModel { - String? setupID; - int? patientID; - int? reservationNo; - int? admissionNo; - String? preOpDiagmosis; - String? postOpDiagmosis; - String? surgeon; - String? assistant; - String? anasthetist; - String? operation; - String? inasion; - String? finding; - String? surgeryProcedure; - String? postOpInstruction; - int? createdBy; - int? editedBy; - String? complicationDetails; - String? bloodLossDetail; - String? histopathSpecimen; - String? microbiologySpecimen; - String? otherSpecimen; - String? scrubNurse; - String? circulatingNurse; - String? bloodTransfusedDetail; + String setupID; + int patientID; + int reservationNo; + int admissionNo; + String preOpDiagmosis; + String postOpDiagmosis; + String surgeon; + String assistant; + String anasthetist; + String operation; + String inasion; + String finding; + String surgeryProcedure; + String postOpInstruction; + int createdBy; + int editedBy; + String complicationDetails; + String bloodLossDetail; + String histopathSpecimen; + String microbiologySpecimen; + String otherSpecimen; + String scrubNurse; + String circulatingNurse; + String bloodTransfusedDetail; CreateUpdateOperationReportRequestModel( {this.setupID, - this.patientID, - this.reservationNo, - this.admissionNo, - this.preOpDiagmosis, - this.postOpDiagmosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.createdBy, - this.editedBy, - this.complicationDetails, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.patientID, + this.reservationNo, + this.admissionNo, + this.preOpDiagmosis, + this.postOpDiagmosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.createdBy, + this.editedBy, + this.complicationDetails, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); CreateUpdateOperationReportRequestModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/operation_report/get_operation_details_request_modle.dart b/lib/models/operation_report/get_operation_details_request_modle.dart index fd7be8a4..7e23b503 100644 --- a/lib/models/operation_report/get_operation_details_request_modle.dart +++ b/lib/models/operation_report/get_operation_details_request_modle.dart @@ -1,34 +1,34 @@ class GetOperationDetailsRequestModel { - bool? isDentalAllowedBackend; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? deviceTypeID; - String? tokenID; - int? patientID; - int? reservationNo; - String? sessionID; - int? projectID; - String? setupID; - bool? patientOutSA; + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int reservationNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; GetOperationDetailsRequestModel( {this.isDentalAllowedBackend = false, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.reservationNo, - this.sessionID, - this.projectID, - this.setupID, - this.patientOutSA}); + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.reservationNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA}); GetOperationDetailsRequestModel.fromJson(Map json) { isDentalAllowedBackend = json['isDentalAllowedBackend']; diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/models/operation_report/get_operation_details_response_modle.dart index b57acc4a..04540ea6 100644 --- a/lib/models/operation_report/get_operation_details_response_modle.dart +++ b/lib/models/operation_report/get_operation_details_response_modle.dart @@ -1,74 +1,74 @@ class GetOperationDetailsResponseModel { - String? setupID; - int? projectID; - int? reservationNo; - int? patientID; - int? admissionID; + String setupID; + int projectID; + int reservationNo; + int patientID; + int admissionID; dynamic surgeryDate; - String? preOpDiagnosis; - String? postOpDiagnosis; - String? surgeon; - String? assistant; - String? anasthetist; - String? operation; - String? inasion; - String? finding; - String? surgeryProcedure; - String? postOpInstruction; - bool? isActive; - int? createdBy; - String? createdName; + String preOpDiagnosis; + String postOpDiagnosis; + String surgeon; + String assistant; + String anasthetist; + String operation; + String inasion; + String finding; + String surgeryProcedure; + String postOpInstruction; + bool isActive; + int createdBy; + String createdName; dynamic createdNameN; - String? createdOn; + String createdOn; dynamic editedBy; dynamic editedByName; dynamic editedByNameN; dynamic editedOn; dynamic oRBookStatus; - String? complicationDetail; - String? bloodLossDetail; - String? histopathSpecimen; - String? microbiologySpecimen; - String? otherSpecimen; + String complicationDetail; + String bloodLossDetail; + String histopathSpecimen; + String microbiologySpecimen; + String otherSpecimen; dynamic scrubNurse; dynamic circulatingNurse; dynamic bloodTransfusedDetail; GetOperationDetailsResponseModel( {this.setupID, - this.projectID, - this.reservationNo, - this.patientID, - this.admissionID, - this.surgeryDate, - this.preOpDiagnosis, - this.postOpDiagnosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.isActive, - this.createdBy, - this.createdName, - this.createdNameN, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedByNameN, - this.editedOn, - this.oRBookStatus, - this.complicationDetail, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.projectID, + this.reservationNo, + this.patientID, + this.admissionID, + this.surgeryDate, + this.preOpDiagnosis, + this.postOpDiagnosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.isActive, + this.createdBy, + this.createdName, + this.createdNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn, + this.oRBookStatus, + this.complicationDetail, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); GetOperationDetailsResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/operation_report/get_reservations_request_model.dart b/lib/models/operation_report/get_reservations_request_model.dart index 8de0bbf3..06425254 100644 --- a/lib/models/operation_report/get_reservations_request_model.dart +++ b/lib/models/operation_report/get_reservations_request_model.dart @@ -1,17 +1,17 @@ class GetReservationsRequestModel { - int? patientID; - int? projectID; - String? doctorID; - int? clinicID; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - bool? patientOutSA; - int? deviceTypeID; - String? tokenID; - String? sessionID; + int patientID; + int projectID; + String doctorID; + int clinicID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + bool patientOutSA; + int deviceTypeID; + String tokenID; + String sessionID; GetReservationsRequestModel( {this.patientID, diff --git a/lib/models/operation_report/get_reservations_response_model.dart b/lib/models/operation_report/get_reservations_response_model.dart index b6191353..3bebdc8b 100644 --- a/lib/models/operation_report/get_reservations_response_model.dart +++ b/lib/models/operation_report/get_reservations_response_model.dart @@ -1,38 +1,38 @@ class GetReservationsResponseModel { - String? setupID; - int? projectID; - int? oTReservationID; - String? oTReservationDate; - String? oTReservationDateN; - int? oTID; - int? admissionRequestNo; - int? admissionNo; - int? primaryDoctorID; - int? patientType; - int? patientID; - int? patientStatusType; - int? clinicID; - int? doctorID; - String? operationDate; - int? operationType; - String? endDate; - String? timeStart; - String? timeEnd; + String setupID; + int projectID; + int oTReservationID; + String oTReservationDate; + String oTReservationDateN; + int oTID; + int admissionRequestNo; + int admissionNo; + int primaryDoctorID; + int patientType; + int patientID; + int patientStatusType; + int clinicID; + int doctorID; + String operationDate; + int operationType; + String endDate; + String timeStart; + String timeEnd; dynamic remarks; - int? status; - int? createdBy; - String? createdOn; - int? editedBy; - String? editedOn; - String? patientName; + int status; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String patientName; Null patientNameN; Null gender; - String? dateofBirth; - String? mobileNumber; - String? emailAddress; - String? doctorName; + String dateofBirth; + String mobileNumber; + String emailAddress; + String doctorName; Null doctorNameN; - String? clinicDescription; + String clinicDescription; Null clinicDescriptionN; GetReservationsResponseModel( diff --git a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart index aa0d1279..f00e84a0 100644 --- a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart +++ b/lib/models/patient/MedicalReport/MedicalReportTemplate.dart @@ -1,32 +1,32 @@ class MedicalReportTemplate { - String? setupID; - int? projectID; - int? templateID; - String? procedureID; - int? reportType; - String? templateName; - String? templateNameN; - String? templateText; - String? templateTextN; - bool? isActive; - String? templateTextHtml; - String? templateTextNHtml; + String setupID; + int projectID; + int templateID; + String procedureID; + int reportType; + String templateName; + String templateNameN; + String templateText; + String templateTextN; + bool isActive; + String templateTextHtml; + String templateTextNHtml; MedicalReportTemplate( {this.setupID, - this.projectID, - this.templateID, - this.procedureID, - this.reportType, - this.templateName, - this.templateNameN, - this.templateText, - this.templateTextN, - this.isActive, - this.templateTextHtml, - this.templateTextNHtml}); + this.projectID, + this.templateID, + this.procedureID, + this.reportType, + this.templateName, + this.templateNameN, + this.templateText, + this.templateTextN, + this.isActive, + this.templateTextHtml, + this.templateTextNHtml}); - MedicalReportTemplate.fromJson(Map json) { + MedicalReportTemplate.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; templateID = json['TemplateID']; @@ -41,8 +41,8 @@ class MedicalReportTemplate { templateTextNHtml = json['TemplateTextNHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['TemplateID'] = this.templateID; diff --git a/lib/models/patient/MedicalReport/MeidcalReportModel.dart b/lib/models/patient/MedicalReport/MeidcalReportModel.dart index 6cfe81ca..74ee53a5 100644 --- a/lib/models/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/models/patient/MedicalReport/MeidcalReportModel.dart @@ -1,60 +1,60 @@ class MedicalReportModel { - String? reportData; - String? setupID; - int? projectID; - String? projectName; - String? projectNameN; - int? patientID; - String? invoiceNo; - int? status; - String? verifiedOn; + String reportData; + String setupID; + int projectID; + String projectName; + String projectNameN; + int patientID; + String invoiceNo; + int status; + String verifiedOn; dynamic verifiedBy; - String? editedOn; - int? editedBy; - int? lineItemNo; - String? createdOn; - int? templateID; - int? doctorID; - int? doctorGender; - String? doctorGenderDescription; - String? doctorGenderDescriptionN; - String? doctorImageURL; - String? doctorName; - String? doctorNameN; - int? clinicID; - String? clinicName; - String? clinicNameN; - String? reportDataHtml; + String editedOn; + int editedBy; + int lineItemNo; + String createdOn; + int templateID; + int doctorID; + int doctorGender; + String doctorGenderDescription; + String doctorGenderDescriptionN; + String doctorImageURL; + String doctorName; + String doctorNameN; + int clinicID; + String clinicName; + String clinicNameN; + String reportDataHtml; MedicalReportModel( {this.reportData, - this.setupID, - this.projectID, - this.projectName, - this.projectNameN, - this.patientID, - this.invoiceNo, - this.status, - this.verifiedOn, - this.verifiedBy, - this.editedOn, - this.editedBy, - this.lineItemNo, - this.createdOn, - this.templateID, - this.doctorID, - this.doctorGender, - this.doctorGenderDescription, - this.doctorGenderDescriptionN, - this.doctorImageURL, - this.doctorName, - this.doctorNameN, - this.clinicID, - this.clinicName, - this.clinicNameN, - this.reportDataHtml}); + this.setupID, + this.projectID, + this.projectName, + this.projectNameN, + this.patientID, + this.invoiceNo, + this.status, + this.verifiedOn, + this.verifiedBy, + this.editedOn, + this.editedBy, + this.lineItemNo, + this.createdOn, + this.templateID, + this.doctorID, + this.doctorGender, + this.doctorGenderDescription, + this.doctorGenderDescriptionN, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicName, + this.clinicNameN, + this.reportDataHtml}); - MedicalReportModel.fromJson(Map json) { + MedicalReportModel.fromJson(Map json) { reportData = json['ReportData']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -83,8 +83,8 @@ class MedicalReportModel { reportDataHtml = json['ReportDataHtml']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ReportData'] = this.reportData; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/models/patient/PatientArrivalEntity.dart index 710cd70f..54622cd7 100644 --- a/lib/models/patient/PatientArrivalEntity.dart +++ b/lib/models/patient/PatientArrivalEntity.dart @@ -1,44 +1,44 @@ class PatientArrivalEntity { - String? age; - String? appointmentDate; - int? appointmentNo; - String? appointmentType; - String? arrivedOn; - String? companyName; - String? endTime; - int? episodeNo; - int? fallRiskScore; - String? gender; - int? medicationOrders; - String? mobileNumber; - String? nationality; - int? patientMRN; - String? patientName; - int? rowCount; - String? startTime; - String? visitType; + String age; + String appointmentDate; + int appointmentNo; + String appointmentType; + String arrivedOn; + String companyName; + String endTime; + int episodeNo; + int fallRiskScore; + String gender; + int medicationOrders; + String mobileNumber; + String nationality; + int patientMRN; + String patientName; + int rowCount; + String startTime; + String visitType; PatientArrivalEntity( {this.age, - this.appointmentDate, - this.appointmentNo, - this.appointmentType, - this.arrivedOn, - this.companyName, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.gender, - this.medicationOrders, - this.mobileNumber, - this.nationality, - this.patientMRN, - this.patientName, - this.rowCount, - this.startTime, - this.visitType}); + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.companyName, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.gender, + this.medicationOrders, + this.mobileNumber, + this.nationality, + this.patientMRN, + this.patientName, + this.rowCount, + this.startTime, + this.visitType}); - PatientArrivalEntity.fromJson(Map json) { + PatientArrivalEntity.fromJson(Map json) { age = json['age']; appointmentDate = json['appointmentDate']; appointmentNo = json['appointmentNo']; @@ -59,8 +59,8 @@ class PatientArrivalEntity { visitType = json['visitType']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['age'] = this.age; data['appointmentDate'] = this.appointmentDate; data['appointmentNo'] = this.appointmentNo; @@ -81,4 +81,4 @@ class PatientArrivalEntity { data['visitType'] = this.visitType; return data; } -} +} \ No newline at end of file diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index c3ba279d..09198dc0 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -1,5 +1,6 @@ class ClinicByProjectIdRequest { - /* + + /* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -7,17 +8,17 @@ class ClinicByProjectIdRequest { *@desc: ClinicByProjectIdRequest */ - int? projectID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; /* { "ProjectID": 21, @@ -47,7 +48,7 @@ class ClinicByProjectIdRequest { this.patientOutSA = false, this.patientTypeID = 1}); - ClinicByProjectIdRequest.fromJson(Map json) { + ClinicByProjectIdRequest.fromJson(Map json) { projectID = json['ProjectID']; languageID = json['LanguageID']; stamp = json['stamp']; diff --git a/lib/models/patient/get_doctor_by_clinic_id_request.dart b/lib/models/patient/get_doctor_by_clinic_id_request.dart index 351f19f7..9504fc35 100644 --- a/lib/models/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/models/patient/get_doctor_by_clinic_id_request.dart @@ -1,31 +1,35 @@ class DoctorsByClinicIdRequest { - int? clinicID; - int? projectID; - bool? continueDentalPlan; - bool? isSearchAppointmnetByClinicID; - int? patientID; - int? gender; - bool? isGetNearAppointment; - bool? isVoiceCommand; - int? latitude; - int? longitude; - bool? license; - bool? isDentalAllowedBackend; - DoctorsByClinicIdRequest({ - this.clinicID, - this.projectID, - this.continueDentalPlan = false, - this.isSearchAppointmnetByClinicID = true, - this.patientID, - this.gender, - this.isGetNearAppointment = false, - this.isVoiceCommand = true, - this.latitude = 0, - this.longitude = 0, - this.license = true, - this.isDentalAllowedBackend = false, - }); + int clinicID; + int projectID; + bool continueDentalPlan; + bool isSearchAppointmnetByClinicID; + int patientID; + int gender; + bool isGetNearAppointment; + bool isVoiceCommand; + int latitude; + int longitude; + bool license; + bool isDentalAllowedBackend; + + + DoctorsByClinicIdRequest( + { + this.clinicID, + this.projectID, + this.continueDentalPlan = false, + this.isSearchAppointmnetByClinicID = true, + this.patientID, + this.gender, + this.isGetNearAppointment = false, + this.isVoiceCommand = true, + this.latitude = 0, + this.longitude = 0, + this.license = true, + this.isDentalAllowedBackend = false, + }); + DoctorsByClinicIdRequest.fromJson(Map json) { clinicID = json['ClinicID']; @@ -57,5 +61,6 @@ class DoctorsByClinicIdRequest { data['License'] = this.license; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; return data; + } } diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index 1f5b97a0..edae9f18 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -1,5 +1,6 @@ class STPReferralFrequencyRequest { -/* + +/* *@author: Ibrahim Albitar *@Date:03/06/2020 *@param: @@ -7,16 +8,16 @@ class STPReferralFrequencyRequest { *@desc: */ - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; /* { "LanguageID": 2, @@ -43,7 +44,7 @@ class STPReferralFrequencyRequest { this.patientOutSA = false, this.patientTypeID = 1}); - STPReferralFrequencyRequest.fromJson(Map json) { + STPReferralFrequencyRequest.fromJson(Map json) { languageID = json['LanguageID']; stamp = json['stamp']; iPAdress = json['IPAdress']; diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart index e16024ac..e1b50a81 100644 --- a/lib/models/patient/get_pending_patient_er_model.dart +++ b/lib/models/patient/get_pending_patient_er_model.dart @@ -7,10 +7,9 @@ */ import 'dart:convert'; -ListPendingPatientListModel listPendingPatientListModelFromJson(String? str) => - ListPendingPatientListModel.fromJson(json.decode(str!)); +ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => ListPendingPatientListModel.fromJson(json.decode(str)); -String? listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); +String listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); class ListPendingPatientListModel { ListPendingPatientListModel({ @@ -57,128 +56,127 @@ class ListPendingPatientListModel { dynamic acceptedBy; dynamic acceptedOn; - int? age; + int age; dynamic appointmentNo; - String? arrivalTime; - String? arrivalTimeD; - int? callStatus; - String? clientRequestId; - String? clinicName; + String arrivalTime; + String arrivalTimeD; + int callStatus; + String clientRequestId; + String clinicName; dynamic consoltationEnd; dynamic consultationNotes; dynamic createdOn; - DateTime? dateOfBirth; - String? deviceToken; - String? deviceType; + DateTime dateOfBirth; + String deviceToken; + String deviceType; dynamic doctorName; - String? editOn; - String? gender; - bool? isFollowUp; + String editOn; + String gender; + bool isFollowUp; dynamic isFromVida; - int? isLoginB; - bool? isOutKsa; - int? isRejected; - String? language; - double? latitude; - double? longitude; - String? mobileNumber; + int isLoginB; + bool isOutKsa; + int isRejected; + String language; + double latitude; + double longitude; + String mobileNumber; dynamic openSession; dynamic openTokenId; - String? patientId; - String? patientName; - int? patientStatus; - String? preferredLanguage; - int? projectId; - int? scoring; - int? serviceId; + String patientId; + String patientName; + int patientStatus; + String preferredLanguage; + int projectId; + int scoring; + int serviceId; dynamic tokenId; - int? vcId; - String? voipToken; + int vcId; + String voipToken; - factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( - acceptedBy: json["AcceptedBy"], - acceptedOn: json["AcceptedOn"], - age: json["Age"], - appointmentNo: json["AppointmentNo"], - arrivalTime: json["ArrivalTime"], - arrivalTimeD: json["ArrivalTimeD"], - callStatus: json["CallStatus"], - clientRequestId: json["ClientRequestID"], - clinicName: json["ClinicName"], - consoltationEnd: json["ConsoltationEnd"], - consultationNotes: json["ConsultationNotes"], - createdOn: json["CreatedOn"], - dateOfBirth: DateTime.parse(json["DateOfBirth"]), - deviceToken: json["DeviceToken"], - deviceType: json["DeviceType"], - doctorName: json["DoctorName"], - editOn: json["EditOn"], - gender: json["Gender"], - isFollowUp: json["IsFollowUP"], - isFromVida: json["IsFromVida"], - isLoginB: json["IsLoginB"], - isOutKsa: json["IsOutKSA"], - isRejected: json["IsRejected"], - language: json["Language"], - latitude: json["Latitude"].toDouble(), - longitude: json["Longitude"].toDouble(), - mobileNumber: json["MobileNumber"], - openSession: json["OpenSession"], - openTokenId: json["OpenTokenID"], - patientId: json["PatientID"], - patientName: json["PatientName"], - patientStatus: json["PatientStatus"], - preferredLanguage: json["PreferredLanguage"], - projectId: json["ProjectID"], - scoring: json["Scoring"], - serviceId: json["ServiceID"], - tokenId: json["TokenID"], - vcId: json["VC_ID"], - voipToken: json["VoipToken"], - ); + factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( + acceptedBy: json["AcceptedBy"], + acceptedOn: json["AcceptedOn"], + age: json["Age"], + appointmentNo: json["AppointmentNo"], + arrivalTime: json["ArrivalTime"], + arrivalTimeD: json["ArrivalTimeD"], + callStatus: json["CallStatus"], + clientRequestId: json["ClientRequestID"], + clinicName: json["ClinicName"], + consoltationEnd: json["ConsoltationEnd"], + consultationNotes: json["ConsultationNotes"], + createdOn: json["CreatedOn"], + dateOfBirth: DateTime.parse(json["DateOfBirth"]), + deviceToken: json["DeviceToken"], + deviceType: json["DeviceType"], + doctorName: json["DoctorName"], + editOn: json["EditOn"], + gender: json["Gender"], + isFollowUp: json["IsFollowUP"], + isFromVida: json["IsFromVida"], + isLoginB: json["IsLoginB"], + isOutKsa: json["IsOutKSA"], + isRejected: json["IsRejected"], + language: json["Language"], + latitude: json["Latitude"].toDouble(), + longitude: json["Longitude"].toDouble(), + mobileNumber: json["MobileNumber"], + openSession: json["OpenSession"], + openTokenId: json["OpenTokenID"], + patientId: json["PatientID"], + patientName: json["PatientName"], + patientStatus: json["PatientStatus"], + preferredLanguage: json["PreferredLanguage"], + projectId: json["ProjectID"], + scoring: json["Scoring"], + serviceId: json["ServiceID"], + tokenId: json["TokenID"], + vcId: json["VC_ID"], + voipToken: json["VoipToken"], + ); - Map toJson() => { - "AcceptedBy": acceptedBy, - "AcceptedOn": acceptedOn, - "Age": age, - "AppointmentNo": appointmentNo, - "ArrivalTime": arrivalTime, - "ArrivalTimeD": arrivalTimeD, - "CallStatus": callStatus, - "ClientRequestID": clientRequestId, - "ClinicName": clinicName, - "ConsoltationEnd": consoltationEnd, - "ConsultationNotes": consultationNotes, - "CreatedOn": createdOn, - "DateOfBirth": - "${dateOfBirth!.year.toString().padLeft(4, '0')}-${dateOfBirth!.month.toString().padLeft(2, '0')}-${dateOfBirth!.day.toString().padLeft(2, '0')}", - "DeviceToken": deviceToken, - "DeviceType": deviceType, - "DoctorName": doctorName, - "EditOn": editOn, - "Gender": gender, - "IsFollowUP": isFollowUp, - "IsFromVida": isFromVida, - "IsLoginB": isLoginB, - "IsOutKSA": isOutKsa, - "IsRejected": isRejected, - "Language": language, - "Latitude": latitude, - "Longitude": longitude, - "MobileNumber": mobileNumber, - "OpenSession": openSession, - "OpenTokenID": openTokenId, - "PatientID": patientId, - "PatientName": patientName, - "PatientStatus": patientStatus, - "PreferredLanguage": preferredLanguage, - "ProjectID": projectId, - "Scoring": scoring, - "ServiceID": serviceId, - "TokenID": tokenId, - "VC_ID": vcId, - "VoipToken": voipToken, - }; + Map toJson() => { + "AcceptedBy": acceptedBy, + "AcceptedOn": acceptedOn, + "Age": age, + "AppointmentNo": appointmentNo, + "ArrivalTime": arrivalTime, + "ArrivalTimeD": arrivalTimeD, + "CallStatus": callStatus, + "ClientRequestID": clientRequestId, + "ClinicName": clinicName, + "ConsoltationEnd": consoltationEnd, + "ConsultationNotes": consultationNotes, + "CreatedOn": createdOn, + "DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", + "DeviceToken": deviceToken, + "DeviceType": deviceType, + "DoctorName": doctorName, + "EditOn": editOn, + "Gender": gender, + "IsFollowUP": isFollowUp, + "IsFromVida": isFromVida, + "IsLoginB": isLoginB, + "IsOutKSA": isOutKsa, + "IsRejected": isRejected, + "Language": language, + "Latitude": latitude, + "Longitude": longitude, + "MobileNumber": mobileNumber, + "OpenSession": openSession, + "OpenTokenID": openTokenId, + "PatientID": patientId, + "PatientName": patientName, + "PatientStatus": patientStatus, + "PreferredLanguage": preferredLanguage, + "ProjectID": projectId, + "Scoring": scoring, + "ServiceID": serviceId, + "TokenID": tokenId, + "VC_ID": vcId, + "VoipToken": voipToken, + }; } // To parse this JSON data, do // diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart index eb505c34..2d3ac663 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -21,22 +21,23 @@ *@desc: */ class InsuranceAprovalsRequest { - int? exuldAppNO; - int? patientID; - int? channel; - int? projectID; - int? languageID; - String? stamp; - String? ipAdress; - double? versionID; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; + int exuldAppNO; + int patientID; + int channel; + int projectID; + int languageID; + String stamp; + String ipAdress; + double versionID; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; InsuranceAprovalsRequest( - {this.exuldAppNO, + { + this.exuldAppNO, this.patientID, this.channel = 9, this.projectID = 12, @@ -45,12 +46,12 @@ class InsuranceAprovalsRequest { this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', this.versionID = 5.8, - this.tokenID, + this.tokenID , this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, this.patientOutSA = false}); - InsuranceAprovalsRequest.fromJson(Map json) { + InsuranceAprovalsRequest.fromJson(Map json) { exuldAppNO = json['EXuldAPPNO']; patientID = json['PatientID']; channel = json['Channel']; @@ -66,8 +67,8 @@ class InsuranceAprovalsRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['EXuldAPPNO'] = this.exuldAppNO; data['PatientID'] = this.patientID; data['Channel'] = this.channel; diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/models/patient/lab_orders/lab_orders_req_model.dart index 15efb56e..a97f4093 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_req_model.dart @@ -1,23 +1,24 @@ -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: + +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: *@return:LabOrdersReqModel *@desc: LabOrdersReqModel class */ class LabOrdersReqModel { - int? patientID; - int? patientTypeID; - int? projectID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int patientID; + int patientTypeID; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; LabOrdersReqModel( {this.patientID, @@ -26,12 +27,12 @@ class LabOrdersReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress = '11.11.11.11', - this.versionID = 5.5, - this.channel = 9, - this.sessionID = 'E2bsEeYEJo', - this.isLoginForDoctorApp = true, - this.patientOutSA = false}); + this.iPAdress='11.11.11.11', + this.versionID=5.5, + this.channel=9, + this.sessionID='E2bsEeYEJo', + this.isLoginForDoctorApp =true, + this.patientOutSA=false}); LabOrdersReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 3aa46535..7f463933 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -1,27 +1,29 @@ + + import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { - String? setupID; - int? projectID; - int? patientID; - int? patientType; - int? orderNo; - String? orderDate; - int? invoiceTransactionType; - int? invoiceNo; - int? clinicId; - int? doctorId; - int? status; - String? createdBy; - dynamic createdByN; - DateTime? createdOn; - String? editedBy; - dynamic editedByN; - String? editedOn; - String? clinicName; - String? doctorImageURL; - String? doctorName; - String? projectName; + String setupID; + int projectID; + int patientID; + int patientType; + int orderNo; + String orderDate; + int invoiceTransactionType; + int invoiceNo; + int clinicId; + int doctorId; + int status; + String createdBy; + Null createdByN; + DateTime createdOn; + String editedBy; + Null editedByN; + String editedOn; + String clinicName; + String doctorImageURL; + String doctorName; + String projectName; LabOrdersResModel( {this.setupID, @@ -46,7 +48,7 @@ class LabOrdersResModel { this.doctorName, this.projectName}); - LabOrdersResModel.fromJson(Map json) { + LabOrdersResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -70,8 +72,8 @@ class LabOrdersResModel { projectName = json['ProjectName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/models/patient/lab_result/lab_result.dart index 6e740e16..ca753f2d 100644 --- a/lib/models/patient/lab_result/lab_result.dart +++ b/lib/models/patient/lab_result/lab_result.dart @@ -1,64 +1,64 @@ class LabResult { - String? setupID; - int? projectID; - int? orderNo; - int? lineItemNo; - int? packageID; - int? testID; - String? description; - String? resultValue; - String? referenceRange; - dynamic convertedResultValue; - dynamic convertedReferenceRange; - dynamic resultValueFlag; - int? status; - String? createdBy; - dynamic createdByN; - String? createdOn; - String? editedBy; - dynamic editedByN; - String? editedOn; - String? verifiedBy; - dynamic verifiedByN; - String? verifiedOn; + String setupID; + int projectID; + int orderNo; + int lineItemNo; + int packageID; + int testID; + String description; + String resultValue; + String referenceRange; + Null convertedResultValue; + Null convertedReferenceRange; + Null resultValueFlag; + int status; + String createdBy; + Null createdByN; + String createdOn; + String editedBy; + Null editedByN; + String editedOn; + String verifiedBy; + Null verifiedByN; + String verifiedOn; Null patientID; - int? gender; - dynamic maleinterpretativeData; - dynamic femaleinterpretativeData; - String? testCode; - String? statusDescription; + int gender; + Null maleInterpretativeData; + Null femaleInterpretativeData; + String testCode; + String statusDescription; LabResult( {this.setupID, - this.projectID, - this.orderNo, - this.lineItemNo, - this.packageID, - this.testID, - this.description, - this.resultValue, - this.referenceRange, - this.convertedResultValue, - this.convertedReferenceRange, - this.resultValueFlag, - this.status, - this.createdBy, - this.createdByN, - this.createdOn, - this.editedBy, - this.editedByN, - this.editedOn, - this.verifiedBy, - this.verifiedByN, - this.verifiedOn, - this.patientID, - this.gender, - this.maleinterpretativeData, - this.femaleinterpretativeData, - this.testCode, - this.statusDescription}); + this.projectID, + this.orderNo, + this.lineItemNo, + this.packageID, + this.testID, + this.description, + this.resultValue, + this.referenceRange, + this.convertedResultValue, + this.convertedReferenceRange, + this.resultValueFlag, + this.status, + this.createdBy, + this.createdByN, + this.createdOn, + this.editedBy, + this.editedByN, + this.editedOn, + this.verifiedBy, + this.verifiedByN, + this.verifiedOn, + this.patientID, + this.gender, + this.maleInterpretativeData, + this.femaleInterpretativeData, + this.testCode, + this.statusDescription}); - LabResult.fromJson(Map json) { + LabResult.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; orderNo = json['OrderNo']; @@ -83,14 +83,14 @@ class LabResult { verifiedOn = json['VerifiedOn']; patientID = json['PatientID']; gender = json['Gender']; - maleinterpretativeData = json['Maleint?erpretativeData']; - femaleinterpretativeData = json['Femaleint?erpretativeData']; + maleInterpretativeData = json['MaleInterpretativeData']; + femaleInterpretativeData = json['FemaleInterpretativeData']; testCode = json['TestCode']; statusDescription = json['StatusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['OrderNo'] = this.orderNo; @@ -115,8 +115,8 @@ class LabResult { data['VerifiedOn'] = this.verifiedOn; data['PatientID'] = this.patientID; data['Gender'] = this.gender; - data['Maleint?erpretativeData'] = this.maleinterpretativeData; - data['Femaleint?erpretativeData'] = this.femaleinterpretativeData; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; data['TestCode'] = this.testCode; data['StatusDescription'] = this.statusDescription; return data; diff --git a/lib/models/patient/lab_result/lab_result_req_model.dart b/lib/models/patient/lab_result/lab_result_req_model.dart index 91510d38..5e58a4a5 100644 --- a/lib/models/patient/lab_result/lab_result_req_model.dart +++ b/lib/models/patient/lab_result/lab_result_req_model.dart @@ -1,36 +1,36 @@ class RequestLabResult { - int? projectID; - String? setupID; - int? orderNo; - int? invoiceNo; - int? patientTypeID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int projectID; + String setupID; + int orderNo; + int invoiceNo; + int patientTypeID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; RequestLabResult( {this.projectID, - this.setupID, - this.orderNo, - this.invoiceNo, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.setupID, + this.orderNo, + this.invoiceNo, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); - RequestLabResult.fromJson(Map json) { + RequestLabResult.fromJson(Map json) { projectID = json['ProjectID']; setupID = json['SetupID']; orderNo = json['OrderNo']; diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/models/patient/my_referral/PendingReferral.dart index 58f12baf..6d3f0b83 100644 --- a/lib/models/patient/my_referral/PendingReferral.dart +++ b/lib/models/patient/my_referral/PendingReferral.dart @@ -1,37 +1,37 @@ import '../patiant_info_model.dart'; class PendingReferral { - PatiantInformtion? patientDetails; - String? doctorImageUrl; - String? nationalityFlagUrl; - String? responded; - String? answerFromTarget; - String? createdOn; - int? data; - int? isSameBranch; - String? editedOn; - int? interBranchReferral; - int? patientID; - String? patientName; - int? patientType; - int? referralNo; - String? referralStatus; - String? referredByDoctorInfo; - String? referredFromBranchName; - String? referredOn; - String? referredType; - String? remarksFromSource; - String? respondedOn; - int? sourceAppointmentNo; - int? sourceProjectId; - String? sourceSetupID; - String? startDate; - int? targetAppointmentNo; - String? targetClinicID; - String? targetDoctorID; - int? targetProjectId; - String? targetSetupID; - bool? isReferralDoctorSameBranch; + PatiantInformtion patientDetails; + String doctorImageUrl; + String nationalityFlagUrl; + String responded; + String answerFromTarget; + String createdOn; + int data; + int isSameBranch; + String editedOn; + int interBranchReferral; + int patientID; + String patientName; + int patientType; + int referralNo; + String referralStatus; + String referredByDoctorInfo; + String referredFromBranchName; + String referredOn; + String referredType; + String remarksFromSource; + String respondedOn; + int sourceAppointmentNo; + int sourceProjectId; + String sourceSetupID; + String startDate; + int targetAppointmentNo; + String targetClinicID; + String targetDoctorID; + int targetProjectId; + String targetSetupID; + bool isReferralDoctorSameBranch; PendingReferral({ this.patientDetails, @@ -68,7 +68,9 @@ class PendingReferral { }); PendingReferral.fromJson(Map json) { - patientDetails = json['patientDetails'] != null ? PatiantInformtion.fromJson(json['patientDetails']) : null; + patientDetails = json['patientDetails'] != null + ? PatiantInformtion.fromJson(json['patientDetails']) + : null; doctorImageUrl = json['DoctorImageURL']; nationalityFlagUrl = json['NationalityFlagURL']; responded = json['Responded']; @@ -77,7 +79,7 @@ class PendingReferral { data = json['data']; isSameBranch = json['isSameBranch']; editedOn = json['editedOn']; - int? erBranchReferral = json['int?erBranchReferral']; + interBranchReferral = json['interBranchReferral']; patientID = json['patientID']; patientName = json['patientName']; patientType = json['patientType']; @@ -89,19 +91,19 @@ class PendingReferral { referredType = json['referredType']; remarksFromSource = json['remarksFromSource']; respondedOn = json['respondedOn']; - sourceAppointmentNo = json['sourceAppoint?mentNo']; + sourceAppointmentNo = json['sourceAppointmentNo']; sourceProjectId = json['sourceProjectId']; sourceSetupID = json['sourceSetupID']; startDate = json['startDate']; - targetAppointmentNo = json['targetAppoint?mentNo']; + targetAppointmentNo = json['targetAppointmentNo']; targetClinicID = json['targetClinicID']; targetDoctorID = json['targetDoctorID']; targetProjectId = json['targetProjectId']; targetSetupID = json['targetSetupID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['DoctorImageURL'] = this.doctorImageUrl; data['NationalityFlagURL'] = this.nationalityFlagUrl; data['Responded'] = this.responded; @@ -110,7 +112,7 @@ class PendingReferral { data['data'] = this.data; data['isSameBranch'] = this.isSameBranch; data['editedOn'] = this.editedOn; - data['int?erBranchReferral'] = this.interBranchReferral; + data['interBranchReferral'] = this.interBranchReferral; data['patientID'] = this.patientID; data['patientName'] = this.patientName; data['patientType'] = this.patientType; @@ -122,11 +124,11 @@ class PendingReferral { data['referredType'] = this.referredType; data['remarksFromSource'] = this.remarksFromSource; data['respondedOn'] = this.respondedOn; - data['sourceAppoint?mentNo'] = this.sourceAppointmentNo; + data['sourceAppointmentNo'] = this.sourceAppointmentNo; data['sourceProjectId'] = this.sourceProjectId; data['sourceSetupID'] = this.sourceSetupID; data['startDate'] = this.startDate; - data['targetAppoint?mentNo'] = this.targetAppointmentNo; + data['targetAppointmentNo'] = this.targetAppointmentNo; data['targetClinicID'] = this.targetClinicID; data['targetDoctorID'] = this.targetDoctorID; data['targetProjectId'] = this.targetProjectId; diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/models/patient/my_referral/clinic-doctor.dart index a8c541cf..843f636c 100644 --- a/lib/models/patient/my_referral/clinic-doctor.dart +++ b/lib/models/patient/my_referral/clinic-doctor.dart @@ -1,86 +1,86 @@ class ClinicDoctor { - int? clinicID; - String? clinicName; - String? doctorTitle; - int? iD; - String? name; - int? projectID; - String? projectName; - int? actualDoctorRate; - int? clinicRoomNo; - String? date; - String? dayName; - int? doctorID; - String? doctorImageURL; - String? doctorProfile; - String? doctorProfileInfo; - int? doctorRate; - int? gender; - String? genderDescription; - bool? isAppointmentAllowed; - bool? isDoctorAllowVedioCall; - bool? isDoctorDummy; - bool? isLiveCare; - String? latitude; - String? longitude; - String? nationalityFlagURL; - String? nationalityID; - String? nationalityName; - String? nearestFreeSlot; - int? noOfPatientsRate; - String? originalClinicID; - int? personRate; - int? projectDistanceInKiloMeters; - String? qR; - String? qRString; - int? rateNumber; - String? serviceID; - String? setupID; - List? speciality; - String? workingHours; + int clinicID; + String clinicName; + String doctorTitle; + int iD; + String name; + int projectID; + String projectName; + int actualDoctorRate; + int clinicRoomNo; + String date; + String dayName; + int doctorID; + String doctorImageURL; + String doctorProfile; + String doctorProfileInfo; + int doctorRate; + int gender; + String genderDescription; + bool isAppointmentAllowed; + bool isDoctorAllowVedioCall; + bool isDoctorDummy; + bool isLiveCare; + String latitude; + String longitude; + String nationalityFlagURL; + String nationalityID; + String nationalityName; + String nearestFreeSlot; + int noOfPatientsRate; + String originalClinicID; + int personRate; + int projectDistanceInKiloMeters; + String qR; + String qRString; + int rateNumber; + String serviceID; + String setupID; + List speciality; + String workingHours; ClinicDoctor( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); - ClinicDoctor.fromJson(Map json) { + ClinicDoctor.fromJson(Map json) { clinicID = json['ClinicID']; clinicName = json['ClinicName']; doctorTitle = json['DoctorTitle']; @@ -99,7 +99,7 @@ class ClinicDoctor { doctorRate = json['DoctorRate']; gender = json['Gender']; genderDescription = json['GenderDescription']; - isAppointmentAllowed = json['IsAppoint?mentAllowed']; + isAppointmentAllowed = json['IsAppointmentAllowed']; isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isDoctorDummy = json['IsDoctorDummy']; isLiveCare = json['IsLiveCare']; @@ -114,16 +114,16 @@ class ClinicDoctor { personRate = json['PersonRate']; projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters']; qR = json['QR']; - qRString = json['QRString?']; + qRString = json['QRString']; rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - speciality = json['Speciality'].cast(); + speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ClinicID'] = this.clinicID; data['ClinicName'] = this.clinicName; data['DoctorTitle'] = this.doctorTitle; @@ -142,7 +142,7 @@ class ClinicDoctor { data['DoctorRate'] = this.doctorRate; data['Gender'] = this.gender; data['GenderDescription'] = this.genderDescription; - data['IsAppoint?mentAllowed'] = this.isAppointmentAllowed; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsLiveCare'] = this.isLiveCare; @@ -157,7 +157,7 @@ class ClinicDoctor { data['PersonRate'] = this.personRate; data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters; data['QR'] = this.qR; - data['QRString?'] = this.qRString; + data['QRString'] = this.qRString; data['RateNumber'] = this.rateNumber; data['ServiceID'] = this.serviceID; data['SetupID'] = this.setupID; @@ -165,4 +165,5 @@ class ClinicDoctor { data['WorkingHours'] = this.workingHours; return data; } -} + +} \ No newline at end of file diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index f79a57c3..f1506f8e 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -1,108 +1,108 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { - int? projectID; - int? lineItemNo; - int? doctorID; - int? patientID; - String? doctorName; - String? doctorNameN; - String? firstName; - String? middleName; - String? lastName; - String? firstNameN; - String? middleNameN; - String? lastNameN; - int? gender; - String? dateofBirth; - String? mobileNumber; - String? emailAddress; - String? patientIdentificationNo; - int? patientType; - String? admissionNo; - String? admissionDate; - String? roomID; - String? bedID; - String? nursingStationID; - String? description; - String? nationalityName; - String? nationalityNameN; - String? clinicDescription; - String? clinicDescriptionN; - int? referralDoctor; - int? referringDoctor; - int? referralClinic; - int? referringClinic; - int? referralStatus; - String? referralDate; - String? referringDoctorRemarks; - String? referredDoctorRemarks; - String? referralResponseOn; - int? priority; - int? frequency; - DateTime? mAXResponseTime; - String? age; - String? frequencyDescription; - String? genderDescription; - bool? isDoctorLate; - bool? isDoctorResponse; - String? nursingStationName; - String? priorityDescription; - String? referringClinicDescription; - String? referringDoctorName; + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; + String nursingStationID; + String description; + String nationalityName; + String nationalityNameN; + String clinicDescription; + String clinicDescriptionN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + String referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + DateTime mAXResponseTime; + String age; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referringDoctorName; MyReferralPatientModel( {this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.age, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName}); + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.age, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); - MyReferralPatientModel.fromJson(Map json) { + MyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; lineItemNo = json['LineItemNo']; doctorID = json['DoctorID']; @@ -154,8 +154,8 @@ class MyReferralPatientModel { referringDoctorName = json['ReferringDoctorName']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.projectID; data['LineItemNo'] = this.lineItemNo; data['DoctorID'] = this.doctorID; 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 dbb3a90b..b353e587 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -1,134 +1,136 @@ + + class MyReferredPatientModel { - String? rowID; - int? projectID; - int? lineItemNo; - int? doctorID; - int? patientID; - String? doctorName; - String? doctorNameN; - String? firstName; - String? middleName; - String? lastName; - String? firstNameN; - String? middleNameN; - String? lastNameN; - int? gender; - String? dateofBirth; - String? mobileNumber; - String? emailAddress; - String? patientIdentificationNo; - int? patientType; - String? admissionNo; - String? admissionDate; - String? roomID; - String? bedID; - String? nursingStationID; - String? description; - String? nationalityName; - String? nationalityNameN; - String? clinicDescription; - String? clinicDescriptionN; - int? referralDoctor; - int? referringDoctor; - int? referralClinic; - int? referringClinic; - int? referralStatus; - String? referralDate; - String? referringDoctorRemarks; - String? referredDoctorRemarks; - String? referralResponseOn; - int? priority; - int? frequency; - String? mAXResponseTime; - int? episodeID; - int? appointmentNo; - String? appointmentDate; - int? appointmentType; - int? patientMRN; - String? createdOn; - int? clinicID; - String? nationalityID; - String? age; - String? doctorImageURL; - String? frequencyDescription; - String? genderDescription; - bool? isDoctorLate; - bool? isDoctorResponse; - String? nationalityFlagURL; - String? nursingStationName; - String? priorityDescription; - String? referringClinicDescription; - String? referralDoctorName; - String? referralClinicDescription; - String? referringDoctorName; - bool? isReferralDoctorSameBranch; - String? referralStatusDesc; + String rowID; + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; + String nursingStationID; + String description; + String nationalityName; + String nationalityNameN; + String clinicDescription; + String clinicDescriptionN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + String referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + String mAXResponseTime; + int episodeID; + int appointmentNo; + String appointmentDate; + int appointmentType; + int patientMRN; + String createdOn; + int clinicID; + String nationalityID; + String age; + String doctorImageURL; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nationalityFlagURL; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referralDoctorName; + String referralClinicDescription; + String referringDoctorName; + bool isReferralDoctorSameBranch; + String referralStatusDesc; - MyReferredPatientModel( - {this.rowID, - this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.isReferralDoctorSameBranch, - this.referralDoctorName, - this.referralClinicDescription, - this.referralStatusDesc}); + MyReferredPatientModel({ + this.rowID, + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.isReferralDoctorSameBranch, + this.referralDoctorName, + this.referralClinicDescription,this.referralStatusDesc + }); MyReferredPatientModel.fromJson(Map json) { rowID = json['RowID']; diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart index 8fb336aa..1372cfd6 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/models/patient/orders_request.dart @@ -1,3 +1,4 @@ + /* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -22,36 +23,36 @@ */ class OrdersRequest { - int? visitType; - int? admissionNo; - int? projectID; - int? languageID; - String? stamp; - String? iPAdress; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; - double? versionID; + int visitType; + int admissionNo; + int projectID; + int languageID; + String stamp; + String iPAdress; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + double versionID; OrdersRequest( - {this.visitType, + {this.visitType , this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID, + this.tokenID , this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, this.versionID = 5.5, this.patientOutSA = false}); - OrdersRequest.fromJson(Map json) { + OrdersRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; @@ -67,8 +68,8 @@ class OrdersRequest { versionID = json['VersionID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -84,4 +85,4 @@ class OrdersRequest { data['VersionID'] = this.versionID; return data; } -} +} \ No newline at end of file diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2ab6ba90..df966f03 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -3,81 +3,81 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PatiantInformtion { - PatiantInformtion? patientDetails; - int? genderInt; + PatiantInformtion patientDetails; + int genderInt; dynamic age; - String? appointmentDate; - DateTime? appointmentDateWithDateTimeForm; + String appointmentDate; + DateTime appointmentDateWithDateTimeForm; dynamic appointmentNo; dynamic appointmentType; - String? arrivalTime; - String? arrivalTimeD; - int? callStatus; + String arrivalTime; + String arrivalTimeD; + int callStatus; dynamic callStatusDisc; - int? callTypeID; - String? clientRequestID; - String? clinicName; - String? consoltationEnd; - String? consultationNotes; - int? appointmentTypeId; - String? arrivedOn; - int? clinicGroupId; - String? companyName; + int callTypeID; + String clientRequestID; + String clinicName; + String consoltationEnd; + String consultationNotes; + int appointmentTypeId; + String arrivedOn; + int clinicGroupId; + String companyName; dynamic dischargeStatus; dynamic doctorDetails; - int? doctorId; - String? endTime; - int? episodeNo; - int? fallRiskScore; - bool? isSigned; - int? medicationOrders; - String? mobileNumber; - String? nationality; - int? projectId; - int? clinicId; + int doctorId; + String endTime; + int episodeNo; + int fallRiskScore; + bool isSigned; + int medicationOrders; + String mobileNumber; + String nationality; + int projectId; + int clinicId; dynamic patientId; - String? doctorName; - String? doctorNameN; - String? firstName; - String? middleName; - String? lastName; - String? firstNameN; - String? middleNameN; - String? lastNameN; - String? fullName; - String? fullNameN; - int? gender; - String? dateofBirth; - String? nationalityId; - String? emailAddress; - String? patientIdentificationNo; - int? patientType; - int? patientMRN; - String? admissionNo; - String? admissionDate; - DateTime? admissionDateWithDateTimeForm; - String? createdOn; - String? roomId; - String? bedId; - String? nursingStationId; - String? description; - String? clinicDescription; - String? clinicDescriptionN; - String? nationalityName; - String? nationalityNameN; - String? genderDescription; - String? nursingStationName; - String? startTime; - String? visitType; - String? nationalityFlagURL; - int? patientStatus; - int? patientStatusType; - int? visitTypeId; - String? startTimes; - String? dischargeDate; - int? status; - int? vcId; - String? voipToken; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + String fullName; + String fullNameN; + int gender; + String dateofBirth; + String nationalityId; + String emailAddress; + String patientIdentificationNo; + int patientType; + int patientMRN; + String admissionNo; + String admissionDate; + DateTime admissionDateWithDateTimeForm; + String createdOn; + String roomId; + String bedId; + String nursingStationId; + String description; + String clinicDescription; + String clinicDescriptionN; + String nationalityName; + String nationalityNameN; + String genderDescription; + String nursingStationName; + String startTime; + String visitType; + String nationalityFlagURL; + int patientStatus; + int patientStatusType; + int visitTypeId; + String startTimes; + String dischargeDate; + int status; + int vcId; + String voipToken; PatiantInformtion( {this.patientDetails, @@ -158,9 +158,7 @@ class PatiantInformtion { PatiantInformtion.fromJson(Map json) { { - patientDetails = json['patientDetails'] != null - ? new PatiantInformtion.fromJson(json['patientDetails']) - : null; + patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null; projectId = json["ProjectID"] ?? json["projectID"]; clinicId = json["ClinicID"] ?? json["clinicID"]; doctorId = json["DoctorID"] ?? json["doctorID"]; @@ -188,8 +186,7 @@ class PatiantInformtion { nationalityId = json["NationalityID"] ?? json["nationalityID"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"]; - patientIdentificationNo = - json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; //TODO make 7 dynamic when the backend retrun it in patient arrival patientType = json["PatientType"] ?? json["patientType"] ?? 1; admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; @@ -199,16 +196,10 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = - json["ClinicDescription"] ?? json["clinicDescription"]; - clinicDescriptionN = - json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; - nationalityName = json["NationalityName"] ?? - json["nationalityName"] ?? - json['NationalityName']; - nationalityNameN = json["NationalityNameN"] ?? - json["nationalityNameN"] ?? - json['NationalityNameN']; + clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName']; + nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN']; age = json["Age"] ?? json["age"]; genderDescription = json["GenderDescription"]; nursingStationName = json["NursingStationName"]; @@ -216,8 +207,7 @@ class PatiantInformtion { startTime = json["startTime"] ?? json['StartTime']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentType = json['appointmentType']; - appointmentTypeId = - json['appointmentTypeId'] ?? json['appointmentTypeid']; + appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; clinicGroupId = json['clinicGroupId']; companyName = json['companyName']; @@ -239,12 +229,9 @@ class PatiantInformtion { ? int?.parse(json["patientId"].toString()) : ''); visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; - nationalityFlagURL = - json['NationalityFlagURL'] ?? json['NationalityFlagURL']; - patientStatusType = - json['patientStatusType'] ?? json['PatientStatusType']; - visitTypeId = - json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; startTimes = json['StartTime'] ?? json['StartTime']; dischargeDate = json['DischargeDate']; status = json['Status']; @@ -267,9 +254,8 @@ class PatiantInformtion { ? AppDateUtils.convertStringToDate(json["admissionDate"]) : null; - appointmentDateWithDateTimeForm = json["AppointmentDate"] != null - ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) - : null; + appointmentDateWithDateTimeForm = + json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null; } } @@ -317,8 +303,7 @@ class PatiantInformtion { data["gender"] = this.gender; data['Age'] = this.age; - data['AppointmentDate'] = - this.appointmentDate!.isNotEmpty ? this.appointmentDate : null; + data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null; data['AppointmentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index c37cd72b..1d0da9c5 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -1,12 +1,12 @@ class GetPatientArrivalListRequestModel { - String? vidaAuthTokenID; - String? from; - String? to; - String? doctorID; - int? pageIndex; - int? pageSize; - int? clinicID; - int? patientMRN; + String vidaAuthTokenID; + String from; + String to; + String doctorID; + int pageIndex; + int pageSize; + int clinicID; + int patientMRN; GetPatientArrivalListRequestModel( {this.vidaAuthTokenID, @@ -40,6 +40,7 @@ class GetPatientArrivalListRequestModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; + return data; } } diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 27da32f1..7368c538 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -7,108 +7,110 @@ *@desc: */ class PatientModel { - int? ProjectID; - int? ClinicID; - int? DoctorID; - String? FirstName; + int ProjectID; + int ClinicID; + int DoctorID; + String FirstName; - String? MiddleName; - String? LastName; - String? PatientMobileNumber; - String? PatientIdentificationID; - int? PatientID; - String? From; - String? To; - int? LanguageID; - String? stamp; - String? IPAdress; - double? VersionID; - int? Channel; - String? TokenID; - String? SessionID; - bool? IsLoginForDoctorApp; - bool? PatientOutSA; - int? Searchtype; - String? IdentificationNo; - String? MobileNo; - int? get getProjectID => ProjectID; + String MiddleName; + String LastName; + String PatientMobileNumber; + String PatientIdentificationID; + int PatientID; + String From; + String To; + int LanguageID; + String stamp; + String IPAdress; + double VersionID; + int Channel; + String TokenID; + String SessionID; + bool IsLoginForDoctorApp; + bool PatientOutSA; + int Searchtype; + String IdentificationNo; + String MobileNo; + int get getProjectID => ProjectID; - set setProjectID(int? ProjectID) => this.ProjectID = ProjectID; + set setProjectID(int ProjectID) => this.ProjectID = ProjectID; - int? get getClinicID => ClinicID; + int get getClinicID => ClinicID; - set setClinicID(int? ClinicID) => this.ClinicID = ClinicID; + set setClinicID(int ClinicID) => this.ClinicID = ClinicID; - int? get getDoctorID => DoctorID; + int get getDoctorID => DoctorID; - set setDoctorID(int? DoctorID) => this.DoctorID = DoctorID; - String? get getFirstName => FirstName; + set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; + String get getFirstName => FirstName; - set setFirstName(String? FirstName) => this.FirstName = FirstName; + set setFirstName(String FirstName) => this.FirstName = FirstName; - String? get getMiddleName => MiddleName; + String get getMiddleName => MiddleName; - set setMiddleName(String? MiddleName) => this.MiddleName = MiddleName; + set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; - String? get getLastName => LastName; + String get getLastName => LastName; - set setLastName(String? LastName) => this.LastName = LastName; + set setLastName(String LastName) => this.LastName = LastName; - String? get getPatientMobileNumber => PatientMobileNumber; + String get getPatientMobileNumber => PatientMobileNumber; - set setPatientMobileNumber(String? PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; + set setPatientMobileNumber(String PatientMobileNumber) => + this.PatientMobileNumber = PatientMobileNumber; -// String? get getPatientIdentificationID => PatientIdentificationID; +// String get getPatientIdentificationID => PatientIdentificationID; -// set setPatientIdentificationID(String? PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; +// set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; - int? get getPatientID => PatientID; + int get getPatientID => PatientID; - set setPatientID(int? PatientID) => this.PatientID = PatientID; + set setPatientID(int PatientID) => this.PatientID = PatientID; - String? get getFrom => From; + String get getFrom => From; - set setFrom(String? From) => this.From = From; + set setFrom(String From) => this.From = From; - String? get getTo => To; + String get getTo => To; - set setTo(String? To) => this.To = To; + set setTo(String To) => this.To = To; - int? get getLanguageID => LanguageID; + int get getLanguageID => LanguageID; - set setLanguageID(int? LanguageID) => this.LanguageID = LanguageID; + set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; - String? get getStamp => stamp; + String get getStamp => stamp; - set setStamp(String? stamp) => this.stamp = stamp; + set setStamp(String stamp) => this.stamp = stamp; - String? get getIPAdress => IPAdress; + String get getIPAdress => IPAdress; - set setIPAdress(String? IPAdress) => this.IPAdress = IPAdress; + set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; - double? get getVersionID => VersionID; + double get getVersionID => VersionID; - set setVersionID(double? VersionID) => this.VersionID = VersionID; + set setVersionID(double VersionID) => this.VersionID = VersionID; - int? get getChannel => Channel; + int get getChannel => Channel; - set setChannel(int? Channel) => this.Channel = Channel; + set setChannel(int Channel) => this.Channel = Channel; - String? get getTokenID => TokenID; + String get getTokenID => TokenID; - set setTokenID(String? TokenID) => this.TokenID = TokenID; + set setTokenID(String TokenID) => this.TokenID = TokenID; - String? get getSessionID => SessionID; + String get getSessionID => SessionID; - set setSessionID(String? SessionID) => this.SessionID = SessionID; + set setSessionID(String SessionID) => this.SessionID = SessionID; - bool? get getIsLoginForDoctorApp => IsLoginForDoctorApp; + bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; - set setIsLoginForDoctorApp(bool? IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; + set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => + this.IsLoginForDoctorApp = IsLoginForDoctorApp; - bool? get getPatientOutSA => PatientOutSA; + bool get getPatientOutSA => PatientOutSA; - set setPatientOutSA(bool? PatientOutSA) => this.PatientOutSA = PatientOutSA; + set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; PatientModel( {this.ProjectID, @@ -135,12 +137,12 @@ class PatientModel { this.IdentificationNo, this.MobileNo}); - factory PatientModel.fromJson(Map json) => PatientModel( + factory PatientModel.fromJson(Map json) => PatientModel( FirstName: json["FirstName"], LastName: json["LasttName"], ); - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['ProjectID'] = this.ProjectID; data['ClinicID'] = this.ClinicID; data['DoctorID'] = this.DoctorID; diff --git a/lib/models/patient/prescription/prescription_report.dart b/lib/models/patient/prescription/prescription_report.dart index 10119e75..05d28bdc 100644 --- a/lib/models/patient/prescription/prescription_report.dart +++ b/lib/models/patient/prescription/prescription_report.dart @@ -1,70 +1,70 @@ class PrescriptionReport { - String? address; - int? appointmentNo; - String? clinic; - String? companyName; - int? days; - String? doctorName; - int? doseDailyQuantity; - String? frequency; - int? frequencyNumber; + String address; + int appointmentNo; + String clinic; + String companyName; + int days; + String doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; Null imageExtension; Null imageSRCUrl; Null imageString; Null imageThumbUrl; - String? isCovered; - String? itemDescription; - int? itemID; - String? orderDate; - int? patientID; - String? patientName; - String? phoneOffice1; + String isCovered; + String itemDescription; + int itemID; + String orderDate; + int patientID; + String patientName; + String phoneOffice1; Null prescriptionQR; - int? prescriptionTimes; + int prescriptionTimes; Null productImage; - String? productImageBase64; - String? productImageString; - int? projectID; - String? projectName; - String? remarks; - String? route; - String? sKU; - int? scaleOffset; - String? startDate; + String productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; PrescriptionReport( {this.address, - this.appointmentNo, - this.clinic, - this.companyName, - this.days, - this.doctorName, - this.doseDailyQuantity, - this.frequency, - this.frequencyNumber, - this.imageExtension, - this.imageSRCUrl, - this.imageString, - this.imageThumbUrl, - this.isCovered, - this.itemDescription, - this.itemID, - this.orderDate, - this.patientID, - this.patientName, - this.phoneOffice1, - this.prescriptionQR, - this.prescriptionTimes, - this.productImage, - this.productImageBase64, - this.productImageString, - this.projectID, - this.projectName, - this.remarks, - this.route, - this.sKU, - this.scaleOffset, - this.startDate}); + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); PrescriptionReport.fromJson(Map json) { address = json['Address']; diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index f6285885..21cb13b1 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,104 +1,104 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionReportForInPatient { - int? admissionNo; - int? authorizedBy; + int admissionNo; + int authorizedBy; Null bedNo; - String? comments; - int? createdBy; - String? createdByName; + String comments; + int createdBy; + String createdByName; Null createdByNameN; - String? createdOn; - String? direction; - int? directionID; + String createdOn; + String direction; + int directionID; Null directionN; - String? dose; - int? editedBy; + String dose; + int editedBy; Null iVDiluentLine; - int? iVDiluentType; + int iVDiluentType; Null iVDiluentVolume; Null iVRate; Null iVStability; - String? itemDescription; - int? itemID; - int? lineItemNo; - int? locationId; - int? noOfDoses; - int? orderNo; - int? patientID; - String? pharmacyRemarks; - DateTime? prescriptionDatetime; - int? prescriptionNo; - String? processedBy; - int? projectID; - int? refillID; - String? refillType; + String itemDescription; + int itemID; + int lineItemNo; + int locationId; + int noOfDoses; + int orderNo; + int patientID; + String pharmacyRemarks; + DateTime prescriptionDatetime; + int prescriptionNo; + String processedBy; + int projectID; + int refillID; + String refillType; Null refillTypeN; - int? reviewedPharmacist; + int reviewedPharmacist; Null roomId; - String? route; - int? routeId; + String route; + int routeId; Null routeN; Null setupID; - DateTime? startDatetime; - int? status; - String? statusDescription; + DateTime startDatetime; + int status; + String statusDescription; Null statusDescriptionN; - DateTime? stopDatetime; - int? unitofMeasurement; - String? unitofMeasurementDescription; + DateTime stopDatetime; + int unitofMeasurement; + String unitofMeasurementDescription; Null unitofMeasurementDescriptionN; PrescriptionReportForInPatient( {this.admissionNo, - this.authorizedBy, - this.bedNo, - this.comments, - this.createdBy, - this.createdByName, - this.createdByNameN, - this.createdOn, - this.direction, - this.directionID, - this.directionN, - this.dose, - this.editedBy, - this.iVDiluentLine, - this.iVDiluentType, - this.iVDiluentVolume, - this.iVRate, - this.iVStability, - this.itemDescription, - this.itemID, - this.lineItemNo, - this.locationId, - this.noOfDoses, - this.orderNo, - this.patientID, - this.pharmacyRemarks, - this.prescriptionDatetime, - this.prescriptionNo, - this.processedBy, - this.projectID, - this.refillID, - this.refillType, - this.refillTypeN, - this.reviewedPharmacist, - this.roomId, - this.route, - this.routeId, - this.routeN, - this.setupID, - this.startDatetime, - this.status, - this.statusDescription, - this.statusDescriptionN, - this.stopDatetime, - this.unitofMeasurement, - this.unitofMeasurementDescription, - this.unitofMeasurementDescriptionN}); + this.authorizedBy, + this.bedNo, + this.comments, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.direction, + this.directionID, + this.directionN, + this.dose, + this.editedBy, + this.iVDiluentLine, + this.iVDiluentType, + this.iVDiluentVolume, + this.iVRate, + this.iVStability, + this.itemDescription, + this.itemID, + this.lineItemNo, + this.locationId, + this.noOfDoses, + this.orderNo, + this.patientID, + this.pharmacyRemarks, + this.prescriptionDatetime, + this.prescriptionNo, + this.processedBy, + this.projectID, + this.refillID, + this.refillType, + this.refillTypeN, + this.reviewedPharmacist, + this.roomId, + this.route, + this.routeId, + this.routeN, + this.setupID, + this.startDatetime, + this.status, + this.statusDescription, + this.statusDescriptionN, + this.stopDatetime, + this.unitofMeasurement, + this.unitofMeasurementDescription, + this.unitofMeasurementDescriptionN}); - PrescriptionReportForInPatient.fromJson(Map json) { + PrescriptionReportForInPatient.fromJson(Map json) { admissionNo = json['AdmissionNo']; authorizedBy = json['AuthorizedBy']; bedNo = json['BedNo']; @@ -138,7 +138,7 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']); + startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ; status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; @@ -148,8 +148,8 @@ class PrescriptionReportForInPatient { unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AdmissionNo'] = this.admissionNo; data['AuthorizedBy'] = this.authorizedBy; data['BedNo'] = this.bedNo; diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/models/patient/prescription/prescription_req_model.dart new file mode 100644 index 00000000..9141c282 --- /dev/null +++ b/lib/models/patient/prescription/prescription_req_model.dart @@ -0,0 +1,71 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:PrescriptionReqModel + *@desc: PrescriptionReqModel class + */ +class PrescriptionReqModel { + int patientID; + int setupID; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + + PrescriptionReqModel( + {this.patientID, + this.setupID, + this.projectID, + this.languageID, + this.stamp = '2020-04-26T09:32:18.317Z', + this.iPAdress = '11.11.11.11', + this.versionID = 5.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.tokenID, + this.isLoginForDoctorApp = true, + this.patientOutSA = false, + this.patientTypeID}); + + PrescriptionReqModel.fromJson(Map json) { + patientID = json['PatientID']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/models/patient/prescription/prescription_res_model.dart index cc7fc44d..9c7e296d 100644 --- a/lib/models/patient/prescription/prescription_res_model.dart +++ b/lib/models/patient/prescription/prescription_res_model.dart @@ -6,39 +6,39 @@ *@desc: PrescriptionResModel class */ class PrescriptionResModel { - String? setupID; - int? projectID; - int? patientID; - int? appointmentNo; - String? appointmentDate; - String? doctorName; - String? clinicDescription; - String? name; - int? episodeID; - int? actualDoctorRate; - int? admission; - int? clinicID; - String? companyName; - String? despensedStatus; - String? dischargeDate; - int? dischargeNo; - int? doctorID; - String? doctorImageURL; - int? doctorRate; - String? doctorTitle; - int? gender; - String? genderDescription; - bool? isActiveDoctorProfile; - bool? isDoctorAllowVedioCall; - bool? isExecludeDoctor; - bool? isInOutPatient; - String? isInOutPatientDescription; - String? isInOutPatientDescriptionN; - bool? isInsurancePatient; - String? nationalityFlagURL; - int? noOfPatientsRate; - String? qR; - List? speciality; + String setupID; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + String doctorName; + String clinicDescription; + String name; + int episodeID; + int actualDoctorRate; + int admission; + int clinicID; + String companyName; + String despensedStatus; + String dischargeDate; + int dischargeNo; + int doctorID; + String doctorImageURL; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isInsurancePatient; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + List speciality; PrescriptionResModel( {this.setupID, @@ -75,7 +75,7 @@ class PrescriptionResModel { this.qR, this.speciality}); - PrescriptionResModel.fromJson(Map json) { + PrescriptionResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -111,8 +111,8 @@ class PrescriptionResModel { speciality = json['Speciality']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/models/patient/prescription/request_prescription_report.dart index 078fd874..0581692e 100644 --- a/lib/models/patient/prescription/request_prescription_report.dart +++ b/lib/models/patient/prescription/request_prescription_report.dart @@ -1,34 +1,34 @@ class RequestPrescriptionReport { - int? projectID; - int? appointmentNo; - int? episodeID; - String? setupID; - int? patientTypeID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int projectID; + int appointmentNo; + int episodeID; + String setupID; + int patientTypeID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; RequestPrescriptionReport( {this.projectID, - this.appointmentNo, - this.episodeID, - this.setupID, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.appointmentNo, + this.episodeID, + this.setupID, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); RequestPrescriptionReport.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/patient/profile/patient_profile_app_bar_model.dart b/lib/models/patient/profile/patient_profile_app_bar_model.dart deleted file mode 100644 index 97862aaa..00000000 --- a/lib/models/patient/profile/patient_profile_app_bar_model.dart +++ /dev/null @@ -1,91 +0,0 @@ -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; - Stream ?videoCallDurationStream; - - - 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, this.videoCallDurationStream}); - - 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']; - videoCallDurationStream = json['videoCallDurationStream']; - - } - - 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; - data['videoCallDurationStream'] = this.videoCallDurationStream; - return data; - } -} diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index aed886cb..13e1b571 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -1,4 +1,5 @@ -/* + +/* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -22,35 +23,33 @@ */ class ProgressNoteRequest { - int? visitType; - int? admissionNo; - int? projectID; - int? languageID; - String? stamp; - String? iPAdress; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; - double? versionID; - + int visitType; + int admissionNo; + int projectID; + int languageID; + String stamp; + String iPAdress; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; ProgressNoteRequest( - {this.visitType, + {this.visitType , this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID, + this.tokenID , this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, this.patientOutSA = false}); - ProgressNoteRequest.fromJson(Map json) { + ProgressNoteRequest.fromJson(Map json) { visitType = json['VisitType']; admissionNo = json['AdmissionNo']; projectID = json['ProjectID']; @@ -65,8 +64,8 @@ class ProgressNoteRequest { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['VisitType'] = this.visitType; data['AdmissionNo'] = this.admissionNo; data['ProjectID'] = this.projectID; @@ -81,4 +80,4 @@ class ProgressNoteRequest { data['PatientTypeID'] = this.patientTypeID; return data; } -} +} \ No newline at end of file diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/models/patient/radiology/radiology_req_model.dart index 3b510019..47154d8b 100644 --- a/lib/models/patient/radiology/radiology_req_model.dart +++ b/lib/models/patient/radiology/radiology_req_model.dart @@ -6,18 +6,18 @@ *@desc: RadiologyReqModel class */ class RadiologyReqModel { - int? patientID; - int? projectID; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; + int patientID; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; RadiologyReqModel( {this.patientID, @@ -33,7 +33,7 @@ class RadiologyReqModel { this.patientOutSA = false, this.patientTypeID}); - RadiologyReqModel.fromJson(Map json) { + RadiologyReqModel.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; languageID = json['LanguageID']; @@ -48,8 +48,8 @@ class RadiologyReqModel { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['LanguageID'] = this.languageID; diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/models/patient/radiology/radiology_res_model.dart index cf618dd7..6c6509a9 100644 --- a/lib/models/patient/radiology/radiology_res_model.dart +++ b/lib/models/patient/radiology/radiology_res_model.dart @@ -6,21 +6,21 @@ *@desc: RadiologyResModel class */ class RadiologyResModel { - String? setupID; - int? projectID; - int? patientID; - int? invoiceLineItemNo; - int? invoiceNo; - String? reportData; - String? imageURL; - int? clinicId; - int? doctorId; - String? reportDate; - String? clinicName; - String? doctorImageURL; - String? doctorName; - String? projectName; - dynamic statusDescription; + String setupID; + int projectID; + int patientID; + int invoiceLineItemNo; + int invoiceNo; + String reportData; + String imageURL; + int clinicId; + int doctorId; + String reportDate; + String clinicName; + String doctorImageURL; + String doctorName; + String projectName; + Null statusDescription; RadiologyResModel( {this.setupID, @@ -39,7 +39,7 @@ class RadiologyResModel { this.projectName, this.statusDescription}); - RadiologyResModel.fromJson(Map json) { + RadiologyResModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -57,8 +57,8 @@ class RadiologyResModel { statusDescription = json['StatusDescription']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/models/patient/reauest_prescription_report_for_in_patient.dart b/lib/models/patient/reauest_prescription_report_for_in_patient.dart index fe8bc3f1..857705c4 100644 --- a/lib/models/patient/reauest_prescription_report_for_in_patient.dart +++ b/lib/models/patient/reauest_prescription_report_for_in_patient.dart @@ -1,34 +1,34 @@ class RequestPrescriptionReportForInPatient { - int? patientID; - int? projectID; - int? admissionNo; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; + int patientID; + int projectID; + int admissionNo; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; RequestPrescriptionReportForInPatient( {this.patientID, - this.projectID, - this.admissionNo, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.projectID, + this.admissionNo, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); - RequestPrescriptionReportForInPatient.fromJson(Map json) { + RequestPrescriptionReportForInPatient.fromJson(Map json) { patientID = json['PatientID']; projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; @@ -44,8 +44,8 @@ class RequestPrescriptionReportForInPatient { patientTypeID = json['PatientTypeID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/models/patient/refer_to_doctor_request.dart index fc1fd80d..83db54f4 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/models/patient/refer_to_doctor_request.dart @@ -1,38 +1,40 @@ import 'package:flutter/cupertino.dart'; class ReferToDoctorRequest { -/* - *@author: Ibrahim Albitar - *@Date:03/06/2020 - *@param: + +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: *@return: *@desc: ReferToDoctor */ - int? projectID; - int? admissionNo; - String? roomID; - String? referralClinic; - String? referralDoctor; - int? createdBy; - int? editedBy; - int? patientID; - int? patientTypeID; - int? referringClinic; - int? referringDoctor; - String? referringDoctorRemarks; - String? priority; - String? frequency; - String? extension; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int projectID; + int admissionNo; + String roomID; + String referralClinic; + String referralDoctor; + int createdBy; + int editedBy; + int patientID; + int patientTypeID; + int referringClinic; + int referringDoctor; + String referringDoctorRemarks; + String priority; + String frequency; + String extension; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + /* { @@ -66,17 +68,17 @@ class ReferToDoctorRequest { ReferToDoctorRequest( {@required this.projectID, @required this.admissionNo, - @required this.roomID, + @required this.roomID , @required this.referralClinic, - @required this.referralDoctor, + @required this.referralDoctor , @required this.createdBy, - @required this.editedBy, + @required this.editedBy , @required this.patientID, @required this.patientTypeID, @required this.referringClinic, @required this.referringDoctor, @required this.referringDoctorRemarks, - @required this.priority, + @required this.priority , @required this.frequency, @required this.extension, this.languageID = 2, @@ -89,7 +91,7 @@ class ReferToDoctorRequest { this.isLoginForDoctorApp = true, this.patientOutSA = false}); - ReferToDoctorRequest.fromJson(Map json) { + ReferToDoctorRequest.fromJson(Map json) { projectID = json['ProjectID']; admissionNo = json['AdmissionNo']; roomID = json['RoomID']; diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/models/patient/request_my_referral_patient_model.dart index 21e725d2..219b7b2a 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/models/patient/request_my_referral_patient_model.dart @@ -1,24 +1,26 @@ + + class RequestMyReferralPatientModel { - int? projectID; - int? clinicID; - int? doctorID; - String? firstName; - String? middleName; - String? lastName; - String? patientMobileNumber; - String? patientIdentificationID; - int? patientID; - String? from; - String? to; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int projectID; + int clinicID; + int doctorID; + String firstName; + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; + int patientID; + String from; + String to; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; RequestMyReferralPatientModel( {this.projectID, @@ -32,17 +34,17 @@ class RequestMyReferralPatientModel { this.patientID = 0, this.from = "0", this.to = "0", - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, + this.languageID , + this.stamp , + this.iPAdress , + this.versionID , + this.channel , this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.sessionID , + this.isLoginForDoctorApp , + this.patientOutSA }); - RequestMyReferralPatientModel.fromJson(Map json) { + RequestMyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/models/patient/topten_users_res_model.dart index b1144d9a..3454568f 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/models/patient/topten_users_res_model.dart @@ -1,3 +1,4 @@ + /* *@author: Amjad Amireh *@Date:27/4/2020 @@ -7,23 +8,25 @@ *@desc: */ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; - //ModelResponse class ModelResponse { - final List? list; - String? firstName; + final List list; + String firstName; ModelResponse({ this.list, this.firstName, }); factory ModelResponse.fromJson(List parsedJson) { - List list = []; - + + + List list = new List(); + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); return new ModelResponse(list: list); } } -class PatiantInformtionl {} +class PatiantInformtionl { +} \ No newline at end of file diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index c02c2464..57133a08 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,68 +1,68 @@ class VitalSignData { - int? appointmentNo; - int? bloodPressureCuffLocation; - int? bloodPressureCuffSize; - int? bloodPressureHigher; - int? bloodPressureLower; - int? bloodPressurePatientPosition; + int appointmentNo; + int bloodPressureCuffLocation; + int bloodPressureCuffSize; + int bloodPressureHigher; + int bloodPressureLower; + int bloodPressurePatientPosition; var bodyMassIndex; - int? fio2; - int? headCircumCm; + int fio2; + int headCircumCm; var heightCm; - int? idealBodyWeightLbs; - bool? isPainManagementDone; - bool? isVitalsRequired; - int? leanBodyWeightLbs; - String? painCharacter; - String? painDuration; - String? painFrequency; - String? painLocation; - int? painScore; - int? patientMRN; - int? patientType; - int? pulseBeatPerMinute; - int? pulseRhythm; - int? respirationBeatPerMinute; - int? respirationPattern; - int? sao2; - int? status; + int idealBodyWeightLbs; + bool isPainManagementDone; + bool isVitalsRequired; + int leanBodyWeightLbs; + String painCharacter; + String painDuration; + String painFrequency; + String painLocation; + int painScore; + int patientMRN; + int patientType; + int pulseBeatPerMinute; + int pulseRhythm; + int respirationBeatPerMinute; + int respirationPattern; + int sao2; + int status; var temperatureCelcius; - int? temperatureCelciusMethod; + int temperatureCelciusMethod; var waistSizeInch; var weightKg; VitalSignData( {this.appointmentNo, - this.bloodPressureCuffLocation, - this.bloodPressureCuffSize, - this.bloodPressureHigher, - this.bloodPressureLower, - this.bloodPressurePatientPosition, - this.bodyMassIndex, - this.fio2, - this.headCircumCm, - this.heightCm, - this.idealBodyWeightLbs, - this.isPainManagementDone, - this.isVitalsRequired, - this.leanBodyWeightLbs, - this.painCharacter, - this.painDuration, - this.painFrequency, - this.painLocation, - this.painScore, - this.patientMRN, - this.patientType, - this.pulseBeatPerMinute, - this.pulseRhythm, - this.respirationBeatPerMinute, - this.respirationPattern, - this.sao2, - this.status, - this.temperatureCelcius, - this.temperatureCelciusMethod, - this.waistSizeInch, - this.weightKg}); + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressureHigher, + this.bloodPressureLower, + this.bloodPressurePatientPosition, + this.bodyMassIndex, + this.fio2, + this.headCircumCm, + this.heightCm, + this.idealBodyWeightLbs, + this.isPainManagementDone, + this.isVitalsRequired, + this.leanBodyWeightLbs, + this.painCharacter, + this.painDuration, + this.painFrequency, + this.painLocation, + this.painScore, + this.patientMRN, + this.patientType, + this.pulseBeatPerMinute, + this.pulseRhythm, + this.respirationBeatPerMinute, + this.respirationPattern, + this.sao2, + this.status, + this.temperatureCelcius, + this.temperatureCelciusMethod, + this.waistSizeInch, + this.weightKg}); VitalSignData.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -133,4 +133,5 @@ class VitalSignData { data['weightKg'] = this.weightKg; return data; } + } diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/models/patient/vital_sign/patient-vital-sign-history.dart index 9b125216..ed39a86e 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-history.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-history.dart @@ -25,9 +25,9 @@ class VitalSignHistory { var painDuration; var painCharacter; var painFrequency; - bool? isPainManagementDone; + bool isPainManagementDone; var status; - bool? isVitalsRequired; + bool isVitalsRequired; var patientID; var createdOn; var doctorID; @@ -242,7 +242,8 @@ class VitalSignHistory { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = + this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index c52cf838..8f5be6ba 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -1,25 +1,26 @@ -/* - *@author: Elham Rababah - *@Date:27/4/2020 - *@param: + +/* + *@author: Elham Rababah + *@Date:27/4/2020 + *@param: *@return: *@desc: VitalSignReqModel */ class VitalSignReqModel { - int? patientID; - int? projectID; - int? patientTypeID; - int? inOutpatientType; - int? transNo; - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; + int patientID; + int projectID; + int patientTypeID; + int inOutpatientType; + int transNo; + int languageID; + String stamp ; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; VitalSignReqModel( {this.patientID, @@ -29,13 +30,12 @@ class VitalSignReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress = '11.11.11.11', - - this.channel = 9, - this.sessionID = 'E2bsEeYEJo', - this.isLoginForDoctorApp = true, + this.iPAdress='11.11.11.11', + this.channel=9, + this.sessionID='E2bsEeYEJo', + this.isLoginForDoctorApp=true, this.patientTypeID, - this.patientOutSA = false}); + this.patientOutSA=false}); VitalSignReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -72,4 +72,5 @@ class VitalSignReqModel { data['PatientTypeID'] = this.patientTypeID; return data; } + } diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index e5af8aef..78af108d 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -34,17 +34,17 @@ class VitalSignResModel { var painDuration; var painCharacter; var painFrequency; - bool? isPainManagementDone; + bool isPainManagementDone; var status; - bool? isVitalsRequired; + bool isVitalsRequired; var patientID; - var createdOn; + var createdOn; var doctorID; var clinicID; var triageCategory; var gCScore; var lineItemNo; - DateTime? vitalSignDate; + DateTime vitalSignDate; var actualTimeTaken; var sugarLevel; var fBS; @@ -61,9 +61,9 @@ class VitalSignResModel { var bloodPressureCuffLocationDesc; var bloodPressureCuffSizeDesc; var bloodPressurePatientPositionDesc; - var clinicName; - var doctorImageURL; - var doctorName; + var clinicName; + var doctorImageURL; + var doctorName; var painScoreDesc; var pulseRhythmDesc; var respirationPatternDesc; @@ -170,8 +170,7 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = - json['VitalSignDate'] != null ? AppDateUtils.convertStringToDate(json['VitalSignDate']) : new DateTime.now(); + vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; @@ -252,7 +251,8 @@ class VitalSignResModel { data['BloodPressure'] = this.bloodPressure; data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; - data['BloodPressurePatientPositionDesc'] = this.bloodPressurePatientPositionDesc; + data['BloodPressurePatientPositionDesc'] = + this.bloodPressurePatientPositionDesc; data['ClinicName'] = this.clinicName; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorName'] = this.doctorName; diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/models/pending_orders/pending_order_request_model.dart index 47577b16..c69cf780 100644 --- a/lib/models/pending_orders/pending_order_request_model.dart +++ b/lib/models/pending_orders/pending_order_request_model.dart @@ -1,20 +1,20 @@ class PendingOrderRequestModel { - bool? isDentalAllowedBackend; - double? versionID; - int? channel; - int? languageID; - String? iPAdress; - String? generalid; - int? deviceTypeID; - String? tokenID; - int? patientID; - int? admissionNo; - String? sessionID; - int? projectID; - String? setupID; - bool? patientOutSA; - int? patientType; - int? patientTypeID; + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; PendingOrderRequestModel( {this.isDentalAllowedBackend, diff --git a/lib/models/pending_orders/pending_orders_model.dart b/lib/models/pending_orders/pending_orders_model.dart index 65f93f89..89525369 100644 --- a/lib/models/pending_orders/pending_orders_model.dart +++ b/lib/models/pending_orders/pending_orders_model.dart @@ -1,5 +1,5 @@ class PendingOrderModel { - String? notes; + String notes; PendingOrderModel({this.notes}); diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 48ef6c9c..a00e217a 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -1,3 +1,4 @@ + /* *@author: Ibrahim Albitar *@Date:27/4/2020 @@ -7,17 +8,17 @@ */ class PharmaciesListRequestModel { - int? itemID; - int? languageID; - String? stamp; - String? ipAdress; - double? versionID; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - bool? patientOutSA; - int? patientTypeID; - int? channel; + int itemID; + int languageID; + String stamp; + String ipAdress; + double versionID; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + int channel; PharmaciesListRequestModel( {this.itemID, @@ -60,4 +61,4 @@ class PharmaciesListRequestModel { data['Channel'] = this.channel; return data; } -} +} \ No newline at end of file diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index a8cd82c3..e81ce9b3 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -7,17 +7,17 @@ */ class PharmaciesItemsRequestModel { - String? pHRItemName; - int? pageIndex = 0; - int? pageSize = 20; - int? channel = 3; - int? languageID = 2; - String? iPAdress = "10.20.10.20"; - String? generalid = "Cs2020@2016\$2958"; - int? patientOutSA = 0; - String? sessionID = "KvFJENeAUCxyVdIfEkHw"; - bool? isDentalAllowedBackend = false; - int? deviceTypeID = 2; + String pHRItemName; + int pageIndex = 0; + int pageSize = 20; + int channel = 3; + int languageID = 2; + String iPAdress = "10.20.10.20"; + String generalid = "Cs2020@2016\$2958"; + int patientOutSA = 0; + String sessionID = "KvFJENeAUCxyVdIfEkHw"; + bool isDentalAllowedBackend = false; + int deviceTypeID = 2; PharmaciesItemsRequestModel( {this.pHRItemName, diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/models/sickleave/add_sickleave_request.dart index 05d839f1..d398153b 100644 --- a/lib/models/sickleave/add_sickleave_request.dart +++ b/lib/models/sickleave/add_sickleave_request.dart @@ -1,11 +1,16 @@ class AddSickLeaveRequest { - String? patientMRN; - String? appointmentNo; - String? startDate; - String? noOfDays; - String? remarks; + String patientMRN; + String appointmentNo; + String startDate; + String noOfDays; + String remarks; - AddSickLeaveRequest({this.patientMRN, this.appointmentNo, this.startDate, this.noOfDays, this.remarks}); + AddSickLeaveRequest( + {this.patientMRN, + this.appointmentNo, + this.startDate, + this.noOfDays, + this.remarks}); AddSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/models/sickleave/extend_sick_leave_request.dart index e25c2eb8..8b61eb90 100644 --- a/lib/models/sickleave/extend_sick_leave_request.dart +++ b/lib/models/sickleave/extend_sick_leave_request.dart @@ -1,10 +1,11 @@ class ExtendSickLeaveRequest { - String? patientMRN; - String? previousRequestNo; - String? noOfDays; - String? remarks; + String patientMRN; + String previousRequestNo; + String noOfDays; + String remarks; - ExtendSickLeaveRequest({this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); + ExtendSickLeaveRequest( + {this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); ExtendSickLeaveRequest.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index 7cfb292b..de831213 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -1,13 +1,13 @@ class GetAllSickLeaveResponse { - int? appointmentNo; - bool? isExtendedLeave; - int? noOfDays; - int? patientMRN; - String? remarks; - int? requestNo; - String? startDate; - int? status; - String? statusDescription; + int appointmentNo; + bool isExtendedLeave; + int noOfDays; + int patientMRN; + String remarks; + int requestNo; + String startDate; + int status; + String statusDescription; GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, diff --git a/lib/models/sickleave/sick_leave_statisitics_model.dart b/lib/models/sickleave/sick_leave_statisitics_model.dart index 179664a6..f679807c 100644 --- a/lib/models/sickleave/sick_leave_statisitics_model.dart +++ b/lib/models/sickleave/sick_leave_statisitics_model.dart @@ -1,12 +1,12 @@ class SickLeaveStatisticsModel { - String? recommendedSickLeaveDays; - int? totalLeavesByAllClinics; - int? totalLeavesByDoctor; + String recommendedSickLeaveDays; + int totalLeavesByAllClinics; + int totalLeavesByDoctor; SickLeaveStatisticsModel( {this.recommendedSickLeaveDays, - this.totalLeavesByAllClinics, - this.totalLeavesByDoctor}); + this.totalLeavesByAllClinics, + this.totalLeavesByDoctor}); SickLeaveStatisticsModel.fromJson(Map json) { recommendedSickLeaveDays = json['recommendedSickLeaveDays']; diff --git a/lib/root_page.dart b/lib/root_page.dart index f7955eff..35a3fa44 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -1,6 +1,8 @@ +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -11,11 +13,8 @@ import 'landing_page.dart'; class RootPage extends StatelessWidget { @override Widget build(BuildContext context) { - - AuthenticationViewModel authenticationViewModel = Provider.of(context); Widget buildRoot() { - switch (authenticationViewModel.status) { case APP_STATUS.LOADING: return Scaffold( @@ -23,9 +22,7 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNVERIFIED: - return VerificationMethodsScreen( - password: null, - ); + return VerificationMethodsScreen(password: null,); break; case APP_STATUS.UNAUTHENTICATED: return LoginScreen(); @@ -33,11 +30,6 @@ class RootPage extends StatelessWidget { case APP_STATUS.AUTHENTICATED: return LandingPage(); break; - default: - return Scaffold( - body: AppLoaderWidget(), - ); - break; } } diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index ba6215f2..9563b29c 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -2,26 +2,31 @@ 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'; import '../../widgets/shared/app_scaffold_widget.dart'; + class LoginScreen extends StatefulWidget { @override _LoginScreenState createState() => _LoginScreenState(); } class _LoginScreenState extends State { - late String platformImei; + String platformImei; bool allowCallApi = true; + //TODO change AppTextFormField to AppTextFormFieldCustom final loginFormKey = GlobalKey(); var projectIdController = TextEditingController(); var userIdController = TextEditingController(); @@ -29,171 +34,224 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - late AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); - double textFieldHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?10:SizeConfig.isHeightShort?8:6); return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), - body: SingleChildScrollView( - child: SafeArea( - child: Container( + body: SafeArea( + child: ListView(children: [ + Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - //TODO Use App Text rather than text - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Text( - TranslationBase.of(context).welcomeTo??"", - style: TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context).drSulaimanAlHabib!, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 6, - fontFamily: 'Poppins'), - ), - Text( - "Doctor App", - style: TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - fontWeight: FontWeight.w600, - color: Color(0xFFD02127)), - ), - ])), - SizedBox( - height: 40, - ), - Form( - key: loginFormKey, - child: Column( - 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); - }, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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: [ + 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'), + ), + + 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: [ + + 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).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: (){ + Helpers + .showCupertinoPicker( + context, + projectsList, + 'facilityName', + onSelectProject, + authenticationViewModel); + }, + + + ), + buildSizedBox() + ]), + ), + ], ), - buildSizedBox(), - ]), - ), - SizedBox( - height: 40, - ), - ], - )), - ), + ) + ], + ) + ])) + ]), ), bottomSheet: Container( -// color: Colors.green, - height: SizeConfig.heightMultiplier * 10, + + height: 90, width: double.infinity, child: Center( child: FractionallySizedBox( widthFactor: 0.9, child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.end, children: [ AppButton( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - hPadding: 1, - title: TranslationBase.of(context).login, + 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 buildSizedBox() { return SizedBox( - height: SizeConfig.heightMultiplier * 2, + height: 20, ); } - login( - context, - ) async { - if (loginFormKey.currentState!.validate()) { - loginFormKey.currentState!.save(); + login(context,) async { + if (loginFormKey.currentState.validate()) { + loginFormKey.currentState.save(); GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.login(authenticationViewModel.userInfo); if (authenticationViewModel.state == ViewState.ErrorLocal) { @@ -201,33 +259,39 @@ class _LoginScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - authenticationViewModel.setUnverified(true, isFromLogin: true); + authenticationViewModel.setUnverified(true,isFromLogin: true); + // Navigator.of(context).pushReplacement( + // MaterialPageRoute( + // builder: (BuildContext context) => + // VerificationMethodsScreen( + // password: authenticationViewModel.userInfo.password, + // isFromLogin: true, + // ), + // ), + // ); } } } onSelectProject(index) { setState(() { - authenticationViewModel.userInfo.projectID = - projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName!; + authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; + projectIdController.text = projectsList[index].facilityName; }); - primaryFocus!.unfocus(); + 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; - projectIdController.text = projectsList[0].facilityName!; + authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; + projectIdController.text = projectsList[0].facilityName; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 17aa4fdc..fc85db8f 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -1,5 +1,6 @@ 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'; @@ -14,99 +15,117 @@ 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(); -///TODO Elham* check if this still in user or not class VerificationMethodsScreen extends StatefulWidget { + + final password; - VerificationMethodsScreen({ - this.password, - }); + + VerificationMethodsScreen({this.password, }); @override _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); } class _VerificationMethodsScreenState extends State { - late ProjectViewModel projectsProvider; + + ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes? fingerPrintBefore; - late AuthMethodTypes selectedOption; - late AuthenticationViewModel authenticationViewModel; + AuthMethodTypes fingerPrintBefore; + AuthMethodTypes selectedOption; + AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); + + return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // baseViewModel: model, body: SingleChildScrollView( child: Center( child: FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child:Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4), - ), - 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( + child: Container( + margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + height: SizeConfig.realScreenHeight * .95, + width: SizeConfig.realScreenWidth, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4), + height: 80, ), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + if(authenticationViewModel.isFromLogin) + InkWell( + onTap: (){ + authenticationViewModel.setUnverified(false,isFromLogin: false); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) + + ), + Container( + + child: Column( + children: [ + SizedBox( + height: 20, + ), + authenticationViewModel.user != null && isMoreOption == false + ? Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText( TranslationBase.of(context).welcomeBack, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + fontSize:12, fontWeight: FontWeight.w700, color: Color(0xFF2B353E), ), AppText( - Helpers.capitalize(authenticationViewModel.user!.doctorName), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, + Helpers.capitalize(authenticationViewModel.user.doctorName), + fontSize: 24, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, ), SizedBox( - height: SizeConfig.heightMultiplier * 4, + height: 20, ), AppText( - TranslationBase.of(context).accountInfo, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + TranslationBase.of(context).accountInfo , + fontSize: 16, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, ), - SizedBox(height: SizeConfig.heightMultiplier * 4), + SizedBox( + height: 20, + ), Container( padding: EdgeInsets.all(15), decoration: BoxDecoration( @@ -114,216 +133,261 @@ class _VerificationMethodsScreenState extends State { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all(color: HexColor('#707070'), width: 0.1), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: SizeConfig.realScreenWidth * .5, - padding: EdgeInsets.all(0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, + Column( + children: [ + + Text( + TranslationBase.of(context) + .lastLoginAt, + overflow: + TextOverflow.ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700,), + + ), + Row( children: [ - Text( - TranslationBase.of(context).lastLoginAt!, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - ), + AppText( + TranslationBase + .of(context) + .verifyWith, + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, ), - 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, - ), - ) - ]), - ), + AppText( + authenticationViewModel.getType( + authenticationViewModel.user + .logInTypeID, + context), + fontSize: 14, + color: Color(0xFF2B353E), + + 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( + AppDateUtils.convertStringToDate(authenticationViewModel.user + .createdOn)) + : '--', + textAlign: + TextAlign.right, + fontSize: 13, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, ), - ), - 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!)) - : '--', - textAlign: TextAlign.right, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - 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: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], + 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: SizeConfig.heightMultiplier * 3, + ), + SizedBox( + height: 20, ), Row( children: [ - //todo add translation AppText( - "Please Verify", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, + "Please Verify", + fontSize: 16, color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), ], - ), - SizedBox( - height: SizeConfig.heightMultiplier * 2, - ), + ) ], ) - : Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + : 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: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - textAlign: TextAlign.left, - ), - ) + 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.getTextMultiplierBasedOnWidth() * 4, - textAlign: TextAlign.start, - ), + 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) + 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; - }); - }, - )) - ]), + 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: [ + : 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), - )) - ], - ) + 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, + mainAxisAlignment: + MainAxisAlignment.center, children: [ Expanded( child: VerificationMethodsList( - authenticationViewModel: authenticationViewModel, - authMethodType: AuthMethodTypes.SMS, - authenticateUser: (AuthMethodTypes authMethodType, isActive) => - authenticateUser(authMethodType, isActive), - )), + 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), - )) + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.WhatsApp, + authenticateUser: + ( + AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )) ], ), ]), - // ) + // ) + ], + ), + ), ], ), - ], ), ), ), @@ -341,7 +405,7 @@ class _VerificationMethodsScreenState extends State { SecondaryButton( label: TranslationBase .of(context) - .useAnotherAccount??'', + .useAnotherAccount, color: Color(0xFFD02127), //fontWeight: FontWeight.w700, onTap: () { @@ -358,12 +422,14 @@ class _VerificationMethodsScreenState extends State { ); } - sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { - if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { + sendActivationCodeByOtpNotificationType( + AuthMethodTypes authMethodType) async { + if (authMethodType == AuthMethodTypes.SMS || + authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.sendActivationCodeForDoctorApp( - authMethodType: authMethodType, password: authenticationViewModel.userInfo.password!); + + await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: authenticationViewModel.userInfo.password ); if (authenticationViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); @@ -382,15 +448,17 @@ class _VerificationMethodsScreenState extends State { sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.sendActivationCodeVerificationScreen(authMethodType); + await authenticationViewModel + .sendActivationCodeVerificationScreen(authMethodType); if (authenticationViewModel.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { await sharedPref.setString(TOKEN, - authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); - if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { + authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + if (authMethodType == AuthMethodTypes.SMS || + authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType,isSilentLogin: true); } else { @@ -400,10 +468,12 @@ class _VerificationMethodsScreenState extends State { } authenticateUser(AuthMethodTypes authMethodType, isActive) { - if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) { + if (authMethodType == AuthMethodTypes.Fingerprint || + authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = (fingerPrintBefore != null ? fingerPrintBefore : authMethodType)!; + this.selectedOption = + fingerPrintBefore != null ? fingerPrintBefore : authMethodType; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -413,7 +483,8 @@ class _VerificationMethodsScreenState extends State { sendActivationCode(authMethodType); break; case AuthMethodTypes.Fingerprint: - this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive); + this.loginWithFingerPrintOrFaceID( + AuthMethodTypes.Fingerprint, isActive); break; case AuthMethodTypes.FaceID: this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive); @@ -436,9 +507,7 @@ class _VerificationMethodsScreenState extends State { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null - ? authenticationViewModel.loggedUser!.mobileNumber - : authenticationViewModel.user!.mobile, + authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, (value) { showDialog( context: context, @@ -448,21 +517,23 @@ class _VerificationMethodsScreenState extends State { this.checkActivationCode(value: value,isSilentLogin: isSilentLogin); }, - () => { + () => + { print('Faild..'), }, ).displayDialog(context); } - - loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async { + loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, + isActive) async { if (isActive) { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && - (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == - AuthMethodTypes.Fingerprint || - SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == - AuthMethodTypes.FaceID)) { + (SelectedAuthMethodTypesService.getMethodsTypeService( + authenticationViewModel.user.logInTypeID) == + AuthMethodTypes.Fingerprint || + SelectedAuthMethodTypesService.getMethodsTypeService( + authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -472,8 +543,8 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String? value,bool isSilentLogin = false}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin); + checkActivationCode({String value,bool isSilentLogin = false}) async { + await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(authenticationViewModel.error); diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index 0cf174c7..7a5c93e6 100644 --- a/lib/screens/base/base_view.dart +++ b/lib/screens/base/base_view.dart @@ -5,11 +5,11 @@ import 'package:provider/provider.dart'; import '../../locator.dart'; class BaseView extends StatefulWidget { - final Widget Function(BuildContext context, T model, Widget? child) builder; - final Function(T)? onModelReady; + final Widget Function(BuildContext context, T model, Widget child) builder; + final Function(T) onModelReady; BaseView({ - required this.builder, + this.builder, this.onModelReady, }); @@ -18,14 +18,14 @@ class BaseView extends StatefulWidget { } class _BaseViewState extends State> { - T? model = locator(); + T model = locator(); bool isLogin = false; @override void initState() { if (widget.onModelReady != null) { - widget.onModelReady!(model!); + widget.onModelReady(model); } super.initState(); @@ -34,7 +34,7 @@ class _BaseViewState extends State> { @override Widget build(BuildContext context) { return ChangeNotifierProvider.value( - value: model!, + value: model, child: Consumer(builder: widget.builder), ); } diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 7088902b..5166d2b1 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -12,8 +12,9 @@ import 'package:flutter/material.dart'; import 'doctor_repaly_chat.dart'; class AllDoctorQuestions extends StatefulWidget { + final Function changeCurrentTab; - const AllDoctorQuestions({Key? key}) : super(key: key); + const AllDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key); @override _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); @@ -30,9 +31,10 @@ class _AllDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, + appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) + ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( @@ -80,7 +82,7 @@ class _AllDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex); } - return false; + return; }, ), ), diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index 39528c9c..52331e8e 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -7,11 +7,11 @@ 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/shared/TextFields.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/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget { final DoctorReplayViewModel previousModel; bool showMsgBox = false; DoctorReplayChat( - {Key? key, required this.reply, required this.previousModel, + {Key key, this.reply, this.previousModel, }); @override @@ -37,8 +37,8 @@ class _DoctorReplayChatState extends State { @override Widget build(BuildContext context) { - if(widget.reply.doctorResponse!.isNotEmpty){ - msgController.text = widget.reply.doctorResponse!; + if(widget.reply.doctorResponse.isNotEmpty){ + msgController.text = widget.reply.doctorResponse; } else { widget.showMsgBox = true; @@ -172,7 +172,7 @@ class _DoctorReplayChatState extends State { margin: EdgeInsets.symmetric(horizontal: 0), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber!); + launch("tel://" +widget.reply.mobileNumber); }, child: Icon( Icons.phone, @@ -194,7 +194,7 @@ class _DoctorReplayChatState extends State { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( - widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!)):AppDateUtils.getHour(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Colors.white, @@ -236,7 +236,7 @@ class _DoctorReplayChatState extends State { SizedBox(height: 30,), SizedBox(height: 30,), - if(widget.reply.doctorResponse != null && widget.reply.doctorResponse!.isNotEmpty) + if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) Align( alignment: Alignment.centerRight, child: Container( @@ -269,7 +269,7 @@ class _DoctorReplayChatState extends State { width: 50, height: 50, child: Image.asset( - widget.previousModel.doctorProfile!.gender == 0 + widget.previousModel.doctorProfile.gender == 0 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -280,7 +280,7 @@ class _DoctorReplayChatState extends State { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - widget.previousModel.doctorProfile!.doctorName, + widget.previousModel.doctorProfile.doctorName, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF2B353E), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 9bdfe49d..8b51319c 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -28,7 +28,7 @@ import 'not_replaied_Doctor_Questions.dart'; class DoctorReplyScreen extends StatefulWidget { final Function changeCurrentTab; - const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); @@ -36,7 +36,7 @@ class DoctorReplyScreen extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; + TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -69,7 +69,7 @@ class _DoctorReplyScreenState extends State return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2!, + appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -109,7 +109,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all!, + TranslationBase.of(context).all, ), ], ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index c48dbf08..69bb9ab2 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -18,7 +18,7 @@ class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; bool isShowMore = false; - DoctorReplyWidget({Key? key, required this.reply}); + DoctorReplyWidget({Key key, this.reply}); @override _DoctorReplyWidgetState createState() => _DoctorReplyWidgetState(); @@ -31,9 +31,10 @@ class _DoctorReplyWidgetState extends State { return Container( child: CardWithBgWidget( - bgColor:widget.reply.infoStatus == 99 + bgColor: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) - : widget.reply.infoStatus == 4 ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 4 + ? IN_PROGRESS_COLOR : widget.reply.infoStatus == 3 ? Color(0xFFD02127) : Colors.green[600], @@ -49,13 +50,14 @@ class _DoctorReplyWidgetState extends State { children: [ RichText( text: new TextSpan( - style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), children: [ new TextSpan( text: widget.reply.infoStatus == 99 - ? TranslationBase.of(context).notReplied - : widget.reply.infoStatus == 1 - ? TranslationBase.of(context).replayCallStatus + ? TranslationBase.of(context).notReplied:widget.reply.infoStatus == 1 + ? TranslationBase.of(context).replayCallStatus : widget.reply.infoStatus == 2 ? TranslationBase.of(context).patientArrived : widget.reply.infoStatus == 3 @@ -69,7 +71,8 @@ class _DoctorReplyWidgetState extends State { .textResponse : '', style: TextStyle( - color: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) + color: widget.reply.infoStatus == 99 + ? Color(0xFF2B353E) : widget.reply.infoStatus == 4 ? IN_PROGRESS_COLOR : widget.reply.infoStatus == 3 @@ -85,21 +88,35 @@ class _DoctorReplyWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).day.toString() + + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + " " + AppDateUtils.getMonth( - AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).month) + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) .toString() .substring(0, 3) + ' ' + - AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).year.toString(), + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), AppText( - AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).hour.toString() + + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .hour + .toString() + ":" + - AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).minute.toString(), + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .minute + .toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) @@ -122,7 +139,7 @@ class _DoctorReplyWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + widget.reply.mobileNumber!); + launch("tel://" + widget.reply.mobileNumber); }, child: Icon( Icons.phone, @@ -188,10 +205,10 @@ class _DoctorReplyWidgetState extends State { isCopyable:false, ), CustomRow( - label: TranslationBase.of(context).age! + " : ", + label: TranslationBase.of(context).age + " : ", isCopyable:false, value: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", ), SizedBox( height: 8, @@ -213,7 +230,7 @@ class _DoctorReplyWidgetState extends State { children: [ new TextSpan( text: - TranslationBase.of(context).requestType! + + TranslationBase.of(context).requestType + ": ", style: TextStyle( fontSize: SizeConfig diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 1416e70a..5b21809f 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart'; class NotRepliedDoctorQuestions extends StatefulWidget { final Function changeCurrentTab; - const NotRepliedDoctorQuestions({Key? key, required this.changeCurrentTab}) + const NotRepliedDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key); @override @@ -33,10 +33,10 @@ class _NotRepliedDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2!, + appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorNotRepliedQuestions.isEmpty - ? ErrorMessage(error: TranslationBase.of(context).noItem!) + ? ErrorMessage(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( @@ -91,7 +91,7 @@ class _NotRepliedDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); } - return false; + return; }, ), ), diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 23117bb8..5ef8b617 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -14,8 +14,9 @@ class PatientArrivalScreen extends StatefulWidget { _PatientArrivalScreen createState() => _PatientArrivalScreen(); } -class _PatientArrivalScreen extends State with SingleTickerProviderStateMixin { - late TabController _tabController; +class _PatientArrivalScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -23,8 +24,10 @@ class _PatientArrivalScreen extends State with SingleTicke PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), - To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd').toString(), + From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", @@ -51,7 +54,7 @@ class _PatientArrivalScreen extends State with SingleTicke Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).arrivalpatient ?? "", + appBarTitle: TranslationBase.of(context).arrivalpatient, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -63,7 +66,9 @@ class _PatientArrivalScreen extends State with SingleTicke width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( - bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7 + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -73,19 +78,22 @@ class _PatientArrivalScreen extends State with SingleTicke indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText(TranslationBase.of(context).arrivalpatient), + child: AppText( + TranslationBase.of(context).arrivalpatient), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: AppText(TranslationBase.of(context).rescheduleLeaves), + child: AppText( + TranslationBase.of(context).rescheduleLeaves), ), ), ], diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart deleted file mode 100644 index fd5ab744..00000000 --- a/lib/screens/home/dashboard_referral_patient.dart +++ /dev/null @@ -1,158 +0,0 @@ -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'; - -import 'label.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: false, - 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: [ - 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), - secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort - ? 5 - : SizeConfig.isHeightShort - ? 7 - : 12), - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort - ? 5 - : SizeConfig.isHeightShort - ? 10 - : 5)) - ], - ), - ), - 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! * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), - 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; - } -} diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 3c633430..4b7c4f46 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,11 +1,9 @@ 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/dashboard/activity_button.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; @@ -18,25 +16,20 @@ class DashboardSliderItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Label( - firstLine: Helpers.getLabelFromKPI(item.kPIName!), - secondLine: Helpers.getNameFromKPI(item.kPIName!), + AppText( + item.kPIName, + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.bold, ), ], ), new Container( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 16 - : SizeConfig.isHeightShort - ? 14 - : SizeConfig.isHeightLarge - ? 15 - : 13), + height: 110, child: ListView( scrollDirection: Axis.horizontal, - children: List.generate(item.summaryoptions!.length, (int index) { - return GetActivityCard(item.summaryoptions![index]); + children: + List.generate(item.summaryoptions.length, (int index) { + return GetActivityButton(item.summaryoptions[index]); }))) ], ); diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 8f51d553..66261292 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,13 +1,16 @@ 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'; +import 'package:charts_flutter/flutter.dart' as charts; class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; @@ -25,10 +28,8 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { - double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31); return Container( - height: height, + height: MediaQuery.of(context).size.height * 0.35, // height: 230, child: Swiper( onIndexChanged: (index) { @@ -40,11 +41,12 @@ class _DashboardSwipeWidgetState extends State { } }, itemBuilder: (BuildContext context, int index) { - return getSwipeWidget(widget.dashboardItemList, index, height); + return getSwipeWidget(widget.dashboardItemList, index); }, itemCount: 3, - - pagination: new SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) { + // itemHeight: 300, + pagination: new SwiperCustomPagination( + builder: (BuildContext context, SwiperPluginConfig config) { return new Stack( alignment: Alignment.bottomCenter, children: [ @@ -57,9 +59,15 @@ class _DashboardSwipeWidgetState extends State { 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), + config.activeIndex == 0 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 1 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), + config.activeIndex == 2 + ? SwiperRoundedPagination(true) + : SwiperRoundedPagination(false), ], ), ), @@ -76,20 +84,19 @@ class _DashboardSwipeWidgetState extends State { ); } - Widget getSwipeWidget(List dashboardItemList, int index, double height) { + Widget getSwipeWidget(List dashboardItemList, int index) { if (index == 1) return RoundedContainer( - raduis: 16, - showBorder: false, + raduis: 16, + showBorder: false, borderColor: Colors.white, shadowWidth: 0.1, shadowSpreadRadius: 2, 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], - ), - ), - ); + child: Padding( + padding: const EdgeInsets.all(5.0), + child: GetOutPatientStack(dashboardItemList[1]))); if (index == 0) return RoundedContainer( raduis: 16, @@ -99,14 +106,156 @@ class _DashboardSwipeWidgetState extends State { shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); + child: Padding( + padding: const EdgeInsets.all(5.0), + child: GetOutPatientStack(dashboardItemList[0]))); if (index == 2) - return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); + return RoundedContainer( + raduis: 16, + showBorder: false, + borderColor: Colors.white, + shadowWidth: 0.1, + shadowSpreadRadius: 2, + shadowDy: 1, + margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Expanded( + flex: 1, + child: Row( + 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: 12, + fontWeight: FontWeight.bold, + fontHeight: 0.5, + ), + AppText( + TranslationBase.of(context) + .referral, + fontSize: 22, + fontWeight: FontWeight.bold, + ), + ], + )), + 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), + ), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + 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: MediaQuery.of(context).size.height * 0.13, + left: 0, + right: 0) + ]), + ), + ], + )), + ])); 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_page_card.dart b/lib/screens/home/home_page_card.dart index 75d1b713..503bbe60 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -5,29 +5,31 @@ class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, this.imageName, - required this.child, - required this.onTap, - Key? key, - required this.color, + @required this.child, + this.onTap, + Key key, + this.color, this.opacity = 0.4, - required this.margin, this.width}) + this.margin}) : super(key: key); final bool hasBorder; - final String? imageName; + final String imageName; final Widget child; - final GestureTapCallback onTap; + 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: width, + width: 120, + height: MediaQuery.of(context).orientation == Orientation.portrait + ? 100 + : 200, margin: this.margin, - decoration: BoxDecoration( + decoration: BoxDecoration( color: !hasBorder ? color != null ? color @@ -41,7 +43,8 @@ class HomePageCard extends StatelessWidget { ? DecorationImage( image: AssetImage('assets/images/dashboard/$imageName'), fit: BoxFit.cover, - colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn), ) : null, ), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index a1a5f8f8..a0d0bce7 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -6,32 +6,29 @@ import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { final Color backgroundColor; final IconData cardIcon; - final String? cardIconImage; + final String cardIconImage; final Color backgroundIconColor; final String text; final Color textColor; - final GestureTapCallback onTap; + final Function onTap; final double iconSize; HomePatientCard({ - required this.backgroundColor, - required this.backgroundIconColor, - required this.cardIcon, - this.cardIconImage, - required this.text, - required this.textColor, - required this.onTap, - this.iconSize = 30, + @required this.backgroundColor, + @required this.backgroundIconColor, + this.cardIcon, + this.cardIconImage, + @required this.text, + @required this.textColor, + @required this.onTap, + this.iconSize = 30, }); @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* - (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( color: backgroundColor, - width: width, - margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), + margin: EdgeInsets.all(4), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -70,12 +67,11 @@ class HomePatientCard extends StatelessWidget { cardIcon != null ? Icon( cardIcon, - size: - SizeConfig.getWidthMultiplier(width: width) * 22, + size: iconSize, color: textColor, ) : Image.asset( - cardIconImage!, + cardIconImage, height: iconSize, width: iconSize, ), @@ -94,9 +90,7 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth(width: width) * - (SizeConfig.isHeightVeryShort ? 11 : 10), + fontSize: SizeConfig.textMultiplier * 1.6, ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 2d469daf..62988caa 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/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'; @@ -33,13 +32,12 @@ import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../routes.dart'; -import 'home_screen_header.dart'; -import 'label.dart'; +import '../../widgets/shared/app_texts_widget.dart'; class HomeScreen extends StatefulWidget { - HomeScreen({Key? key, this.title}) : super(key: key); + HomeScreen({Key key, this.title}) : super(key: key); - final String? title; + final String title; final String iconURL = 'assets/images/dashboard_icon/'; @override @@ -48,15 +46,15 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { bool isLoading = false; - ProjectViewModel? projectsProvider; - DoctorProfileModel? profile; + ProjectViewModel projectsProvider; + var _isInit = true; + DoctorProfileModel profile; bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - var clinicId; - late AuthenticationViewModel authenticationViewModel; + var clinicId; + AuthenticationViewModel authenticationViewModel; int colorIndex = 0; - final GlobalKey scaffoldKey = new GlobalKey(); @override Widget build(BuildContext context) { @@ -70,17 +68,12 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { - model.startHomeScreenServices(projectsProvider, authenticationViewModel); + model.startHomeScreenServices( + projectsProvider, authenticationViewModel); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBar: HomeScreenHeader( - model: model, - onOpenDrawer: () { - Scaffold.of(context).openDrawer(); - }, - ), + isShowAppBar: false, body: ListView(children: [ Column(children: [ StickyHeader( @@ -330,21 +323,21 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - List backgroundColors = []; - backgroundColors.add(Color(0xffD02127)); - backgroundColors.add(Colors.grey[300]!); - backgroundColors.add(Color(0xff2B353E)); + List backgroundColors = List(3); + backgroundColors[0] = Color(0xffD02127); + backgroundColors[1] = Colors.grey[300]; + backgroundColors[2] = Color(0xff2B353E); + List backgroundIconColors = List(3); + backgroundIconColors[0] = Colors.white12; + backgroundIconColors[1] = Colors.white38; + backgroundIconColors[2] = Colors.white10; + List textColors = List(3); + textColors[0] = Colors.white; + textColors[1] = Colors.black; + textColors[2] = Colors.white; - List backgroundIconColors = []; - backgroundIconColors.add(Colors.white12); - backgroundIconColors.add(Colors.white38); - backgroundIconColors.add(Colors.white10); + List patientCards = List(); - List textColors = []; - textColors.add(Colors.white); - textColors.add(Colors.black); - textColors.add(Colors.white); - List patientCards = []; if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], @@ -352,7 +345,8 @@ class _HomeScreenState extends State { cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], iconSize: 21, - text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", + text: + "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", onTap: () { // TODO MOSA TEST // PatiantInformtion patient = PatiantInformtion( @@ -387,13 +381,14 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.inpatient, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myInPatient!, + text: TranslationBase.of(context).myInPatient, onTap: () { Navigator.push( context, FadePage( page: InPatientScreen( - specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!)!, + specialClinic: model.getSpecialClinic( + clinicId ?? projectsProvider.doctorClinicsList[0].clinicID), ), ), ); @@ -407,7 +402,7 @@ class _HomeScreenState extends State { //TODO Elham* match the of the icon cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient!, + text: TranslationBase.of(context).registerNewPatient, onTap: () { Navigator.push( context, @@ -424,17 +419,21 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myOutPatient_2lines!, + text: TranslationBase.of(context).myOutPatient_2lines, onTap: () { String date = AppDateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); Navigator.push( context, MaterialPageRoute( builder: (context) => OutPatientsScreen( - patientSearchRequestModel: PatientSearchRequestModel( - from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID), + patientSearchRequestModel: PatientSearchRequestModel( + from: date, + to: date, + doctorID: authenticationViewModel.doctorProfile.doctorID), ), settings: RouteSettings(name: 'OutPatientsScreen'), )); @@ -447,7 +446,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.referral_1, textColor: textColors[colorIndex], - text: TranslationBase.of(context).myPatientsReferral!, + text: TranslationBase.of(context).myPatientsReferral, onTap: () { Navigator.push( context, @@ -465,7 +464,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search, textColor: textColors[colorIndex], - text: TranslationBase.of(context).searchPatientDashBoard!, + text: TranslationBase.of(context).searchPatientDashBoard, onTap: () { Navigator.push( context, @@ -482,7 +481,7 @@ class _HomeScreenState extends State { backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search_medicines, textColor: textColors[colorIndex], - text: TranslationBase.of(context).searchMedicineDashboard!, + text: TranslationBase.of(context).searchMedicineDashboard, onTap: () { Navigator.push( context, @@ -494,7 +493,10 @@ class _HomeScreenState extends State { )); changeColorIndex(); - return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()]; + return [ + ...List.generate(patientCards.length, (index) => patientCards[index]) + .toList() + ]; } changeColorIndex() { diff --git a/lib/screens/home/home_screen_header.dart b/lib/screens/home/home_screen_header.dart deleted file mode 100644 index 9b1aa63c..00000000 --- a/lib/screens/home/home_screen_header.dart +++ /dev/null @@ -1,219 +0,0 @@ -// 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:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:provider/provider.dart'; - -// ignore: must_be_immutable -class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget { - - final DashboardViewModel model; - final Function onOpenDrawer; - - double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 6); - - HomeScreenHeader({Key? key, required this.model, required this.onOpenDrawer}) : super(key: key); - - @override - _HomeScreenHeaderState createState() => _HomeScreenHeaderState(); - - @override - Size get preferredSize => Size(double.maxFinite,height); -} - -class _HomeScreenHeaderState extends State { - ProjectViewModel? projectsProvider; - int? clinicId; - - - AuthenticationViewModel? authenticationViewModel; - - - @override - Widget build(BuildContext context) { - ProjectViewModel projectsProvider = Provider.of(context); - authenticationViewModel = Provider.of(context); - - return widget.model.state == ViewState.Busy - ? Container(color: Colors.grey.withOpacity(0.65)) - : Container( - color: Colors.grey[100], - child: Stack(children: [ - IconButton( - icon: Icon(FontAwesomeIcons.ellipsisH), - iconSize: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?4: 3), - color: Colors.black, - onPressed: () { - widget.onOpenDrawer(); - }, - ), - Column( - children: [ - ProfileWelcomeWidget( - Row( - mainAxisAlignment: MainAxisAlignment.end, - 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, - crossAxisAlignment: CrossAxisAlignment.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 - .getHeightMultiplier( - height: widget.height) * - 35, - minHeight: SizeConfig - .getHeightMultiplier( - height: widget.height) * - 30, - ), - child: Center( - child: AppText( - projectsProvider - .doctorClinicsList - .length - .toString(), - color: - Colors.white, - fontSize: - projectsProvider - .isArabic - ? SizeConfig - .getHeightMultiplier( - height: widget.height) - : SizeConfig - .getHeightMultiplier( - height: widget - .height) * 20, - textAlign: - TextAlign - .center, - ), - )), - ], - ), - AppText(item.clinicName, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: MediaQuery - .of(context) - .size - .width * .6) * (SizeConfig.isWidthLarge?4:5), - color: Color(0xFF2B353E), - maxLines: 1, - maxLength: 2, - letterSpacing: -0.96, - textOverflow: TextOverflow - .ellipsis, - fontWeight: - FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (int? 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/screens/home/label.dart b/lib/screens/home/label.dart deleted file mode 100644 index 59c396ac..00000000 --- a/lib/screens/home/label.dart +++ /dev/null @@ -1,45 +0,0 @@ -// 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= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, - }) : super(key: key); - final String? firstLine; - final String? secondLine; - Color color; - final double? secondLineFontSize; - final double? firstLineFontSize; - - @override - Widget build(BuildContext context) { - - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - firstLine, - fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , - // fontWeight: FontWeight.bold, - color: color, - fontHeight: .5, - letterSpacing: -0.72, - fontWeight: FontWeight.w600, - ), - AppText( - secondLine, - color: color, - fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), - fontWeight: FontWeight.bold, - letterSpacing: -1.44, - - ), - ], - ); - } -} \ No newline at end of file diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index a9ab2d9f..62b97f2d 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -5,7 +5,6 @@ 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'; @@ -24,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; + final PatiantInformtion patient; - const EndCallScreen({Key? key, this.patient,}) : super(key: key); + const EndCallScreen({Key key, this.patient,}) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -34,15 +33,15 @@ class EndCallScreen extends StatefulWidget { class _EndCallScreenState extends State { bool isInpatient = false; - PatiantInformtion ?patient; + PatiantInformtion patient; bool isDischargedPatient = false; bool isSearchAndOut = false; - late String patientType; - late String arrivalType; - late String from; - late String to; + String patientType; + String arrivalType; + String from; + String to; - late LiveCarePatientViewModel liveCareModel; + LiveCarePatientViewModel liveCareModel; @override void initState() { super.initState(); @@ -53,7 +52,7 @@ class _EndCallScreenState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; if(routeArgs.containsKey('patient')) patient = routeArgs['patient']; } @@ -61,13 +60,15 @@ class _EndCallScreenState extends State { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).resume!, TranslationBase.of(context).theCall!, '', 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).resume, + TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.green[800]!, + color: Colors.green[800], onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.startCall(isReCall: false, vCID: patient!.vcId!).then((value) async { + await liveCareModel + .startCall(isReCall: false, vCID: patient.vcId) + .then((value) async { await liveCareModel.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { @@ -77,12 +78,12 @@ class _EndCallScreenState extends State { kToken: liveCareModel.startCallRes.openTokenID, kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', - vcId: patient!.vcId, + vcId: patient.vcId, isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording: false, - patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"), + patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, - doctorId: liveCareModel.doctorProfile!.doctorID, + doctorId: liveCareModel.doctorProfile.doctorID, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, @@ -90,19 +91,20 @@ class _EndCallScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient!.vcId!, + patient.vcId, false, - - );GifLoaderDialogUtils.hideDialog(context); + ); + GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } }, - onCallNotRespond: (SessionStatusModel sessionStatusModel) async { + onCallNotRespond: + (SessionStatusModel sessionStatusModel) async { GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCall( - patient!.vcId!, + patient.vcId, sessionStatusModel.sessionStatus == 3, ); GifLoaderDialogUtils.hideDialog(context); @@ -117,23 +119,26 @@ class _EndCallScreenState extends State { } }, isDartIcon: true, dartIcon: DoctorApp.call), PatientProfileCardModel( - TranslationBase.of(context).endLC!, TranslationBase.of(context).consultation!, '', 'patient/vital_signs.png', + TranslationBase.of(context).endLC, + TranslationBase.of(context).consultation, + '', + 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.red[800]!, + color: Colors.red[800], onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.getAlternativeServices(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(patient!.vcId!, isConfirmed); + await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -146,7 +151,10 @@ class _EndCallScreenState extends State { } }); }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), - PatientProfileCardModel(TranslationBase.of(context).sendLC!, TranslationBase.of(context).instruction!, "", + PatientProfileCardModel( + TranslationBase.of(context).sendLC, + TranslationBase.of(context).instruction, + "", 'patient/health_summary.png', onTap: () { Helpers.showConfirmationDialog(context, @@ -154,7 +162,7 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.sendSMSInstruction(patient!.vcId!); + await liveCareModel.sendSMSInstruction(patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -168,12 +176,20 @@ class _EndCallScreenState extends State { // isDisable: true, dartIcon: DoctorApp.send_instruction), PatientProfileCardModel( - TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!), + TranslationBase.of(context).transferTo, + TranslationBase.of(context).admin, + '', + 'patient/health_summary.png', onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + LivaCareTransferToAdmin(patient: patient), settings: RouteSettings(name: 'LivaCareTransferToAdmin'),),); - }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), + }, + isInPatient: isInpatient, + isDartIcon: true, + dartIcon: DoctorApp.transfer_to_admin), ]; return BaseView( @@ -182,12 +198,8 @@ 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( patient, @@ -196,8 +208,8 @@ class _EndCallScreenState extends State { }, isInpatient: isInpatient, - height: (patient!.patientStatusType != null && - patient!.patientStatusType == 43) + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -212,7 +224,8 @@ class _EndCallScreenState extends State { child: ListView( children: [ Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + padding: + const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -237,8 +250,9 @@ class _EndCallScreenState extends State { crossAxisCount: 3, itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient!, + itemBuilder: (BuildContext context, int index) => + PatientProfileButton( + patient: patient, patientType: patientType, arrivalType: arrivalType, from: from, @@ -248,13 +262,14 @@ class _EndCallScreenState extends State { route: cardsList[index].route, icon: cardsList[index].icon, isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, + isDischargedPatient: + cardsList[index].isDischargedPatient, isDisable: cardsList[index].isDisable, onTap: cardsList[index].onTap, isLoading: cardsList[index].isLoading, isDartIcon: cardsList[index].isDartIcon, dartIcon: cardsList[index].dartIcon, - color: cardsList[index].color, + color: cardsList[index].color, ), ), ], @@ -354,10 +369,10 @@ class _EndCallScreenState extends State { } class CheckBoxListWidget extends StatefulWidget { - final LiveCarePatientViewModel? model; + final LiveCarePatientViewModel model; const CheckBoxListWidget({ - Key? key, + Key key, this.model, }) : super(key: key); @@ -371,7 +386,7 @@ class _CheckBoxListState extends State { return SingleChildScrollView( child: Column( children: [ - ...widget.model!.alternativeServicesList + ...widget.model.alternativeServicesList .map( (element) => Container( child: CheckboxListTile( @@ -383,7 +398,7 @@ class _CheckBoxListState extends State { value: element.isSelected, onChanged: (newValue) { setState(() { - widget.model! + widget.model .setSelectedCheckboxValues(element, newValue); }); }, 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 00cb9579..233f59d8 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -23,20 +23,21 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class LivaCareTransferToAdmin extends StatefulWidget { final PatiantInformtion patient; - const LivaCareTransferToAdmin({Key? key, required this.patient}) : super(key: key); + const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key); @override - _LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState(); + _LivaCareTransferToAdminState createState() => + _LivaCareTransferToAdminState(); } class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; TextEditingController noteController = TextEditingController(); - late String noteError; + String noteError; void initState() { requestPermissions(); @@ -58,7 +59,8 @@ class _LivaCareTransferToAdminState extends State { onModelReady: (model) {}, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + appBarTitle: + "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, body: Container( @@ -82,13 +84,17 @@ class _LivaCareTransferToAdminState extends State { ), Positioned( top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), onPressed: () { - initSpeechState().then((value) => {onVoiceText()}); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ], @@ -99,31 +105,32 @@ class _LivaCareTransferToAdminState extends State { ), ), ButtonBottomSheet( - title: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + title: + "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", onPressed: () { setState(() { if (noteController.text.isEmpty) { - noteError = TranslationBase.of(context).emptyMessage!; + noteError = TranslationBase.of(context).emptyMessage; } else { - noteError = null!; + noteError = null; } if (noteController.text.isNotEmpty) { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - await 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(); - } - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + await 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(); + } + }); } }); }, @@ -138,7 +145,8 @@ class _LivaCareTransferToAdminState extends State { 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, @@ -182,7 +190,8 @@ class _LivaCareTransferToAdminState extends State { } 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; } diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 0e13c867..a9c7b38f 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -30,8 +30,8 @@ class LiveCarePatientScreen extends StatefulWidget { class _LiveCarePatientScreenState extends State { final _controller = TextEditingController(); - late Timer timer; - late LiveCarePatientViewModel _liveCareViewModel; + Timer timer; + LiveCarePatientViewModel _liveCareViewModel; @override void initState() { super.initState(); @@ -45,8 +45,8 @@ class _LiveCarePatientScreenState extends State { @override void dispose() { _liveCareViewModel.isLogin(0); - // _liveCareViewModel = null!; - timer.cancel(); + _liveCareViewModel = null; + timer?.cancel(); super.dispose(); } @@ -99,13 +99,11 @@ class _LiveCarePatientScreenState extends State { }, marginTop: 5, suffixIcon: IconButton( - onPressed: () {}, - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, ), ), model.state == ViewState.Idle @@ -115,7 +113,7 @@ class _LiveCarePatientScreenState extends State { ? Center( child: ErrorMessage( error: TranslationBase.of(context) - .youDontHaveAnyPatient!, + .youDontHaveAnyPatient, ), ) : ListView.builder( diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index a503ae74..f081479c 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -21,7 +21,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class LiveCarePandingListScreen extends StatefulWidget { // In the constructor, require a item id. - LiveCarePandingListScreen({Key? key}) : super(key: key); + LiveCarePandingListScreen({Key key}) : super(key: key); @override _LiveCarePandingListState createState() => _LiveCarePandingListState(); @@ -31,7 +31,7 @@ class _LiveCarePandingListState extends State { List _data = []; Helpers helpers = new Helpers(); bool _isInit = true; - late LiveCareViewModel _liveCareProvider; + LiveCareViewModel _liveCareProvider; @override void didChangeDependencies() { super.didChangeDependencies(); @@ -45,7 +45,7 @@ class _LiveCarePandingListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).livecare!, + appBarTitle: TranslationBase.of(context).livecare, body: Container( child: ListView(scrollDirection: Axis.vertical, @@ -61,11 +61,13 @@ class _LiveCarePandingListState extends State { ? Center( child: Text( _liveCareProvider.errorMsg, - style: TextStyle(color: Theme.of(context).errorColor), + style: TextStyle( + color: Theme.of(context).errorColor), ), ) : Column( - children: _liveCareProvider.liveCarePendingList.map((item) { + children: _liveCareProvider.liveCarePendingList + .map((item) { return Container( decoration: myBoxDecoration(), child: InkWell( @@ -84,28 +86,47 @@ class _LiveCarePandingListState extends State { Column( children: [ Container( - decoration: BoxDecoration( + decoration: + BoxDecoration( gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), + begin: Alignment( + -1, + -1), + end: Alignment( + 1, 1), colors: [ - Colors.grey[100]!, - Colors.grey[200]!, + Colors.grey[ + 100], + Colors.grey[ + 200], ]), boxShadow: [ BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) + color: Color.fromRGBO( + 0, + 0, + 0, + 0.08), + offset: Offset( + 0.0, + 5.0), + blurRadius: + 16.0) ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), + borderRadius: + BorderRadius.all( + Radius.circular( + 50.0)), ), width: 80, height: 80, child: Icon( - item.gender == "1" - ? DoctorApp.male - : DoctorApp.female_icon, + item.gender == + "1" + ? DoctorApp + .male + : DoctorApp + .female_icon, size: 80, )), ], @@ -114,28 +135,48 @@ class _LiveCarePandingListState extends State { width: 20, ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment + .start, children: [ AppText( item.patientName, - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + fontSize: 2.0 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight + .bold, ), SizedBox( height: 8, ), AppText( - TranslationBase.of(context).fileNo! + - item.patientID.toString(), - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + TranslationBase.of( + context) + .fileNo + + item.patientID + .toString(), + fontSize: 2.0 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight + .bold, ), AppText( - TranslationBase.of(context).age! + + TranslationBase.of( + context) + .age + ' ' + - item.age.toString(), - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + item.age + .toString(), + fontSize: 2.0 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight + .bold, ), SizedBox( height: 8, @@ -152,7 +193,8 @@ class _LiveCarePandingListState extends State { Icons.video_call, size: 40, ), - color: Colors.green, //Colors.black, + color: Colors + .green, //Colors.black, onPressed: () => { _isInit = true, // sharedPref.setObj( @@ -213,9 +255,9 @@ class _LiveCarePandingListState extends State { MyGlobals myGlobals = new MyGlobals(); class MyGlobals { - GlobalKey? _scaffoldKey; + GlobalKey _scaffoldKey; MyGlobals() { _scaffoldKey = GlobalKey(); } - GlobalKey get scaffoldKey => _scaffoldKey!; + GlobalKey get scaffoldKey => _scaffoldKey; } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index f62e3e11..e024624a 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -18,8 +18,7 @@ class VideoCallPage extends StatefulWidget { final PatiantInformtion patientData; final listContext; final LiveCarePatientViewModel model; - VideoCallPage( - {required this.patientData, this.listContext, required this.model}); + VideoCallPage({this.patientData, this.listContext, this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -28,10 +27,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - late Timer _timmerInstance; + Timer _timmerInstance; int _start = 0; String _timmer = ''; - late LiveCareViewModel _liveCareProvider; + LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -67,12 +66,8 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, - isRecording: tokenData != null ? tokenData.isRecording! : false, - patientName: widget.patientData.fullName != null - ? widget.patientData.fullName! - : widget.patientData.firstName != null - ? "${widget.patientData.firstName} ${widget.patientData.lastName}" - : "-", + isRecording: tokenData != null ? tokenData.isRecording: false, + patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], @@ -82,13 +77,13 @@ class _VideoCallPageState extends State { }, onCallEnd: () { //TODO handling onCallEnd - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { changeRoute(context); }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { //TODO handling onCalNotRespondEnd - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { changeRoute(context); }); }); @@ -141,7 +136,7 @@ class _VideoCallPageState extends State { height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.fullName!, + widget.patientData.fullName, style: TextStyle( color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, @@ -237,7 +232,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCall()}, child: - Text(TranslationBase.of(context).endcall!), + Text(TranslationBase.of(context).endcall), color: Colors.red, textColor: Colors.white, )), @@ -246,7 +241,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {resumeCall()}, child: - Text(TranslationBase.of(context).resumecall!), + Text(TranslationBase.of(context).resumecall), color: Colors.green[900], textColor: Colors.white, ), @@ -256,7 +251,7 @@ class _VideoCallPageState extends State { child: RaisedButton( onPressed: () => {endCallWithCharge()}, child: Text(TranslationBase.of(context) - .endcallwithcharge!), + .endcallwithcharge), textColor: Colors.white, ), ), @@ -267,7 +262,7 @@ class _VideoCallPageState extends State { setState(() => {isTransfer = true}) }, child: Text( - TranslationBase.of(context).transfertoadmin!), + TranslationBase.of(context).transfertoadmin), color: Colors.yellow[900], ), ), diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index 9b8450e3..b1ee901b 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_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/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'; @@ -19,23 +19,23 @@ class HealthSummaryPage extends StatefulWidget { } class _HealthSummaryPageState extends State { - late PatiantInformtion patient; + PatiantInformtion patient; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), - builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, + builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( + appBar: PatientProfileAppBar( + patient, isInpatient: isInpatient, ), isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -79,64 +79,62 @@ class _HealthSummaryPageState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines!.length, + itemCount: model.medicalFileList[0].entityList[0].timelines.length, itemBuilder: (BuildContext ctxt, int index) { return InkWell( - onTap: () async{ - if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0] - .consulations!.length != + onTap: () async { + if (model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] + .consulations.length != 0) await locator().logEvent( eventCategory: "Health Summary Page", eventAction: "Health Summary Details", - );Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicalFileDetails( - age: patient.age is String ? patient.age ?? "" : "${patient.age}", - firstName: patient.firstName ?? "", - lastName: patient.lastName ?? "", - gender: patient.genderDescription ?? "", - encounterNumber: index, - pp: patient.patientId, - patient: patient, - doctorName: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.isNotEmpty - ? model.medicalFileList[0].entityList![0].timelines![index].doctorName - : "", - clinicName: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.isNotEmpty - ? model.medicalFileList[0].entityList![0].timelines![index].clinicName - : "", - doctorImage: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.isNotEmpty - ? model.medicalFileList[0].entityList![0].timelines![index].doctorImage - : "", - episode: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.isNotEmpty - ? model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0] - .consulations![0].episodeID - .toString() - : "", - vistDate: model.medicalFileList[0].entityList![0].timelines![index].date - .toString()), + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MedicalFileDetails( + age: patient.age is String ? patient.age ?? "" : "${patient.age}", + firstName: patient.firstName, + lastName: patient.lastName, + gender: patient.genderDescription, + encounterNumber: index, + pp: patient.patientId, + patient: patient, + doctorName: model.medicalFileList[0].entityList[0].timelines[index] + .timeLineEvents[0].consulations.isNotEmpty + ? model.medicalFileList[0].entityList[0].timelines[index].doctorName + : "", + clinicName: model.medicalFileList[0].entityList[0].timelines[index] + .timeLineEvents[0].consulations.isNotEmpty + ? model.medicalFileList[0].entityList[0].timelines[index].clinicName + : "", + doctorImage: model.medicalFileList[0].entityList[0].timelines[index] + .timeLineEvents[0].consulations.isNotEmpty + ? model.medicalFileList[0].entityList[0].timelines[index].doctorImage + : "", + episode: model.medicalFileList[0].entityList[0].timelines[index] + .timeLineEvents[0].consulations.isNotEmpty + ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] + .consulations[0].episodeID + .toString() + : "", + vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()), settings: RouteSettings(name: 'MedicalFileDetails'), ), ); }, child: DoctorCard( - doctorName: - model.medicalFileList[0].entityList![0].timelines![index].doctorName ?? "", - clinic: model.medicalFileList[0].entityList![0].timelines![index].clinicName ?? "", - branch: model.medicalFileList[0].entityList![0].timelines![index].projectName ?? "", - profileUrl: - model.medicalFileList[0].entityList![0].timelines![index].doctorImage ?? "", + doctorName: model.medicalFileList[0].entityList[0].timelines[index].doctorName, + clinic: model.medicalFileList[0].entityList[0].timelines[index].clinicName, + branch: model.medicalFileList[0].entityList[0].timelines[index].projectName, + profileUrl: model.medicalFileList[0].entityList[0].timelines[index].doctorImage, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList![0].timelines![index].date ?? "", + model.medicalFileList[0].entityList[0].timelines[index].date, ), isPrescriptions: true, - isShowEye: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.length != + isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] + .consulations.length != 0 ? true : false), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 7fab2bd8..b53284a9 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'; @@ -21,24 +21,24 @@ class MedicalFileDetails extends StatefulWidget { int encounterNumber; int pp; PatiantInformtion patient; - String? clinicName; + String clinicName; String episode; - String? doctorName; + String doctorName; String vistDate; - String? doctorImage; + String doctorImage; MedicalFileDetails( - {required this.age, - required this.firstName, - required this.lastName, - required this.gender, - required this.encounterNumber, - required this.pp, - required this.patient, + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp, + this.patient, this.doctorName, - required this.vistDate, + this.vistDate, this.clinicName, - required this.episode, + this.episode, this.doctorImage}); @override @@ -50,11 +50,11 @@ class MedicalFileDetails extends StatefulWidget { encounterNumber: encounterNumber, pp: pp, patient: patient, - clinicName: clinicName!, - doctorName: doctorName!, + clinicName: clinicName, + doctorName: doctorName, episode: episode, vistDate: vistDate, - doctorImage: doctorImage!, + doctorImage: doctorImage, ); } @@ -73,64 +73,51 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {required this.age, - required this.firstName, - required this.lastName, - required this.gender, - required this.encounterNumber, - required this.pp, - required this.patient, - required this.doctorName, - required this.vistDate, - required this.clinicName, - required this.episode, - required this.doctorImage}); + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp, + this.patient, + this.doctorName, + this.vistDate, + this.clinicName, + this.episode, + this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; bool isAssessmentExpand = true; - PatientProfileAppBarModel? patientProfileAppBarModel; - ProjectViewModel? projectViewModel; - - @override - 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) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { if (model.medicalFileList.length == 0) { model.getMedicalFile(mrn: pp); } }, - builder: (BuildContext? context, MedicalFileViewModel? model, Widget? child) => AppScaffold( - patientProfileAppBarModel: patientProfileAppBarModel!, + 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(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -138,9 +125,14 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model!.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber].timeLineEvents![0] - .consulations!.length != + model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != 0 ? Padding( padding: EdgeInsets.all(10.0), @@ -149,81 +141,109 @@ class _MedicalFileDetailsState extends State { children: [ SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != 0) Container( width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all( + color: Colors.grey[200], + width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of(context) - .historyOfPresentIllness! + TranslationBase.of( + context) + .historyOfPresentIllness .toUpperCase(), - variant: isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : true, + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isHistoryExpand = !isHistoryExpand; + isHistoryExpand = + !isHistoryExpand; }); }, - child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isHistoryExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstCheifComplaint! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstCheifComplaint .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ Row( children: [ Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstCheifComplaint![index] - .hOPI! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstCheifComplaint[ + index] + .hOPI .trim(), ), ), - SizedBox(width: 35.0), + SizedBox( + width: 35.0), ], ), ], @@ -243,62 +263,86 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != 0) Container( width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all( + color: Colors.grey[200], + width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText(TranslationBase.of(context).assessment!.toUpperCase(), - variant: isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : true, + AppText( + TranslationBase.of( + context) + .assessment + .toUpperCase(), + variant: + isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isAssessmentExpand = !isAssessmentExpand; + isAssessmentExpand = + !isAssessmentExpand; }); }, - child: - Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isAssessmentExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ Row( children: [ @@ -308,39 +352,58 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] - .iCD10! + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .iCD10 .trim(), fontSize: 13.5, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), - SizedBox(width: 15.0), + SizedBox( + width: 15.0), ], ), Row( children: [ AppText( - TranslationBase.of(context).condition! + ": ", + TranslationBase.of( + context) + .condition + + ": ", fontSize: 12.5, ), Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] - .condition! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .condition .trim(), fontSize: 13.0, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ), ], @@ -350,14 +413,22 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] .description, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, fontSize: 15.0, ), ) @@ -366,21 +437,32 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - TranslationBase.of(context).type! + ": ", + TranslationBase.of( + context) + .type + + ": ", fontSize: 15.5, ), Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] .type, fontSize: 16.0, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ), ], @@ -390,13 +472,16 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstAssessments![index] - .remarks! + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[ + index] + .remarks .trim(), ), Divider( @@ -421,62 +506,85 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != 0) Container( width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all( + color: Colors.grey[200], + width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText(TranslationBase.of(context).test!.toUpperCase(), - variant: isProcedureExpand ? "bodyText" : '', - bold: isProcedureExpand ? true : true, + AppText( + TranslationBase.of( + context) + .test + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isProcedureExpand = !isProcedureExpand; + isProcedureExpand = + !isProcedureExpand; }); }, - child: - Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isProcedureExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment + .center, children: [ Row( children: [ @@ -487,39 +595,63 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] - .procedureId! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .procedureId .trim(), - fontSize: 13.5, - fontWeight: FontWeight.w700, + fontSize: + 13.5, + fontWeight: + FontWeight + .w700, ), ], ), - SizedBox(width: 35.0), + SizedBox( + width: 35.0), Column( children: [ AppText( - TranslationBase.of(context).orderDate! + ": ", + TranslationBase.of( + context) + .orderDate + + ": ", ), AppText( - AppDateUtils.getDateFormatted(DateTime.parse( + AppDateUtils.getDateFormatted( + DateTime + .parse( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] - .orderDate! + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .orderDate .trim(), )), - fontSize: 13.5, - fontWeight: FontWeight.w700, + fontSize: + 13.5, + fontWeight: + FontWeight + .w700, ), ], ), @@ -533,14 +665,22 @@ class _MedicalFileDetailsState extends State { Expanded( child: AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] .procName, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ) ], @@ -552,15 +692,22 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstProcedure![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] .patientID .toString(), - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ], ), @@ -589,59 +736,78 @@ class _MedicalFileDetailsState extends State { height: 30, ), if (model.medicalFileList.length != 0 && - model.medicalFileList[0].entityList![0].timelines![encounterNumber] - .timeLineEvents![0].consulations!.length != + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != 0) Container( width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all( + color: Colors.grey[200], + width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( - TranslationBase.of(context) - .physicalSystemExamination! + TranslationBase.of( + context) + .physicalSystemExamination .toUpperCase(), - variant: isPhysicalExam ? "bodyText" : '', - bold: isPhysicalExam ? true : true, + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isPhysicalExam = !isPhysicalExam; + isPhysicalExam = + !isPhysicalExam; }); }, - child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + child: Icon(isPhysicalExam + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam! + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam .length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext ctxt, + int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( @@ -649,17 +815,27 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText(TranslationBase.of(context).examType! + ": "), + AppText(TranslationBase.of( + context) + .examType + + ": "), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] .examDesc, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ], ), @@ -667,30 +843,47 @@ class _MedicalFileDetailsState extends State { children: [ AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] .examDesc, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ) ], ), Row( children: [ - AppText(TranslationBase.of(context).abnormal! + ": "), + AppText(TranslationBase.of( + context) + .abnormal + + ": "), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] .abnormal, - fontWeight: FontWeight.w700, + fontWeight: + FontWeight + .w700, ), ], ), @@ -699,12 +892,15 @@ class _MedicalFileDetailsState extends State { ), AppText( model - .medicalFileList[0] - .entityList![0] - .timelines![encounterNumber] - .timeLineEvents![0] - .consulations![0] - .lstPhysicalExam![index] + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[ + index] .remarks, ), Divider( diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index ec58385a..6ebb2fc8 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -32,7 +32,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function? changeLoadingState; + final Function changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -47,16 +47,17 @@ class _MedicineSearchState extends State { bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - late GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + GetMedicationResponseModel _selectedMedication; + GlobalKey key = + new GlobalKey>(); // String lastWords; List _localeNames = []; - late String lastError; + String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - late String reconizedWord; + String reconizedWord; @override void didChangeDependencies() { @@ -70,13 +71,15 @@ class _MedicineSearchState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); // if (hasSpeech) { // _localeNames = await speech.locales(); // var systemLocale = await speech.systemLocale(); - _currentLocaleId = - TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; + _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' + ? 'en-GB' + : 'ar-SA'; // systemLocale.localeId; // } if (!mounted) return; @@ -86,7 +89,9 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -119,7 +124,7 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchMedicine!, + appBarTitle: TranslationBase.of(context).searchMedicine, body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, @@ -135,8 +140,9 @@ class _MedicineSearchState extends State { FractionallySizedBox( widthFactor: 0.9, child: AppTextFieldCustomSearch( - hintText: TranslationBase.of(context).searchMedicineNameHere, - searchController: myController, + hintText: + TranslationBase.of(context).searchMedicineNameHere, + searchController: myController, onFieldSubmitted: (value) { searchMedicine(context, model); }, @@ -164,15 +170,18 @@ class _MedicineSearchState extends State { ), ), Container( - margin: EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), + margin: + EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).youCanFind! + - (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + + TranslationBase.of(context).youCanFind + + (myController.text != '' + ? model.pharmacyItemsList.length.toString() + : '0') + " " + - TranslationBase.of(context).itemsInSearch!, + TranslationBase.of(context).itemsInSearch, fontWeight: FontWeight.bold, ), ], @@ -189,20 +198,26 @@ class _MedicineSearchState extends State { scrollDirection: Axis.vertical, // shrinkWrap: true, - itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length, + itemCount: model.pharmacyItemsList == null + ? 0 + : model.pharmacyItemsList.length, itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model.pharmacyItemsList[index]["ItemDescription"], - url: model.pharmacyItemsList[index]["ImageSRCUrl"], + label: model.pharmacyItemsList[index] + ["ItemDescription"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"], ), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PharmaciesListScreen( - itemID: model.pharmacyItemsList[index]["ItemID"], - url: model.pharmacyItemsList[index]["ImageSRCUrl"]), + itemID: model.pharmacyItemsList[index] + ["ItemID"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"]), settings: RouteSettings( name: 'PharmaciesListScreen'), ), diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 764a19f6..49c39c53 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,7 +23,8 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - PharmaciesListScreen({Key? key, required this.itemID, required this.url}) : super(key: key); + PharmaciesListScreen({Key key, @required this.itemID, this.url}) + : super(key: key); @override _PharmaciesListState createState() => _PharmaciesListState(); @@ -31,7 +32,8 @@ class PharmaciesListScreen extends StatefulWidget { class _PharmaciesListState extends State { Helpers helpers = new Helpers(); - late ProjectViewModel projectsProvider; + ProjectViewModel projectsProvider; + @override Widget build(BuildContext context) { @@ -40,7 +42,7 @@ class _PharmaciesListState extends State { onModelReady: (model) => model.getPharmaciesList(widget.itemID), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList!, + appBarTitle: TranslationBase.of(context).pharmaciesList, body: Container( height: SizeConfig.screenHeight, child: ListView( @@ -50,64 +52,71 @@ class _PharmaciesListState extends State { children: [ model.pharmaciesList.length > 0 ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7)), - child: widget.url != null - ? Image.network( - widget.url, - height: SizeConfig.imageSizeMultiplier * 21, - width: SizeConfig.imageSizeMultiplier * 20, - fit: BoxFit.cover, - ) - : Container(), - ), + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: widget.url != null + ? Image.network( + widget.url, + height: + SizeConfig.imageSizeMultiplier * + 21, + width: + SizeConfig.imageSizeMultiplier * + 20, + fit: BoxFit.cover, + ): Container(), ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - AppText( - TranslationBase.of(context).description, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - TranslationBase.of(context).price, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["SellingPrice"].toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - ), - ) - ], - )) - : Container(), + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + AppText( + TranslationBase.of(context) + .description, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["ItemDescription"], + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + AppText( + TranslationBase.of(context).price, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + model.pharmaciesList[0]["SellingPrice"] + .toString(), + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + ], + ), + ) + ], + )): Container(), Container( margin: EdgeInsets.only( top: SizeConfig.widthMultiplier * 2, @@ -122,15 +131,18 @@ class _PharmaciesListState extends State { fontWeight: FontWeight.bold, ), ), - alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, ), Container( width: SizeConfig.screenWidth * 0.99, - margin: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.only(left: 10,right: 10), child: ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model.pharmaciesList.length, + itemCount: model.pharmaciesList == null ? 0 : model + .pharmaciesList.length, itemBuilder: (BuildContext context, int index) { return RoundedContainer( margin: EdgeInsets.only(top: 5), @@ -139,11 +151,15 @@ class _PharmaciesListState extends State { Expanded( flex: 1, child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7)), + borderRadius: + BorderRadius.all(Radius.circular(7)), child: Image.network( - model.pharmaciesList[index]["ProjectImageURL"], - height: SizeConfig.imageSizeMultiplier * 15, - width: SizeConfig.imageSizeMultiplier * 15, + model + .pharmaciesList[index]["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, ), ), @@ -151,7 +167,8 @@ class _PharmaciesListState extends State { Expanded( flex: 4, child: AppText( - model.pharmaciesList[index]["LocationDescription"], + model + .pharmaciesList[index]["LocationDescription"], margin: 10, ), ), @@ -169,7 +186,10 @@ class _PharmaciesListState extends State { Icons.call, color: Colors.red, ), - onTap: () => launch("tel://" + model.pharmaciesList[index]["PhoneNumber"]), + onTap: () => + launch("tel://" + + model + .pharmaciesList[index]["PhoneNumber"]), ), ), Padding( @@ -181,9 +201,14 @@ class _PharmaciesListState extends State { ), onTap: () { MapsLauncher.launchCoordinates( - double.parse(model.pharmaciesList[index]["Latitude"]), - double.parse(model.pharmaciesList[index]["Longitude"]), - model.pharmaciesList[index]["LocationDescription"]); + double.parse( + model + .pharmaciesList[index]["Latitude"]), + double.parse( + model + .pharmaciesList[index]["Longitude"]), + model.pharmaciesList[index] + ["LocationDescription"]); }, ), ), @@ -196,18 +221,18 @@ class _PharmaciesListState extends State { }), ) ]), - ), - ), - ); + ),),); } + Image imageFromBase64String(String base64String) { return Image.memory(base64Decode(base64String)); } //TODO CHECK THE URL IS NULL OR NOT - Uint8List? dataFromBase64String(String base64String) { - if (base64String != null) return base64Decode(base64String); + Uint8List dataFromBase64String(String base64String) { + if(base64String !=null) + return base64Decode(base64String); } String base64String(Uint8List data) { diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 9f42bbca..8c9f0f1d 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -38,7 +38,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget { AddPatientSickLeaveScreen( {this.appointmentNo, this.patientMRN, - required this.patient, required this.previousModel}); + this.patient, this.previousModel}); @override _AddPatientSickLeaveScreenState createState() => @@ -52,7 +52,7 @@ class _AddPatientSickLeaveScreenState extends State { TextEditingController _clinicController = new TextEditingController(); TextEditingController _doctorController = new TextEditingController(); TextEditingController _remarkController = new TextEditingController(); - late DateTime currentDate; + DateTime currentDate; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); bool isFormSubmitted = false; @@ -85,8 +85,8 @@ class _AddPatientSickLeaveScreenState extends State { return BaseView( onModelReady: (model) async { await model.getDoctorProfile(); - _clinicController.text = model.doctorProfile!.clinicDescription!; - _doctorController.text = model.doctorProfile!.doctorName!; + _clinicController.text = model.doctorProfile.clinicDescription; + _doctorController.text = model.doctorProfile.doctorName; await model.preSickLeaveStatistics( widget.appointmentNo, widget.patientMRN); }, @@ -97,7 +97,7 @@ class _AddPatientSickLeaveScreenState extends State { child: AppScaffold( baseViewModel: model, appBar: BottomSheetTitle( - title: TranslationBase.of(context).addSickLeave!, + title: TranslationBase.of(context).addSickLeave, ), isShowAppBar: true, body: Center( @@ -112,9 +112,9 @@ class _AddPatientSickLeaveScreenState extends State { ), AppTextFieldCustom( height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).sickLeave! + + hintText: TranslationBase.of(context).sickLeave + ' ' + - TranslationBase.of(context).days!, + TranslationBase.of(context).days, maxLines: 1, minLines: 1, dropDownColor: Colors.white, @@ -154,7 +154,7 @@ class _AddPatientSickLeaveScreenState extends State { minLines: 1, isTextFieldHasSuffix: true, suffixIcon: IconButton( - icon: Icon(Icons.calendar_today), onPressed: () { },), + icon: Icon(Icons.calendar_today)), inputFormatters: [ FilteringTextInputFormatter.allow( RegExp(ONLY_NUMBERS)) diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index a1817985..51c5b35b 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -23,13 +23,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientSickLeaveScreen extends StatelessWidget { - late PatiantInformtion patient; + PatiantInformtion patient; @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( @@ -84,7 +84,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ), ), AddNewOrder( - label: TranslationBase.of(context).noSickLeaveApplied!, + label: TranslationBase.of(context).noSickLeaveApplied, onTap: () async { await locator().logEvent( eventCategory: "Add Sick Leave Screen" @@ -193,7 +193,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .startDate! + + .startDate + ' ' ?? "", labelSize: SizeConfig @@ -217,7 +217,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .endDate! + + .endDate + ' ' ?? "", labelSize: SizeConfig @@ -269,7 +269,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ) : patient.patientStatusType != 43 ? ErrorMessage( - error: TranslationBase.of(context).noSickLeave!, + error: TranslationBase.of(context).noSickLeave, ) : SizedBox(), SizedBox( diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 83e8376a..6791785a 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -59,6 +59,7 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ + SizedBox( height: 12, ), @@ -69,7 +70,6 @@ class _DischargedPatientState extends State { }, marginTop: 0, suffixIcon: IconButton( - onPressed: () {}, icon: Icon( DoctorApp.filter_1, color: Colors.black, @@ -170,14 +170,14 @@ class _DischargedPatientState extends State { ? model .filterData[ index] - .nationalityName! + .nationalityName .trim() : model.filterData[index].nationality != null ? model .filterData[ index] - .nationality! + .nationality .trim() : model.filterData[index].nationalityId != null @@ -203,7 +203,7 @@ class _DischargedPatientState extends State { .network( model.filterData[index].nationalityFlagURL != null - ? model.filterData[index].nationalityFlagURL! + ? model.filterData[index].nationalityFlagURL : '', height: 25, @@ -320,7 +320,7 @@ class _DischargedPatientState extends State { text: model.filterData[index].admissionDate == null ? "" - : TranslationBase.of(context).admissionDate! + + : TranslationBase.of(context).admissionDate + " : ", style: TextStyle( fontSize: @@ -385,7 +385,7 @@ class _DischargedPatientState extends State { .w300, ), AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}", + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", fontSize: 15, fontWeight: diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 138559d4..ba4c108c 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'; @@ -17,20 +17,21 @@ import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), + onModelReady: (model) => model.getECGPatient( + patientType: patient.patientType, + patientOutSA: 0, + patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Color(0xffF8F8F8), - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), @@ -38,105 +39,84 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox( - height: 12, - ), - AppText( - 'Service', - style: "caption2", - color: Colors.black, - ), - AppText( - 'ECG', - bold: true, - fontSize: 22, - ), - SizedBox( - height: 12, - ), - ...List.generate( - model.patientMuseResultsModelList.length, - (index) => InkWell( - onTap: () async { - await launch(model.patientMuseResultsModelList[index].imageURL ?? ""); - }, - child: Container( - width: double.infinity, - height: 120, - margin: EdgeInsets.only(top: 5, bottom: 5), - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all(color: Colors.white, width: 2), - color: Colors.white, - borderRadius: BorderRadius.circular(8)), - child: Column( - children: [ - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'ECG Report', - fontWeight: FontWeight.w700, - fontSize: 17, - ), - SizedBox(height: 3), - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).orderNo, - style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), - new TextSpan( - text: - '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', - style: TextStyle( - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - fontSize: 14)), - ], - ), - ) - ], - ), + SizedBox(height: 12,), + AppText('Service',style: "caption2",color: Colors.black,), + AppText('ECG',bold: true,fontSize: 22,), + SizedBox(height: 12,), + ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( + onTap: () async { + await launch( + model.patientMuseResultsModelList[index].imageURL); + }, + child: Container( + width: double.infinity, + height: 120, + margin: EdgeInsets.only(top: 5,bottom: 5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all(color: Colors.white,width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8) + ), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + SizedBox(height:3), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).orderNo, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', + style: TextStyle( + fontWeight: FontWeight.w600, + fontFamily: + 'Poppins', + fontSize: 14)), + ], ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime ?? DateTime.now())}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], - fontSize: 14, - ), - ], - ), - ), - ], - ), - SizedBox( - height: 15, - ), - Align( - alignment: Alignment.topRight, - child: Icon(DoctorApp.external_link), - ) - ], + ) + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + ], + ), ), - ), - )), + ], + ), + SizedBox(height: 15,), + Align( + alignment: Alignment.topRight, + child: Icon(DoctorApp.external_link), + ) + ], + ), + ), + )), + ], ), ), diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index 3ee29b28..f2d0f74e 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -10,8 +10,8 @@ import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { InPatientHeader( - {required this.model, - required this.specialClinic, + {this.model, + this.specialClinic, this.activeTab, this.selectedMapId, this.onChangeFunc}) diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 89f7c65e..0c48cd2a 100644 --- a/lib/screens/patients/In_patient/NoData.dart +++ b/lib/screens/patients/In_patient/NoData.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class NoData extends StatelessWidget { const NoData({ - Key? key, + Key key, }) : super(key: key); @override @@ -13,7 +13,7 @@ class NoData extends StatelessWidget { child: SingleChildScrollView( child: Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable!)), + error: TranslationBase.of(context).noDataAvailable)), ), ); } diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index edbdd113..6e9ad14f 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -25,12 +25,12 @@ class InPatientListPage extends StatefulWidget { final Function onChangeValue; InPatientListPage( - {required this.isMyInPatient, - required this.patientSearchViewModel, - required this.selectedClinicName, - required this.onChangeValue, - required this.isAllClinic, - required this.showBottomSheet}); + {this.isMyInPatient, + this.patientSearchViewModel, + this.selectedClinicName, + this.onChangeValue, + this.isAllClinic, + this.showBottomSheet}); @override _InPatientListPageState createState() => _InPatientListPageState(); @@ -279,7 +279,7 @@ class _InPatientListPageState extends State { .patientSearchViewModel .InpatientClinicList[index]); widget.patientSearchViewModel - .filterByClinic(clinicName: value.toString()); + .filterByClinic(clinicName: value); }); }, activeColor: Colors.red, diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 940cc9e8..ef9f8b03 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -24,8 +24,8 @@ class InPatientScreen extends StatefulWidget { bool isAllClinic = true; bool showBottomSheet = false; - late String selectedClinicName; - InPatientScreen({Key? key, required this.specialClinic}); + String selectedClinicName; + InPatientScreen({Key key, this.specialClinic}); @override _InPatientScreenState createState() => _InPatientScreenState(); @@ -33,9 +33,9 @@ class InPatientScreen extends StatefulWidget { class _InPatientScreenState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; + TabController _tabController; int _activeTab = 0; - late int selectedMapId; + int selectedMapId; @override void initState() { @@ -79,7 +79,7 @@ class _InPatientScreenState extends State builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: InPatientHeader( + appBar: InPatientHeader( model: model, selectedMapId: selectedMapId, specialClinic: widget.specialClinic, @@ -136,13 +136,13 @@ class _InPatientScreenState extends State unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll!, + TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 1, - TranslationBase.of(context).myInPatientTitle!, + TranslationBase.of(context).myInPatientTitle, counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged!), + TranslationBase.of(context).discharged), ], ), ), diff --git a/lib/screens/patients/In_patient/list_of_all_in_patient.dart b/lib/screens/patients/In_patient/list_of_all_in_patient.dart index b29aafa2..06634819 100644 --- a/lib/screens/patients/In_patient/list_of_all_in_patient.dart +++ b/lib/screens/patients/In_patient/list_of_all_in_patient.dart @@ -7,10 +7,10 @@ import 'NoData.dart'; class ListOfAllInPatient extends StatelessWidget { const ListOfAllInPatient({ - Key? key, - required this.isAllClinic, - required this.hasQuery, - required this.patientSearchViewModel, + Key key, + @required this.isAllClinic, + @required this.hasQuery, + this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -42,7 +42,7 @@ class ListOfAllInPatient extends StatelessWidget { isInpatient: true, isMyPatient: patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile!.doctorID, + patientSearchViewModel.doctorProfile.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { @@ -61,7 +61,7 @@ class ListOfAllInPatient extends StatelessWidget { "arrivalType": "1", "isMyPatient": patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile!.doctorID, + patientSearchViewModel.doctorProfile.doctorID, }); }, ); @@ -77,7 +77,7 @@ class ListOfAllInPatient extends StatelessWidget { patientSearchViewModel.removeOnFilteredList(); } } - return false; + return; }, ), ), diff --git a/lib/screens/patients/In_patient/list_of_my_inpatient.dart b/lib/screens/patients/In_patient/list_of_my_inpatient.dart index 79b7c0df..f5f7c070 100644 --- a/lib/screens/patients/In_patient/list_of_my_inpatient.dart +++ b/lib/screens/patients/In_patient/list_of_my_inpatient.dart @@ -6,10 +6,10 @@ import '../../../routes.dart'; import 'NoData.dart'; class ListOfMyInpatient extends StatelessWidget { const ListOfMyInpatient({ - Key? key, - required this.isAllClinic, - required this.hasQuery, - required this.patientSearchViewModel, + Key key, + @required this.isAllClinic, + @required this.hasQuery, + this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -56,6 +56,9 @@ class ListOfMyInpatient extends StatelessWidget { }, ); }), + onNotification: (t) { + return; + }, ), ), ); diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 68d8c319..f78752ec 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -49,7 +49,8 @@ class ReferralDischargedPatientDetails 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', @@ -66,15 +67,20 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromDischargeReferralPatient(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = + model.getPatientFromDischargeReferralPatient( + referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "arrivalType": "1", "isDischargedPatient": true, - "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( @@ -105,10 +111,11 @@ class ReferralDischargedPatientDetails extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -120,7 +127,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate!, + referredPatient.referralDate, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -143,10 +150,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.admissionDate ?? "", "dd MMM,yyyy"), + referredPatient.admissionDate, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -166,10 +175,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.dischargeDate ?? "", "dd MMM,yyyy"), + referredPatient.dischargeDate, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -188,10 +199,11 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate ?? "").difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate ?? "")).inDays + 1}", + "${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -213,30 +225,36 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.referringDoctorName, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), ], ), 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), ), ], @@ -244,48 +262,60 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.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), ), AppText( - referredPatient.referringClinicDescription, + referredPatient + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), 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), ), ), @@ -301,7 +331,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority! + ": ", + TranslationBase.of(context).priority + + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -312,7 +343,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -331,10 +363,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), 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), ), ), @@ -356,7 +390,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -378,7 +413,8 @@ class ReferralDischargedPatientDetails extends StatelessWidget { referredPatient.frequency.toString(), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -389,7 +425,9 @@ class ReferralDischargedPatientDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).maxResponseTime! + ": ", + TranslationBase.of(context) + .maxResponseTime + + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -398,10 +436,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget { Expanded( child: AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime ?? "", "dd MMM,yyyy"), + referredPatient.mAXResponseTime, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -411,7 +451,8 @@ class ReferralDischargedPatientDetails 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_left.png', height: 50, @@ -455,22 +496,30 @@ class ReferralDischargedPatientDetails 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), ), ], diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 1e001799..92f92f87 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -17,88 +17,81 @@ class ReferralDischargedPatientPage extends StatefulWidget { } class _ReferralDischargedPatientPageState extends State { + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.gtMyDischargeReferralPatient(), builder: (_, model, w) => AppScaffold( appBarTitle: 'Referral Discharged ', - backgroundColor: Colors.grey[200]!, + backgroundColor: Colors.grey[200], isShowAppBar: false, baseViewModel: model, - body: model.myDischargeReferralPatient.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( - 'No Discharged Patient', - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ) - : Padding( + body: model.myDischargeReferralPatient.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: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 5, - ), - Expanded( - child: ListView.builder( - itemCount: model.myDischargeReferralPatient.length, - itemBuilder: (context, index) => InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), - ), - ); - }, - child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode( - model.myDischargeReferralPatient[index].referralStatus!, context), - referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, - patientName: model.myDischargeReferralPatient[index].firstName! + - " " + - model.myDischargeReferralPatient[index].lastName!, - patientGender: model.myDischargeReferralPatient[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted( - model.myDischargeReferralPatient[index].referralDate!), - referredTime: - AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate!), - patientID: "${model.myDischargeReferralPatient[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic: - "${model.myDischargeReferralPatient[index].referringClinicDescription}", - remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, - nationality: model.myDischargeReferralPatient[index].nationalityName, - nationalityFlag: - '', //model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend - doctorAvatar: - '', //model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend - referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, - clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), - ), - )), - ), - ], + child: AppText( + 'No Discharged Patient', + color: Theme.of(context).errorColor, ), + ) + ], + ), + ):Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 5,), + Expanded( + child: ListView.builder( + itemCount: model.myDischargeReferralPatient.length, + itemBuilder: (context,index)=>InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context), + referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, + patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName, + patientGender: model.myDischargeReferralPatient[index].gender, + referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate), + referredTime: AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate), + patientID: "${model.myDischargeReferralPatient[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}", + remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, + nationality: model.myDischargeReferralPatient[index].nationalityName, + nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend + doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend + referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, + clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + )), ), + + ], + ), + ), ), ); } + + } diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index bd7e3efb..2c89425e 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -4,9 +4,9 @@ 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/locator.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'; @@ -17,7 +17,7 @@ import 'package:provider/provider.dart'; import '../base/base_view.dart'; class InsuranceApprovalScreenNew extends StatefulWidget { - final int? appointmentNo; + final int appointmentNo; InsuranceApprovalScreenNew({this.appointmentNo}); @@ -29,7 +29,7 @@ class _InsuranceApprovalScreenNewState extends State @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; @@ -39,16 +39,16 @@ class _InsuranceApprovalScreenNewState extends State ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: int.parse(patient.appointmentNo.toString()), projectId: patient.projectId) + appointmentNo: int.parse(patient?.appointmentNo.toString()), projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), - builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, + builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( + appBar: PatientProfileAppBar( + patient, isInpatient: isInpatient, ), isShowAppBar: true, baseViewModel: model, - appBarTitle: TranslationBase.of(context).approvals ?? "", + appBarTitle: TranslationBase.of(context).approvals, body: patient.admissionNo != null ? SingleChildScrollView( child: Container( diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index a506b113..0945df37 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'; @@ -17,10 +17,14 @@ class InsuranceApprovalsDetails extends StatefulWidget { int indexInsurance; String patientType; - InsuranceApprovalsDetails({required this.patient, required this.indexInsurance, required this.patientType}); + InsuranceApprovalsDetails( + {this.patient, this.indexInsurance, this.patientType}); @override _InsuranceApprovalsDetailsState createState() => - _InsuranceApprovalsDetailsState(patient: patient, indexInsurance: indexInsurance, patientType: patientType); + _InsuranceApprovalsDetailsState( + patient: patient, + indexInsurance: indexInsurance, + patientType: patientType); } class _InsuranceApprovalsDetailsState extends State { @@ -28,12 +32,13 @@ class _InsuranceApprovalsDetailsState extends State { int indexInsurance; String patientType; - _InsuranceApprovalsDetailsState({required this.patient, required this.indexInsurance, required this.patientType}); + _InsuranceApprovalsDetailsState( + {this.patient, this.indexInsurance, this.patientType}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; return BaseView( onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 @@ -41,602 +46,776 @@ class _InsuranceApprovalsDetailsState extends State { ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, projectId: patient.projectId) + appointmentNo: patient.appointmentNo, + projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient) : null, - builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) => AppScaffold( - isShowAppBar: true, - baseViewModel: model, - patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), - body: patient.admissionNo != null - ? SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBar: PatientProfileAppBar( + patient), + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - AppText( - TranslationBase.of(context!).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', + Row( + children: [ + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], ), ], ), - ], - ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), - ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - AppText( - model!.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != null - ? model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption ?? - "" - : "", - color: model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != - null - ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" || - "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "تمت الموافقة" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), + Row( + children: [ + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalStatusDescption != + null + ? model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalStatusDescption ?? + "" + : "", + color: model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalStatusDescption != + null + ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), + ), + ], ), - ], - ), - Row( - children: [ - AppText( - model.insuranceApprovalInPatient[indexInsurance].doctorName!.toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Column( + Row( + children: [ + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .doctorName + .toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Image.network( - model.insuranceApprovalInPatient[indexInsurance].doctorImage!, - fit: BoxFit.fill, - width: 700, + Column( + children: [ + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig + .imageSizeMultiplier * + 12, + // radius: (52) + child: ClipRRect( + borderRadius: + BorderRadius.circular( + 50), + child: Image.network( + model + .insuranceApprovalInPatient[ + indexInsurance] + .doctorImage, + fit: BoxFit.fill, + width: 700, + ), + ), + backgroundColor: + Colors.transparent, ), ), - backgroundColor: Colors.transparent, - ), + ], ), - ], - ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 25.0, - ), - Row( + Expanded( + child: Padding( + padding: + const EdgeInsets.symmetric( + horizontal: 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of(context).clinic! + ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance].clinicName, - fontSize: 14, - ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvalNo! + ": ", - color: Colors.grey[500], - fontSize: 14, + SizedBox( + height: 25.0, ), - AppText( - model.insuranceApprovalInPatient[indexInsurance].approvalNo - .toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - 'Unused Count:', - color: Colors.grey[500], - fontSize: 14, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .clinic + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .clinicName, + fontSize: 14, + ), + ) + ], ), - AppText( - model.insuranceApprovalInPatient[indexInsurance].unUsedCount - .toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).companyName! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .approvalNo + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalNo + .toString(), + fontSize: 14, + ) + ], ), - AppText('Sample') - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).receiptOn! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .unUsedCount + .toString(), + fontSize: 14, + ) + ], ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .companyName + + ": ", + color: Colors.grey[500], + ), + AppText('Sample') + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).expiryDate! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .receiptOn + + ": ", + color: Colors.grey[500], + ), + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ), + ], ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .expiryDate + + ": ", + color: Colors.grey[500], + ), + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ], ), ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context).procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context).status, - fontWeight: FontWeight.w700, - ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context) + .procedure, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], ), - Expanded( - child: AppText( - TranslationBase.of(context).usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], - ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model - .insuranceApprovalInPatient[indexInsurance].apporvalDetails!.length, - itemBuilder: (BuildContext context, int index) { - return Container( - child: Column( - children: [ - Row( + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApprovalInPatient[ + indexInsurance] + .apporvalDetails + .length, + itemBuilder: + (BuildContext context, + int index) { + return Container( + child: Column( children: [ - Expanded( - child: Container( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance] - .apporvalDetails![index].procedureName ?? - "", - textAlign: TextAlign.start, + Row( + children: [ + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.procedureName ?? + "", + textAlign: + TextAlign + .start, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance] - .apporvalDetails![index].status ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.status ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApprovalInPatient[indexInsurance] - .apporvalDetails![index].isInvoicedDesc ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.isInvoicedDesc ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), + ], + ), + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, ), ], ), - SizedBox( - width: 5, - ), - Divider( - color: Colors.black38, - ), - ], - ), - ); - }), + ); + }), + ), + ], ), - ], - ), + ), + ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - ) - : SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - AppText( - TranslationBase.of(context!).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', + Row( + children: [ + AppText( + TranslationBase.of(context).insurance22, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + TranslationBase.of(context).approvals22, + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], ), ], ), - ], - ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), - ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - AppText( - model!.insuranceApproval[indexInsurance].approvalStatusDescption != null - ? model.insuranceApproval[indexInsurance].approvalStatusDescption ?? "" - : "", - color: model.insuranceApproval[indexInsurance].approvalStatusDescption != null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == - "Approved" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), + Row( + children: [ + AppText( + model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption != + null + ? model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption ?? + "" + : "", + color: model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption != + null + ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), + ), + ], ), - ], - ), - Row( - children: [ - AppText( - model.insuranceApproval[indexInsurance].doctorName!.toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Column( + Row( + children: [ + AppText( + model + .insuranceApproval[indexInsurance] + .doctorName + .toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Image.network( - model.insuranceApproval[indexInsurance].doctorImage!, - fit: BoxFit.fill, - width: 700, + Column( + children: [ + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig + .imageSizeMultiplier * + 12, + // radius: (52) + child: ClipRRect( + borderRadius: + BorderRadius.circular( + 50), + child: Image.network( + model + .insuranceApproval[ + indexInsurance] + .doctorImage, + fit: BoxFit.fill, + width: 700, + ), + ), + backgroundColor: + Colors.transparent, ), ), - backgroundColor: Colors.transparent, - ), + ], ), - ], - ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 25.0, - ), - Row( + Expanded( + child: Padding( + padding: + const EdgeInsets.symmetric( + horizontal: 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - TranslationBase.of(context).clinic! + ": ", - color: Colors.grey[500], - fontSize: 14, + SizedBox( + height: 25.0, ), - Expanded( - child: AppText( - model.insuranceApproval[indexInsurance].clinicName, - fontSize: 14, - ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvalNo! + ": ", - color: Colors.grey[500], - fontSize: 14, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .clinic + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + .clinicName, + fontSize: 14, + ), + ) + ], ), - AppText( - model.insuranceApproval[indexInsurance].approvalNo.toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).unusedCount! + ": ", - color: Colors.grey[500], - fontSize: 14, + Row( + children: [ + AppText( + TranslationBase.of( + context) + .approvalNo + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApproval[ + indexInsurance] + .approvalNo + .toString(), + fontSize: 14, + ) + ], ), - AppText( - model.insuranceApproval[indexInsurance].unUsedCount.toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).companyName! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .unusedCount + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApproval[ + indexInsurance] + .unUsedCount + .toString(), + fontSize: 14, + ) + ], ), - AppText('Sample') - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).receiptOn! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .companyName + + ": ", + color: Colors.grey[500], + ), + AppText('Sample') + ], ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .receiptOn + + ": ", + color: Colors.grey[500], + ), + Expanded( + child: AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).expiryDate! + ": ", - color: Colors.grey[500], + Row( + children: [ + AppText( + TranslationBase.of( + context) + .expiryDate + + ": ", + color: Colors.grey[500], + ), + if (model + .insuranceApproval[ + indexInsurance] + .expiryDate != + null) + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ], ), - if (model.insuranceApproval[indexInsurance].expiryDate != null) - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - ), ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - SizedBox( - height: 20.0, - ), - Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - children: [ - Expanded( - child: AppText( - TranslationBase.of(context).procedure, - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: AppText( - TranslationBase.of(context).status, - fontWeight: FontWeight.w700, - ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + TranslationBase.of(context) + .procedure, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .status, + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + TranslationBase.of(context) + .usageStatus, + fontWeight: FontWeight.w700, + ), + ) + ], ), - Expanded( - child: AppText( - TranslationBase.of(context).usageStatus, - fontWeight: FontWeight.w700, - ), - ) - ], - ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model.insuranceApproval[indexInsurance].apporvalDetails!.length, - itemBuilder: (BuildContext context, int index) { - return Container( - child: Column( - children: [ - Row( + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApproval[ + indexInsurance] + .apporvalDetails + .length, + itemBuilder: + (BuildContext context, + int index) { + return Container( + child: Column( children: [ - Expanded( - child: Container( - child: AppText( - model.insuranceApproval[indexInsurance] - .apporvalDetails![index].procedureName ?? - "", - textAlign: TextAlign.start, + Row( + children: [ + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.procedureName ?? + "", + textAlign: + TextAlign + .start, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApproval[indexInsurance] - .apporvalDetails![index].status ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.status ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), - ), - Expanded( - child: Container( - child: AppText( - model.insuranceApproval[indexInsurance] - .apporvalDetails![index].isInvoicedDesc ?? - "", - textAlign: TextAlign.center, + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.isInvoicedDesc ?? + "", + textAlign: + TextAlign + .center, + ), + ), ), - ), + ], + ), + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, ), ], ), - SizedBox( - width: 5, - ), - Divider( - color: Colors.black38, - ), - ], - ), - ); - }), + ); + }), + ), + ], ), - ], - ), + ), + ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - )), + ), + )), ); } } diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 3636e698..14ae707b 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -16,7 +16,8 @@ class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; - const FilterDatePage({Key? key, required this.outPatientFilterType, required this.patientSearchViewModel}) + const FilterDatePage( + {Key key, this.outPatientFilterType, this.patientSearchViewModel}) : super(key: key); @override @@ -45,7 +46,8 @@ class _FilterDatePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ BottomSheetTitle( - title: (OutPatientFilterType.Previous == widget.outPatientFilterType) + title: (OutPatientFilterType.Previous == + widget.outPatientFilterType) ? " Filter Previous Out Patient" : "Filter Nextweek Out Patient", ), @@ -61,12 +63,16 @@ class _FilterDatePageState extends State { color: Colors.white, child: InkWell( onTap: () => selectDate(context, - firstDate: getFirstDate(widget.outPatientFilterType), - lastDate: getLastDate(widget.outPatientFilterType)), + firstDate: + getFirstDate(widget.outPatientFilterType), + lastDate: + getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).fromDate!, - widget.patientSearchViewModel.selectedFromDate != null + TranslationBase.of(context).fromDate, + widget.patientSearchViewModel + .selectedFromDate != + null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -86,12 +92,16 @@ class _FilterDatePageState extends State { child: InkWell( onTap: () => selectDate(context, isFromDate: false, - firstDate: getFirstDate(widget.outPatientFilterType), - lastDate: getLastDate(widget.outPatientFilterType)), + firstDate: + getFirstDate(widget.outPatientFilterType), + lastDate: + getLastDate(widget.outPatientFilterType)), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).toDate!, - widget.patientSearchViewModel.selectedToDate != null + TranslationBase.of(context).toDate, + widget.patientSearchViewModel + .selectedToDate != + null ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" : null, true, @@ -136,30 +146,41 @@ class _FilterDatePageState extends State { padding: 10, color: Color(0xFF359846), onPressed: () async { - if (widget.patientSearchViewModel.selectedFromDate == null || - widget.patientSearchViewModel.selectedToDate == null) { - Helpers.showErrorToast("Please Select All The date Fields "); + if (widget.patientSearchViewModel.selectedFromDate == + null || + widget.patientSearchViewModel.selectedToDate == + null) { + Helpers.showErrorToast( + "Please Select All The date Fields "); } else { - Duration difference = widget.patientSearchViewModel.selectedToDate! - .difference(widget.patientSearchViewModel.selectedFromDate!); + Duration difference = widget + .patientSearchViewModel.selectedToDate + .difference(widget + .patientSearchViewModel.selectedFromDate); if (difference.inDays > 90) { Helpers.showErrorToast( "The difference between from date and end date must be less than 3 months"); } else { String dateTo = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedToDate!, 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedToDate, + 'yyyy-MM-dd'); String dateFrom = AppDateUtils.convertDateToFormat( - widget.patientSearchViewModel.selectedFromDate!, 'yyyy-MM-dd'); + widget.patientSearchViewModel.selectedFromDate, + 'yyyy-MM-dd'); - PatientSearchRequestModel currentModel = PatientSearchRequestModel(); + PatientSearchRequestModel currentModel = + PatientSearchRequestModel(); currentModel.to = dateTo; currentModel.from = dateFrom; GifLoaderDialogUtils.showMyDialog(context); - await widget.patientSearchViewModel.getOutPatient(currentModel, isLocalBusy: true); + await widget.patientSearchViewModel + .getOutPatient(currentModel, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); - if (widget.patientSearchViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientSearchViewModel.error); + if (widget.patientSearchViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientSearchViewModel.error); } else { Navigator.of(context).pop(); } @@ -178,15 +199,16 @@ class _FilterDatePageState extends State { )); } - selectDate(BuildContext context, {bool isFromDate = true, DateTime? firstDate, lastDate}) async { + selectDate(BuildContext context, + {bool isFromDate = true, DateTime firstDate, lastDate}) async { Helpers.hideKeyboard(context); DateTime selectedDate = isFromDate ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate : this.widget.patientSearchViewModel.selectedToDate ?? lastDate; - final DateTime? picked = await showDatePicker( + final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, - firstDate: firstDate!, + firstDate: firstDate, lastDate: lastDate, initialEntryMode: DatePickerEntryMode.calendar, ); @@ -210,22 +232,27 @@ class _FilterDatePageState extends State { getFirstDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime(DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); + return DateTime( + DateTime.now().year - 20, DateTime.now().month, DateTime.now().day); } else { - return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); + return DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); } } getLastDate(OutPatientFilterType outPatientFilterType) { if (outPatientFilterType == OutPatientFilterType.Previous) { - return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + return DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); } else { - return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); + return DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day + 7); } } - InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, - {Icon? suffixIcon}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 3a7cce7e..e0e4fb4a 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -34,13 +34,13 @@ class OutPatientsScreen extends StatefulWidget { final isAppbar; final arrivalType; final isView; - final PatientType? selectedPatientType; - final PatientSearchRequestModel? patientSearchRequestModel; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String? searchKey; + final String searchKey; OutPatientsScreen( {this.patientSearchForm, @@ -61,21 +61,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - late int clinicId; - late AuthenticationViewModel authenticationViewModel; + int clinicId; + AuthenticationViewModel authenticationViewModel; List _times = []; int _activeLocation = 1; - String? patientType; - late String patientTypeTitle; + String patientType; + String patientTypeTitle; var selectedFilter = 1; - late String arrivalType; - late ProjectViewModel projectsProvider; + String arrivalType; + ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - late PatientModel patient; + PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; bool isSortDes = true; @@ -84,15 +84,15 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); _times = [ - TranslationBase.of(context).previous!, - TranslationBase.of(context).today!, - TranslationBase.of(context).nextWeek!, + TranslationBase.of(context).previous, + TranslationBase.of(context).today, + TranslationBase.of(context).nextWeek, ]; final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel!); + await model.getOutPatient(widget.patientSearchRequestModel); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -106,13 +106,15 @@ class _OutPatientsScreenState extends State { Container( // color: Colors.red, height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: _times.map((item) { - bool _isActive = _times[_activeLocation] == item ? true : false; + bool _isActive = + _times[_activeLocation] == item ? true : false; return Expanded( child: InkWell( @@ -132,7 +134,8 @@ class _OutPatientsScreenState extends State { await model.getPatientBasedOnDate( item: item, selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget.patientSearchRequestModel, + patientSearchRequestModel: + widget.patientSearchRequestModel, isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); @@ -140,11 +143,16 @@ class _OutPatientsScreenState extends State { child: 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), + decoration: + TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive + ? Color(0xFFD02127) + : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -152,16 +160,22 @@ class _OutPatientsScreenState extends State { AppText( item, fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), + color: _isActive + ? Colors.white + : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), - _isActive && _activeLocation != 0 && model.state == ViewState.Idle + _isActive && + _activeLocation != 0 && + model.state == ViewState.Idle ? Container( padding: EdgeInsets.all(2), - margin: EdgeInsets.symmetric(horizontal: 5), + margin: EdgeInsets.symmetric( + horizontal: 5), decoration: new BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(50), + borderRadius: + BorderRadius.circular(50), ), constraints: BoxConstraints( minWidth: 20, @@ -169,7 +183,9 @@ class _OutPatientsScreenState extends State { ), child: new Text( model.filterData.length.toString(), - style: new TextStyle(color: Colors.red, fontSize: 10), + style: new TextStyle( + color: Colors.red, + fontSize: 10), textAlign: TextAlign.center, ), ) @@ -192,21 +208,23 @@ class _OutPatientsScreenState extends State { }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, - color: Colors.black, - ), - iconSize: 20, - - onPressed: _activeLocation != 0 - ? null - : () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => FilterDatePage( - outPatientFilterType: outPatientFilterType, - patientSearchViewModel: model, + icon: Icon( + _activeLocation != 0 + ? DoctorApp.filter_1 + : FontAwesomeIcons.slidersH, + color: Colors.black, + ), + iconSize: 20, + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage( + outPatientFilterType: outPatientFilterType, + patientSearchViewModel: model, ), settings: RouteSettings( name: 'FilterOutPatentDateScreen'), @@ -217,16 +235,16 @@ class _OutPatientsScreenState extends State { icon: Icon( isSortDes ? FontAwesomeIcons.sortAmountDown - : FontAwesomeIcons.sortAmountUp, + : FontAwesomeIcons.sortAmountUp, color: Colors.black, - ), - iconSize: 20, - onPressed: () { - model.sortOutPatient(isDes: isSortDes); + ), + iconSize: 20, + onPressed: () { + model.sortOutPatient(isDes: isSortDes); isSortDes = !isSortDes; }, - ), - ), + ), + ), SizedBox( height: 10.0, ), @@ -235,7 +253,8 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", + error: TranslationBase.of(context) + .youDontHaveAnyPatient, ), ) : ListView.builder( @@ -244,28 +263,35 @@ class _OutPatientsScreenState extends State { itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { if (_activeLocation != 0 || - (model.filterData[index].patientStatusType != null && - model.filterData[index].patientStatusType == 43)) + (model.filterData[index].patientStatusType != + null && + model.filterData[index] + .patientStatusType == + 43)) return Padding( padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: "1", - arrivalType: "1", + patientType: patientType, + arrivalType: arrivalType, isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget.patientSearchRequestModel!.from, - "to": widget.patientSearchRequestModel!.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index cee49c6c..c7056ce3 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -12,38 +12,42 @@ import 'package:flutter/material.dart'; class OutPatientPrescriptionDetailsScreen extends StatefulWidget { final PrescriptionResModel prescriptionResModel; - OutPatientPrescriptionDetailsScreen({Key? key, required this.prescriptionResModel}); + OutPatientPrescriptionDetailsScreen({Key key, this.prescriptionResModel}); @override - _OutPatientPrescriptionDetailsScreenState createState() => _OutPatientPrescriptionDetailsScreenState(); + _OutPatientPrescriptionDetailsScreenState createState() => + _OutPatientPrescriptionDetailsScreenState(); } -class _OutPatientPrescriptionDetailsScreenState extends State { - getPrescriptionReport(BuildContext context, PatientViewModel model) { - RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport( +class _OutPatientPrescriptionDetailsScreenState + extends State { + + + getPrescriptionReport(BuildContext context,PatientViewModel model ){ + RequestPrescriptionReport prescriptionReqModel = + RequestPrescriptionReport( appointmentNo: widget.prescriptionResModel.appointmentNo, episodeID: widget.prescriptionResModel.episodeID, setupID: widget.prescriptionResModel.setupID, patientTypeID: widget.prescriptionResModel.patientID); model.getPrescriptionReport(prescriptionReqModel.toJson()); } - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => getPrescriptionReport(context, model), builder: (_, model, w) => AppScaffold( - appBarTitle: TranslationBase.of(context).prescriptionDetails ?? "", - body: CardWithBgWidgetNew( - widget: ListView.builder( - itemCount: model.prescriptionReport.length, - itemBuilder: (BuildContext context, int index) { - return OutPatientPrescriptionDetailsItem( - prescriptionReport: model.prescriptionReport[index], - ); - }), - ), - ), - ); + appBarTitle: TranslationBase.of(context).prescriptionDetails, + body: CardWithBgWidgetNew( + widget: ListView.builder( + itemCount: model.prescriptionReport.length, + itemBuilder: (BuildContext context, int index) { + return OutPatientPrescriptionDetailsItem( + prescriptionReport: + model.prescriptionReport[index], + ); + }), + ), + ),); } } diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index 587550e3..7df6905f 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -5,11 +5,11 @@ import 'package:flutter/material.dart'; class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const PatientSearchHeader({Key? key, required this.title}) : super(key: key); + const PatientSearchHeader({Key key, this.title}) : super(key: key); @override Widget build(BuildContext context) { - return Container( + return Container( padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, @@ -38,5 +38,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { } @override - Size get preferredSize => Size(double.maxFinite, 65); + Size get preferredSize => Size(double.maxFinite,65); } 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 de135ff1..b0ec2943 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -31,41 +31,45 @@ class PatientsSearchResultScreen extends StatefulWidget { final String searchKey; PatientsSearchResultScreen( - {required this.selectedPatientType, - required this.patientSearchRequestModel, + {this.selectedPatientType, + this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, - required this.searchKey, + this.searchKey, this.isSearchAndOut = false}); @override - _PatientsSearchResultScreenState createState() => _PatientsSearchResultScreenState(); + _PatientsSearchResultScreenState createState() => + _PatientsSearchResultScreenState(); } -class _PatientsSearchResultScreenState extends State { - late int clinicId; - late AuthenticationViewModel authenticationViewModel; +class _PatientsSearchResultScreenState + extends State { + int clinicId; + AuthenticationViewModel authenticationViewModel; - String? patientType; - String? patientTypeTitle; + String patientType; + String patientTypeTitle; var selectedFilter = 1; - String? arrivalType; - late ProjectViewModel projectsProvider; + String arrivalType; + ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - late PatientModel patient; + PatientModel patient; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - if (!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + if (!widget.isSearchWithKeyInfo && + widget.selectedPatientType == PatientType.OutPatient) { await model.getOutPatient(widget.patientSearchRequestModel); } else { - await model.getPatientFileInformation(widget.patientSearchRequestModel); + await model + .getPatientFileInformation(widget.patientSearchRequestModel); } }, builder: (_, model, w) => AppScaffold( @@ -85,15 +89,14 @@ class _PatientsSearchResultScreenState extends State }, marginTop: 5, suffixIcon: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - // padding: EdgeInsets.only(bottom: 30), - onPressed: () {}, - ), - ), + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + // padding: EdgeInsets.only(bottom: 30), + ), + ), SizedBox( height: 10.0, ), @@ -102,7 +105,8 @@ class _PatientsSearchResultScreenState extends State child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context).youDontHaveAnyPatient ?? "", + error: TranslationBase.of(context) + .youDontHaveAnyPatient, ), ) : ListView.builder( @@ -114,22 +118,27 @@ class _PatientsSearchResultScreenState extends State padding: EdgeInsets.all(8.0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType ?? "", - arrivalType: arrivalType ?? "", + patientType: patientType, + arrivalType: arrivalType, isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": widget.isSearch, - "isInpatient": widget.isInpatient, - "arrivalType": "7", - "isSearchAndOut": widget.isSearchAndOut, - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + "isSearchAndOut": + widget.isSearchAndOut, + }); }, // isFromSearch: widget.isSearch, ), diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index b61de12a..e1fdd033 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -30,7 +30,7 @@ class _PatientSearchScreenState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; - late AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -45,7 +45,8 @@ class _PatientSearchScreenState extends State { child: Center( child: Column( children: [ - BottomSheetTitle(title: TranslationBase.of(context).searchPatient!), + BottomSheetTitle( + title: TranslationBase.of(context).searchPatient), FractionallySizedBox( // widthFactor: 0.9, child: Container( @@ -137,29 +138,41 @@ class _PatientSearchScreenState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel(doctorID: authenticationViewModel.doctorProfile!.doctorID); + PatientSearchRequestModel( + doctorID: authenticationViewModel.doctorProfile.doctorID); if (showOther) { patientSearchRequestModel.firstName = - firstNameInfoController.text.trim().isEmpty ? "0" : firstNameInfoController.text.trim(); + firstNameInfoController.text.trim().isEmpty + ? "0" + : firstNameInfoController.text.trim(); patientSearchRequestModel.middleName = - middleNameInfoController.text.trim().isEmpty ? "0" : middleNameInfoController.text.trim(); + middleNameInfoController.text.trim().isEmpty + ? "0" + : middleNameInfoController.text.trim(); patientSearchRequestModel.lastName = - lastNameFileInfoController.text.isEmpty ? "0" : lastNameFileInfoController.text.trim(); + lastNameFileInfoController.text.isEmpty + ? "0" + : lastNameFileInfoController.text.trim(); } if (patientFileInfoController.text.isNotEmpty) { if (patientFileInfoController.text.length == 10 && - (patientFileInfoController.text[0] == '2' || patientFileInfoController.text[0] == '1')) { - patientSearchRequestModel.identificationNo = patientFileInfoController.text; + (patientFileInfoController.text[0] == '2' || + patientFileInfoController.text[0] == '1')) { + patientSearchRequestModel.identificationNo = + patientFileInfoController.text; patientSearchRequestModel.searchType = 2; patientSearchRequestModel.patientID = 0; - } else if ((patientFileInfoController.text.length == 10 || patientFileInfoController.text.length == 9) && - ((patientFileInfoController.text[0] == '0' && patientFileInfoController.text[1] == '5') || + } else if ((patientFileInfoController.text.length == 10 || + patientFileInfoController.text.length == 9) && + ((patientFileInfoController.text[0] == '0' && + patientFileInfoController.text[1] == '5') || patientFileInfoController.text[0] == '5')) { patientSearchRequestModel.mobileNo = patientFileInfoController.text; patientSearchRequestModel.searchType = 0; } else { - patientSearchRequestModel.patientID = int.parse(patientFileInfoController.text); + patientSearchRequestModel.patientID = + int.parse(patientFileInfoController.text); patientSearchRequestModel.searchType = 1; } } @@ -179,7 +192,8 @@ class _PatientSearchScreenState extends State { builder: (BuildContext context) => PatientsSearchResultScreen( selectedPatientType: selectedPatientType, patientSearchRequestModel: patientSearchRequestModel, - isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, + isSearchWithKeyInfo: + patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, isSearchAndOut: true, searchKey: patientFileInfoController.text, diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart new file mode 100644 index 00000000..a1ee2cab --- /dev/null +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -0,0 +1,110 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/patient_type.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/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:hexcolor/hexcolor.dart'; + +class TimeBar extends StatefulWidget { + final PatientSearchViewModel model; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + + const TimeBar( + {Key key, + this.model, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo}) + : super(key: key); + @override + _TimeBarState createState() => _TimeBarState(); +} + +class _TimeBarState extends State { + @override + Widget build(BuildContext context) { + List _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + int _activeLocation = 0; + return Container( + height: MediaQuery.of(context).size.height * 0.0619, + width: SizeConfig.screenWidth * 0.94, + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(12.5), + // border: Border.all( + // width: 0.5, + // ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.058, + width: SizeConfig.screenWidth * 0.2334, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12.5), + topRight: Radius.circular(12.5), + topLeft: Radius.circular(9.5), + bottomLeft: Radius.circular(9.5)), + color: _isActive ? HexColor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + + fontWeight: FontWeight.normal, + ), + ), + )), + ), + onTap: () async { + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.getPatientBasedOnDate( + item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: + widget.patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10), + topRight: Radius.circular(10)), + color: Colors.white), + alignment: Alignment.center, + height: 1, + width: SizeConfig.screenWidth * 0.23, + ) + : Container() + ]); + }).toList(), + ), + ); + } +} diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index e50c6ae1..9268b031 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -7,7 +7,6 @@ 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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -86,14 +85,17 @@ class _UcafDetailScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), child: Column( children: [ - treatmentStepsBar(context, model, screenSize, patient), + treatmentStepsBar( + context, model, screenSize, patient), SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem(context, model), + ...getSelectedTreatmentStepItem( + context, model), ], ), ), @@ -102,20 +104,23 @@ class _UcafDetailScreenState extends State { ), ), ), + ], ), )); } - Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, Size screenSize, PatiantInformtion patient) { + Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, + Size screenSize, PatiantInformtion patient) { List __treatmentSteps = [ - TranslationBase.of(context).diagnosis ?? "".toUpperCase(), - TranslationBase.of(context).medications ?? "".toUpperCase(), - TranslationBase.of(context).procedures ?? "".toUpperCase(), + TranslationBase.of(context).diagnosis.toUpperCase(), + TranslationBase.of(context).medications.toUpperCase(), + TranslationBase.of(context).procedures.toUpperCase(), ]; return Container( height: screenSize.height * 0.070, - decoration: Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + decoration: Helpers.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -127,13 +132,16 @@ class _UcafDetailScreenState extends State { child: Container( height: screenSize.height * 0.070, decoration: Helpers.containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : 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, ), ), @@ -166,17 +174,20 @@ class _UcafDetailScreenState extends State { ); } - List getSelectedTreatmentStepItem(BuildContext _context, UcafViewModel model) { + List getSelectedTreatmentStepItem( + BuildContext _context, UcafViewModel model) { switch (_activeTap) { case 0: if (model.patientAssessmentList != null) { return [ - ListView.builder(itemCount: model.patientAssessmentList.length, + ListView.builder( + itemCount: model.patientAssessmentList.length, scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return DiagnosisWidget(model, model.patientAssessmentList[index]); + return DiagnosisWidget( + model, model.patientAssessmentList[index]); }) ]; } else { @@ -187,12 +198,16 @@ class _UcafDetailScreenState extends State { break; case 1: return [ - ListView.builder(itemCount:model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, + ListView.builder( + itemCount: model.prescriptionList != null + ? model.prescriptionList.entityList.length + : 0, scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return MedicationWidget(model, model.prescriptionList!.entityList![index]); + return MedicationWidget( + model, model.prescriptionList.entityList[index]); }) ]; break; @@ -200,7 +215,8 @@ class _UcafDetailScreenState extends State { if (model.orderProcedures != null) { return [ ListView.builder( - itemCount:model.orderProcedures.length, scrollDirection: Axis.vertical, + itemCount: model.orderProcedures.length, + scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { @@ -230,10 +246,12 @@ class DiagnosisWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MasterKeyModel? diagnosisType = - model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisType, id: diagnosis.diagnosisTypeID); - MasterKeyModel? diagnosisCondition = - model.findMasterDataById(masterKeys: MasterKeysService.DiagnosisCondition, id: diagnosis.conditionID); + MasterKeyModel diagnosisType = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisType, + id: diagnosis.diagnosisTypeID); + MasterKeyModel diagnosisCondition = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisCondition, + id: diagnosis.conditionID); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -504,7 +522,7 @@ class ProceduresWidget extends StatelessWidget { AppText( "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: procedure.isCovered! ? Colors.green : Colors.red, + color: procedure.isCovered ? Colors.green : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 1d1d549b..93bae074 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -1,12 +1,13 @@ +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'; @@ -83,7 +84,8 @@ class _UCAFInputScreenState extends State { children: [ // PatientHeaderWidgetNoAvatar(patient), Container( - margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric( + vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -137,7 +139,8 @@ class _UCAFInputScreenState extends State { height: 16, ),*/ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -151,7 +154,8 @@ class _UCAFInputScreenState extends State { ), AppText( "BP (H/L)", - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: + SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -160,7 +164,8 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.bloodPressure}", - fontSize: SizeConfig.textMultiplier * 2, + fontSize: + SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -174,7 +179,8 @@ class _UCAFInputScreenState extends State { children: [ AppText( "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: + SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -184,7 +190,8 @@ class _UCAFInputScreenState extends State { Expanded( child: AppText( "${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)", - fontSize: SizeConfig.textMultiplier * 2, + fontSize: + SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -198,13 +205,15 @@ class _UCAFInputScreenState extends State { height: 2, ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( children: [ AppText( "${TranslationBase.of(context).pulseBeats}:", - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: + SizeConfig.textMultiplier * 1.8, color: Colors.black, fontWeight: FontWeight.normal, ), @@ -213,7 +222,8 @@ class _UCAFInputScreenState extends State { ), AppText( "${model.hartRat}", - fontSize: SizeConfig.textMultiplier * 2, + fontSize: + SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.w700, ), @@ -225,7 +235,8 @@ class _UCAFInputScreenState extends State { height: 16, ), AppText( - TranslationBase.of(context).chiefComplaintsAndSymptoms, + TranslationBase.of(context) + .chiefComplaintsAndSymptoms, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.w700, @@ -246,9 +257,11 @@ class _UCAFInputScreenState extends State { height: 8, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).instruction, - dropDownText: - Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint ?? ""), + hintText: + TranslationBase.of(context).instruction, + dropDownText: Helpers.parseHtmlString(model + .patientChiefComplaintList[0] + .chiefComplaint), controller: _additionalComplaintsController, inputType: TextInputType.multiline, enabled: false, @@ -370,29 +383,31 @@ class _UCAFInputScreenState extends State { ) : model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null - ?Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, + ? 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( + model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context) + .chiefComplaintEmptyMsg, + fontWeight: FontWeight.normal, + textAlign: TextAlign.center, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - model.patientVitalSignsHistory == null ||model.patientVitalSignsHistory.length == 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context).chiefComplaintEmptyMsg, - fontWeight: FontWeight.normal, - textAlign: TextAlign.center, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], - ), - ): Container(), + ) + : Container(), ), ); } diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 78f7f6db..6d9838f4 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -18,7 +18,7 @@ class PageStepperWidget extends StatelessWidget { final Size screenSize; final List stepsTitles; - PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize, this.stepsTitles}); + PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize, this.stepsTitles}); @override Widget build(BuildContext context) { @@ -33,9 +33,11 @@ class PageStepperWidget extends StatelessWidget { children: [ for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, + dividerWidth, stepsTitles: stepsTitles,) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) + StepWidget(i, false, i == stepsCount, i < currentStepIndex, + dividerWidth, stepsTitles: stepsTitles,) ], ) ], @@ -45,6 +47,7 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { + final int index; final bool isInProgress; final bool isFinalStep; @@ -52,7 +55,8 @@ class StepWidget extends StatelessWidget { final double dividerWidth; final List stepsTitles; - StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles}); + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, + this.dividerWidth, {this.stepsTitles}); @override Widget build(BuildContext context) { @@ -60,9 +64,9 @@ class StepWidget extends StatelessWidget { if (isInProgress) { status = StepStatus.InProgress; } else { - if (isStepFinish) { + if(isStepFinish){ status = StepStatus.Completed; - } else { + }else { status = StepStatus.Locked; } } @@ -78,18 +82,10 @@ class StepWidget extends StatelessWidget { width: 30, height: 30, decoration: BoxDecoration( - color: status == StepStatus.InProgress - ? Color(0xFFCC9B14) - : status == StepStatus.Locked - ? Color(0xFFE3E3E3) - : Color(0xFF359846), + color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), shape: BoxShape.circle, border: Border.all( - color: status == StepStatus.InProgress - ? Color(0xFFCC9B14) - : status == StepStatus.Locked - ? Color(0xFFE3E3E3) - : Color(0xFF359846), + color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), width: 1), ), child: Center( @@ -130,13 +126,11 @@ class StepWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(4.0), ), - border: Border.all( - color: status == StepStatus.InProgress - ? Color(0xFFF1E9D3) - : status == StepStatus.Locked - ? Color(0x29797979) - : Color(0xFFD8E8D8), - width: 0.30), + border: Border.all(color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0x29797979) + : Color(0xFFD8E8D8), width: 0.30), ), child: AppText( status == StepStatus.InProgress @@ -151,8 +145,8 @@ class StepWidget extends StatelessWidget { color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked - ? Color(0xFF969696) - : Color(0xFF359846), + ? Color(0xFF969696) + : Color(0xFF359846), ), ) ], @@ -164,4 +158,4 @@ enum StepStatus { InProgress, Locked, Completed, -} +} \ No newline at end of file diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 2be71d19..8c38ece7 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -15,7 +15,7 @@ import 'UCAF-detail-screen.dart'; import 'UCAF-input-screen.dart'; class UCAFPagerScreen extends StatefulWidget { - const UCAFPagerScreen({Key? key}) : super(key: key); + const UCAFPagerScreen({Key key}) : super(key: key); @override _UCAFPagerScreenState createState() => _UCAFPagerScreenState(); @@ -53,7 +53,7 @@ class _UCAFPagerScreenState extends State @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 0ec237da..f83117e2 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AdmissionOrdersScreen extends StatefulWidget { - const AdmissionOrdersScreen({Key? key}) : super(key: key); + const AdmissionOrdersScreen({Key key}) : super(key: key); @override _AdmissionOrdersScreenState createState() => _AdmissionOrdersScreenState(); @@ -23,22 +23,22 @@ class AdmissionOrdersScreen extends StatefulWidget { class _AdmissionOrdersScreenState extends State { bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; + AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: 2014005178, patientId: patient!.patientMRN!), + admissionNo: 2014005178, patientId: patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -50,7 +50,7 @@ class _AdmissionOrdersScreenState extends State { body: model.admissionOrderList == null || model.admissionOrderList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).noDataAvailable!) + error: TranslationBase.of(context).noDataAvailable) : Container( color: Colors.grey[200], child: Column( @@ -257,6 +257,21 @@ class _AdmissionOrdersScreenState extends State { SizedBox( height: 8, ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // Expanded( + // child: AppText( + // model + // .admissionOrderList[ + // index] + // .notes, + // fontSize: 10, + // isCopyable: true, + // ), + // ), + // ]) ], ), SizedBox( 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 c17c36e3..9fa78cef 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 @@ -6,10 +6,10 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_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/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'; @@ -41,16 +41,16 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - appBarTitle: TranslationBase.of(context).admissionRequest!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -217,7 +217,7 @@ class _AdmissionRequestThirdScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - - appBarTitle: TranslationBase.of(context).admissionRequest!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -155,7 +154,7 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.Idle && model.icdCodes.length > 0) { openListDialogField('description', 'code', model.icdCodes, (selectedValue) { 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 a92912dc..0258d26f 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 @@ -8,11 +8,11 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_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/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'; @@ -40,28 +40,28 @@ class _AdmissionRequestSecondScreenState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - appBarTitle: TranslationBase.of(context).admissionRequest!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); @@ -187,16 +187,15 @@ class _AdmissionRequestSecondScreenState extends State { DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1), DiabeticType(nameAr: "Urine Acet", nameEn: "Urine Acet", value: 2), DiabeticType(nameAr: "Blood Glucose", nameEn: "Blood Glucose", value: 3), - DiabeticType( - nameAr: "Blood Glucose(Glucometer)", - nameEn: "Blood Glucose(Glucometer)", - value: 4) + DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) ]; - late DiabeticType selectedDiabeticType; + DiabeticType selectedDiabeticType; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; ProjectViewModel projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) async { selectedDiabeticType = diabeticType[2]; - await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, - isLocalBusy: false); + await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false); generateData(model); }, builder: (_, model, w) => AppScaffold( @@ -74,69 +70,84 @@ class _DiabeticChartState extends State { child: Column( children: [ Container( - width: MediaQuery.of(context).size.width * 0.7, + width: MediaQuery.of(context).size.width * 0.7, child: DropdownButtonHideUnderline( child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedDiabeticType.value, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return diabeticType.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( - diabeticType.length.toString(), - color: Colors.white, - fontSize: - projectsProvider.isArabic ? 10 : 11, - textAlign: TextAlign.center, - ), - )), + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedDiabeticType.value, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return diabeticType + .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( + diabeticType + .length + .toString(), + color: Colors.white, + fontSize: projectsProvider + .isArabic + ? 10 + : 11, + textAlign: + TextAlign.center, + ), + )), + ], + ), + AppText( + selectedDiabeticType.nameEn, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), ], + ); + }).toList(); + }, + onChanged: (newValue) async { + await onChangeFunc(newValue, model, patient); + setState(() { + + }); + }, + items: diabeticType + .map((item) { + return DropdownMenuItem( + child: AppText( + item.nameEn, + textAlign: TextAlign.left, ), - AppText(selectedDiabeticType.nameEn, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (newValue) async { - await onChangeFunc(newValue, model, patient); - setState(() {}); - }, - items: diabeticType.map((item) { - return DropdownMenuItem( - child: AppText( - item.nameEn, - textAlign: TextAlign.left, - ), - value: item.value, - ); - }).toList(), - )), + value: item.value, + ); + }).toList(), + )), ), timeSeriesData1.length != 0 || timeSeriesData2.length != 0 ? Padding( @@ -144,13 +155,14 @@ class _DiabeticChartState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container( margin: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartForDiabetic( - title: selectedDiabeticType.nameEn!, + title: selectedDiabeticType.nameEn, isOX: false, timeSeries1: timeSeriesData1, // timeSeries2: timeSeriesData2, @@ -187,7 +199,7 @@ class _DiabeticChartState extends State { ], ), ) - : ErrorMessage(error: TranslationBase.of(context).noItem!), + : ErrorMessage(error: TranslationBase.of(context).noItem), ], ), )), @@ -199,21 +211,21 @@ class _DiabeticChartState extends State { model.diabeticChartValuesList.toList().forEach( (element) { DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.dateChart!); - if (element.resultValue!.toInt() != 0) + AppDateUtils.getDateTimeFromServerFormat(element.dateChart); + if (element.resultValue.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue!.toDouble(), + element.resultValue.toDouble(), ), ); - if (element.resultValue!.toInt() != 0) + if (element.resultValue.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.resultValue!.toDouble(), + element.resultValue.toDouble(), ), ); }, @@ -224,17 +236,20 @@ class _DiabeticChartState extends State { onChangeFunc(newValue, PatientViewModel model, patient) async { GifLoaderDialogUtils.showMyDialog(context); setState(() { - selectedDiabeticType = diabeticType[newValue - 1]; + selectedDiabeticType = diabeticType[newValue-1]; timeSeriesData1.clear(); timeSeriesData2.clear(); }); - await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, - isLocalBusy: true); - if (model.state == ViewState.ErrorLocal) { + await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true); + if(model.state == ViewState.ErrorLocal){ Helpers.showErrorToast(model.error); } generateData(model); GifLoaderDialogUtils.hideDialog(context); + + + + } } diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index f1600b10..b3b1b581 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -12,10 +12,8 @@ import 'package:provider/provider.dart'; class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; - DiabeticDetails({ - Key? key, - required this.diabeticDetailsList, - }); + DiabeticDetails( + {Key key, this.diabeticDetailsList,}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -42,6 +40,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60, @@ -53,7 +52,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), child: Container( child: AppText( - "Result", + "Result", fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -71,8 +70,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: - BorderSide(width: 1.0, color: Colors.grey[300]!), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -87,7 +85,7 @@ class _VitalSignDetailsWidgetState extends State { widget.diabeticDetailsList.forEach((diabetic) { var data = diabetic.resultValue; DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart!); + AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart index 6f4005f1..671230c2 100644 --- a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -12,10 +12,10 @@ class LineChartForDiabetic extends StatelessWidget { final bool isOX; LineChartForDiabetic( - {required this.title, required this.timeSeries1, required this.indexes, this.isOX= false}); + {this.title, this.timeSeries1, this.indexes, this.isOX= false}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); @override Widget build(BuildContext context) { @@ -93,7 +93,7 @@ class LineChartForDiabetic extends StatelessWidget { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => TextStyle( + getTextStyles: (value) => const TextStyle( color: Colors.black, fontSize: 10, ), @@ -188,12 +188,12 @@ class LineChartForDiabetic extends StatelessWidget { } List getData(context) { - List spots = []; + List spots = List(); for (int index = 0; index < timeSeries1.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = []; + List spots2 = List(); // for (int index = 0; index < timeSeries2.length; index++) { // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); // } @@ -225,7 +225,7 @@ class LineChartForDiabetic extends StatelessWidget { ), ); - List lineChartData = []; + List lineChartData = List(); if(spots.isNotEmpty){ lineChartData.add(lineChartBarData1); } diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 640e3061..65e483b5 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -31,7 +31,7 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class DiagnosisScreen extends StatefulWidget { - const DiagnosisScreen({Key? key}) : super(key: key); + const DiagnosisScreen({Key key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); @@ -39,22 +39,21 @@ class DiagnosisScreen extends StatefulWidget { class _ProgressNoteState extends State { bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; getDiagnosisForInPatient(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = - GetDiagnosisForInPatientRequestModel( - admissionNo: int.parse(patient!.admissionNo!), - patientTypeID: patient!.patientType!, - patientID: patient.patientId, - setupID: "010266"); + GetDiagnosisForInPatientRequestModel( + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } @@ -62,7 +61,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -77,7 +76,8 @@ class _ProgressNoteState extends State { ), body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 - ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noItem) : Container( color: Colors.grey[200], child: Column( @@ -85,7 +85,8 @@ class _ProgressNoteState extends State { Expanded( child: Container( child: ListView.builder( - itemCount: model.diagnosisForInPatientList.length, + itemCount: + model.diagnosisForInPatientList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, @@ -159,7 +160,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn!), + .createdOn), isArabic: projectViewModel .isArabic, @@ -185,7 +186,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .diagnosisForInPatientList[ index] - .createdOn!)) + .createdOn)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, @@ -206,9 +207,9 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .icd! + - " : ", + TranslationBase.of( + context) + .icd + " : ", fontSize: 12, ), Expanded( @@ -227,17 +228,16 @@ class _ProgressNoteState extends State { ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ - AppText( - "Ascii Desc : ", + AppText("Ascii Desc : ", fontSize: 12, ), Expanded( child: AppText( model .diagnosisForInPatientList[ - index] + index] .asciiDesc, fontSize: 12, isCopyable: true, diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 50e1cd4d..f29315ae 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -10,9 +10,10 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; final PatiantInformtion patient; - const AllDischargeSummary({ required this.patient}); + const AllDischargeSummary({this.changeCurrentTab, this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -26,7 +27,7 @@ class _AllDischargeSummaryState extends State { onModelReady: (model) { model.getAllDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo!), + admissionNo: int.parse(widget.patient.admissionNo), ); }, builder: (_, model, w) => AppScaffold( @@ -35,7 +36,7 @@ class _AllDischargeSummaryState extends State { body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty ? ErrorMessage( - error: TranslationBase.of(context).noDataAvailable!) + error: TranslationBase.of(context).noDataAvailable) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index 33572f93..c1e72f96 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -17,7 +17,7 @@ class DischargeSummaryWidget extends StatefulWidget { final GetDischargeSummaryResModel dischargeSummary; bool isShowMore = false; - DischargeSummaryWidget({Key? key, required this.dischargeSummary}); + DischargeSummaryWidget({Key key, this.dischargeSummary}); @override _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); @@ -40,7 +40,7 @@ class _DischargeSummaryWidgetState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: EdgeInsets.all(15.0), @@ -52,26 +52,26 @@ class _DischargeSummaryWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CustomRow( - label: TranslationBase.of(context).doctorName! + ": ", + label: TranslationBase.of(context).doctorName + ": ", value: widget.dischargeSummary.createdByName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).branch! + ": ", + label: TranslationBase.of(context).branch + ": ", value: widget.dischargeSummary.projectName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).clinicName! + ": ", + label: TranslationBase.of(context).clinicName + ": ", value: widget.dischargeSummary.clinicName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).dischargeDate! + ": ", + label: TranslationBase.of(context).dischargeDate + ": ", value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn) .day diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index b5ab77a7..31935fcf 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -12,8 +12,9 @@ import 'all_discharge_summary.dart'; import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { + final Function changeCurrentTab; - const DischargeSummaryPage({Key? key, }) + const DischargeSummaryPage({Key key, this.changeCurrentTab}) : super(key: key); @override @@ -22,7 +23,7 @@ class DischargeSummaryPage extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; + TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -48,15 +49,16 @@ class _DoctorReplyScreenState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return WillPopScope( onWillPop: () async { + widget.changeCurrentTab(); return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2!, + appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: true, // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileAppBar( @@ -101,7 +103,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all!, + TranslationBase.of(context).all, ), ], ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index a99ce464..4984999f 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -9,9 +9,10 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; final PatiantInformtion patient; - const PendingDischargeSummary({Key? key, required this.patient}) + const PendingDischargeSummary({Key key, this.changeCurrentTab, this.patient}) : super(key: key); @override @@ -28,7 +29,7 @@ class _PendingDischargeSummaryState extends State { onModelReady: (model) { model.getPendingDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo!), + admissionNo: int.parse(widget.patient.admissionNo), ); }, builder: (_, model, w) => AppScaffold( @@ -37,7 +38,7 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) + .noDataAvailable) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index f0ee0404..be863b87 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -20,7 +20,7 @@ class FlowChartPage extends StatelessWidget { final bool isInpatient; FlowChartPage( - {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); + {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @override Widget build(BuildContext context) { @@ -39,37 +39,37 @@ class FlowChartPage extends StatelessWidget { baseViewModel: model, body: model.labOrdersResultHistoryList.isNotEmpty ? SingleChildScrollView( - child: Container( - child: LabResultHistoryChartAndDetails( - name: filterName, - labResultHistory: model.labOrdersResultHistoryList, - ), - // child: LabResultChartAndDetails( - // name: filterName, - // labResult: model.labOrdersResultsList, - // ), - ), - ) + child: Container( + child: LabResultHistoryChartAndDetails( + name: filterName, + labResultHistory: model.labOrdersResultHistoryList, + ), + // child: LabResultChartAndDetails( + // name: filterName, + // labResult: model.labOrdersResultsList, + // ), + ), + ) : Container( - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noDataAvailable, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], ), - ) - ], - ), - ), - ), + ), + ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 4a23710f..118bc476 100644 --- a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -14,7 +14,7 @@ class LabResultHistoryPage extends StatelessWidget { final String filterName; final PatiantInformtion patient; - LabResultHistoryPage({required this.patientLabOrder, required this.filterName, required this.patient}); + LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); // TODO mosa UI changes @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index df0eef1f..6ca92a4a 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -21,14 +21,14 @@ class LabResultWidget extends StatelessWidget { final bool isInpatient; LabResultWidget( - {Key? key, - required this.filterName, - required this.patientLabResultList, - required this.patientLabOrder, - required this.patient, - required this.isInpatient}) + {Key key, + this.filterName, + this.patientLabResultList, + this.patientLabOrder, + this.patient, + this.isInpatient}) : super(key: key); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -47,33 +47,34 @@ class LabResultWidget extends StatelessWidget { children: [ AppText( filterName, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, ), ], ), - //InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: FlowChartPage( - // filterName: filterName, - // patientLabOrder: patientLabOrder, - // patient: patient, - // isInpatient: isInpatient, - // ), - // ), - // ); - // }, - // // child: AppText( - // // TranslationBase.of(context).showMoreBtn, - // // textDecoration: TextDecoration.underline, - // // color: Colors.blue, - // // ), - //), + // InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: FlowChartPage( + // filterName: filterName, + // patientLabOrder: patientLabOrder, + // patient: patient, + // isInpatient: isInpatient, + // ), + // ), + // ); + // }, + // // child: AppText( + // // TranslationBase.of(context).showMoreBtn, + // // textDecoration: TextDecoration.underline, + // // color: Colors.blue, + // // ), + // ), ], - ),SizedBox( + ), + SizedBox( height: 8, ), Row( @@ -150,7 +151,7 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( /*'${patientLabResultList[index].testCode}\n' +*/ - patientLabResultList[index].description!, + patientLabResultList[index].description, textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.8, isCopyable: true, @@ -185,8 +186,9 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( patientLabResultList[index].resultValue ?? - - "" + " " + "${patientLabResultList[index].uOM ?? ""}", + "" + + " " + + "${patientLabResultList[index].uOM ?? ""}", textAlign: TextAlign.center, isCopyable: true, fontSize: SizeConfig.textMultiplier * 1.8, @@ -220,7 +222,7 @@ class LabResultWidget extends StatelessWidget { FadePage( page: FlowChartPage( filterName: - patientLabResultList[index].description!, + patientLabResultList[index].description, patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient, @@ -329,7 +331,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - lab.resultValue! + " " + lab.uOM!, + lab.resultValue + " " + lab.uOM, textAlign: TextAlign.center, ), ), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index c08d1514..697d16d2 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultDetailsWidget extends StatefulWidget { final List labResult; LabResultDetailsWidget({ - required this.labResult, + this.labResult, }); @override @@ -24,7 +24,7 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - /* decoration: BoxDecoration( + /* decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), @@ -74,7 +74,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]!), + inside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -87,16 +87,17 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResult.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); tableRow.add(TableRow(children: [ Container( child: Container( padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', + '${projectViewModel.isArabic? AppDateUtils.getWeekDayArabic(date.weekday): AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ), @@ -109,6 +110,7 @@ class _VitalSignDetailsWidgetState extends State { '${vital.resultValue}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart index ba49e356..490d0ec4 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -12,15 +12,14 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { final List labResultHistory; LabResultHistoryDetailsWidget({ - required this.labResultHistory, + this.labResultHistory, }); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); } -class _VitalSignDetailsWidgetState - extends State { +class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -73,7 +72,7 @@ class _VitalSignDetailsWidgetState ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]!), + inside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -86,7 +85,7 @@ class _VitalSignDetailsWidgetState List fullData(ProjectViewModel projectViewModel) { List tableRow = []; widget.labResultHistory.forEach((vital) { - var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); tableRow.add(TableRow(children: [ Container( child: Container( @@ -114,4 +113,4 @@ class _VitalSignDetailsWidgetState }); return tableRow; } -} +} \ No newline at end of file diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index 4c27861e..89860f44 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -10,15 +10,15 @@ class LineChartCurved extends StatefulWidget { final String title; final List labResult; - LineChartCurved({required this.title, required this.labResult}); + LineChartCurved({this.title, this.labResult}); @override State createState() => LineChartCurvedState(); } class LineChartCurvedState extends State { - bool? isShowingMainData; - List xAxixs = []; + bool isShowingMainData; + List xAxixs = List(); int indexes = 0; @override @@ -59,6 +59,7 @@ class LineChartCurvedState extends State { widget.title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -91,7 +92,8 @@ class LineChartCurvedState extends State { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -100,23 +102,27 @@ class LineChartCurvedState extends State { fontSize: 11, ), margin: 28, - rotateAngle: -65, + rotateAngle:-65, getTitles: (value) { print(value); - DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime!); + DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); if (widget.labResult.length < 8) { if (widget.labResult.length > value.toInt()) { return '${date.day}/ ${date.year}'; } else return ''; } else { - if (value.toInt() == 0) return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}'; + if (value.toInt() == 0) + return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResult.length - 1) + return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { return '${date.day}/ ${date.year}'; } } + + return ''; }, ), @@ -154,7 +160,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY() + 2, + maxY: getMaxY()+2, minY: getMinY(), lineBarsData: getData(), ); @@ -163,10 +169,10 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; widget.labResult.forEach((element) { - try { - double resultValueDouble = double.parse(element.resultValue!); - if (resultValueDouble > max) max = resultValueDouble; - } catch (e) { + try{ + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble > max) max = resultValueDouble;} + catch(e){ print(e); } }); @@ -176,14 +182,13 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; - try { - min = double.parse(widget.labResult[0].resultValue ?? ""); - - widget.labResult.forEach((element) { - double resultValueDouble = double.parse(element.resultValue ?? ""); - if (resultValueDouble < min) min = resultValueDouble; - }); - } catch (e) { + try{ + min = double.parse(widget.labResult[0].resultValue); + + widget.labResult.forEach((element) { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble < min) min = resultValueDouble; + });}catch(e){ print(e); } int value = min.toInt(); @@ -192,14 +197,15 @@ class LineChartCurvedState extends State { } List getData() { - List spots = []; + List spots = List(); for (int index = 0; index < widget.labResult.length; index++) { - try { - var resultValueDouble = double.parse(widget.labResult[index].resultValue ?? ""); - spots.add(FlSpot(index.toDouble(), resultValueDouble)); - } catch (e) { + try{ + var resultValueDouble = double.parse(widget.labResult[index].resultValue); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + }catch(e){ print(e); spots.add(FlSpot(index.toDouble(), 0.0)); + } } diff --git a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart index 606c75a2..ea9300d0 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart @@ -9,15 +9,15 @@ class LineChartCurvedLabHistory extends StatefulWidget { final String title; final List labResultHistory; - LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); + LineChartCurvedLabHistory({this.title, this.labResultHistory}); @override State createState() => LineChartCurvedLabHistoryState(); } class LineChartCurvedLabHistoryState extends State { - late bool isShowingMainData; - List xAxixs = []; + bool isShowingMainData; + List xAxixs = List(); int indexes = 0; @override @@ -197,7 +197,7 @@ class LineChartCurvedLabHistoryState extends State { } List getData() { - List spots = []; + List spots = List(); for (int index = 0; index < widget.labResultHistory.length; index++) { try { var resultValueDouble = diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 6efac930..545b4378 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -14,24 +14,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AllLabSpecialResult extends StatefulWidget { - const AllLabSpecialResult({Key? key}) : super(key: key); + const AllLabSpecialResult({Key key}) : super(key: key); @override _AllLabSpecialResultState createState() => _AllLabSpecialResultState(); } class _AllLabSpecialResultState extends State { - late String patientType; + String patientType; - late String arrivalType; - late PatiantInformtion patient; - late bool isInpatient; - late bool isFromLiveCare; + String arrivalType; + PatiantInformtion patient; + bool isInpatient; + bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -46,7 +46,7 @@ class _AllLabSpecialResultState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - model.getAllSpecialLabResult(patientId: patient!.patientMRN!), + model.getAllSpecialLabResult(patientId: patient.patientMRN), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -71,9 +71,9 @@ class _AllLabSpecialResultState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).special! + + TranslationBase.of(context).special + " " + - TranslationBase.of(context).lab!, + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, @@ -110,10 +110,10 @@ class _AllLabSpecialResultState extends State { height: 160, decoration: BoxDecoration( color: model.allSpecialLabList[index] - .isLiveCareAppointment! + .isLiveCareAppointment ? Colors.red[900] : !model.allSpecialLabList[index] - .isInOutPatient! + .isInOutPatient ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -135,17 +135,17 @@ class _AllLabSpecialResultState extends State { child: Center( child: Text( model.allSpecialLabList[index] - .isLiveCareAppointment! + .isLiveCareAppointment ? TranslationBase.of(context) - .liveCare! + .liveCare .toUpperCase() : !model.allSpecialLabList[index] - .isInOutPatient! + .isInOutPatient ? TranslationBase.of(context) - .inPatientLabel! + .inPatientLabel .toUpperCase() : TranslationBase.of(context) - .outpatient! + .outpatient .toUpperCase(), style: TextStyle(color: Colors.white), ), @@ -159,21 +159,21 @@ class _AllLabSpecialResultState extends State { FadePage( page: SpecialLabResultDetailsPage( resultData: model.allSpecialLabList[index] - .resultDataHTML!, + .resultDataHTML, patient: patient, ), ), ), doctorName: - model.allSpecialLabList[index].doctorName!, + model.allSpecialLabList[index].doctorName, invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}', profileUrl: model - .allSpecialLabList[index].doctorImageURL!, + .allSpecialLabList[index].doctorImageURL, branch: - model.allSpecialLabList[index].projectName!, - clinic: model.allSpecialLabList[index] - .clinicDescription!, + model.allSpecialLabList[index].projectName, + clinic: model + .allSpecialLabList[index].clinicDescription, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( model.allSpecialLabList[index].createdOn, diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 371cabec..49fee0f4 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,3 +1,4 @@ + import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -7,16 +8,18 @@ import 'package:flutter/material.dart'; import 'LineChartCurved.dart'; import 'Lab_Result_details_wideget.dart'; + class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ - Key? key, - required this.labResult, - required this.name, + Key key, + @required this.labResult, + @required this.name, }) : super(key: key); final List labResult; final String name; + @override Widget build(BuildContext context) { return Padding( @@ -26,16 +29,19 @@ class LabResultChartAndDetails extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: LineChartCurved( - title: name, - labResult: labResult, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) ), + child: LineChartCurved(title: name,labResult:labResult,), ), Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -45,9 +51,7 @@ class LabResultChartAndDetails extends StatelessWidget { fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), - SizedBox( - height: 8, - ), + SizedBox(height: 8,), LabResultDetailsWidget( labResult: labResult.reversed.toList(), ), @@ -58,4 +62,5 @@ class LabResultChartAndDetails extends StatelessWidget { ), ); } + } diff --git a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart index fdf95b2c..322eb817 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart @@ -9,9 +9,9 @@ import 'LineChartCurvedLabHistory.dart'; class LabResultHistoryChartAndDetails extends StatelessWidget { LabResultHistoryChartAndDetails({ - Key? key, - required this.labResultHistory, - required this.name, + Key key, + @required this.labResultHistory, + @required this.name, }) : super(key: key); final List labResultHistory; diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index a8b98be9..dd8ace01 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; class LabResult extends StatefulWidget { final LabOrdersResModel labOrders; - LabResult({Key? key, required this.labOrders}); + LabResult({Key key, this.labOrders}); @override _LabResultState createState() => _LabResultState(); @@ -27,11 +27,13 @@ class _LabResultState extends State { onModelReady: (model) => model.getLabResult(widget.labOrders), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).labOrders ?? "", + appBarTitle: TranslationBase.of(context).labOrders, body: model.labResultList.length == 0 - ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoLabOrders ?? "") + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoLabOrders) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, + 0, SizeConfig.realScreenWidth * 0.05, 0), child: ListView( children: [ CardWithBgWidgetNew( @@ -67,6 +69,7 @@ class _LabResultState extends State { ), ], ), + ], ), ), 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 ee220b06..4ccd4379 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'; @@ -17,12 +17,12 @@ class LaboratoryResultPage extends StatefulWidget { final bool isInpatient; LaboratoryResultPage( - {Key? key, - required this.patientLabOrders, - required this.patient, - required this.patientType, - required this.arrivalType, - required this.isInpatient}); + {Key key, + this.patientLabOrders, + this.patient, + this.patientType, + this.arrivalType, + this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -33,25 +33,29 @@ class _LaboratoryResultPageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: true), + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: widget.patient, - isInpatient: widget.isInpatient, - isFromLabResult: true, - appointmentDate: widget.patientLabOrders.orderDate!, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient:widget.isInpatient, + isFromLabResult: true, + appointmentDate: widget.patientLabOrders.orderDate, ), + baseViewModel: model, body: AppScaffold( isShowAppBar: false, body: SingleChildScrollView( child: LaboratoryResultWidget( onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo!, - details: - model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML : null, - orderNo: widget.patientLabOrders.orderNo!, + billNo: widget.patientLabOrders.invoiceNo, + details: model.patientLabSpecialResult.length > 0 + ? model.patientLabSpecialResult[0].resultDataHTML + : null, + orderNo: widget.patientLabOrders.orderNo, patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index e84552ba..9bf81081 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -18,21 +18,21 @@ import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; - final String? details; + final String details; final String orderNo; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; final bool isInpatient; const LaboratoryResultWidget( - {Key? key, - required this.onTap, - required this.billNo, - required this.details, - required this.orderNo, - required this.patientLabOrder, - required this.patient, - required this.isInpatient}) + {Key key, + this.onTap, + this.billNo, + this.details, + this.orderNo, + this.patientLabOrder, + this.patient, + this.isInpatient}) : super(key: key); @override @@ -42,7 +42,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -90,9 +90,11 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 0, right: 0), + margin: EdgeInsets.only( + left: 0, right: 0), child: AppText( - TranslationBase.of(context).generalResult, + TranslationBase.of(context) + .generalResult, fontSize: SizeConfig.textMultiplier * 2.3, bold: false, ))), @@ -100,7 +102,9 @@ class _LaboratoryResultWidgetState extends State { width: 25, height: 25, child: Icon( - _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -134,12 +138,15 @@ class _LaboratoryResultWidgetState extends State { shrinkWrap: true, itemBuilder: (context, index) { return LabResultWidget( - patientLabOrder: widget.patientLabOrder, - filterName: model.labResultLists[index].filterName, - patientLabResultList: model.labResultLists[index].patientLabResultList, - patient: widget.patient, - isInpatient: widget.isInpatient, - ); + patientLabOrder: widget.patientLabOrder, + filterName: model + .labResultLists[index].filterName, + patientLabResultList: model + .labResultLists[index] + .patientLabResultList, + patient: widget.patient, + isInpatient: widget.isInpatient, + ); }), ], ), @@ -151,13 +158,13 @@ class _LaboratoryResultWidgetState extends State { else if (widget.details == null) Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable!, + error: TranslationBase.of(context).noDataAvailable, ), ), SizedBox( height: 15, ), - if (widget.details != null && widget.details!.isNotEmpty) + if (widget.details != null && widget.details.isNotEmpty) Column( children: [ InkWell( @@ -179,9 +186,11 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 0, right: 0), + margin: EdgeInsets.only( + left: 0, right: 0), child: AppText( - TranslationBase.of(context).specialResult, + TranslationBase.of(context) + .specialResult, fontSize: SizeConfig.textMultiplier * 2.3, bold: false, ))), @@ -189,7 +198,9 @@ class _LaboratoryResultWidgetState extends State { width: 25, height: 25, child: Icon( - _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, + _isShowMore + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, color: Colors.grey[800], size: 22, ), @@ -212,12 +223,16 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: !Helpers.isTextHtml(widget.details!) + child: !Helpers.isTextHtml(widget.details) ? AppText( - widget.details ?? TranslationBase.of(context).noDataAvailable, + widget.details ?? + TranslationBase.of(context) + .noDataAvailable, ) : Html( - data: widget.details ?? TranslationBase.of(context).noDataAvailable, + data: widget.details ?? + TranslationBase.of(context) + .noDataAvailable, ), ), ), 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 d600f7c2..2c6dbb0c 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/card_with_bg_widget.dart'; @@ -23,16 +23,17 @@ class LabsHomePage extends StatefulWidget { } class _LabsHomePageState extends State { - late String patientType; + String patientType; + + String arrivalType; + PatiantInformtion patient; + bool isInpatient; + bool isFromLiveCare; - late String arrivalType; - late PatiantInformtion patient; - late bool isInpatient; - late bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -49,10 +50,12 @@ class _LabsHomePageState extends State { onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -119,7 +122,7 @@ class _LabsHomePageState extends State { ), ); }, - label: TranslationBase.of(context).applyForNewLabOrder ?? "", + label: TranslationBase.of(context).applyForNewLabOrder, ), ...List.generate( model.patientLabOrdersList.length, @@ -142,28 +145,27 @@ class _LabsHomePageState extends State { left: 1, child: Container( width: 20, - - decoration: BoxDecoration( - color: model.patientLabOrdersList[index].isLiveCareAppointment! - ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient! - ? 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)), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment! - ? TranslationBase.of(context).liveCare!.toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient! - ? TranslationBase.of(context).inPatientLabel!.toUpperCase() - : TranslationBase.of(context).outpatient!.toUpperCase(), + decoration: BoxDecoration( + color: model.patientLabOrdersList[index].isLiveCareAppointment + ? Colors.red[900] + : !model.patientLabOrdersList[index].isInOutPatient + ? 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)), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -187,12 +189,12 @@ class _LabsHomePageState extends State { ), ), ), - doctorName: model.patientLabOrdersList[index].doctorName ?? "", + doctorName: model.patientLabOrdersList[index].doctorName, invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model.patientLabOrdersList[index].doctorImageURL ?? "", - branch: model.patientLabOrdersList[index].projectName ?? "", - clinic: model.patientLabOrdersList[index].clinicDescription ?? "", - appointmentDate: model.patientLabOrdersList[index].orderDate!.add(Duration(days: 1)), + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: model.patientLabOrdersList[index].clinicDescription, + appointmentDate: model.patientLabOrdersList[index].orderDate, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index e338635a..db86dd72 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget { final String resultData; final PatiantInformtion patient; - const SpecialLabResultDetailsPage({Key? key, required this.resultData, required this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key key, this.resultData, this.patient}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 5035806d..72ee1311 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -14,16 +14,16 @@ import 'package:html_editor_enhanced/html_editor.dart'; import 'package:permission_handler/permission_handler.dart'; class AddVerifyMedicalReport extends StatefulWidget { - final PatiantInformtion? patient; - final String? patientType; - final String? arrivalType; - final MedicalReportModel? medicalReport; - final PatientMedicalReportViewModel? model; - final MedicalReportStatus? status; - final String? medicalNote; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final MedicalReportModel medicalReport; + final PatientMedicalReportViewModel model; + final MedicalReportStatus status; + final String medicalNote; const AddVerifyMedicalReport( - {Key? key, + {Key key, this.patient, this.patientType, this.arrivalType, @@ -38,7 +38,6 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { - HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { String txtOfMedicalReport; @@ -51,8 +50,8 @@ class _AddVerifyMedicalReportState extends State { baseViewModel: model, isShowAppBar: true, appBarTitle: widget.status == MedicalReportStatus.ADD - ? TranslationBase.of(context).medicalReportAdd! - : TranslationBase.of(context).medicalReportVerify!, + ? TranslationBase.of(context).medicalReportAdd + : TranslationBase.of(context).medicalReportVerify, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: Column( children: [ @@ -69,26 +68,13 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: (widget.medicalReport != - null + initialText: (widget.medicalReport != null ? widget.medicalNote - : widget - .model! - .medicalReportTemplate[ - 0] - .templateText! - .length > - 0 - ? widget - .model! - .medicalReportTemplate[0] - .templateText + : widget.model.medicalReportTemplate[0].templateText.length > 0 + ? widget.model.medicalReportTemplate[0].templateText : ""), hint: "Write the medical report ", - height: - MediaQuery.of(context).size.height * - 0.75, - controller: _controller, + height: MediaQuery.of(context).size.height * 0.75, ), ], ), @@ -114,35 +100,27 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await _controller.getText(); + txtOfMedicalReport = await HtmlEditor.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.medicalReport != null - ? await widget.model!.updateMedicalReport( - widget.patient!, + ?await widget.model.updateMedicalReport( + widget.patient, txtOfMedicalReport, - widget.medicalReport != null - ? widget.medicalReport!.lineItemNo - : null, - widget.medicalReport != null - ? widget.medicalReport!.invoiceNo - : null) - : await widget.model!.addMedicalReport( - widget.patient!, txtOfMedicalReport); + widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, + widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) + : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); //model.getMedicalReportList(patient); Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context); - if (widget.model!.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - widget.model!.error); + if (widget.model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(widget.model.error); } } else { - DrAppToastMsg.showErrorToast( - "Please enter medical note"); + DrAppToastMsg.showErrorToast("Please enter medical note"); } }, ), @@ -159,22 +137,17 @@ class _AddVerifyMedicalReportState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = - await _controller.getText(); + txtOfMedicalReport = await HtmlEditor.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.model!.verifyMedicalReport( - widget.patient!, widget.medicalReport!); + await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport); GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context); - if (widget.model!.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - widget.model!.error); + if (widget.model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(widget.model.error); } } else { - DrAppToastMsg.showErrorToast( - "Please enter medical note"); + DrAppToastMsg.showErrorToast("Please enter medical note"); } }, ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index ceac8526..ab24f8e0 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -1,13 +1,16 @@ 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'; @@ -17,7 +20,7 @@ class MedicalReportDetailPage extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -28,8 +31,9 @@ class MedicalReportDetailPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), + appBar: PatientProfileAppBar( + patient, + ), body: Container( child: SingleChildScrollView( child: Column( @@ -55,29 +59,27 @@ class MedicalReportDetailPage extends StatelessWidget { ], ), ), - medicalReport.reportDataHtml != null - ? 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: Html(data: medicalReport.reportDataHtml ?? ""), - ) - : Container( - child: ErrorMessage( - error: "No Data", - ), + medicalReport.reportDataHtml != null ? 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: Html( + data: medicalReport.reportDataHtml ?? "" + ), + ) : Container( + child: ErrorMessage(error: "No Data",), + ), ], ), ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index e0155547..a25d03b4 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -6,7 +6,6 @@ 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/locator.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'; @@ -14,6 +13,7 @@ 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'; @@ -33,7 +33,7 @@ class MedicalReportPage extends StatefulWidget { class _MedicalReportPageState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -48,8 +48,9 @@ class _MedicalReportPageState extends State { baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), + appBar: PatientProfileAppBar( + patient, + ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -83,21 +84,22 @@ class _MedicalReportPageState extends State { await locator().logEvent( eventCategory: "Medical Report Page", eventAction: "Add New Medical Report", - );Navigator.push( + ); + Navigator.push( context, MaterialPageRoute( builder: (context) => AddVerifyMedicalReport( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - model: model, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + model: model, status: MedicalReportStatus.ADD, - ), + ), settings: RouteSettings(name: 'AddVerifyMedicalReport'), ), ); }, - label: TranslationBase.of(context).createNewMedicalReport!, + label: TranslationBase.of(context).createNewMedicalReport, ), // if (model.state != ViewState.ErrorLocal)ß ...List.generate( @@ -109,21 +111,22 @@ class _MedicalReportPageState extends State { context, MaterialPageRoute( builder: (context) => AddVerifyMedicalReport( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - medicalReport: model.medicalReportList[index], - model: model, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + medicalReport: model.medicalReportList[index], + model: model, medicalNote: model.medicalReportList[index].reportDataHtml, ), - settings: RouteSettings(name: 'AddVerifyMedicalReport')),); - } else { - Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD, - 'medicalReport': model.medicalReportList[index], + settings: RouteSettings(name: 'AddVerifyMedicalReport')), + ); + } else { + Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'type': MedicalReportStatus.ADD, + 'medicalReport': model.medicalReportList[index], 'model': model, }); } @@ -132,111 +135,110 @@ class _MedicalReportPageState extends State { margin: EdgeInsets.symmetric(horizontal: 8), child: CardWithBgWidget( hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700]!, - widget: Column( - children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - model.medicalReportList[index].status == 1 - ? TranslationBase.of(context).onHold - : TranslationBase.of(context).verified, - color: model.medicalReportList[index].status == 1 - ? Color(0xFFCC9B14) - : Colors.green[700], - fontSize: 1.4 * SizeConfig.textMultiplier, - bold: true, - ), - AppText( - projectViewModel.isArabic - ? model.medicalReportList[index].doctorNameN?? "" - : model.medicalReportList[index].doctorName?? "", - fontSize: 1.9 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700, - color: Color(0xFF2E303A), - ), - ], - )), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn ?? "", "dd MMM yyyy")}', - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn ?? "", "hh:mm a")}', - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, - ), - ], - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), - child: LargeAvatar( - name: projectViewModel.isArabic + bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700], + widget: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + model.medicalReportList[index].status == 1 + ? TranslationBase.of(context).onHold + : TranslationBase.of(context).verified, + color: model.medicalReportList[index].status == 1 + ? Color(0xFFCC9B14) + : Colors.green[700], + fontSize: 1.4 * SizeConfig.textMultiplier, + bold: true, + ), + AppText( + projectViewModel.isArabic ? model.medicalReportList[index].doctorNameN ?? "" : model.medicalReportList[index].doctorName ?? "", - url: model.medicalReportList[index].doctorImageURL, + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), ), - width: 50, - height: 50, - ), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - projectViewModel.isArabic - ? model.medicalReportList[index].projectNameN - : model.medicalReportList[index].projectName, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0xFF2E303A), - ), - AppText( - projectViewModel.isArabic - ? model.medicalReportList[index].clinicNameN - : model.medicalReportList[index].clinicName, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0xFF2E303A), - ), - ], - ), + ], + )), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + AppText( + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * SizeConfig.textMultiplier, ), + ], + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), + child: LargeAvatar( + name: projectViewModel.isArabic + ? model.medicalReportList[index].doctorNameN + : model.medicalReportList[index].doctorName, + url: model.medicalReportList[index].doctorImageURL, ), - Container( - height: 50, + width: 50, + height: 50, + ), + Expanded( + child: Container( child: Column( - mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - model.medicalReportList[index].status == 1 ? DoctorApp.edit_1 - :EvaIcons.eye , + AppText( + projectViewModel.isArabic + ? model.medicalReportList[index].projectNameN + : model.medicalReportList[index].projectName, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0xFF2E303A), + ), + AppText( + projectViewModel.isArabic + ? model.medicalReportList[index].clinicNameN + : model.medicalReportList[index].clinicName, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0xFF2E303A), ), ], ), - ) - ], - ), - ], - ), + ), + ), + Container( + height: 50, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Icon( + model.medicalReportList[index].status == 1 ? DoctorApp.edit_1 : EvaIcons.eye, + ), + ], + ), + ) + ], + ), + ], ), ), ), ), + ), SizedBox( height: 15, ) diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index f17688f5..52a1b0e0 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -33,21 +33,22 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); + const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - late List notesList; + List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + getProgressNoteList(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -56,12 +57,15 @@ class _ProgressNoteState extends State { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo ?? ""), + admissionNo: int.parse(patient.admissionNo), projectID: patient.projectId, tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { + model + .getPatientProgressNote(progressNoteRequest.toJson(), + isLocalBusy: isLocalBusy) + .then((c) { notesList = model.patientProgressNoteList; }); } @@ -70,10 +74,11 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), builder: (_, model, w) => AppScaffold( @@ -87,7 +92,7 @@ class _ProgressNoteState extends State { body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote!) + error: TranslationBase.of(context).errorNoProgressNote) : Container( color: Colors.grey[200], child: Column( @@ -113,8 +118,8 @@ class _ProgressNoteState extends State { ); }, label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet! - : TranslationBase.of(context).addProgressNote!, + ? TranslationBase.of(context).addNewOrderSheet + : TranslationBase.of(context).addProgressNote, ), Expanded( child: Container( @@ -129,7 +134,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile!.doctorID != + .doctorProfile.doctorID != model .patientProgressNoteList[ index] @@ -156,7 +161,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile!.doctorID != + .doctorProfile.doctorID != model .patientProgressNoteList[ index] @@ -201,7 +206,7 @@ class _ProgressNoteState extends State { .status != 4 && authenticationViewModel - .doctorProfile!.doctorID == + .doctorProfile.doctorID == model .patientProgressNoteList[ index] @@ -239,222 +244,327 @@ class _ProgressNoteState extends State { ), // color:Colors.red[600], - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of(context).update, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of( + context) + .update, + fontSize: 10, + color: Colors.white, + ), + ], ), + padding: EdgeInsets.all(6), ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "verify", - confirmFun: () async { - GifLoaderDialogUtils.showMyDialog(context); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo ?? ""), - cancelledNote: false, - lineItemNo: - model.patientProgressNoteList[index].lineItemNo, - createdBy: model.patientProgressNoteList[index].createdBy, - notes: model.patientProgressNoteList[index].notes, - verifiedNote: true, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context, model, - isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: + false, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: true, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of(context).noteVerify, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + child: Row( + children: [ + Icon( + FontAwesomeIcons + .check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of( + context) + .noteVerify, + fontSize: 10, + color: Colors.white, + ), + ], ), + padding: EdgeInsets.all(6), ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: TranslationBase.of(context).cancel!, - confirmFun: () async { - GifLoaderDialogUtils.showMyDialog( - context, - ); - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo ?? ""), - cancelledNote: true, - lineItemNo: - model.patientProgressNoteList[index].lineItemNo, - createdBy: model.patientProgressNoteList[index].createdBy, - notes: model.patientProgressNoteList[index].notes, - verifiedNote: false, - patientTypeID: patient.patientType, - patientOutSA: false, - ); - await model.updatePatientProgressNote(reqModel); - await getProgressNoteList(context, model, - isLocalBusy: true); - GifLoaderDialogUtils.hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: + TranslationBase.of( + context) + .cancel, + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context, + ); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: true, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: false, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + child: Row( + children: [ + Icon( + FontAwesomeIcons + .trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], ), - ), - SizedBox( - width: 10, - ) - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.60, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).createdBy, - fontSize: 10, - ), - Expanded( - child: AppText( - model.patientProgressNoteList[index].doctorName ?? '', - fontWeight: FontWeight.w600, - fontSize: 12, - isCopyable:true,), - ), - ], - ), - ], + padding: EdgeInsets.all(6), ), ), - Column( - children: [ - AppText( - model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.getDateTimeFromServerFormat( - model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel.isArabic, - isMonthShort: true): AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), - isArabic: projectViewModel.isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - isCopyable:true,), - AppText( - model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getHour( - AppDateUtils.getDateTimeFromServerFormat( - model.patientProgressNoteList[index].createdOn ?? "")) - : AppDateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14,isCopyable:true, - ), - ], - crossAxisAlignment: CrossAxisAlignment.end, + SizedBox( + width: 10, ) ], ), - SizedBox( - height: 8, - ), - Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - model.patientProgressNoteList[index].notes, - fontSize: 10,isCopyable:true, + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .doctorName ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable:true, + ), + ), + ], + ), + ], ), ), - ]) - ], - ), - SizedBox( - height: 20, - ), - ], - ), + Column( + children: [ + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientProgressNoteList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable:true, + ), + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientProgressNoteList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable:true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .notes, + fontSize: 10, + isCopyable:true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], ), - ); - }), - ), + ), + ); + }), ), + ), ], ), ), @@ -462,7 +572,7 @@ class _ProgressNoteState extends State { ); } - showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { + showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( context: context, builder: (ctx) => Center( diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index b2873fde..3fde4262 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -28,19 +28,19 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class UpdateNoteOrder extends StatefulWidget { - final NoteModel? note; + final NoteModel note; final PatientViewModel patientModel; final PatiantInformtion patient; final int visitType; final bool isUpdate; const UpdateNoteOrder( - {Key? key, + {Key key, this.note, - required this.patientModel, - required this.patient, - required this.visitType, - required this.isUpdate}) + this.patientModel, + this.patient, + this.visitType, + this.isUpdate}) : super(key: key); @override @@ -48,12 +48,12 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { - int? selectedType; + int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel? projectViewModel; + ProjectViewModel projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -81,7 +81,7 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note!.notes!; + progressNoteController.text = widget.note.notes; } return AppScaffold( @@ -99,12 +99,12 @@ class _UpdateNoteOrderState extends State { title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd)! + - TranslationBase.of(context).orderSheet! + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet : (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd)! + - TranslationBase.of(context).progressNote!, + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -119,13 +119,17 @@ class _UpdateNoteOrderState extends State { AppTextFieldCustom( hintText: widget.visitType == 3 ? (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd)! + - TranslationBase.of(context).orderSheet! + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd)! + - TranslationBase.of(context).progressNote!, + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).progressNote, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -133,19 +137,26 @@ class _UpdateNoteOrderState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: progressNoteController.text.isEmpty && isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: + progressNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), Positioned( - top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel!.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, + top: + -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), onPressed: () { - initSpeechState().then((value) => {onVoiceText()}); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ], @@ -162,34 +173,34 @@ class _UpdateNoteOrderState extends State { ), ), bottomSheet: Container( - height: progressNoteController.text.isNotEmpty ? 130 : 70, + height: progressNoteController.text.isNotEmpty? 130:70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ - if (progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), + if(progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + ), + ), Container( margin: EdgeInsets.all(5), child: AppButton( title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd)! + - TranslationBase.of(context).orderSheet! + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate! - : TranslationBase.of(context).noteAdd!) + - TranslationBase.of(context).progressNote!, + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -201,23 +212,26 @@ class _UpdateNoteOrderState extends State { GifLoaderDialogUtils.showMyDialog(context); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); if (widget.isUpdate) { UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo!), + admissionNo: int.parse(widget.patient.admissionNo), cancelledNote: false, - lineItemNo: widget.note!.lineItemNo, - createdBy: widget.note?.createdBy, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, notes: progressNoteController.text, verifiedNote: false, patientTypeID: widget.patient.patientType, patientOutSA: false, ); - await widget.patientModel.updatePatientProgressNote(reqModel); + await widget.patientModel + .updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( - admissionNo: int.parse(widget.patient.admissionNo!), + admissionNo: + int.parse(widget.patient.admissionNo), createdBy: doctorProfile.doctorID, visitType: widget.visitType, patientID: widget.patient.patientId, @@ -226,23 +240,28 @@ class _UpdateNoteOrderState extends State { patientOutSA: false, notes: progressNoteController.text); - await widget.patientModel.createPatientProgressNote(reqModel); + await widget.patientModel + .createPatientProgressNote(reqModel); } if (widget.patientModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.patientModel.error); } else { - ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: int.parse(widget.patient.admissionNo!), - projectID: widget.patient.projectId, - patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson()); + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Your Order added Successfully"); + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); Navigator.of(context).pop(); } else { Helpers.showErrorToast("You cant add only spaces"); @@ -257,7 +276,8 @@ class _UpdateNoteOrderState extends State { 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, @@ -301,7 +321,8 @@ class _UpdateNoteOrderState extends State { } 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; } diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 472f3f85..0fbac8bf 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -30,32 +30,31 @@ import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class NursingProgressNoteScreen extends StatefulWidget { - const NursingProgressNoteScreen({Key? key}) : super(key: key); + const NursingProgressNoteScreen({Key key}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - late List notesList; + List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel( - admissionNo: int.parse(patient!.admissionNo!), - patientTypeID: patient!.patientType!, - patientID: patient.patientId, - setupID: "010266"); + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } @@ -63,7 +62,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -80,7 +79,7 @@ class _ProgressNoteState extends State { body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote!) + error: TranslationBase.of(context).errorNoProgressNote) : Container( color: Colors.grey[200], child: Column( @@ -163,7 +162,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ index] - .createdOn!), + .createdOn), isArabic: projectViewModel .isArabic, @@ -189,7 +188,7 @@ class _ProgressNoteState extends State { .getDateTimeFromServerFormat(model .patientNursingProgressNoteList[ index] - .createdOn!)) + .createdOn)) : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 376f8dbb..c2751424 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -31,31 +31,31 @@ import '../../../../widgets/shared/app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class OperationReportScreen extends StatefulWidget { - final int? visitType; + final int visitType; - const OperationReportScreen({Key? key, this.visitType}) : super(key: key); + const OperationReportScreen({Key key, this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - late List notesList; + List notesList; var filteredNotesList; bool isDischargedPatient = false; - late AuthenticationViewModel authenticationViewModel; - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( - onModelReady: (model) => model.getReservations(patient!.patientMRN!), + onModelReady: (model) => model.getReservations(patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -71,7 +71,7 @@ class _ProgressNoteState extends State { model.reservationList == null || model.reservationList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote!) + error: TranslationBase.of(context).errorNoProgressNote) : Expanded( child: Container( child: ListView.builder( diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 6ff2b7de..d042ff2f 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -36,16 +36,16 @@ class UpdateOperationReport extends StatefulWidget { final GetReservationsResponseModel reservation; // final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; - final int? visitType; + final int visitType; final bool isUpdate; const UpdateOperationReport( - {Key? key, + {Key key, // this.operationReportViewModel, - required this.patient, + this.patient, this.visitType, - required this.isUpdate, - required this.reservation}) + this.isUpdate, + this.reservation}) : super(key: key); @override @@ -53,12 +53,12 @@ class UpdateOperationReport extends StatefulWidget { } class _UpdateOperationReportState extends State { - late int selectedType; + int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController(); @@ -135,7 +135,7 @@ class _UpdateOperationReportState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: BottomSheetTitle( - title: TranslationBase.of(context).operationReports!, + title: TranslationBase.of(context).operationReports, ), body: SingleChildScrollView( child: Container( @@ -540,8 +540,8 @@ class _UpdateOperationReportState extends State { child: AppButton( title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd)! + - TranslationBase.of(context).operationReports!, + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).operationReports, color: Color(0xff359846), // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, @@ -590,9 +590,9 @@ class _UpdateOperationReportState extends State { bloodLossDetailController.text, patientID: widget.patient.patientId, admissionNo: - int.parse(widget.patient.admissionNo!), + int.parse(widget.patient.admissionNo), createdBy: model - .doctorProfile!.doctorID!, + .doctorProfile.doctorID, setupID: "010266"); await model .updateOperationReport( diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index c69f3868..e9e4f8b2 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -24,73 +24,73 @@ class PendingOrdersScreen extends StatelessWidget { admissionNo: int.parse(patient.admissionNo)), builder: (BuildContext context, PendingOrdersViewModel model, Widget child) => - AppScaffold( - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - isShowAppBar: true, - baseViewModel: model, - appBarTitle: "Pending Orders", - body: model.pendingOrdersList == null || + AppScaffold( + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Pending Orders", + body: model.pendingOrdersList == null || model.pendingOrdersList.length == 0 - ? DrAppEmbeddedError( + ? DrAppEmbeddedError( error: TranslationBase.of(context).noDataAvailable) - : Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).pending, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).orders, - fontSize: 25.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).pending, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), ), - ), - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.pendingOrdersList.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: AppText( + model.pendingOrdersList[index].notes), ), - border: Border.all( - color: Color(0xFF707070), width: 0.30), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: AppText( - model.pendingOrdersList[index].notes), ), - ), - ); - })), - ], - ), - ), + ); + })), + ], + ), + ), ); } } diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index 51d9fae0..ca8be2c0 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -10,15 +10,17 @@ import 'package:flutter/material.dart'; class InpatientPrescriptionDetailsScreen extends StatefulWidget { @override - _InpatientPrescriptionDetailsScreenState createState() => _InpatientPrescriptionDetailsScreenState(); + _InpatientPrescriptionDetailsScreenState createState() => + _InpatientPrescriptionDetailsScreenState(); } -class _InpatientPrescriptionDetailsScreenState extends State { +class _InpatientPrescriptionDetailsScreenState + extends State { bool _showDetails = false; - String? error; - TextEditingController? answerController; + String error; + TextEditingController answerController; bool _isInit = true; - late PrescriptionReportForInPatient prescription; + PrescriptionReportForInPatient prescription; @override void initState() { @@ -29,7 +31,7 @@ class _InpatientPrescriptionDetailsScreenState extends State diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart index 9808bb97..e4351d91 100644 --- a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -8,23 +8,26 @@ class PatientProfileCardModel { final bool isInPatient; final bool isDisable; final bool isLoading; - final GestureTapCallback? onTap; + final Function onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData? dartIcon; - final Color? color; + final IconData dartIcon; + final Color color; - - PatientProfileCardModel(this.nameLine1, this.nameLine2, this.route, this.icon, - {this.isInPatient = false, - this.isDisable = false, - this.isLoading = false, - this.onTap, - this.isDischargedPatient = false, - this.isSelectInpatient = false, - this.isDartIcon = false, - this.dartIcon, + PatientProfileCardModel( + this.nameLine1, + this.nameLine2, + this.route, + this.icon, { + this.isInPatient = false, + this.isDisable = false, + this.isLoading = false, + this.onTap, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + this.isDartIcon = false, + this.dartIcon, this.color, }); } 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 2aa9e669..0c66b493 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -8,7 +8,6 @@ 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/SOAP/in_patient/PostEpisodeForInpatientRequestModel.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'; @@ -18,7 +17,6 @@ import 'package:doctor_app_flutter/util/NotificationPermissionUtils.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/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'; @@ -34,8 +32,9 @@ class PatientProfileScreen extends StatefulWidget { _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { - late PatiantInformtion patient; +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { + PatiantInformtion patient; LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); bool isFromSearch = false; @@ -47,16 +46,17 @@ class _PatientProfileScreenState extends State with Single bool isDischargedPatient = false; bool isSearchAndOut = false; bool isCallStarted = false; - late String patientType; - late String arrivalType; - late String from; - late String to; - late TabController _tabController; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; int index = 0; int _activeTab = 0; - late StreamController videoCallDurationStreamController; - late Stream videoCallDurationStream; //= (() async*{})(); TODO Elham* + StreamController videoCallDurationStreamController; + Stream videoCallDurationStream = (() async* {})(); + @override void initState() { _tabController = TabController(length: 2, vsync: this); @@ -77,7 +77,7 @@ class _PatientProfileScreenState extends State with Single @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -110,7 +110,7 @@ class _PatientProfileScreenState extends State with Single _activeTab = 1; } - late StreamSubscription callTimer; + StreamSubscription callTimer; callConnected() { callTimer = @@ -126,7 +126,7 @@ class _PatientProfileScreenState extends State with Single callDisconnected() { callTimer.cancel(); - videoCallDurationStreamController.sink.add(''); + videoCallDurationStreamController.sink.add(null); setState(() { isCallStarted = false; @@ -140,9 +140,11 @@ class _PatientProfileScreenState extends State with Single onModelReady: (model) async { if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); - },builder: (_, model, w) => AppScaffold( - baseViewModel: model,isLoading: true, - appBarTitle: TranslationBase.of(context).patientProfile ?? "", + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isLoading: true, + appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false, body: Column( children: [ @@ -150,20 +152,18 @@ class _PatientProfileScreenState extends State with Single children: [ Column( children: [ - PatientProfileAppBar( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, - videoCallDurationStream: videoCallDurationStream, - isInpatient: isInpatient, - isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient: isDischargedPatient), - ), + PatientProfileHeaderNewDesignAppBar( + patient, arrivalType ?? '0', patientType, + videoCallDurationStream: videoCallDurationStream, + isInpatient: isInpatient, + isFromLiveCare: isFromLiveCare, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), Container( height: !isSearchAndOut ? isDischargedPatient @@ -190,7 +190,8 @@ class _PatientProfileScreenState extends State with Single isInpatient: isInpatient, from: from, to: to, - isDischargedPatient: isDischargedPatient, + isDischargedPatient: + isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( @@ -213,9 +214,10 @@ class _PatientProfileScreenState extends State with Single ), if ((isInpatient && !isDischargedPatient) ? true - :isFromLiveCare - ? patient.episodeNo != null - : patient.patientStatusType != null && patient.patientStatusType == 43) + : isFromLiveCare + ? patient.episodeNo != null + : patient.patientStatusType != null && + patient.patientStatusType == 43) BaseView( onModelReady: (model) async { model.getDoctorProfile(); @@ -457,7 +459,12 @@ class AvatarWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index e9451e54..ca304986 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -12,7 +12,7 @@ class ProfileGridForInPatient extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double? height; + final double height; final bool isInpatient; final bool isDischargedPatient; final bool isFromSearch; @@ -20,26 +20,32 @@ class ProfileGridForInPatient extends StatelessWidget { String to; ProfileGridForInPatient( - {Key? key, - required this.patient, - required this.patientType, - required this.arrivalType, + {Key key, + this.patient, + this.patientType, + this.arrivalType, this.height, - required this.isInpatient, - required this.from, - required this.to, - required this.isDischargedPatient, - required this.isFromSearch}) + this.isInpatient, + this.from, + this.to, + this.isDischargedPatient, + this.isFromSearch}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital ?? "", TranslationBase.of(context).signs ?? "", - VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).lab ?? "", TranslationBase.of(context).result ?? "", - LAB_RESULT, 'patient/lab_results.png', + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).lab, @@ -47,45 +53,75 @@ class ProfileGridForInPatient extends StatelessWidget { ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).result!, - RADIOLOGY_PATIENT, 'patient/health_summary.png', + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).result, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).prescription!, - ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).progress!, TranslationBase.of(context).note!, PROGRESS_NOTE, + PatientProfileCardModel( + TranslationBase.of(context).progress, + TranslationBase.of(context).note, + PROGRESS_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).order!, TranslationBase.of(context).sheet!, ORDER_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).order, + TranslationBase.of(context).sheet, + ORDER_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, - ORDER_PROCEDURE, 'patient/Order_Procedures.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).medical!, TranslationBase.of(context).report!, - PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', - isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( - TranslationBase.of(context).referral!, - TranslationBase.of(context).patient!, + TranslationBase.of(context).medical, + TranslationBase.of(context).report, + PATIENT_MEDICAL_REPORT, + 'patient/health_summary.png', + isInPatient: isInpatient, + isDisable: false), + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, REFER_IN_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), - PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).approvals!, - PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).approvals, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, DISCHARGE_SUMMARY, + PatientProfileCardModel( + TranslationBase.of(context).discharge, + TranslationBase.of(context).report, + DISCHARGE_SUMMARY, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, ) + isInPatient: isInpatient,) , PatientProfileCardModel( - TranslationBase.of(context).patientSick!, - TranslationBase.of(context).leave!, + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 7045f6c7..a374898c 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -12,31 +12,32 @@ class ProfileGridForOther extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double? height; + final double height; final bool isInpatient; final bool isFromLiveCare; String from; String to; ProfileGridForOther( - {Key? key, - required this.patient, - required this.patientType, - required this.arrivalType, + {Key key, + this.patient, + this.patientType, + this.arrivalType, this.height, - required this.isInpatient, - required this.from, - required this.to, - required this.isFromLiveCare}) + this.isInpatient, + this.from, + this.to, + this.isFromLiveCare}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', @@ -47,21 +48,22 @@ class ProfileGridForOther extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, isDisable: isFromLiveCare @@ -69,8 +71,8 @@ class ProfileGridForOther extends StatelessWidget { : patient.patientStatusType != 43 || patient.appointmentNo == null), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( - TranslationBase.of(context).referral!, - TranslationBase.of(context).patient!, + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, @@ -79,7 +81,7 @@ class ProfileGridForOther extends StatelessWidget { : patient.patientStatusType != 43 || patient.appointmentNo == null, ), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, isDisable: isFromLiveCare diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 47097c43..5bcc398d 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -11,29 +11,23 @@ class ProfileGridForSearch extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - final double? height; + final double height; final bool isInpatient; String from; String to; ProfileGridForSearch( - {Key? key, - required this.patient, - required this.patientType, - required this.arrivalType, - this.height, - required this.isInpatient, - required this.from, - required this.to}) + {Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', @@ -44,29 +38,30 @@ class ProfileGridForSearch extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'patient/ucaf.png', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel(TranslationBase.of(context).referral!, TranslationBase.of(context).patient!, + PatientProfileCardModel(TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel(TranslationBase.of(context).admission!, TranslationBase.of(context).request!, + PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), ]; diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 779776a4..1e742de9 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -2,9 +2,9 @@ import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.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'; @@ -17,13 +17,12 @@ import '../../../../locator.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - final String? patientType; - final String? arrivalType; + final String patientType; + final String arrivalType; final bool isInpatient; RadiologyDetailsPage( - {Key? key, required this.finalRadiology, required this.patient, this.patientType, this.arrivalType, - this.isInpatient = false}); + {Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false}); @override Widget build(BuildContext context) { @@ -34,9 +33,9 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, - appointmentDate: finalRadiology.orderDate!, + appBar: PatientProfileAppBar( + patient, + appointmentDate: finalRadiology.orderDate, doctorName: finalRadiology.doctorName, clinic: finalRadiology.clinicDescription, branch: finalRadiology.projectName, @@ -107,7 +106,7 @@ class RadiologyDetailsPage extends StatelessWidget { ); launch(model.radImageURL); }, - label: TranslationBase.of(context).openRad ?? "", + label: TranslationBase.of(context).openRad, ), ), ) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 6714460f..958301fd 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'; @@ -23,16 +23,16 @@ class RadiologyHomePage extends StatefulWidget { } class _RadiologyHomePageState extends State { - String? patientType; - late PatiantInformtion patient; - late String arrivalType; - late bool isInpatient; - late bool isFromLiveCare; + String patientType; + PatiantInformtion patient; + String arrivalType; + bool isInpatient; + bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -50,8 +50,10 @@ class _RadiologyHomePageState extends State { isShowAppBar: true, backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -116,7 +118,7 @@ class _RadiologyHomePageState extends State { settingRoute: 'AddProcedureTabPage'), ); }, - label: TranslationBase.of(context).applyForRadiologyOrder ?? "", + label: TranslationBase.of(context).applyForRadiologyOrder, ), ...List.generate( model.radiologyList.length, @@ -138,9 +140,9 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index].isLiveCareAppodynamicment! + color: model.radiologyList[index].isLiveCareAppodynamicment ? Colors.red[900] - : !model.radiologyList[index].isInOutPatient! + : !model.radiologyList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( @@ -153,11 +155,11 @@ class _RadiologyHomePageState extends State { quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index].isLiveCareAppodynamicment! - ? TranslationBase.of(context).liveCare!.toUpperCase() - : !model.radiologyList[index].isInOutPatient! - ? TranslationBase.of(context).inPatientLabel!.toUpperCase() - : TranslationBase.of(context).outpatient!.toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -171,7 +173,7 @@ class _RadiologyHomePageState extends State { branch: '${model.radiologyList[index].projectName}', clinic: model.radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate!, + model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index bf883517..e7714074 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -11,12 +11,12 @@ class RadiologyReportScreen extends StatelessWidget { final String reportData; final String url; - RadiologyReportScreen({Key? key, required this.reportData, required this.url}); + RadiologyReportScreen({Key key, this.reportData, this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport ?? "", + appBarTitle: TranslationBase.of(context).radiologyReport, body: SingleChildScrollView( child: Column( children: [ @@ -38,9 +38,7 @@ class RadiologyReportScreen extends StatelessWidget { fontSize: 2.5 * SizeConfig.textMultiplier, ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.13, - ) + SizedBox(height:MediaQuery.of(context).size.height * 0.13 ,) ], ), ), diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 2ab83a88..251a91fa 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -26,11 +26,13 @@ import 'ReplySummeryOnReferralPatient.dart'; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; - final AddReferredRemarksRequestModel? myReferralInPatientRequestModel; - final bool? isEdited; + final AddReferredRemarksRequestModel myReferralInPatientRequestModel; + final bool isEdited; const AddReplayOnReferralPatient( - {Key? key, required this.patientReferralViewModel, required this.myReferralInPatientModel, + {Key key, + this.patientReferralViewModel, + this.myReferralInPatientModel, this.isEdited, this.myReferralInPatientRequestModel}) : super(key: key); @@ -80,39 +82,40 @@ class _AddReplayOnReferralPatientState extends State 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(); - }, + 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( + Container( // height: replayOnReferralController.text.isNotEmpty ? 130 : 70, // margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 5a4eab5f..2a48e079 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -21,10 +21,12 @@ class ReplySummeryOnReferralPatient extends StatefulWidget { ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply); @override - _ReplySummeryOnReferralPatientState createState() => _ReplySummeryOnReferralPatientState(this.referredPatient); + _ReplySummeryOnReferralPatientState createState() => + _ReplySummeryOnReferralPatientState(this.referredPatient); } -class _ReplySummeryOnReferralPatientState extends State { +class _ReplySummeryOnReferralPatientState + extends State { final MyReferralPatientModel referredPatient; _ReplySummeryOnReferralPatientState(this.referredPatient); @@ -35,16 +37,19 @@ class _ReplySummeryOnReferralPatientState extends State AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).summeryReply!, + 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), + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric( + horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, @@ -65,7 +70,7 @@ class _ReplySummeryOnReferralPatientState extends State( 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 c818639a..29697dc1 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -32,7 +32,7 @@ class _MyReferralInPatientScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient ?? "", + appBarTitle: TranslationBase.of(context).referPatient, body: Column( children: [ Container( @@ -77,15 +77,15 @@ class _MyReferralInPatientScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ListView.builder( - itemCount:model.myReferralPatients.length, - scrollDirection: Axis.vertical, + ListView.builder( + itemCount: model.myReferralPatients.length, + scrollDirection: Axis.vertical, physics: ScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { return InkWell( - onTap: () { - if (patientType == + onTap: () { + if (patientType == PatientType.OUT_PATIENT) { Navigator.push( context, @@ -95,43 +95,74 @@ class _MyReferralInPatientScreenState extends State { .myReferralPatients[index]), ), ); - } else {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!), + } else { + 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), - ), - ); - }) - ], + .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/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 03488886..fe6fd2db 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -12,12 +12,13 @@ import '../../../../routes.dart'; class MyReferralPatientScreen extends StatelessWidget { @override Widget build(BuildContext context) { + return BaseView( onModelReady: (model) => model.getPendingReferralPatients(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient ?? "", + appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( child: Column( @@ -50,30 +51,49 @@ class MyReferralPatientScreen extends StatelessWidget { model.pendingReferral.length, (index) => InkWell( onTap: () { - Navigator.of(context) - .pushNamed(MY_REFERRAL_DETAIL, arguments: {'referral': model.pendingReferral[index]}); + Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, + arguments: { + 'referral': model.pendingReferral[index] + }); }, child: PatientReferralItemWidget( - referralStatus: model.pendingReferral[index].referralStatus, - patientName: model.pendingReferral[index].patientName, - patientGender: model.pendingReferral[index].patientDetails?.gender, - referredDate: model.pendingReferral[index].referredOn!.split(" ")[0], - referredTime: model.pendingReferral[index].referredOn!.split(" ")[1], - patientID: "${model.pendingReferral[index].patientID}", - isSameBranch: model.pendingReferral[index].isReferralDoctorSameBranch, + referralStatus: + model.pendingReferral[index].referralStatus, + patientName: + model.pendingReferral[index].patientName, + patientGender: model + .pendingReferral[index].patientDetails.gender, + referredDate: model + .pendingReferral[index].referredOn + .split(" ")[0], + referredTime: model + .pendingReferral[index].referredOn + .split(" ")[1], + patientID: + "${model.pendingReferral[index].patientID}", + isSameBranch: model.pendingReferral[index] + .isReferralDoctorSameBranch, isReferral: true, - remark: model.pendingReferral[index].remarksFromSource, - nationality: model.pendingReferral[index].patientDetails!.nationalityName, - nationalityFlag: model.pendingReferral[index].nationalityFlagUrl, - doctorAvatar: model.pendingReferral[index].doctorImageUrl, - referralDoctorName: model.pendingReferral[index].referredByDoctorInfo, + remark: + model.pendingReferral[index].remarksFromSource, + nationality: model.pendingReferral[index] + .patientDetails.nationalityName, + nationalityFlag: + model.pendingReferral[index].nationalityFlagUrl, + doctorAvatar: + model.pendingReferral[index].doctorImageUrl, + referralDoctorName: model + .pendingReferral[index].referredByDoctorInfo, clinicDescription: null, infoIcon: InkWell( onTap: () { - Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, - arguments: {'referral': model.pendingReferral[index]}); + Navigator.of(context) + .pushNamed(MY_REFERRAL_DETAIL, arguments: { + 'referral': model.pendingReferral[index] + }); }, - child: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), + child: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), ), ), ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index d87fdc39..de1d5958 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -18,8 +18,9 @@ class PatientReferralScreen extends StatefulWidget { } class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - late TabController _tabController; - int index = 0; + + TabController _tabController; + int index=0; @override void initState() { @@ -40,11 +41,12 @@ class _PatientReferralScreen extends State with SingleTic _tabController.dispose(); } + @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).patientsreferral!, + appBarTitle: TranslationBase.of(context).patientsreferral, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, @@ -55,7 +57,9 @@ class _PatientReferralScreen extends State with SingleTic height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( border: Border( - bottom: BorderSide(color: Theme.of(context).dividerColor, width: 1), //width: 0.7 + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 1), //width: 0.7 ), color: Colors.white), child: Center( @@ -65,20 +69,24 @@ class _PatientReferralScreen extends State with SingleTic 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), + labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 0 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -95,14 +103,17 @@ class _PatientReferralScreen extends State with SingleTic ), Container( width: MediaQuery.of(context).size.width * 0.34, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 1 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -120,13 +131,16 @@ class _PatientReferralScreen extends State with SingleTic Container( width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), child: Center( child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 2 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -141,6 +155,7 @@ class _PatientReferralScreen extends State with SingleTic ), ), ), + ], ), ), 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 41514739..41686ead 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'; @@ -31,8 +31,8 @@ class PatientMakeInPatientReferralScreen extends StatefulWidget { class _PatientMakeInPatientReferralScreenState extends State { - late PatiantInformtion patient; - late List referToList; + PatiantInformtion patient; + List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; @@ -41,13 +41,13 @@ class _PatientMakeInPatientReferralScreenState final _remarksController = TextEditingController(); final _extController = TextEditingController(); int _activePriority = 1; - late String appointmentDate; + String appointmentDate; - String? branchError; - String? hospitalError; - String? clinicError; - String? doctorError; - String? frequencyError; + String branchError; + String hospitalError; + String clinicError; + String doctorError; + String frequencyError; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); @@ -121,12 +121,12 @@ class _PatientMakeInPatientReferralScreenState @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; - referToList = []; + referToList = List(); dynamic sameBranch = { "id": 1, "name": TranslationBase.of(context).sameBranch @@ -144,10 +144,12 @@ class _PatientMakeInPatientReferralScreenState onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient!, + appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -183,7 +185,7 @@ class _PatientMakeInPatientReferralScreenState children: [ AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: TranslationBase.of(context).branch ?? "ssss", + hintText: TranslationBase.of(context).branch, dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, @@ -520,31 +522,31 @@ class _PatientMakeInPatientReferralScreenState setState(() { if (_referTo == null) { branchError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { branchError = null; } if (_selectedBranch == null) { hospitalError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { hospitalError = null; } if (_selectedClinic == null) { clinicError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { clinicError = null; } if (_selectedDoctor == null) { doctorError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { doctorError = null; } if (_selectedFrequency == null) { frequencyError = - TranslationBase.of(context).fieldRequired!; + TranslationBase.of(context).fieldRequired; } else { frequencyError = null; } @@ -591,9 +593,9 @@ class _PatientMakeInPatientReferralScreenState Widget priorityBar(BuildContext _context, Size screenSize) { List _priorities = [ - TranslationBase.of(context).veryUrgent!.toUpperCase(), - TranslationBase.of(context).urgent!.toUpperCase(), - TranslationBase.of(context).routine!.toUpperCase(), + TranslationBase.of(context).veryUrgent.toUpperCase(), + TranslationBase.of(context).urgent.toUpperCase(), + TranslationBase.of(context).routine.toUpperCase(), ]; return Container( height: screenSize.height * 0.070, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 014fc8c7..6010a422 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -4,12 +4,12 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/locator.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/patient-referral-item-widget.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'; @@ -27,19 +27,19 @@ class PatientMakeReferralScreen extends StatefulWidget { } class _PatientMakeReferralScreenState extends State { - late PatiantInformtion patient; - late List referToList; + PatiantInformtion patient; + List referToList; dynamic _referTo; dynamic _selectedBranch; dynamic _selectedClinic; dynamic _selectedDoctor; - late DateTime appointmentDate; + DateTime appointmentDate; final _remarksController = TextEditingController(); - String? branchError = null; - String? hospitalError = null; - String? clinicError = null; - String? doctorError = null; + String branchError = null; + String hospitalError = null; + String clinicError = null; + String doctorError = null; @override void initState() { @@ -50,12 +50,12 @@ class _PatientMakeReferralScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - referToList = []; + referToList = List(); dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; referToList.add(sameBranch); @@ -67,9 +67,9 @@ class _PatientMakeReferralScreenState extends State { onModelReady: (model) => model.getPatientReferral(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient!, + appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( child: Container( child: Column( @@ -106,18 +106,18 @@ class _PatientMakeReferralScreenState extends State { referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus, patientName: model.patientReferral[model.patientReferral.length - 1].patientName, patientGender: - model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender, + model.patientReferral[model.patientReferral.length - 1].patientDetails.gender, referredDate: - model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[0], + model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[0], referredTime: - model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[1], + model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[1], patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, isReferral: true, remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource, nationality: - model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName, + model.patientReferral[model.patientReferral.length - 1].patientDetails.nationalityName, nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl, doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl, referralDoctorName: @@ -140,22 +140,22 @@ class _PatientMakeReferralScreenState extends State { eventAction: "Submit Refer", ); 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; } @@ -374,11 +374,10 @@ class _PatientMakeReferralScreenState extends State { enabled: false, isTextFieldHasSuffix: true, suffixIcon: IconButton( - onPressed: () {}, icon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + Icons.calendar_today, + color: Colors.black, + )), onClick: () { _selectDate(context, model); }, @@ -401,7 +400,7 @@ class _PatientMakeReferralScreenState extends State { _selectDate(BuildContext context, PatientReferralViewModel model) async { // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://stackoverflow.com/a/63147062/6246772 to customize a date picker - final DateTime? picked = await showDatePicker( + final DateTime picked = await showDatePicker( context: context, initialDate: appointmentDate, firstDate: DateTime.now().add(Duration(hours: 2)), 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 c9c037e2..cfc26eee 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 @@ -21,6 +21,7 @@ import 'AddReplayOnReferralPatient.dart'; class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; + ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); @override @@ -138,7 +139,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", + "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", fontFamily: 'Poppins', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, @@ -150,7 +151,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getDayMonthYearDateFormatted( - referredPatient.referralDate!, + referredPatient.referralDate, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -183,7 +184,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.getTimeHHMMA( - referredPatient.referralDate!, + referredPatient.referralDate, ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -221,28 +222,29 @@ 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.5 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.frequencyDescription?? '', + if (referredPatient.frequency != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ), + Expanded( + child: AppText( + referredPatient.frequencyDescription ?? '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), ], ), ), @@ -260,11 +262,11 @@ class ReferralPatientDetailScreen extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.nationalityFlagURL!, + referredPatient.nationalityFlagURL, height: 25, width: 30, errorBuilder: - (BuildContext context, Object exception, StackTrace? stackTrace) { + (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -279,46 +281,49 @@ class ReferralPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority! + ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.priorityDescription?? '', + TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * 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.5 * 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.6 * 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, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * 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.6 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -337,11 +342,11 @@ class ReferralPatientDetailScreen extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL!, + referredPatient.doctorImageURL, height: 25, width: 30, errorBuilder: - (BuildContext context, Object exception, StackTrace? stackTrace) { + (BuildContext context, Object exception, StackTrace stackTrace) { return Text(''); }, )) @@ -431,7 +436,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), ), if (referredPatient.referredDoctorRemarks != null && - referredPatient.referredDoctorRemarks!.isNotEmpty) + referredPatient.referredDoctorRemarks.isNotEmpty) Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), @@ -495,7 +500,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, isEdited: referredPatient.referredDoctorRemarks != null && - referredPatient.referredDoctorRemarks!.isNotEmpty, + referredPatient.referredDoctorRemarks.isNotEmpty, ), ), ); diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 246ab11d..354ee04f 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -27,7 +27,7 @@ class _ReferredPatientScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referredPatient!, + appBarTitle: TranslationBase.of(context).referredPatient, body: Column( children: [ Container( @@ -47,7 +47,8 @@ class _ReferredPatientScreenState extends State { }, ), ), - model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 + model.listMyReferredPatientModel == null || + model.listMyReferredPatientModel.length == 0 ? Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -80,38 +81,67 @@ class _ReferredPatientScreenState extends State { shrinkWrap: true, itemBuilder: (context, index) { return InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferredPatientDetailScreen(model.getReferredPatientItem(index), + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferredPatientDetailScreen( + model.getReferredPatientItem(index), this.patientType), - ), - ); - }, - 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), + ), + ); }, ), ], @@ -132,7 +162,8 @@ class PatientTypeRadioWidget extends StatefulWidget { PatientTypeRadioWidget(this.radioOnChange); @override - _PatientTypeRadioWidgetState createState() => _PatientTypeRadioWidgetState(this.radioOnChange); + _PatientTypeRadioWidgetState createState() => + _PatientTypeRadioWidgetState(this.radioOnChange); } class _PatientTypeRadioWidgetState extends State { @@ -151,9 +182,9 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).inPatient), value: PatientType.IN_PATIENT, groupValue: patientType, - onChanged: (PatientType? value) { + onChanged: (PatientType value) { setState(() { - patientType = value!; + patientType = value; radioOnChange(value); }); }, @@ -164,9 +195,9 @@ class _PatientTypeRadioWidgetState extends State { title: AppText(TranslationBase.of(context).outpatient), value: PatientType.OUT_PATIENT, groupValue: patientType, - onChanged: (PatientType? value) { + onChanged: (PatientType value) { setState(() { - patientType = value!; + patientType = value; radioOnChange(value); }); }, 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 c292497f..f6d3b8d7 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 @@ -52,7 +52,8 @@ class ReferredPatientDetailScreen 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', @@ -69,15 +70,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromReferral(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = + model.getPatientFromReferral(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": patientType == PatientType.IN_PATIENT, "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( @@ -92,15 +97,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromReferral(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = + model.getPatientFromReferral(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": patientType == PatientType.IN_PATIENT, "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: Column( @@ -137,7 +146,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( referredPatient.referralStatusDesc, @@ -152,7 +162,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate ?? "", "dd MMM,yyyy"), + referredPatient.referralDate, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -161,16 +172,20 @@ class ReferredPatientDetailScreen 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( @@ -184,7 +199,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), AppText( AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate ?? "", "hh:mm a"), + referredPatient.referralDate, + "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -193,25 +209,29 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.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.referralClinicDescription, + referredPatient + .referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -220,52 +240,66 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), - if(referredPatient - .frequencyDescription != 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, + if (referredPatient + .frequencyDescription != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 14, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0XFF2E303A), + ), + ), + ], + ), ], ), ), 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'); }, )) @@ -281,50 +315,64 @@ class ReferredPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority ?? "" + ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - AppText( - referredPatient.priorityDescription, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 14, - color: Color(0XFF2E303A), - ), - ], - ), - 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"):'', + TranslationBase.of(context).priority + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 14, color: Color(0XFF2E303A), ), - ), - ], - ), + ], + ), + 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") + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), Row( 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_left.png', height: 50, @@ -332,17 +380,26 @@ class ReferredPatientDetailScreen 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 ?? "", + referredPatient.doctorImageURL, height: 25, width: 30, errorBuilder: - (BuildContext context, Object exception, StackTrace? stackTrace) { + (BuildContext context, + Object exception, + StackTrace stackTrace) { return Text('No Image'); }, )) @@ -358,22 +415,30 @@ class ReferredPatientDetailScreen 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.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * + SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient.referralClinicDescription, + referredPatient + .referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * SizeConfig.textMultiplier, + fontSize: 1.3 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -430,16 +495,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0), + margin: EdgeInsets.only( + left: 0, top: 0, right: 4, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: referredPatient.doctorImageURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL ?? "", + referredPatient.doctorImageURL, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { return Text('No Image'); }, )) @@ -464,8 +532,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient - .referredDoctorRemarks == null ?'':referredPatient.referredDoctorRemarks!.isNotEmpty + referredPatient.referredDoctorRemarks == + null + ? '' + : referredPatient.referredDoctorRemarks + .isNotEmpty ? referredPatient .referredDoctorRemarks : TranslationBase.of(context) @@ -485,28 +556,34 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), ), - if (patientType == PatientType.IN_PATIENT)Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: AppButton( - title: TranslationBase.of(context).acknowledged, - color: Colors.red[700], - fontColor: Colors.white, - fontWeight: FontWeight.w700, - fontSize: 1.8, - hPadding: 8, - vPadding: 12, - disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks!.isNotEmpty ? false : true, - onPressed: () async { - await model.verifyReferralDoctorRemarks(referredPatient); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast("Referral is acknowledged"); - Navigator.pop(context); - } - }, + if (patientType == PatientType.IN_PATIENT) + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: AppButton( + title: TranslationBase.of(context).acknowledged, + color: Colors.red[700], + fontColor: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 1.8, + hPadding: 8, + vPadding: 12, + disabled: referredPatient.referredDoctorRemarks == null + ? true + : referredPatient.referredDoctorRemarks.isNotEmpty + ? false + : true, + onPressed: () async { + await model.verifyReferralDoctorRemarks(referredPatient); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast( + "Referral is acknowledged"); + Navigator.pop(context); + } + }, + ), ), - ), ], ), ), diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 17b8740c..53447743 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -34,12 +34,12 @@ class AddAssessmentDetails extends StatefulWidget { final bool isUpdate; AddAssessmentDetails( - {Key? key, - required this.mySelectedAssessment, - required this.addSelectedAssessment, - required this.patientInfo, + {Key key, + this.mySelectedAssessment, + this.addSelectedAssessment, + this.patientInfo, this.isUpdate = false, - required this.mySelectedAssessmentList}); + this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -60,37 +60,48 @@ class _AddAssessmentDetailsState extends State { ProjectViewModel projectViewModel = Provider.of(context); remarkController.text = widget.mySelectedAssessment.remark ?? ""; - appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); + appointmentIdController.text = + widget.mySelectedAssessment.appointmentId.toString(); if (widget.isUpdate) { if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" - : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; + ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr + : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; if (widget.mySelectedAssessment.selectedDiagnosisType != null) typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr ?? "" - : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn ?? ""; + ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr + : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; if (widget.mySelectedAssessment.selectedICD != null) - icdNameController.text = widget.mySelectedAssessment.selectedICD!.code; + icdNameController.text = widget.mySelectedAssessment.selectedICD.code; } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, - {IconData? icon, String? validationError}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData icon, String validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: - BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), + borderSide: BorderSide( + color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), + width: 2.5), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), + borderSide: BorderSide( + color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), + width: 2.5), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), + borderSide: BorderSide( + color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), + width: 2.5), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -124,77 +135,113 @@ class _AddAssessmentDetailsState extends State { FractionallySizedBox( widthFactor: 0.9, child: Container( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - // height: 55.0, - height: Helpers.getTextFieldHeight(),hintText: TranslationBase.of(context).appointmentNumber, - isTextFieldHasSuffix: false, - enabled: false, - controller: appointmentIdController, - ), - ), - SizedBox( - height: 10, - ), - Container( - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = null; - icdNameController.text = null!; - }); - } - : null, - child: widget.mySelectedAssessment.selectedICD == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, - child: AutoCompleteTextField( - decoration: TextFieldsUtils.textFieldSelectorDecoration( - TranslationBase.of(context).nameOrICD!, "", true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment.selectedICD = item; - icdNameController.text = '${item.code.trim()}/${item.description}'; - }), - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => new Padding( - child: AppText(suggestion.description + " / " + suggestion.code.toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.code.toLowerCase().startsWith(input.toLowerCase()), - ), - ) - : AppTextFieldCustom(height: Helpers.getTextFieldHeight(), - onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = null; - icdNameController.text = null!; - }); - } - : null, - hintText: TranslationBase.of(context).nameOrICD, - maxLines: 1, - minLines: 1, - controller: icdNameController, - enabled: true, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - onPressed: () {}, - icon: Icon( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + // height: 55.0, + height: Helpers.getTextFieldHeight(), + + hintText: + TranslationBase.of(context).appointmentNumber, + isTextFieldHasSuffix: false, + enabled: false, + controller: appointmentIdController, + ), + ), + SizedBox( + height: 10, + ), + Container( + child: InkWell( + onTap: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : null, + child: widget + .mySelectedAssessment.selectedICD == + null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + widget.mySelectedAssessment + .selectedICD == + null, + child: AutoCompleteTextField< + MasterKeyModel>( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + TranslationBase.of(context) + .nameOrICD, + null, + true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment + .selectedICD = item; + icdNameController.text = + '${item.code.trim()}/${item.description}'; + }), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => + new Padding( + child: AppText( + suggestion.description + + " / " + + suggestion.code + .toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.code + .toLowerCase() + .startsWith( + input.toLowerCase()), + ), + ) + : AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : null, + hintText: TranslationBase.of(context) + .nameOrICD, + maxLines: 1, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( Icons.search, color: Colors.grey.shade600, )), - )),), + )), + ), if(widget.mySelectedAssessment .selectedICD != null) @@ -220,103 +267,132 @@ class _AddAssessmentDetailsState extends State { ), ), ], - ), - SizedBox( - height: 7, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisCondition != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,okFunction: (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; - conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr ?? "" - : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn ?? ""; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).condition, - maxLines: 1, - minLines: 1, - controller: conditionController, - isTextFieldHasSuffix: true, - enabled: false, - hasBorder: true, - validationError: - isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null + ), + SizedBox( + height: 7, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + + onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, + + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment + .selectedDiagnosisCondition = + selectedValue; + conditionController + .text = projectViewModel + .isArabic + ? widget + .mySelectedAssessment + .selectedDiagnosisCondition + .nameAr + : widget + .mySelectedAssessment + .selectedDiagnosisCondition + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).condition, + maxLines: 1, + minLines: 1, + controller: conditionController, + isTextFieldHasSuffix: true, + enabled: false, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == + null ? TranslationBase.of(context).emptyMessage : null, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisType != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,okFunction: (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; - typeController.text = - (projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn)!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).dType, - maxLines: 1, - minLines: 1, - enabled: false, - isTextFieldHasSuffix: true, - controller: typeController, - hasBorder: true, - validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).remarks, - maxLines: 18, - minLines: 5, - inputType: TextInputType.multiline, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = remarkController.text; - }, - ), - ), - SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), - ), + onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment + .selectedDiagnosisType = + selectedValue; + typeController.text = + projectViewModel.isArabic + ? selectedValue.nameAr + : selectedValue.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).dType, + maxLines: 1, + minLines: 1, + enabled: false, + isTextFieldHasSuffix: true, + controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == + null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + maxLines: 18, + minLines: 5, + inputType: TextInputType.multiline, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = + remarkController.text; + }, + ), + ), + SizedBox( + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + + ), ])), ), ], @@ -326,23 +402,31 @@ class _AddAssessmentDetailsState extends State { bottomSheet: model.state == ViewState.Busy?Container(height: 0,): BottomSheetDialogButton( - label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), - onTap: () async { - setState(() { - isFormSubmitted = true; - }); - widget.mySelectedAssessment.remark = remarkController.text; - widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - widget.mySelectedAssessment.selectedDiagnosisType != null && - widget.mySelectedAssessment.selectedICD != null) { - await submitAssessment( - isUpdate: widget.isUpdate, - model: model, - mySelectedAssessment: widget.mySelectedAssessment); - } - }, - + label: (widget.isUpdate + ? 'Update Assessment Details' + : 'Add Assessment Details'), + onTap: () async { + setState(() { + isFormSubmitted = true; + }); + widget.mySelectedAssessment.remark = + remarkController.text; + widget.mySelectedAssessment.appointmentId = + int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment + .selectedDiagnosisCondition != + null && + widget.mySelectedAssessment + .selectedDiagnosisType != + null && + widget.mySelectedAssessment.selectedICD != null) { + await submitAssessment( + isUpdate: widget.isUpdate, + model: model, + mySelectedAssessment: + widget.mySelectedAssessment); + } + }, ), ), ), @@ -350,7 +434,9 @@ class _AddAssessmentDetailsState extends State { } submitAssessment( - {required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { + {SOAPViewModel model, + MySelectedAssessment mySelectedAssessment, + bool isUpdate = false}) async { GifLoaderDialogUtils.showMyDialog(context); if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( @@ -359,24 +445,25 @@ class _AddAssessmentDetailsState extends State { appointmentNo: widget.patientInfo.appointmentNo, remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, - icdcode10Id: mySelectedAssessment.selectedICD!.code, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code, prevIcdCode10ID: mySelectedAssessment.icdCode10ID); await model.patchAssessment(patchAssessmentReqModel); } else { - PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, - icdcode10Id: mySelectedAssessment.selectedICD!.code) + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code) ]); await model.postAssessment(postAssessmentRequestModel); @@ -389,7 +476,7 @@ class _AddAssessmentDetailsState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; widget.addSelectedAssessment(mySelectedAssessment, isUpdate); Navigator.of(context).pop(); diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index f42289f9..80cdc34c 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -30,12 +30,13 @@ class UpdateAssessmentPage extends StatefulWidget { final PatiantInformtion patientInfo; final Function changeLoadingState; final int currentIndex; + UpdateAssessmentPage( - {Key? key, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -44,7 +45,7 @@ class UpdateAssessmentPage extends StatefulWidget { class _UpdateAssessmentPageState extends State implements AssessmentCallBack { bool isAssessmentExpand = false; - List mySelectedAssessmentList = []; + List mySelectedAssessmentList = List(); @override Widget build(BuildContext context) { @@ -59,30 +60,33 @@ class _UpdateAssessmentPageState extends State if (model.patientAssessmentList.isNotEmpty) { model.patientAssessmentList.forEach((element) { - MasterKeyModel? diagnosisType = model.getOneMasterKey( + MasterKeyModel diagnosisType = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisType, id: element.diagnosisTypeID, ); - MasterKeyModel? selectedICD = model.getOneMasterKey( + MasterKeyModel selectedICD = model.getOneMasterKey( masterKeys: MasterKeysService.ICD10, id: element.icdCode10ID, ); - MasterKeyModel? diagnosisCondition = model.getOneMasterKey( + MasterKeyModel diagnosisCondition = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment( - appointmentNo: element.appointmentNo, - remark: element.remarks, - diagnosisType: diagnosisType, - diagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID); + if (diagnosisCondition != null && + diagnosisType != null && + diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = + SoapUtils.generateMySelectedAssessment( + appointmentNo: element.appointmentNo, + remark: element.remarks, + diagnosisType: diagnosisType, + diagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); mySelectedAssessmentList.add(temMySelectedAssessment); } @@ -477,9 +481,10 @@ class _UpdateAssessmentPageState extends State } openAssessmentDialog(BuildContext context, - {MySelectedAssessment? assessment, required bool isUpdate, required SOAPViewModel model}) { + {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { if (assessment == null) { - assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo); + assessment = SoapUtils.generateMySelectedAssessment( + remark: '', appointmentNo: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -487,11 +492,12 @@ class _UpdateAssessmentPageState extends State context: context, builder: (context) { return AddAssessmentDetails( - mySelectedAssessment: assessment!, + mySelectedAssessment: assessment, patientInfo: widget.patientInfo, isUpdate: isUpdate, mySelectedAssessmentList: mySelectedAssessmentList, - addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, + bool isUpdate) async { setState(() { if (!isUpdate) mySelectedAssessmentList.add(mySelectedAssessment); diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 3f55b8f4..42b94656 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -18,7 +18,9 @@ class AddExaminationPage extends StatefulWidget { final Function(MasterKeyModel) removeExamination; AddExaminationPage( - {required this.mySelectedExamination, required this.addSelectedExamination, required this.removeExamination}); + {this.mySelectedExamination, + this.addSelectedExamination, + this.removeExamination}); @override _AddExaminationPageState createState() => _AddExaminationPageState(); @@ -50,10 +52,9 @@ class _AddExaminationPageState extends State { backgroundColor: Color.fromRGBO(248, 248, 248, 1), body: Column( mainAxisAlignment: MainAxisAlignment.start, - - children: [ - Expanded( - child: SingleChildScrollView( + children: [ + Expanded( + child: SingleChildScrollView( child: Column( children: [ Container( @@ -72,8 +73,10 @@ class _AddExaminationPageState extends State { children: [ ExaminationsListSearchWidget( mySelectedExamination: - widget.mySelectedExamination,masterList: model.physicalExaminationList, - isServiceSelected: (master) => isServiceSelected(master), + widget.mySelectedExamination, + masterList: model.physicalExaminationList, + isServiceSelected: (master) => + isServiceSelected(master), removeExamination: (selectedExamination) { setState(() { mySelectedExaminationLocal.remove(selectedExamination); @@ -81,7 +84,8 @@ class _AddExaminationPageState extends State { }, addExamination: (selectedExamination) { - mySelectedExaminationLocal.insert(0, selectedExamination); + mySelectedExaminationLocal + .insert(0, selectedExamination); // setState(() {}); }, ), @@ -100,7 +104,7 @@ class _AddExaminationPageState extends State { ) : BottomSheetDialogButton( label: "${TranslationBase.of(context).addExamination}", - onTap: () { + onTap: () { widget.addSelectedExamination(mySelectedExaminationLocal); }, ), @@ -108,8 +112,10 @@ class _AddExaminationPageState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = mySelectedExaminationLocal.where((element) => - masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); + Iterable exam = mySelectedExaminationLocal.where( + (element) => + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); if (exam.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index e6df38e7..c9202e52 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -8,7 +8,6 @@ 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:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_html/shims/dart_ui.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -19,16 +18,16 @@ class AddExaminationWidget extends StatefulWidget { final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; bool isExpand; - final VoidCallback expandClick; + final Function expandClick; final List mySelectedExamination; AddExaminationWidget({ - required this.item, - required this.removeExamination, - required this.addExamination, - required this.isServiceSelected, - required this.isExpand, - required this.expandClick, + this.item, + this.removeExamination, + this.addExamination, + this.isServiceSelected, + this.isExpand, + this.expandClick, this.mySelectedExamination, }); @@ -98,7 +97,9 @@ class _AddExaminationWidgetState extends State { margin: EdgeInsets.symmetric(horizontal: 8), child: InkWell( onTap: widget.expandClick, - child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + child: Icon(widget.isExpand + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), ), ], ), @@ -142,7 +143,9 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 1 ? HexColor("#D02127") : Colors.white, + color: status == 1 + ? HexColor("#D02127") + : Colors.white, shape: BoxShape.circle, ), ), @@ -180,7 +183,9 @@ class _AddExaminationWidgetState extends State { ), child: Container( decoration: BoxDecoration( - color: status == 2 ? HexColor("#D02127") : Colors.white, + color: status == 2 + ? HexColor("#D02127") + : Colors.white, shape: BoxShape.circle, ), ), @@ -206,23 +211,26 @@ class _AddExaminationWidgetState extends State { examination.notExamined = true; }, child: Row( - children: [Container( - padding: EdgeInsets.all(2.0), - margin: EdgeInsets.symmetric(horizontal: 6), - width: 20, - height: 20, - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.circle, - border: Border.all(color: Colors.grey, width: 1), - ), - child: Container( + children: [ + Container( + padding: EdgeInsets.all(2.0), + margin: EdgeInsets.symmetric(horizontal: 6), + width: 20, + height: 20, decoration: BoxDecoration( - color: status == 3 ? HexColor("#D02127") : Colors.white, + color: Colors.white, shape: BoxShape.circle, + border: Border.all(color: Colors.grey, width: 1), + ), + child: Container( + decoration: BoxDecoration( + color: status == 3 + ? HexColor("#D02127") + : Colors.white, + shape: BoxShape.circle, + ), ), ), - ), Expanded( child: AppText( TranslationBase.of(context).notExamined, diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 7ad9dedd..9dd00302 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -10,7 +10,7 @@ import 'package:provider/provider.dart'; class ExaminationItemCard extends StatelessWidget { final MySelectedExamination examination; - final VoidCallback removeExamination; + final Function removeExamination; ExaminationItemCard(this.examination, this.removeExamination); @@ -31,10 +31,11 @@ class ExaminationItemCard extends StatelessWidget { child: Container( child: AppText( projectViewModel.isArabic - ? examination.selectedExamination!.nameAr != null && examination.selectedExamination!.nameAr != "" - ? examination.selectedExamination!.nameAr - : examination.selectedExamination!.nameEn - : examination.selectedExamination!.nameEn, + ? examination.selectedExamination.nameAr != null && + examination.selectedExamination.nameAr != "" + ? examination.selectedExamination.nameAr + : examination.selectedExamination.nameEn + : examination.selectedExamination.nameEn, fontWeight: FontWeight.w600, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -47,15 +48,15 @@ class ExaminationItemCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - !examination.isNormal! - ? examination.isAbnormal! + !examination.isNormal + ? examination.isAbnormal ? TranslationBase.of(context).abnormal : TranslationBase.of(context).notExamined : TranslationBase.of(context).normal, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - color: !examination.isNormal! - ? examination.isAbnormal! + color: !examination.isNormal + ? examination.isAbnormal ? Colors.red.shade800 : Colors.grey.shade800 : Colors.green.shade800, diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index c89b30d3..c041b545 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -16,18 +16,20 @@ class ExaminationsListSearchWidget extends StatefulWidget { final List mySelectedExamination; ExaminationsListSearchWidget( - {required this.removeExamination, - required this.addExamination, - required this.isServiceSelected, - required this.masterList, this.mySelectedExamination}); + {this.removeExamination, + this.addExamination, + this.isServiceSelected, + this.masterList, this.mySelectedExamination}); @override - _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); + _ExaminationsListSearchWidgetState createState() => + _ExaminationsListSearchWidgetState(); } -class _ExaminationsListSearchWidgetState extends State { +class _ExaminationsListSearchWidgetState + extends State { int expandedIndex = -1; - List items = []; + List items = List(); TextEditingController filteredSearchController = TextEditingController(); @override @@ -51,11 +53,10 @@ class _ExaminationsListSearchWidgetState extends State dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { - if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || - item.nameEn!.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || + item.nameEn.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 99891220..9712eafd 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -31,11 +31,11 @@ class UpdateObjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key? key, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -44,9 +44,10 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; - List mySelectedExamination = []; + List mySelectedExamination = List(); - BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -294,7 +295,8 @@ class _UpdateObjectivePageState extends State removeExamination(MasterKeyModel masterKey) { Iterable history = mySelectedExamination.where( (element) => - masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) { setState(() { diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index f2f67f8c..37a6096e 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -31,12 +31,12 @@ class UpdatePlanPage extends StatefulWidget { final int currentIndex; UpdatePlanPage( - {Key? key, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex, - required this.sOAPViewModel, + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex, + this.sOAPViewModel, this.changeStateFun}); @override @@ -50,9 +50,11 @@ class _UpdatePlanPageState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - TextEditingController progressNoteController = TextEditingController(text: null); + TextEditingController progressNoteController = + TextEditingController(text: null); - BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -115,13 +117,16 @@ class _UpdatePlanPageState extends State Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - widget.sOAPViewModel.setPlanCallBack(this);GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( - appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel + widget.sOAPViewModel.setPlanCallBack(this); + GetGetProgressNoteReqModel getGetProgressNoteReqModel = + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel .getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { @@ -356,8 +361,8 @@ class _UpdatePlanPageState extends State episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, planNote: patientProgressNote.planNote, - doctorID: '', - editedBy: ''); + doctorID: '', + editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { await widget.sOAPViewModel diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 3816dfa9..6449913c 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -4,48 +4,52 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class SOAPOpenItems extends StatelessWidget { - final VoidCallback onTap; + final Function onTap; final String label; - const SOAPOpenItems({Key? key, required this.onTap, required this.label}) : super(key: key); + const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { - return InkWell( + return InkWell( onTap: onTap, child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0), + padding: EdgeInsets.symmetric( + vertical: 8, horizontal: 8.0), margin: EdgeInsets.symmetric(vertical: 8), decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade400, width: 0.5), + border: Border.all( + color: Colors.grey.shade400, width: 0.5), borderRadius: BorderRadius.all( Radius.circular(8), ), color: Colors.white, ), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "$label", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*4.5, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "$label", + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4.5, fontWeight: FontWeight.w700, - color: Color(0xFF2E303A), - letterSpacing:-0.44, - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, + color: Color(0xFF2E303A), + letterSpacing:-0.44 , + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*3.5, fontWeight: FontWeight.w500, - color: Color(0xFF575757), - letterSpacing:-0.56, - ), - ], - )), + color: Color(0xFF575757), + letterSpacing:-0.56 , + ), + ], + )), Icon( Icons.add_box_rounded, size: 28, @@ -57,3 +61,6 @@ class SOAPOpenItems extends StatelessWidget { ); } } + + + diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index ef92e0db..8d29150e 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -7,9 +7,8 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ - Key? key, - required this.currentIndex, - required this.changePageViewIndex, this.patientInfo, + Key key, + this.currentIndex, this.changePageViewIndex, this.patientInfo, }) : super(key: key); final int currentIndex; @@ -22,9 +21,7 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 15, - ), + SizedBox(height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 15,), AppText( TranslationBase.of(context).createNew, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4), @@ -33,8 +30,7 @@ class SOAPStepHeader extends StatelessWidget { color: Color(0xFF2E303A), ), - AppText( - TranslationBase.of(context).episode, + AppText(TranslationBase.of(context).episode, fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 8), fontWeight: FontWeight.bold, letterSpacing:-1.44, diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index c7d48e1c..835dd225 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -9,7 +9,7 @@ class BottomSheetDialogButton extends StatelessWidget { double headerHeight = SizeConfig.heightMultiplier * 12; - BottomSheetDialogButton({Key? key, this.onTap, this.label}) : super(key: key); + BottomSheetDialogButton({Key key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index f9055e1a..d6c19372 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -4,8 +4,7 @@ import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { BottomSheetTitle({ - Key? key, - required this.title, + Key key, this.title, }) : super(key: key); final String title; @@ -13,42 +12,51 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { @override Widget build(BuildContext context) { return Container( - //padding: EdgeInsets.only(// left: 0, right: 5, bottom: 5, top: 5), + // padding: EdgeInsets.only( + // left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), height: headerHeight, child: Center( - child: Container( - padding: EdgeInsets.only(left: 10, right: 10), - margin: EdgeInsets.only(top: headerHeight *0.5), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle(fontSize: 20, color: Colors.black), - children: [ - new TextSpan( - text: title, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), - ], + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: headerHeight *0.5), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( + + text: title, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), + ], + ), ), - ), - InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Icon(DoctorApp.close_1, size: SizeConfig.getTextMultiplierBasedOnWidth()*5, color: Color(0xFF2B353E))) - ], - ), - ],), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(DoctorApp.close_1, + size:SizeConfig.getTextMultiplierBasedOnWidth()*5, + color: Color(0xFF2B353E))) + ], + ), + ], + ), ), ), ); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 866900d9..c1b2d443 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -9,17 +9,12 @@ import 'package:hexcolor/hexcolor.dart'; class ExpandableSOAPWidget extends StatelessWidget { final bool isExpanded; final Widget child; - final VoidCallback onTap; + final Function onTap; final headerTitle; final bool isRequired; const ExpandableSOAPWidget( - {Key? key, - required this.isExpanded, - required this.child, - required this.onTap, - this.headerTitle, - this.isRequired = true}) + {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) : super(key: key); @override @@ -31,10 +26,12 @@ class ExpandableSOAPWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: HexColor('#707070'), width: 0.30), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), ), child: HeaderBodyExpandableNotifier( - headerWidget: InkWell( + headerWidget: InkWell( onTap: onTap, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -43,20 +40,24 @@ class ExpandableSOAPWidget extends StatelessWidget { onTap: onTap, child: Row( children: [ - AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), + AppText(headerTitle, + variant: isExpanded ? "bodyText" : '', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), letterSpacing:-0.64, - fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), - if (isRequired) - Icon( - FontAwesomeIcons.asterisk, - size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, - ) + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A),), + if(isRequired) + Icon( + FontAwesomeIcons.asterisk, + size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, + ) ], ), ), InkWell( onTap: onTap, - child: Icon(isExpanded ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline), + child: Icon( + isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), ) ], ), @@ -66,4 +67,4 @@ class ExpandableSOAPWidget extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart index c64fe86a..1e5231c9 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart @@ -10,7 +10,7 @@ class RemoveButton extends StatelessWidget { final Function onTap; final String label; - const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key); + const RemoveButton({Key key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index 22f92f00..e1c97d75 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -16,7 +16,7 @@ class StepsWidget extends StatelessWidget { final PatiantInformtion patientInfo; StepsWidget( - {Key? key, + {Key key, this.index, this.changeCurrentTab, this.height = 0.0, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index ff5c6e6f..60c43d00 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -19,19 +19,20 @@ class AddAllergies extends StatefulWidget { final Function addAllergiesFun; final List myAllergiesList; - const AddAllergies({Key? key, required this.addAllergiesFun, required this.myAllergiesList}) : super(key: key); + const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) + : super(key: key); @override _AddAllergiesState createState() => _AddAllergiesState(); } class _AddAllergiesState extends State { - late List allergiesList; - late List allergySeverityList; + List allergiesList; + List allergySeverityList; TextEditingController remarkController = TextEditingController(); TextEditingController severityController = TextEditingController(); TextEditingController allergyController = TextEditingController(); - late List myAllergiesListLocal; + List myAllergiesListLocal; @override initState() { @@ -59,7 +60,7 @@ class _AddAllergiesState extends State { baseViewModel: model, isShowAppBar: true, appBar: BottomSheetTitle( - title: TranslationBase.of(context).addAllergies??"", + title: TranslationBase.of(context).addAllergies, ), body: Center( child: Container( @@ -131,10 +132,11 @@ class _AddAllergiesState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where((element) => - masterKey.id == element.selectedAllergy!.id && - masterKey.typeId == element.selectedAllergy!.typeId && - element.isChecked!); + Iterable allergy = myAllergiesListLocal.where( + (element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); if (allergy.length > 0) { return true; } @@ -142,14 +144,16 @@ class _AddAllergiesState extends State { } removeAllergyFromLocalList(MasterKeyModel masterKey) { - myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); + myAllergiesListLocal + .removeWhere((element) => element.selectedAllergy.id == masterKey.id); } - MySelectedAllergy? getSelectedAllergy(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where((element) => - masterKey.id == element.selectedAllergy!.id && - masterKey.typeId == element.selectedAllergy!.typeId && - element.isChecked!); + MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { + Iterable allergy = myAllergiesListLocal.where( + (element) => + masterKey.id == element.selectedAllergy.id && + masterKey.typeId == element.selectedAllergy.typeId && + element.isChecked); if (allergy.length > 0) { return allergy.first; } @@ -164,14 +168,17 @@ class _AddAllergiesState extends State { List allergy = // ignore: missing_return myAllergiesListLocal - .where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id) + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) .toList(); if (allergy.isEmpty) { myAllergiesListLocal.add(mySelectedAllergy); } else { allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; allergy.first.remark = mySelectedAllergy.remark; allergy.first.isChecked = mySelectedAllergy.isChecked; } diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index cceab871..130e730d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -26,7 +26,7 @@ class AddAllergiesItem extends StatefulWidget { final MasterKeyModel item; const AddAllergiesItem( - {Key? key, + {Key key, this.model, this.removeAllergy, this.addAllergy, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 2c13c5b2..8819f04a 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -24,7 +24,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final String hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key? key, + {Key key, this.model, this.addSelectedAllergy, this.removeAllergy, @@ -43,7 +43,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { - List items = []; + List items = List(); TextEditingController filteredSearchController = TextEditingController(); @override @@ -122,10 +122,10 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState } void filterSearchResults(String query) { - List dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((items) { if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) { diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index b0902519..c8a519c3 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -17,7 +17,7 @@ import 'add_allergies.dart'; class UpdateAllergiesWidget extends StatefulWidget { List myAllergiesList; - UpdateAllergiesWidget({Key? key, required this.myAllergiesList}); + UpdateAllergiesWidget({Key key, this.myAllergiesList}); @override _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); @@ -38,7 +38,6 @@ class _UpdateAllergiesWidgetState extends State { onTap: () { openAllergiesList(context, changeAllState, removeAllergy); }, - ), SizedBox( height: 20, @@ -64,11 +63,14 @@ class _UpdateAllergiesWidgetState extends State { children: [ AppText( projectViewModel.isArabic - ? selectedAllergy.selectedAllergy!.nameAr - : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(), - textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, - bold: true, - color: Color(0xFF2B353E), + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Color(0xFF2B353E), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontWeight: FontWeight.w700, letterSpacing: -0.48, @@ -93,7 +95,7 @@ class _UpdateAllergiesWidgetState extends State { ), width: MediaQuery.of(context).size.width * 0.5, ), - if (selectedAllergy.isChecked!) + if (selectedAllergy.isChecked) RemoveButton( onTap: () => removeAllergy(selectedAllergy), ) @@ -126,9 +128,10 @@ class _UpdateAllergiesWidgetState extends State { // ignore: missing_return widget.myAllergiesList .where((element) => - mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && - mySelectedAllergy.selectedAllergy!.id == - element.selectedAllergy!.id) + mySelectedAllergy.selectedAllergySeverity.id == + element.selectedAllergySeverity.id && + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) .toList(); if (allergy.length > 0) { @@ -192,7 +195,8 @@ class _UpdateAllergiesWidgetState extends State { changeParentState(); Navigator.of(context).pop(); } else { - Helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + Helpers.showErrorToast( + TranslationBase.of(context).requiredMsg); } }); }); diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index dd64365e..0e5e6ec1 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -7,14 +7,14 @@ import '../medication/update_medication_widget.dart'; class UpdateChiefComplaints extends StatelessWidget { const UpdateChiefComplaints({ - Key? key, - required this.formKey, - required this.complaintsController, - required this.illnessController, - required this.medicationController, - required this.complaintsControllerError, - required this.illnessControllerError, - required this.medicationControllerError, + Key key, + @required this.formKey, + @required this.complaintsController, + @required this.illnessController, + @required this.medicationController, + this.complaintsControllerError, + this.illnessControllerError, + this.medicationControllerError, }) : super(key: key); final GlobalKey formKey; @@ -41,43 +41,56 @@ class UpdateChiefComplaints extends StatelessWidget { minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - validationError: complaintsControllerError != '' ? complaintsControllerError : null, + validationError: complaintsControllerError != '' + ? complaintsControllerError + : null, ), - SizedBox( + SizedBox( height: 20, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).historyOfPresentIllness, + hintText: TranslationBase + .of(context) + .historyOfPresentIllness, controller: illnessController, inputType: TextInputType.multiline, + maxLines: 25, minLines: 7, hasBorder: true, - validationError: illnessControllerError != '' ? illnessControllerError : null, - ), - SizedBox( - height: 10, - ), - UpdateMedicationWidget( - medicationController: medicationController, - ), - SizedBox( - height: 10, - ), + validationError: illnessControllerError != '' + ? illnessControllerError + : null, + ), + SizedBox( + height: 10, + ), + UpdateMedicationWidget( + medicationController: medicationController, + ), + SizedBox( + height: 10, + ), AppTextFieldCustom( - hintText: TranslationBase.of(context).currentMedications, + hintText: TranslationBase + .of(context) + .currentMedications, controller: medicationController, maxLines: 25, minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - validationError: medicationControllerError != '' ? medicationControllerError : null, - ), - SizedBox( - height: 10, - ), - ]), + + validationError: medicationControllerError != '' + ? medicationControllerError + : null, + + ), + SizedBox( + height: 10, + ), + ]), ); } -} +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index cb0598cd..b10d831d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -23,12 +23,12 @@ class AddHistoryDialog extends StatefulWidget { final Function(MasterKeyModel) removeHistory; const AddHistoryDialog( - {Key? key, - required this.changePageViewIndex, - required this.controller, - required this.myHistoryList, - required this.addSelectedHistories, - required this.removeHistory}) + {Key key, + this.changePageViewIndex, + this.controller, + this.myHistoryList, + this.addSelectedHistories, + this.removeHistory}) : super(key: key); @override @@ -167,7 +167,7 @@ class _AddHistoryDialogState extends State { ) : BottomSheetDialogButton( label: TranslationBase.of(context).addSelectedHistories, - onTap: () { + onTap: () { widget.addSelectedHistories(); }, ), @@ -177,8 +177,9 @@ class _AddHistoryDialogState extends State { createAndAddHistory(MasterKeyModel history) { List myhistory = widget.myHistoryList - .where( - (element) => history.id == element.selectedHistory!.id && history.typeId == element.selectedHistory!.typeId) + .where((element) => + history.id == element.selectedHistory.id && + history.typeId == element.selectedHistory.typeId) .toList(); if (myhistory.isEmpty) { @@ -197,10 +198,11 @@ class _AddHistoryDialogState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable history = widget.myHistoryList.where((element) => - masterKey.id == element.selectedHistory!.id && - masterKey.typeId == element.selectedHistory!.typeId && - element.isChecked!); + Iterable history = widget.myHistoryList.where( + (element) => + masterKey.id == element.selectedHistory.id && + masterKey.typeId == element.selectedHistory.typeId && + element.isChecked); if (history.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index 94919109..305b0c65 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -8,7 +8,7 @@ import 'package:provider/provider.dart'; class PriorityBar extends StatefulWidget { final Function onTap; - const PriorityBar({Key? key, required this.onTap}) : super(key: key); + const PriorityBar({Key key, this.onTap}) : super(key: key); @override _PriorityBarState createState() => _PriorityBarState(); @@ -28,7 +28,8 @@ class _PriorityBarState extends State { "طبي", ]; - BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { return BoxDecoration(); } @@ -57,11 +58,14 @@ class _PriorityBarState extends State { children: [ Container( height: screenSize.height * 0.070, - decoration: containerBorderDecoration(_isActive ? HexColor("#B8382B") : Colors.white, + decoration: containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white), child: Center( child: Text( - (projectViewModel.isArabic) ? _prioritiesAr[index] : item, + (projectViewModel.isArabic) + ? _prioritiesAr[index] + : item, textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, @@ -71,12 +75,8 @@ class _PriorityBarState extends State { ), ), ), - if (_isActive) - Container( - width: 120, - height: 4, - color: AppGlobal.appPrimaryColor, - ) + if(_isActive) + Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) ], ), ), diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index f0512273..e00a83f5 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -14,14 +14,15 @@ import 'add_history_dialog.dart'; class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; - const UpdateHistoryWidget({Key? key, required this.myHistoryList}) : super(key: key); + const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); @override _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); } -class _UpdateHistoryWidgetState extends State with TickerProviderStateMixin { - late PageController _controller; +class _UpdateHistoryWidgetState extends State + with TickerProviderStateMixin { + PageController _controller; changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); @@ -60,14 +61,16 @@ class _UpdateHistoryWidgetState extends State with TickerPr Container( child: AppText( projectViewModel.isArabic - ? myHistory.selectedHistory!.nameAr - : myHistory.selectedHistory!.nameEn, - - textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, - color: Color(0xFF2B353E), + ? myHistory.selectedHistory.nameAr + : myHistory.selectedHistory.nameEn, + textDecoration: myHistory.isChecked + ? null + : TextDecoration.lineThrough, + color: Color(0xFF2B353E), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontWeight: FontWeight.w700, - letterSpacing: -0.48,), + letterSpacing: -0.48, + ), width: MediaQuery.of(context).size.width * 0.5, ), if (myHistory.isChecked) @@ -93,10 +96,11 @@ class _UpdateHistoryWidgetState extends State with TickerPr // ignore: missing_return widget.myHistoryList .where((element) => - historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId) + historyKey.id == element.selectedHistory.id && + historyKey.typeId == element.selectedHistory.typeId) .toList(); - if (history.length > 0){ + if (history.length > 0) { if (history.first.isLocal) { setState(() { widget.myHistoryList.remove(history.first); diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index d2048a62..72330be3 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -26,25 +26,27 @@ class AddMedication extends StatefulWidget { final Function addMedicationFun; TextEditingController medicationController; - AddMedication({Key? key, required this.addMedicationFun, required this.medicationController}) : super(key: key); + AddMedication({Key key, this.addMedicationFun, this.medicationController}) + : super(key: key); @override _AddMedicationState createState() => _AddMedicationState(); } class _AddMedicationState extends State { - late MasterKeyModel _selectedMedicationDose; - late MasterKeyModel _selectedMedicationStrength; - late MasterKeyModel _selectedMedicationRoute; - late MasterKeyModel _selectedMedicationFrequency; + MasterKeyModel _selectedMedicationDose; + MasterKeyModel _selectedMedicationStrength; + MasterKeyModel _selectedMedicationRoute; + MasterKeyModel _selectedMedicationFrequency; TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - GetMedicationResponseModel? _selectedMedication; + GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + GlobalKey key = + new GlobalKey>(); bool isFormSubmitted = false; @override @@ -207,161 +209,210 @@ class _AddMedicationState extends State { _selectedMedicationDose = selectedValue; - doseController.text = projectViewModel.isArabic - ? _selectedMedicationDose.nameAr! - : _selectedMedicationDose.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).doseTime, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && _selectedMedicationDose == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom(height: Helpers.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationStrengthList, - okText: TranslationBase.of(context).ok,selectedValue: + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).doseTime, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && + _selectedMedicationDose == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: + model.medicationStrengthList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: _selectedMedicationStrength, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = selectedValue; + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - strengthController.text = projectViewModel.isArabic - ? _selectedMedicationStrength.nameAr! - : _selectedMedicationStrength.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).strength, - maxLines: 1, - minLines: 1, - controller: strengthController, - validationError: isFormSubmitted && _selectedMedicationStrength == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom(height: Helpers.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationRouteList, - selectedValue: - _selectedMedicationRoute,okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = selectedValue; + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).strength, + maxLines: 1, + minLines: 1, + controller: strengthController, + validationError: isFormSubmitted && + _selectedMedicationStrength == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + selectedValue: + _selectedMedicationRoute, + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - routeController.text = projectViewModel.isArabic - ? _selectedMedicationRoute.nameAr! - : _selectedMedicationRoute.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 1, - minLines: 1, - controller: routeController, - validationError: isFormSubmitted && _selectedMedicationRoute == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom(height: Helpers.getTextFieldHeight(), - onClick: model.medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationFrequencyList, - okText: TranslationBase.of(context).ok,selectedValue: + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 1, + minLines: 1, + controller: routeController, + validationError: isFormSubmitted && + _selectedMedicationRoute == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.medicationFrequencyList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: + model.medicationFrequencyList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: _selectedMedicationFrequency, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = selectedValue; + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; - frequencyController.text = projectViewModel.isArabic - ? _selectedMedicationFrequency.nameAr! - : _selectedMedicationFrequency.nameEn!; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).frequency, - enabled: false, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && _selectedMedicationFrequency == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 20 - : SizeConfig.isHeightShort - ? 15 - : 10), - ), + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).frequency, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && + _selectedMedicationFrequency == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 20 + : SizeConfig.isHeightShort + ? 15 + : 10), + ), ], ), )), diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index 39bc2a21..c6427511 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -9,8 +9,8 @@ class UpdateMedicationWidget extends StatefulWidget { final TextEditingController medicationController; UpdateMedicationWidget({ - Key? key, - required this.medicationController, + Key key, + this.medicationController, }); @override @@ -22,12 +22,11 @@ class _UpdateMedicationWidgetState extends State { Widget build(BuildContext context) { return Column( children: [ - SOAPOpenItems( - label: "${TranslationBase.of(context).addMedication}", - onTap: () { - openMedicationList(context); - }, - ), + + SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () { + openMedicationList(context); + + },), SizedBox( height: 20, ) @@ -35,6 +34,7 @@ class _UpdateMedicationWidgetState extends State { ); } + openMedicationList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, @@ -49,3 +49,6 @@ class _UpdateMedicationWidgetState extends State { }); } } + + + diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 79417789..fd5e6b45 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -26,11 +26,11 @@ class UpdateSubjectivePage extends StatefulWidget { final int currentIndex; UpdateSubjectivePage( - {Key? key, - required this.changePageViewIndex, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -46,15 +46,16 @@ class _UpdateSubjectivePageState extends State TextEditingController medicationController = TextEditingController(); final formKey = GlobalKey(); - List myAllergiesList = []; - List myHistoryList = []; + List myAllergiesList = List(); + List myHistoryList = List(); getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); if (model.patientHistoryList.isNotEmpty) { model.patientHistoryList.forEach((element) { - if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { - MasterKeyModel? history = model.getOneMasterKey( + if (element.historyType == + MasterKeysService.HistoryFamily.getMasterKeyService()) { + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); @@ -68,8 +69,9 @@ class _UpdateSubjectivePageState extends State myHistoryList.add(mySelectedHistory); } } - if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { - MasterKeyModel? history = model.getOneMasterKey( + if (element.historyType == + MasterKeysService.HistoryMedical.getMasterKeyService()) { + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); @@ -83,8 +85,9 @@ class _UpdateSubjectivePageState extends State myHistoryList.add(mySelectedHistory); } } - if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { - MasterKeyModel? history = model.getOneMasterKey( + if (element.historyType == + MasterKeysService.HistorySports.getMasterKeyService()) { + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); @@ -98,8 +101,9 @@ class _UpdateSubjectivePageState extends State myHistoryList.add(mySelectedHistory); } } - if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { - MasterKeyModel? history = model.getOneMasterKey( + if (element.historyType == + MasterKeysService.HistorySurgical.getMasterKeyService()) { + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); @@ -120,19 +124,22 @@ class _UpdateSubjectivePageState extends State getAllergies(SOAPViewModel model) async { if (model.patientAllergiesList.isNotEmpty) { model.patientAllergiesList.forEach((element) { - MasterKeyModel? selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + MasterKeyModel selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), + id: 0, + typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, id: element.severity, - )!; + ); } MySelectedAllergy mySelectedAllergy = @@ -143,7 +150,9 @@ class _UpdateSubjectivePageState extends State remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); + + if (selectedAllergy != null && selectedAllergySeverity != null) + myAllergiesList.add(mySelectedAllergy); }); } } @@ -159,11 +168,14 @@ class _UpdateSubjectivePageState extends State if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!); - illnessController.text = model.patientChiefComplaintList[0].hopi!; - medicationController.text = !(model.patientChiefComplaintList[0].currentMedication)!.isNotEmpty - ? model.patientChiefComplaintList[0].currentMedication! + '\n \n' - : model.patientChiefComplaintList[0].currentMedication!; + complaintsController.text = Helpers.parseHtmlString( + model.patientChiefComplaintList[0].chiefComplaint); + illnessController.text = model.patientChiefComplaintList[0].hopi; + medicationController.text = + !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication + + '\n \n' + : model.patientChiefComplaintList[0].currentMedication; } if (widget.patientInfo.admissionNo == null) { await getHistory(model); @@ -214,43 +226,47 @@ class _UpdateSubjectivePageState extends State height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), -if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).histories, - isRequired: false, - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Column( - children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], + if (widget.patientInfo.admissionNo == null) + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).histories, + isRequired: false, + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Column( + children: [ + UpdateHistoryWidget(myHistoryList: myHistoryList) + ], + ), + isExpanded: isHistoryExpand, ), - isExpanded: isHistoryExpand, - ), SizedBox( height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), -if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).allergiesSoap, - isRequired: false, - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Column( - children: [ - UpdateAllergiesWidget( - myAllergiesList: myAllergiesList, - ), - SizedBox( - height: 30, - ), - ], + if (widget.patientInfo.admissionNo == null) + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).allergiesSoap, + isRequired: false, + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Column( + children: [ + UpdateAllergiesWidget( + myAllergiesList: myAllergiesList, + ), + SizedBox( + height: 30, + ), + ], + ), + isExpanded: isAllergiesExpand, ), - isExpanded: isAllergiesExpand, - ), SizedBox( height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), @@ -294,17 +310,21 @@ if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidge } else { setState(() { if (complaintsController.text.isEmpty) { - model.complaintsControllerError = TranslationBase.of(context).emptyMessage!; + model.complaintsControllerError = + TranslationBase.of(context).emptyMessage; } else if (complaintsController.text.length < 25) { - model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLength!; + model.complaintsControllerError = + TranslationBase.of(context).chiefComplaintLength; } if (illnessController.text.isEmpty) { - model.illnessControllerError = TranslationBase.of(context).emptyMessage!; + model.illnessControllerError = + TranslationBase.of(context).emptyMessage; } if (medicationController.text.isEmpty) { - model.medicationControllerError = TranslationBase.of(context).emptyMessage!; + model.medicationControllerError = + TranslationBase.of(context).emptyMessage; } }); 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 707770eb..a6740a2c 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/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/util/translations_delegate_base.dart'; @@ -22,21 +21,22 @@ import 'plan/update_plan_page.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; - const UpdateSoapIndex({Key? key, required this.isUpdate}) : super(key: key); + const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); } -class _UpdateSoapIndexState extends State with TickerProviderStateMixin { - PageController? _controller; +class _UpdateSoapIndexState extends State + with TickerProviderStateMixin { + PageController _controller; int _currentIndex = 0; - List myAllergiesList = []; - List myHistoryList = []; + List myAllergiesList = List(); + List myHistoryList = List(); changePageViewIndex(pageIndex, {isChangeState = true}) { if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); - _controller?.jumpToPage(pageIndex); + _controller.jumpToPage(pageIndex); setState(() { _currentIndex = pageIndex; }); @@ -64,7 +64,7 @@ class _UpdateSoapIndexState extends State with TickerProviderSt } @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( builder: (_,model,w)=>AppScaffold( diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index ec33ccf0..564c8c2c 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -1,19 +1,19 @@ +import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; class LineChartCurved extends StatelessWidget { final String title; final List timeSeries; final int indexes; - LineChartCurved({required this.title, required this.timeSeries, required this.indexes}); + LineChartCurved({this.title, this.timeSeries, this.indexes}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); // DateFormat format = DateFormat("yyyy-MM-dd"); DateFormat yearFormat = DateFormat("yyyy/MMM"); @@ -105,7 +105,8 @@ class LineChartCurved extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -129,7 +130,9 @@ class LineChartCurved extends StatelessWidget { return ''; } } else { - if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { + if (value.toInt() == 0 || + value.toInt() == timeSeries.length - 1 || + xAxixs.contains(value.toInt())) { DateTime dateTime = timeSeries[value.toInt()].time; if (isDatesSameYear) { return monthFormat.format(dateTime); @@ -230,12 +233,14 @@ class LineChartCurved extends StatelessWidget { } List getData(context) { - List spots = []; + List spots = List(); isDatesSameYear = true; int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); - if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { + if (isDatesSameYear == false || + (previousDateYear != 0 && + previousDateYear != timeSeries[index].time.year)) { isDatesSameYear = false; } previousDateYear = timeSeries[index].time.year; diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 197e517f..1c387c9a 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -13,14 +13,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final bool isOX; LineChartCurvedBloodPressure( - {required this.title, - required this.timeSeries1, - required this.indexes, - required this.timeSeries2, - this.isOX = false}); + {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); @override Widget build(BuildContext context) { @@ -47,6 +43,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -58,7 +55,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -77,30 +75,26 @@ class LineChartCurvedBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), - ), - SizedBox( - width: 5, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), ), - AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng) + SizedBox(width: 5,), + AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) ], ), - SizedBox( - width: 15, - ), + SizedBox(width: 15,), Row( children: [ Container( width: 20, height: 20, - decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red), - ), - SizedBox( - width: 5, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.red), ), - AppText( - isOX ? "FIO2" : TranslationBase.of(context).diastolicLng, - ) + SizedBox(width: 5,), + AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) ], ), ], @@ -129,7 +123,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -228,12 +223,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } List getData(context) { - List spots = []; + List spots = List(); for (int index = 0; index < timeSeries1.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = []; + List spots2 = List(); for (int index = 0; index < timeSeries2.length; index++) { spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); } @@ -265,11 +260,11 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - List lineChartData = []; - if (spots.isNotEmpty) { + List lineChartData = List(); + if(spots.isNotEmpty){ lineChartData.add(lineChartBarData1); } - if (spots2.isNotEmpty) { + if(spots2.isNotEmpty){ lineChartData.add(lineChartBarData2); } return lineChartData; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index a2a649f0..69f45d6e 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -17,13 +17,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget { final String viewKey2; VitalSignBloodPressureWidget( - {Key? key, - required this.vitalList, - required this.title1, - required this.title2, - required this.viewKey1, - required this.title3, - required this.viewKey2}); + {Key key, + this.vitalList, + this.title1, + this.title2, + this.viewKey1, + this.title3, + this.viewKey2}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -50,6 +50,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60, @@ -64,6 +65,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60 @@ -78,6 +80,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60 @@ -93,7 +96,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -123,7 +126,8 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( 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 fc3c6096..09694ad6 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 @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.d import 'package:doctor_app_flutter/locator.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'; @@ -16,15 +16,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int? appointmentNo; - int? projectID; + int appointmentNo; + int projectID; bool isNotOneAppointment; VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -40,8 +40,8 @@ class VitalSignDetailsScreen extends StatelessWidget { baseViewModel: mode, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), - appBarTitle: TranslationBase.of(context).vitalSign!, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( children: [ @@ -56,7 +56,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -283,10 +283,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context).height!, + des: TranslationBase.of(context).height, imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm!, + unit: TranslationBase.of(context).cm, ), ), ), @@ -313,9 +313,9 @@ class VitalSignDetailsScreen extends StatelessWidget { ); }, child: VitalSignItem( - des: TranslationBase.of(context).weight!, + des: TranslationBase.of(context).weight, imagePath: "${assetBasePath}weight.png", - unit: TranslationBase.of(context).kg!, + unit: TranslationBase.of(context).kg, lastVal: mode.weightKg, ), ), @@ -337,10 +337,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context).temperature!, + des: TranslationBase.of(context).temperature, imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC!, + unit: TranslationBase.of(context).tempC, ), ), ), @@ -361,10 +361,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).heart!, + des: TranslationBase.of(context).heart, imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm!, + unit: TranslationBase.of(context).bpm, ), ), InkWell( @@ -384,10 +384,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).respirationRate!, + des: TranslationBase.of(context).respirationRate, imagePath: "${assetBasePath}respiration_rate.png", lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context).respirationSigns!, + unit: TranslationBase.of(context).respirationSigns, ), ), InkWell( @@ -407,10 +407,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure!, + des: TranslationBase.of(context).bloodPressure, imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias!, + unit: TranslationBase.of(context).sysDias, ), ), InkWell( @@ -430,7 +430,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).oxygenation!, + des: TranslationBase.of(context).oxygenation, imagePath: "${assetBasePath}oxg.png", lastVal: "${mode.oxygenation}%", unit: "", @@ -453,10 +453,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).painScale!, + des: TranslationBase.of(context).painScale, imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: TranslationBase.of(context).severe!, + unit: TranslationBase.of(context).severe, ), ), ], diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index 5c83fd09..cec53580 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -15,7 +15,7 @@ class VitalSignDetailsWidget extends StatefulWidget { final String viewKey; VitalSignDetailsWidget( - {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey}); + {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -55,6 +55,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60, @@ -76,6 +77,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, + fontFamily: 'Poppins', ), // height: 60 @@ -91,7 +93,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -108,7 +110,8 @@ class _VitalSignDetailsWidgetState extends State { ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index d051f98c..20d5b439 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -9,17 +9,17 @@ class VitalSignItem extends StatelessWidget { final String lastVal; final String unit; final String imagePath; - final double? height; - final double? width; + final double height; + final double width; const VitalSignItem( - {Key? key, - required this.des, + {Key key, + @required this.des, this.lastVal = 'N/A', this.unit = '', this.height, this.width, - required this.imagePath}) + @required this.imagePath}) : super(key: key); @override 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 eed82785..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 @@ -2,32 +2,32 @@ 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'; import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { - final vitalSignDetails? pageKey; - final String? pageTitle; - List? VSchart; + final vitalSignDetails pageKey; + final String pageTitle; + List VSchart; PatiantInformtion patient; String patientType; String arrivalType; VitalSignItemDetailsScreen( - {required this.vitalList, - required this.pageKey, - required this.pageTitle, - required this.patient, - required this.patientType, - required this.arrivalType}); + {this.vitalList, + this.pageKey, + this.pageTitle, + this.patient, + this.patientType, + this.arrivalType}); final List vitalList; @@ -187,10 +187,11 @@ class VitalSignItemDetailsScreen extends StatelessWidget { default: } return AppScaffold( - appBarTitle: pageTitle ?? "", + appBarTitle: pageTitle, backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), + appBar: PatientProfileAppBar( + patient,), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -201,7 +202,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails?.firstName ?? patient.fullName ?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, @@ -219,7 +220,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { child: ListView( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - children: VSchart!.map((chartInfo) { + children: VSchart.map((chartInfo) { var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); @@ -228,14 +229,20 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return VitalSignDetailPainScale(vitalList); } - if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || - chartInfo['viewKey'] == 'O2') { + if (vitalListTemp.length != 0 && + chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( vitalList: vitalList, - name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], - title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], + title3: projectViewModel.isArabic + ? chartInfo['title3Ar'] + : chartInfo['title3'], viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', ); @@ -244,9 +251,13 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index 0d3803b8..ef8049ce 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -11,12 +11,12 @@ import 'LineChartCurved.dart'; class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ - Key? key, - required this.vitalList, - required this.name, - required this.viewKey, - required this.title1, - required this.title2, + Key key, + @required this.vitalList, + @required this.name, + @required this.viewKey, + @required this.title1, + @required this.title2, }) : super(key: key); final List vitalList; @@ -31,45 +31,50 @@ class VitalSingChartAndDetials extends StatelessWidget { generateData(); return timeSeriesData.length != 0 ? Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: LineChartCurved( - title: name, - timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, - ), + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).graphDetails, - fontSize: SizeConfig.textMultiplier * 2.1, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - SizedBox( - height: 8, - ), - VitalSignDetailsWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - viewKey: viewKey, - ), - ], - ), + child: LineChartCurved( + title: name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, ), - /*AppExpandableNotifier( + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + + fontFamily: 'Poppins', + ), + SizedBox(height: 8,), + VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ], + ), + ), + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWid: VitalSignDetailsWidget( @@ -79,9 +84,9 @@ class VitalSingChartAndDetials extends StatelessWidget { viewKey: viewKey, ), ),*/ - ], - ), - ) + ], + ), + ) : Container( width: double.infinity, height: MediaQuery.of(context).size.height, @@ -95,11 +100,14 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); - if (element.toJson()[viewKey] != null && element.toJson()[viewKey]?.toInt() != 0) + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + if (element.toJson()[viewKey] != null && + element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey].toDouble(), ), ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index ba75ed30..d0416539 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -11,14 +11,14 @@ import 'LineChartCurvedBloodPressure.dart'; class VitalSingChartBloodPressure extends StatelessWidget { VitalSingChartBloodPressure({ - Key? key, - required this.vitalList, - required this.name, - required this.viewKey1, - required this.viewKey2, - required this.title1, - required this.title2, - required this.title3, + Key key, + @required this.vitalList, + @required this.name, + @required this.viewKey1, + @required this.viewKey2, + @required this.title1, + @required this.title2, + @required this.title3, }) : super(key: key); final List vitalList; @@ -42,10 +42,12 @@ class VitalSingChartBloodPressure extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), child: LineChartCurvedBloodPressure( title: name, - isOX: title2 == "SAO2", + isOX: title2=="SAO2", timeSeries1: timeSeriesData1, timeSeries2: timeSeriesData2, indexes: timeSeriesData1.length ~/ 5.5, @@ -54,7 +56,9 @@ class VitalSingChartBloodPressure extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -111,18 +115,21 @@ class VitalSingChartBloodPressure extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey1]?.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey1].toDouble(), ), ); if (element.toJson()[viewKey2]?.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey2].toDouble(), ), ); diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index ac20d1e1..17405829 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -7,10 +7,9 @@ import 'package:flutter/material.dart'; class CustomEditableText extends StatefulWidget { CustomEditableText({ Key key, - required this.controller, + @required this.controller, this.hint, - this.isEditable = false, - this.isSubmitted, + this.isEditable = false, this.isSubmitted, }) : super(key: key); final TextEditingController controller; @@ -28,7 +27,7 @@ class _CustomEditableTextState extends State { Widget build(BuildContext context) { return Column( children: [ - if (!widget.isEditable) + if(!widget.isEditable) Container( height: 60, decoration: BoxDecoration( @@ -37,7 +36,7 @@ class _CustomEditableTextState extends State { borderRadius: BorderRadius.all(Radius.circular(20)), border: Border.fromBorderSide( BorderSide( - color: Colors.grey[300]!, + color: Colors.grey[300], width: 2, ), ), @@ -63,6 +62,7 @@ class _CustomEditableTextState extends State { child: Icon( DoctorApp.edit_1, size: 20, + ), onTap: () { setState(() { @@ -74,15 +74,17 @@ class _CustomEditableTextState extends State { ), ), ), - if (widget.isEditable) + if(widget.isEditable) AppTextFieldCustom( hintText: widget.hint, //TranslationBase.of(context).addoperationReports, controller: widget.controller, - validationError: - widget.controller.text.isEmpty && widget.isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: widget.controller + .text.isEmpty && + widget.isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, maxLines: 1, minLines: 1, hasBorder: true, @@ -90,4 +92,4 @@ class _CustomEditableTextState extends State { ], ); } -} +} \ No newline at end of file diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 6aaacb26..c03c6f96 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -44,7 +44,7 @@ class RegisterConfirmationPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterConfirmationPatientPage( - {Key? key, this.operationReportViewModel, this.patient, this.model}) + {Key key, this.operationReportViewModel, this.patient, this.model}) : super(key: key); @override diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 9bc2d6fe..231ff3d1 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -12,7 +12,7 @@ import 'package:flutter/material.dart'; import 'RegisterSearchPatientPage.dart'; class RegisterPatientPage extends StatefulWidget { - const RegisterPatientPage({Key? key}) : super(key: key); + const RegisterPatientPage({Key key}) : super(key: key); @override _RegisterPatientPageState createState() => _RegisterPatientPageState(); diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index fd425c01..2afc593e 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -30,7 +30,7 @@ class RegisterSearchPatientPage extends StatefulWidget { final PatientRegistrationViewModel model; const RegisterSearchPatientPage( - {Key? key, this.changePageViewIndex, this.model}) + {Key key, this.changePageViewIndex, this.model}) : super(key: key); @override @@ -66,7 +66,7 @@ class _RegisterSearchPatientPageState extends State { @override void initState() { _phoneCode.text = ""; - countryList = []; + countryList = List(); dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"}; dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"}; diff --git a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart index 6f0e1a31..d58e5a3b 100644 --- a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart +++ b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class VerifyActivationCodePage extends StatefulWidget { - const VerifyActivationCodePage({Key? key}) : super(key: key); + const VerifyActivationCodePage({Key key}) : super(key: key); @override _VerifyActivationCodePageState createState() => diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index f2d0646f..8634e76e 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -501,15 +501,15 @@ class _ActivationPageState extends State { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]!), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]!), + borderSide: BorderSide(color: Colors.grey[300]), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]!), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 128acac6..9cd5121a 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.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/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; @@ -21,7 +22,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/medicine/medicine_item_widget.dart'; -import '../../widgets/shared/text_fields/TextFields.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -32,6 +33,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -45,46 +47,46 @@ addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion pati } postPrescription( - {String? duration, - String? doseTimeIn, - String? dose, - String? drugId, - String? strength, - String? route, - String? frequency, - String? indication, - String? instruction, - PrescriptionViewModel? model, - DateTime? doseTime, - String? doseUnit, - String? icdCode, - PatiantInformtion? patient, - String? patientType}) async { + {String duration, + String doseTimeIn, + String dose, + String drugId, + String strength, + String route, + String frequency, + String indication, + String instruction, + PrescriptionViewModel model, + DateTime doseTime, + String doseUnit, + String icdCode, + PatiantInformtion patient, + String patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = []; + List prescriptionList = List(); - postProcedureReqModel.appointmentNo = patient!.appointmentNo; + postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose ?? "0"), - itemId: drugId!.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit ?? "1"), - route: route!.isEmpty ? 1 : int.parse(route), - frequency: frequency!.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose), + itemId: drugId.isEmpty ? 1 : int.parse(drugId), + doseUnitId: int.parse(doseUnit), + route: route.isEmpty ? 1 : int.parse(route), + frequency: frequency.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration!.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime!.toIso8601String())); + doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); + await model.postPrescription(postProcedureReqModel, patient.patientMRN); - if (model.state == ViewState.Error) { + if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); @@ -104,15 +106,14 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState extends State { - String? routeError; - String? frequencyError; - String? doseTimeError; - String? durationError; - String? unitError; - String? strengthError; + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; - late int selectedType; - bool isSubmitted = false; + int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -122,9 +123,9 @@ class _PrescriptionFormWidgetState extends State { bool visbiltySearch = true; final myController = TextEditingController(); - DateTime? selectedDate; - int? strengthChar; - GetMedicationResponseModel? _selectedMedication; + DateTime selectedDate; + int strengthChar; + GetMedicationResponseModel _selectedMedication; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -220,6 +221,7 @@ class _PrescriptionFormWidgetState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { x = model.patientAssessmentList.map((element) { @@ -245,7 +247,7 @@ class _PrescriptionFormWidgetState extends State { builder: ( BuildContext context, MedicineViewModel model, - Widget? child, + Widget child, ) => NetworkBaseView( baseViewModel: model, @@ -343,11 +345,11 @@ class _PrescriptionFormWidgetState extends State { child: MedicineItemWidget( label: model.allMedicationList[index].description), onTap: () { - model.getItem(itemID: model.allMedicationList[index].itemId!); + model.getItem(itemID: model.allMedicationList[index].itemId); visbiltyPrescriptionForm = true; visbiltySearch = false; _selectedMedication = model.allMedicationList[index]; - uom = _selectedMedication!.uom; + uom = _selectedMedication.uom; }, ); }, @@ -380,11 +382,11 @@ class _PrescriptionFormWidgetState extends State { activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (int? value) { - setSelectedType(value!); + onChanged: (value) { + setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular ?? ""), + Text(TranslationBase.of(context).regular), ], ), ), @@ -406,7 +408,7 @@ class _PrescriptionFormWidgetState extends State { setState(() { strengthChar = value.length; }); - if (strengthChar! >= 5) { + if (strengthChar >= 5) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).only5DigitsAllowedForStrength, ); @@ -421,7 +423,6 @@ class _PrescriptionFormWidgetState extends State { width: 5.0, ), PrescriptionTextFiled( - isSubmitted: isSubmitted, width: MediaQuery.of(context).size.width * 0.517, element: model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0] @@ -443,7 +444,6 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, elementList: model.itemMedicineListRoute, element: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0] @@ -457,16 +457,13 @@ class _PrescriptionFormWidgetState extends State { route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route ?? "", + hintText: TranslationBase.of(context).route, ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, - hintText: TranslationBase.of(context).frequency ?? "", - elementError: frequencyError ?? "", - element: model.itemMedicineList.length == 1 - ? frequency = model.itemMedicineList[0] - : frequency, + hintText: TranslationBase.of(context).frequency, + elementError: frequencyError, + element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', keyName: 'description', @@ -481,7 +478,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication!.itemId!, + itemCode: _selectedMedication.itemId, strength: double.parse(strengthController.text)); return; @@ -490,9 +487,8 @@ class _PrescriptionFormWidgetState extends State { }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, - hintText: TranslationBase.of(context).doseTime ?? "", - elementError: doseTimeError ?? "", + hintText: TranslationBase.of(context).doseTime, + elementError: doseTimeError, element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -545,7 +541,7 @@ class _PrescriptionFormWidgetState extends State { onTap: () => selectDate(context, widget.model), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date ?? "", + TranslationBase.of(context).date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -560,10 +556,9 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - isSubmitted: isSubmitted, element: duration, - elementError: durationError ?? "", - hintText: TranslationBase.of(context).duration ?? "", + elementError: durationError, + hintText: TranslationBase.of(context).duration, elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -577,7 +572,7 @@ class _PrescriptionFormWidgetState extends State { model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication!.itemId!, + itemCode: _selectedMedication.itemId, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -658,10 +653,10 @@ class _PrescriptionFormWidgetState extends State { frequency != null && selectedDate != null && strengthController.text != "") { - if (_selectedMedication!.isNarcotic == true) { + if (_selectedMedication.isNarcotic == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context) .narcoticMedicineCanOnlyBePrescribedFromVida); - // Navigator.pop(context); + Navigator.pop(context); return; } @@ -675,7 +670,7 @@ class _PrescriptionFormWidgetState extends State { return; } - if (formKey.currentState!.validate()) { + if (formKey.currentState.validate()) { Navigator.pop(context); openDrugToDrug(model); { @@ -763,41 +758,40 @@ class _PrescriptionFormWidgetState extends State { } } else { setState(() { - isSubmitted = true; if (duration == null) { durationError = TranslationBase.of(context).fieldRequired; } else { - durationError = ""; + durationError = null; } if (doseTime == null) { doseTimeError = TranslationBase.of(context).fieldRequired; } else { - doseTimeError = ""; + doseTimeError = null; } if (route == null) { routeError = TranslationBase.of(context).fieldRequired; } else { - routeError = ""; + routeError = null; } if (frequency == null) { frequencyError = TranslationBase.of(context).fieldRequired; } else { - frequencyError = ""; + frequencyError = null; } if (units == null) { unitError = TranslationBase.of(context).fieldRequired; } else { - unitError = ""; + unitError = null; } if (strengthController.text == "") { strengthError = TranslationBase.of(context).fieldRequired; } else { - strengthError = ""; + strengthError = null; } }); } - formKey.currentState!.save(); + formKey.currentState.save(); }, ), ], @@ -826,7 +820,7 @@ class _PrescriptionFormWidgetState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime? picked = await showDatePicker( + final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -840,8 +834,8 @@ class _PrescriptionFormWidgetState extends State { } } - InputDecoration textFieldSelectorDecoration(String? hintText, String? selectedText, bool isDropDown, - {Icon? suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -920,7 +914,7 @@ class _PrescriptionFormWidgetState extends State { route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: _selectedMedication!.itemId.toString(), + drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, @@ -940,7 +934,7 @@ class _PrescriptionFormWidgetState extends State { getPriscriptionforDrug(List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { - prescriptionList[0].entityList!.forEach((element) { + prescriptionList[0].entityList.forEach((element) { if (element.mediSpanGPICode != null) { prescriptionDetails.add({ 'DrugId': element.mediSpanGPICode, @@ -956,10 +950,10 @@ class _PrescriptionFormWidgetState extends State { } }); } - if (_selectedMedication!.mediSpanGPICode != null) { + if (_selectedMedication.mediSpanGPICode != null) { prescriptionDetails.add({ - 'DrugId': _selectedMedication!.mediSpanGPICode, - 'DrugName': _selectedMedication!.description, + 'DrugId': _selectedMedication.mediSpanGPICode, + 'DrugName': _selectedMedication.description, 'Dose': strengthController.text, 'DoseType': model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 6b1e0df0..15abfeb6 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -54,34 +54,45 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (model3) => model3.getDrugToDrug(model.patientVitalSigns!, widget.listAssessment, - model2.patientAllergiesList, widget.patient, widget.prescription), - builder: (BuildContext context, PrescriptionViewModel model3, Widget? child) => NetworkBaseView( - baseViewModel: model3, - child: Container( - height: SizeConfig.realScreenHeight * .4, - child: new ListView.builder( - itemCount: expandableList.length, - itemBuilder: (context, i) { - return new ExpansionTile( - title: new AppText( - expandableList[i]['name'] + - ' ' + - '(' + - getDrugInfo(expandableList[i]['level'], model3).length.toString() + - ')', - fontSize: 20, - fontWeight: FontWeight.bold, - ), - children: getDrugInfo(expandableList[i]['level'], model3).map((item) { - return Container( - padding: EdgeInsets.all(10), - child: AppText( - item['comment'], - color: Colors.red[900], - )); - }).toList()); - })))) + onModelReady: (model3) => model3.getDrugToDrug( + model.patientVitalSigns, + widget.listAssessment, + model2.patientAllergiesList, + widget.patient, + widget.prescription), + builder: (BuildContext context, PrescriptionViewModel model3, + Widget child) => + NetworkBaseView( + baseViewModel: model3, + child: Container( + height: SizeConfig.realScreenHeight * .4, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new AppText( + expandableList[i]['name'] + + ' ' + + '(' + + getDrugInfo(expandableList[i]['level'], + model3) + .length + .toString() + + ')', + fontSize: 20, + fontWeight: FontWeight.bold, + ), + children: getDrugInfo( + expandableList[i]['level'], model3) + .map((item) { + return Container( + padding: EdgeInsets.all(10), + child: AppText( + item['comment'], + color: Colors.red[900], + )); + }).toList()); + })))) : Container( height: SizeConfig.realScreenHeight * .45, child: Center( diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 4da17968..cac2f99a 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -18,7 +18,7 @@ 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 '../../widgets/shared/text_fields/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.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'; @@ -32,12 +32,12 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class PrescriptionCheckOutScreen extends StatefulWidget { - final PrescriptionViewModel? model; - final PatiantInformtion? patient; - final List? prescriptionList; - final ProcedureTempleteDetailsModel? groupProcedures; + final PrescriptionViewModel model; + final PatiantInformtion patient; + final List prescriptionList; + final ProcedureTempleteDetailsModel groupProcedures; - const PrescriptionCheckOutScreen({Key? key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) + const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); @override @@ -46,44 +46,44 @@ class PrescriptionCheckOutScreen extends StatefulWidget { class _PrescriptionCheckOutScreenState extends State { postPrescription( - {String? duration, - String? doseTimeIn, - String? dose, - String? drugId, - String? strength, - String? route, - String? frequency, - String? indication, - String? instruction, - PrescriptionViewModel? model, - DateTime? doseTime, - String? doseUnit, - String? icdCode, - PatiantInformtion? patient, - String? patientType}) async { + {String duration, + String doseTimeIn, + String dose, + String drugId, + String strength, + String route, + String frequency, + String indication, + String instruction, + PrescriptionViewModel model, + DateTime doseTime, + String doseUnit, + String icdCode, + PatiantInformtion patient, + String patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = []; + List prescriptionList = List(); - postProcedureReqModel.appointmentNo = patient!.appointmentNo; + postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose!), - itemId: drugId!.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit!), - route: route!.isEmpty ? 1 : int.parse(route), - frequency: frequency!.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose), + itemId: drugId.isEmpty ? 1 : int.parse(drugId), + doseUnitId: int.parse(doseUnit), + route: route.isEmpty ? 1 : int.parse(route), + frequency: frequency.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration!.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime!.toIso8601String())); + doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); + await model.postPrescription(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -93,14 +93,14 @@ class _PrescriptionCheckOutScreenState extends State } } - String? routeError; - String? frequencyError; - String? doseTimeError; - String? durationError; - String? unitError; - String? strengthError; + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; - late int selectedType; + int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -110,10 +110,10 @@ class _PrescriptionCheckOutScreenState extends State bool visbiltySearch = true; final myController = TextEditingController(); - late DateTime selectedDate; - late int strengthChar; - late GetMedicationResponseModel _selectedMedication; - late GlobalKey key = new GlobalKey>(); + DateTime selectedDate; + int strengthChar; + GetMedicationResponseModel _selectedMedication; + GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -210,17 +210,17 @@ class _PrescriptionCheckOutScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - model.getItem(itemID: int.parse(widget.groupProcedures!.aliasN!.replaceAll("item code ;", ""))); + model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; }); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient!.patientMRN, - episodeID: widget.patient!.episodeNo.toString(), + patientMRN: widget.patient.patientMRN, + episodeID: widget.patient.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patient!.appointmentNo); + appointmentNo: widget.patient.appointmentNo); if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); } @@ -235,7 +235,7 @@ class _PrescriptionCheckOutScreenState extends State builder: ( BuildContext context, MedicineViewModel model, - Widget? child, + Widget child, ) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), @@ -309,7 +309,7 @@ class _PrescriptionCheckOutScreenState extends State child: Column( children: [ AppText( - widget.groupProcedures!.procedureName ?? "", + widget.groupProcedures.procedureName ?? "", bold: true, ), Container( @@ -323,11 +323,11 @@ class _PrescriptionCheckOutScreenState extends State activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, - onChanged: (int? value) { - setSelectedType(value!); + onChanged: (value) { + setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular!), + Text(TranslationBase.of(context).regular), ], ), ), @@ -366,7 +366,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.560, element: units, - elementError: unitError ?? "", + elementError: unitError, keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -385,7 +385,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: route, - elementError: routeError ?? "", + elementError: routeError, keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -394,12 +394,12 @@ class _PrescriptionCheckOutScreenState extends State route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route!, + hintText: TranslationBase.of(context).route, ), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency!, - elementError: frequencyError ?? "", + hintText: TranslationBase.of(context).frequency, + elementError: frequencyError, element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', @@ -415,7 +415,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId!, + itemCode: _selectedMedication.itemId, strength: double.parse(strengthController.text)); return; @@ -424,8 +424,8 @@ class _PrescriptionCheckOutScreenState extends State }), SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime ?? "", - elementError: doseTimeError!, + hintText: TranslationBase.of(context).doseTime, + elementError: doseTimeError, element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -475,10 +475,10 @@ class _PrescriptionCheckOutScreenState extends State height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate(context, widget.model!), + onTap: () => selectDate(context, widget.model), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date!, + TranslationBase.of(context).date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -494,8 +494,8 @@ class _PrescriptionCheckOutScreenState extends State SizedBox(height: spaceBetweenTextFileds), PrescriptionTextFiled( element: duration, - elementError: durationError ?? "", - hintText: TranslationBase.of(context).duration!, + elementError: durationError, + hintText: TranslationBase.of(context).duration, elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', @@ -509,7 +509,7 @@ class _PrescriptionCheckOutScreenState extends State model.getBoxQuantity( freq: frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId!, + itemCode: _selectedMedication.itemId, strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -531,7 +531,7 @@ class _PrescriptionCheckOutScreenState extends State TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of(context).instruction!, + hintText: TranslationBase.of(context).instruction, controller: instructionController, //keyboardType: TextInputType.number, ), @@ -586,13 +586,13 @@ class _PrescriptionCheckOutScreenState extends State return; } - if (formKey.currentState!.validate()) { + if (formKey.currentState.validate()) { Navigator.pop(context); // openDrugToDrug(model); { postPrescription( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID!.isEmpty + ? model.patientAssessmentList[0].icdCode10ID.isEmpty ? "test" : model.patientAssessmentList[0].icdCode10ID.toString() : "test", @@ -607,9 +607,9 @@ class _PrescriptionCheckOutScreenState extends State doseUnit: model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), - patient: widget.patient!, + patient: widget.patient, doseTimeIn: doseTime['id'].toString(), - model: widget.model!, + model: widget.model, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() @@ -617,7 +617,7 @@ class _PrescriptionCheckOutScreenState extends State route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget.groupProcedures!.aliasN! + drugId: (widget.groupProcedures.aliasN .replaceAll("item code ;", "")), strength: strengthController.text, indication: indicationController.text, @@ -649,19 +649,19 @@ class _PrescriptionCheckOutScreenState extends State frequencyError = null; } if (units == null) { - unitError = TranslationBase.of(context).fieldRequired!; + unitError = TranslationBase.of(context).fieldRequired; } else { unitError = null; } if (strengthController.text == "") { - strengthError = TranslationBase.of(context).fieldRequired!; + strengthError = TranslationBase.of(context).fieldRequired; } else { strengthError = null; } }); } - formKey.currentState!.save(); + formKey.currentState.save(); }, ), ], @@ -690,7 +690,7 @@ class _PrescriptionCheckOutScreenState extends State Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime? picked = await showDatePicker( + final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -704,8 +704,8 @@ class _PrescriptionCheckOutScreenState extends State } } - InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, - {Icon? suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart index 0c364c6d..623cee90 100644 --- a/lib/screens/prescription/prescription_details_page.dart +++ b/lib/screens/prescription/prescription_details_page.dart @@ -8,13 +8,13 @@ import 'package:flutter/material.dart'; class PrescriptionDetailsPage extends StatelessWidget { final PrescriptionReport prescriptionReport; - PrescriptionDetailsPage({required Key key, required this.prescriptionReport}); + PrescriptionDetailsPage({Key key, this.prescriptionReport}); @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions!, + appBarTitle: TranslationBase.of(context).prescriptions, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -28,14 +28,14 @@ class PrescriptionDetailsPage extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Row( children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(5)), child: Image.network( - prescriptionReport.imageSRCUrl!, + prescriptionReport.imageSRCUrl, fit: BoxFit.cover, width: 60, height: 70, @@ -45,9 +45,10 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: AppText(prescriptionReport.itemDescription!.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), + child: AppText( + prescriptionReport.itemDescription.isNotEmpty + ? prescriptionReport.itemDescription + : prescriptionReport.itemDescriptionN), ), ), ) @@ -58,7 +59,9 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, margin: EdgeInsets.only(top: 10, left: 10, right: 10), child: Table( - border: TableBorder.symmetric(inside: BorderSide(width: 0.5), outside: BorderSide(width: 0.5)), + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + outside: BorderSide(width: 0.5)), children: [ TableRow( children: [ @@ -106,22 +109,28 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 50, width: double.infinity, - child: Center(child: Text(prescriptionReport.routeN ?? ""))), + child: + Center(child: Text(prescriptionReport.routeN))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center(child: Text(prescriptionReport.frequencyN ?? ''))), + child: Center( + child: + Text(prescriptionReport.frequencyN ?? ''))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center(child: Text('${prescriptionReport.doseDailyQuantity}'))), + child: Center( + child: Text( + '${prescriptionReport.doseDailyQuantity}'))), Container( color: Colors.white, height: 50, width: double.infinity, - child: Center(child: Text('${prescriptionReport.days}'))) + child: + Center(child: Text('${prescriptionReport.days}'))) ], ), ], diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index bd28146d..84f38748 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -3,10 +3,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'; @@ -23,14 +23,14 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { final int prescriptionIndex; PrescriptionItemsInPatientPage( - {Key? key, - required this.prescriptions, - required this.patient, - required this.patientType, - required this.arrivalType, - required this.stopOn, - required this.startOn, - required this.prescriptionIndex}); + {Key key, + this.prescriptions, + this.patient, + this.patientType, + this.arrivalType, + this.stopOn, + this.startOn, + this.prescriptionIndex}); @override Widget build(BuildContext context) { @@ -43,9 +43,9 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], baseViewModel: model, - patientProfileAppBarModel: PatientProfileAppBarModel(patient: patient), + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( child: Container( child: Column( @@ -101,7 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText(" " + prescriptions.routeDescription.toString()), + AppText(" " + prescriptions.routeDescription.toString() ?? ''), ], ), Row( @@ -160,7 +160,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText(" " + prescriptions.dose.toString()), + AppText(" " + prescriptions.dose.toString() ?? ''), ], ), Row( @@ -169,9 +169,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).status, color: Colors.grey, ), - AppText( - " " + prescriptions.statusDescription.toString(), - ), + AppText(" " + prescriptions.statusDescription.toString() ?? ''), ], ), Row( diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 2fb4131d..b97343c4 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'; @@ -17,39 +17,36 @@ class PrescriptionItemsPage extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - PrescriptionItemsPage( - {Key? key, - required this.prescriptions, - required this.patient, - required this.patientType, - required this.arrivalType}); + PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions, patient: patient), + onModelReady: (model) => + model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], baseViewModel: model, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, - clinic: prescriptions.clinicDescription!, - branch: prescriptions.name!, + appBar: PatientProfileAppBar( + patient, + clinic: prescriptions.clinicDescription, + branch: prescriptions.name, isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate!), - doctorName: prescriptions.doctorName!, - profileUrl: prescriptions.doctorImageURL!, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), + doctorName: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, isAppointmentHeader: true, ), body: SingleChildScrollView( child: Container( child: Column( children: [ - if (!prescriptions.isInOutPatient!) + + if (!prescriptions.isInOutPatient) ...List.generate( model.prescriptionReportList.length, - (index) => Container( + (index) => Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: Colors.white, @@ -61,224 +58,179 @@ class PrescriptionItemsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 18, right: 18), - child: AppText( - model.prescriptionReportList[index].itemDescription!.isNotEmpty - ? model.prescriptionReportList[index].itemDescription - : model.prescriptionReportList[index].itemDescriptionN, - bold: true, - )), - SizedBox( - height: 12, - ), + margin: EdgeInsets.only(left: 18,right: 18), + child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), + SizedBox(height: 12,), Row( children: [ - SizedBox( - width: 18, - ), + SizedBox(width: 18,), Container( decoration: BoxDecoration( - shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), height: 55, width: 55, child: InkWell( - onTap: () { + onTap: (){ showDialog( context: context, - builder: (ctx) => ShowImageDialog( - imageUrl: - model.prescriptionReportEnhList[index].imageSRCUrl ?? "", - )); + builder: (ctx) => ShowImageDialog( + imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, + ) + ); }, child: Padding( padding: const EdgeInsets.all(8.0), child: Image.network( - model.prescriptionReportList[index].imageSRCUrl ?? "", + model.prescriptionReportList[index].imageSRCUrl, fit: BoxFit.cover, ), ), ), ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).route, - color: Colors.grey, - ), - Expanded( - child: AppText(" " + model.prescriptionReportList[index].routeN!)), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).frequency, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].frequencyN!), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].doseDailyQuantity), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).duration, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].days.toString()), - ], - ), - SizedBox( - height: 12, - ), - AppText(model.prescriptionReportList[index].remarks ?? ''), - ], - ), - ) + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), + ], + ), + Row( + children: [ + AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), + ], + ), + SizedBox(height: 12,), + AppText(model.prescriptionReportList[index].remarks ?? ''), + ], + ),) + + ], ) ], ), ), )) + else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18, right: 18), - child: AppText( - model.prescriptionReportEnhList[index].itemDescription, - bold: true, - ), - ), - SizedBox( - height: 12, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 18, - ), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)), - height: 55, - width: 55, - child: InkWell( - onTap: () { - showDialog( + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18,right: 18), + child: AppText(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), + SizedBox(height: 12,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(width: 18,), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), + height: 55, + width: 55, + child: InkWell( + onTap: (){ + showDialog( context: context, builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl!, - )); - }, - child: Stack( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl ?? "", - fit: BoxFit.cover, + imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, + ) + ); + }, + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + model.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + + ), ), - ), - Positioned( - top: 10, - right: 10, - child: Icon( - EvaIcons.search, - color: Colors.grey, - size: 35, - )) - ], + Positioned( + top: 10, + right: 10, + child: Icon(EvaIcons.search,color: Colors.grey,size: 35,)) + ], + ), ), ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( + SizedBox(width: 10,), + Expanded(child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - AppText( - TranslationBase.of(context).route, - color: Colors.grey, - ), - Expanded(child: AppText(" " + model.prescriptionReportEnhList[index].route!)), + AppText(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), ], ), Row( children: [ - AppText( - TranslationBase.of(context).frequency, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportEnhList[index].frequency!), + AppText(TranslationBase.of(context).frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), ], ), Row( children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText(" " + - model.prescriptionReportEnhList[index].doseDailyQuantity.toString()), + AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), ], ), Row( children: [ - AppText( - TranslationBase.of(context).duration, - color: Colors.grey, - ), - AppText(" " + model.prescriptionReportList[index].days.toString()), + AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), - SizedBox( - height: 12, - ), - AppText(model.prescriptionReportEnhList[index].remarks ?? ''), + SizedBox(height: 12,), + AppText(model.prescriptionReportEnhList[index].remarks?? ''), ], - ), - ) - ], - ) - ], + ),) + + + ], + ) + ], + ), ), ), - ), - ), + ), + + + ], ), ), @@ -287,3 +239,6 @@ class PrescriptionItemsPage extends StatelessWidget { ); } } + + + diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index faf6229e..c63ccd1e 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -8,25 +8,23 @@ import 'package:flutter/material.dart'; class PrescriptionTextFiled extends StatefulWidget { dynamic element; final String elementError; - final bool? isSubmitted; final List elementList; final String keyName; final String keyId; final String hintText; - final double? width; + final double width; final Function(dynamic) okFunction; PrescriptionTextFiled( - {Key? key, - required this.element, - required this.elementError, + {Key key, + @required this.element, + @required this.elementError, this.width, - required this.elementList, - required this.keyName, - required this.keyId, - required this.hintText, - required this.okFunction, - this.isSubmitted}) + this.elementList, + this.keyName, + this.keyId, + this.hintText, + this.okFunction}) : super(key: key); @override @@ -67,9 +65,7 @@ class _PrescriptionTextFiledState extends State { ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, - validationError: widget.element == null && widget.isSubmitted == true && widget.elementList.length != 1 - ? widget.elementError - : null, + validationError: widget.elementList.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index c3764b22..b3cb4ec0 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -1,6 +1,5 @@ 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'; @@ -9,11 +8,12 @@ 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'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import '../../widgets/shared/in_patient_doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; @@ -22,7 +22,7 @@ import 'package:flutter/material.dart'; class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -37,8 +37,10 @@ class PrescriptionsPage extends StatelessWidget { baseViewModel: model, isShowAppBar: true, backgroundColor: Colors.grey[100], - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, @@ -107,7 +109,7 @@ class PrescriptionsPage extends StatelessWidget { ); }, label: TranslationBase.of(context) - .applyForNewPrescriptionsOrder ?? "", + .applyForNewPrescriptionsOrder, ), ...List.generate( model.prescriptionsList.length, @@ -126,17 +128,17 @@ class PrescriptionsPage extends StatelessWidget { ), child: DoctorCard( doctorName: - model.prescriptionsList[index].doctorName ?? "", + model.prescriptionsList[index].doctorName, profileUrl: model - .prescriptionsList[index].doctorImageURL ?? "", - branch: model.prescriptionsList[index].name ?? "", + .prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, clinic: model.prescriptionsList[index] - .clinicDescription ?? "", + .clinicDescription, isPrescriptions: true, appointmentDate: AppDateUtils.getDateTimeFromServerFormat( model.prescriptionsList[index] - .appointmentDate ?? "", + .appointmentDate, ), ))), if (model.prescriptionsList.isEmpty && @@ -196,14 +198,14 @@ class PrescriptionsPage extends StatelessWidget { model .medicationForInPatient[ index] - .startDatetime ?? "", + .startDatetime, ), stopOn: AppDateUtils .getDateTimeFromServerFormat( model .medicationForInPatient[ index] - .stopDatetime ?? "", + .stopDatetime, ), ), ), @@ -219,7 +221,7 @@ class PrescriptionsPage extends StatelessWidget { appointmentDate: AppDateUtils .getDateTimeFromServerFormat( model.medicationForInPatient[index] - .prescriptionDatetime ?? "", + .prescriptionDatetime, ), createdBy: model .medicationForInPatient[index] diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 81cae799..01ba6a91 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -12,7 +12,7 @@ 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 '../../widgets/shared/text_fields/TextFields.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; @@ -42,22 +42,22 @@ class UpdatePrescriptionForm extends StatefulWidget { final PrescriptionViewModel model; UpdatePrescriptionForm( - {required this.drugName, - required this.doseStreangth, - required this.drugId, - required this.remarks, - required this.patient, - required this.duration, - required this.route, - required this.dose, - required this.startDate, - required this.doseUnit, - required this.enteredRemarks, - required this.frequency, - required this.model, - required this.drugNameGeneric, - required this.uom, - required this.box}); + {this.drugName, + this.doseStreangth, + this.drugId, + this.remarks, + this.patient, + this.duration, + this.route, + this.dose, + this.startDate, + this.doseUnit, + this.enteredRemarks, + this.frequency, + this.model, + this.drugNameGeneric, + this.uom, + this.box}); @override _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); } @@ -66,31 +66,35 @@ class _UpdatePrescriptionFormState extends State { TextEditingController strengthController = TextEditingController(); TextEditingController remarksController = TextEditingController(); int testNum = 0; - late int strengthChar; - late PatiantInformtion patient; + int strengthChar; + PatiantInformtion patient; dynamic route; dynamic doseTime; dynamic frequencyUpdate; dynamic updatedDuration; dynamic units; - late GetMedicationResponseModel newSelectedMedication; - GlobalKey key = new GlobalKey>(); - late List indicationList; + GetMedicationResponseModel newSelectedMedication; + GlobalKey key = + new GlobalKey>(); + List indicationList; dynamic indication; - late DateTime selectedDate; + DateTime selectedDate; @override void initState() { super.initState(); strengthController.text = widget.doseStreangth; remarksController.text = widget.remarks; - indicationList = []; + indicationList = List(); dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = {"id": 550, "name": "Phenytoin Hypersensitivity Syndrome"}; + dynamic indication6 = { + "id": 550, + "name": "Phenytoin Hypersensitivity Syndrome" + }; dynamic indication7 = {"id": 551, "name": "Asterixis"}; dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; @@ -111,7 +115,8 @@ class _UpdatePrescriptionFormState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: + (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) async { await model.getMedicationList(); @@ -122,13 +127,20 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationDoseTime(); await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); - route = model.getLookupByIdFilter(model.itemMedicineListRoute, widget.route); - doseTime = model.getLookupById(model.medicationDoseTimeList, widget.dose); - updatedDuration = model.getLookupById(model.medicationDurationList, widget.duration); - units = model.getLookupByIdFilter(model.itemMedicineListUnit, widget.doseUnit); - frequencyUpdate = model.getLookupById(model.medicationFrequencyList, widget.frequency); + route = model.getLookupByIdFilter( + model.itemMedicineListRoute, widget.route); + doseTime = + model.getLookupById(model.medicationDoseTimeList, widget.dose); + updatedDuration = model.getLookupById( + model.medicationDurationList, widget.duration); + units = model.getLookupByIdFilter( + model.itemMedicineListUnit, widget.doseUnit); + frequencyUpdate = model.getLookupById( + model.medicationFrequencyList, widget.frequency); }, - builder: (BuildContext context, MedicineViewModel model, Widget? child) => NetworkBaseView( + builder: + (BuildContext context, MedicineViewModel model, Widget child) => + NetworkBaseView( baseViewModel: model, child: GestureDetector( onTap: () { @@ -138,13 +150,15 @@ class _UpdatePrescriptionFormState extends State { initialChildSize: 0.98, maxChildSize: 0.99, minChildSize: 0.6, - builder: (BuildContext context, ScrollController scrollController) { + builder: + (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.5, child: Form( child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), + padding: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -230,16 +244,25 @@ class _UpdatePrescriptionFormState extends State { // height: 12, // ), Container( - height: MediaQuery.of(context).size.height * 0.060, + height: + MediaQuery.of(context).size.height * + 0.060, width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.4900, - height: MediaQuery.of(context).size.height * 0.55, + width: MediaQuery.of(context) + .size + .width * + 0.4900, + height: MediaQuery.of(context) + .size + .height * + 0.55, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter(5), + LengthLimitingTextInputFormatter( + 5), // WhitelistingTextInputFormatter // .digitsOnly ], @@ -247,7 +270,8 @@ class _UpdatePrescriptionFormState extends State { hintText: widget.doseStreangth, fontSize: 15.0, controller: strengthController, - keyboardType: TextInputType.numberWithOptions( + keyboardType: TextInputType + .numberWithOptions( decimal: true, ), onChanged: (String value) { @@ -255,7 +279,8 @@ class _UpdatePrescriptionFormState extends State { strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast("Only 5 Digits allowed for strength"); + DrAppToastMsg.showErrorToast( + "Only 5 Digits allowed for strength"); } }, // validator: (value) { @@ -273,34 +298,59 @@ class _UpdatePrescriptionFormState extends State { width: 10.0, ), Container( - width: MediaQuery.of(context).size.width * 0.3700, + width: MediaQuery.of(context) + .size + .width * + 0.3700, child: InkWell( - onTap: model.itemMedicineListUnit != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( - list: model.itemMedicineListUnit, - attributeName: 'description', - attributeValueId: 'parameterCode', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - units = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, + onTap: + model.itemMedicineListUnit != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .itemMedicineListUnit, + attributeName: + 'description', + attributeValueId: + 'parameterCode', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: + (BuildContext + context) { + return dialog; + }, + ); + } + : null, child: TextField( - decoration: textFieldSelectorDecoration( - 'UNIT Type', units != null ? units['description'] : null, true), + decoration: + textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units[ + 'description'] + : null, + true), enabled: false, ), ), @@ -312,16 +362,24 @@ class _UpdatePrescriptionFormState extends State { height: 12, ), Container( - height: MediaQuery.of(context).size.height * 0.070, + height: + MediaQuery.of(context).size.height * + 0.070, child: InkWell( - onTap: model.itemMedicineListRoute != null + onTap: model.itemMedicineListRoute != + null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( - list: model.itemMedicineListRoute, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .itemMedicineListRoute, attributeName: 'description', - attributeValueId: 'parameterCode', - okText: TranslationBase.of(context).ok, + attributeValueId: + 'parameterCode', + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { route = selectedValue; @@ -334,15 +392,21 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: textFieldSelectorDecoration( - 'Route', route != null ? route['description'] : null, true), + decoration: + textFieldSelectorDecoration( + 'Route', + route != null + ? route['description'] + : null, + true), enabled: false, ), ), @@ -351,16 +415,23 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: MediaQuery.of(context).size.height * 0.070, + height: + MediaQuery.of(context).size.height * + 0.070, child: InkWell( - onTap: model.medicationDoseTimeList != null + onTap: model.medicationDoseTimeList != + null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( - list: model.medicationDoseTimeList, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationDoseTimeList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { doseTime = selectedValue; @@ -370,15 +441,22 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: textFieldSelectorDecoration(TranslationBase.of(context).doseTime!, - doseTime != null ? doseTime['nameEn'] : null, true), + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .doseTime, + doseTime != null + ? doseTime['nameEn'] + : null, + true), enabled: false, ), ), @@ -387,36 +465,50 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: MediaQuery.of(context).size.height * 0.070, + height: + MediaQuery.of(context).size.height * + 0.070, child: InkWell( - onTap: model.medicationFrequencyList != null + onTap: model.medicationFrequencyList != + null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( - list: model.medicationFrequencyList, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationFrequencyList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { - frequencyUpdate = selectedValue; + frequencyUpdate = + selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).frequency!, - frequencyUpdate != null ? frequencyUpdate['nameEn'] : null, - true), + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .frequency, + frequencyUpdate != null + ? frequencyUpdate[ + 'nameEn'] + : null, + true), enabled: false, ), ), @@ -425,36 +517,51 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: MediaQuery.of(context).size.height * 0.070, + height: + MediaQuery.of(context).size.height * + 0.070, child: InkWell( - onTap: model.medicationDurationList != null + onTap: model.medicationDurationList != + null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( - list: model.medicationDurationList, + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationDurationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { - updatedDuration = selectedValue; + updatedDuration = + selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).duration!, - updatedDuration != null ? updatedDuration['nameEn'].toString() : null, - true), + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .duration, + updatedDuration != null + ? updatedDuration[ + 'nameEn'] + .toString() + : null, + true), enabled: false, ), ), @@ -463,26 +570,46 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: - model.patientAssessmentList.isNotEmpty ? screenSize.height * 0.070 : 0.0, - width: model.patientAssessmentList.isNotEmpty ? double.infinity : 0.0, - child: model.patientAssessmentList.isNotEmpty + height: model.patientAssessmentList + .isNotEmpty + ? screenSize.height * 0.070 + : 0.0, + width: model.patientAssessmentList + .isNotEmpty + ? double.infinity + : 0.0, + child: model.patientAssessmentList + .isNotEmpty ? Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.29, + width: + MediaQuery.of(context) + .size + .width * + 0.29, child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard(context); - } - : null, + onTap: + indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, child: TextField( decoration: textFieldSelectorDecoration( - model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.toString() + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString() : '', - indication != null ? indication['name'] : null, + indication != null + ? indication[ + 'name'] + : null, true), enabled: true, readOnly: true, @@ -490,20 +617,34 @@ class _UpdatePrescriptionFormState extends State { ), ), Container( - width: MediaQuery.of(context).size.width * 0.61, + width: + MediaQuery.of(context) + .size + .width * + 0.61, child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard(context); - } - : null, + onTap: + indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, child: TextField( maxLines: 3, decoration: textFieldSelectorDecoration( - model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].asciiDesc.toString() + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .asciiDesc + .toString() : '', - indication != null ? indication['name'] : null, + indication != null + ? indication[ + 'name'] + : null, true), enabled: true, readOnly: true, @@ -519,18 +660,22 @@ class _UpdatePrescriptionFormState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: () => selectDate(context, widget.model), + onTap: () => + selectDate(context, widget.model), child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - AppDateUtils.getDateFormatted(DateTime.parse(widget.startDate)), - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: Helpers + .textFieldSelectorDecoration( + AppDateUtils.getDateFormatted( + DateTime.parse( + widget.startDate)), + selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), @@ -544,11 +689,14 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( + ListSelectDialog dialog = + ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -558,15 +706,21 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: textFieldSelectorDecoration( - "UOM", widget.uom != null ? widget.uom : null, true), + decoration: + textFieldSelectorDecoration( + "UOM", + widget.uom != null + ? widget.uom + : null, + true), // enabled: false, readOnly: true, ), @@ -578,11 +732,14 @@ class _UpdatePrescriptionFormState extends State { onTap: model.allMedicationList != null ? () { Helpers.hideKeyboard(context); - ListSelectDialog dialog = ListSelectDialog( + ListSelectDialog dialog = + ListSelectDialog( list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { // duration = selectedValue; @@ -592,17 +749,22 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: textFieldSelectorDecoration( - 'Box Quantity', - widget.box != null ? "Box Quantity: " + widget.box.toString() : null, - true), + decoration: + textFieldSelectorDecoration( + 'Box Quantity', + widget.box != null + ? "Box Quantity: " + + widget.box.toString() + : null, + true), // enabled: false, readOnly: true, ), @@ -613,8 +775,11 @@ class _UpdatePrescriptionFormState extends State { ), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), child: TextFields( controller: remarksController, maxLines: 7, @@ -625,39 +790,59 @@ class _UpdatePrescriptionFormState extends State { height: 10.0, ), SizedBox( - height: MediaQuery.of(context).size.height * 0.08, + height: + MediaQuery.of(context).size.height * + 0.08, ), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( - title: 'update prescription'.toUpperCase(), + title: 'update prescription' + .toUpperCase(), onPressed: () { - if (double.parse(strengthController.text) > 1000.0) { - DrAppToastMsg.showErrorToast("1000 is the MAX for the strength"); + if (double.parse( + strengthController.text) > + 1000.0) { + DrAppToastMsg.showErrorToast( + "1000 is the MAX for the strength"); return; } - if (double.parse(strengthController.text) == 0.0) { - DrAppToastMsg.showErrorToast("strength can't be zero"); + if (double.parse( + strengthController + .text) == + 0.0) { + DrAppToastMsg.showErrorToast( + "strength can't be zero"); return; } - if (strengthController.text.length > 4) { - DrAppToastMsg.showErrorToast("strength can't be more then 4 digits "); + if (strengthController + .text.length > + 4) { + DrAppToastMsg.showErrorToast( + "strength can't be more then 4 digits "); return; } // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) updatePrescription( newStartDate: selectedDate, - newDoseStreangth: strengthController.text.isNotEmpty - ? strengthController.text - : widget.doseStreangth, + newDoseStreangth: + strengthController + .text.isNotEmpty + ? strengthController + .text + : widget + .doseStreangth, newUnit: units != null - ? units['parameterCode'].toString() + ? units['parameterCode'] + .toString() : widget.doseUnit, doseUnit: widget.doseUnit, - doseStreangth: widget.doseStreangth, + doseStreangth: + widget.doseStreangth, duration: widget.duration, startDate: widget.startDate, doseId: widget.dose, @@ -665,18 +850,30 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: updatedDuration != null - ? updatedDuration['id'].toString() - : widget.duration, + newDuration: + updatedDuration != null + ? updatedDuration['id'] + .toString() + : widget.duration, drugId: widget.drugId, - remarks: remarksController.text, - route: - route != null ? route['parameterCode'].toString() : widget.route, - frequency: frequencyUpdate != null - ? frequencyUpdate['id'].toString() - : widget.frequency, - dose: doseTime != null ? doseTime['id'].toString() : widget.dose, - enteredRemarks: widget.enteredRemarks); + remarks: remarksController + .text, + route: route != null + ? route['parameterCode'] + .toString() + : widget.route, + frequency: + frequencyUpdate != null + ? frequencyUpdate[ + 'id'] + .toString() + : widget.frequency, + dose: doseTime != null + ? doseTime['id'] + .toString() + : widget.dose, + enteredRemarks: + widget.enteredRemarks); Navigator.pop(context); }, ), @@ -701,7 +898,7 @@ class _UpdatePrescriptionFormState extends State { Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime? picked = await showDatePicker( + final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -715,8 +912,9 @@ class _UpdatePrescriptionFormState extends State { } } - InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, - {Icon? suffixIcon}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -747,29 +945,30 @@ class _UpdatePrescriptionFormState extends State { } updatePrescription( - {required PrescriptionViewModel model, - required int drugId, - String? newDrugId, - required String frequencyId, - required String remarks, - required String dose, - required String doseId, - required String frequency, - required String route, - required String routeId, - required String startDate, - required DateTime newStartDate, - required String doseUnit, - required String doseStreangth, - required String newDoseStreangth, - required String duration, - required String newDuration, - required String newUnit, - required String enteredRemarks, - required PatiantInformtion patient}) async { + {PrescriptionViewModel model, + int drugId, + String newDrugId, + String frequencyId, + String remarks, + String dose, + String doseId, + String frequency, + String route, + String routeId, + String startDate, + DateTime newStartDate, + String doseUnit, + String doseStreangth, + String newDoseStreangth, + String duration, + String newDuration, + String newUnit, + String enteredRemarks, + PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); - List sss = []; + PostPrescriptionReqModel updatePrescriptionReqModel = + new PostPrescriptionReqModel(); + List sss = List(); updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; updatePrescriptionReqModel.clinicID = patient.clinicId; @@ -778,22 +977,31 @@ class _UpdatePrescriptionFormState extends State { sss.add(PrescriptionRequestModel( covered: true, - dose: newDoseStreangth.isNotEmpty ? double.parse(newDoseStreangth) : double.parse(doseStreangth), + dose: newDoseStreangth.isNotEmpty + ? double.parse(newDoseStreangth) + : double.parse(doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, - doseUnitId: newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), + doseUnitId: + newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), - frequency: frequency.isNotEmpty ? int.parse(frequency) : int.parse(frequencyId), + frequency: frequency.isNotEmpty + ? int.parse(frequency) + : int.parse(frequencyId), remarks: remarks.isEmpty ? enteredRemarks : remarks, approvalRequired: true, icdcode10Id: "test2", doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: newDuration.isNotEmpty ? int.parse(newDuration) : int.parse(duration), - doseStartDate: newStartDate != null ? newStartDate.toIso8601String() : startDate)); + duration: newDuration.isNotEmpty + ? int.parse(newDuration) + : int.parse(duration), + doseStartDate: + newStartDate != null ? newStartDate.toIso8601String() : startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; - await model.updatePrescription(updatePrescriptionReqModel, patient.patientMRN!); + await model.updatePrescription( + updatePrescriptionReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -805,22 +1013,22 @@ class _UpdatePrescriptionFormState extends State { void updatePrescriptionForm( {context, - required String drugName, - required String drugNameGeneric, - required int drugId, - required String remarks, - required PrescriptionViewModel model, - required PatiantInformtion patient, - required String rouat, - required String frequency, - required String dose, - required String duration, - required String doseStreangth, - required String doseUnit, - required String enteredRemarks, - required String uom, - required int box, - required String startDate}) { + String drugName, + String drugNameGeneric, + int drugId, + String remarks, + PrescriptionViewModel model, + PatiantInformtion patient, + String rouat, + String frequency, + String dose, + String duration, + String doseStreangth, + String doseUnit, + String enteredRemarks, + String uom, + int box, + String startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 740ae8e6..06e56f03 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -15,24 +15,24 @@ class ExpansionProcedure extends StatefulWidget { final ProcedureViewModel model; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel)? selectProcedures; + final Function(ProcedureTempleteDetailsModel) selectProcedures; - final bool Function(ProcedureTempleteModel)? isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; + final bool Function(ProcedureTempleteModel) isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; final bool isProcedure; final ProcedureTempleteDetailsModel groupProcedures; const ExpansionProcedure( - {Key? key, - required this.procedureTempleteModel, - required this.model, - required this.removeFavProcedure, - required this.addFavProcedure, + {Key key, + this.procedureTempleteModel, + this.model, + this.removeFavProcedure, + this.addFavProcedure, this.selectProcedures, this.isEntityListSelected, this.isEntityFavListSelected, this.isProcedure = true, - required this.groupProcedures}) + this.groupProcedures}) : super(key: key); @override @@ -77,8 +77,8 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: AppText( widget.isProcedure == true - ? "Procedures for " + widget.procedureTempleteModel.templateName! - : "Prescription for " + widget.procedureTempleteModel.templateName!, + ? "Procedures for " + widget.procedureTempleteModel.templateName + : "Prescription for " + widget.procedureTempleteModel.templateName, fontSize: 16.0, variant: "bodyText", bold: true, @@ -118,14 +118,14 @@ class _ExpansionProcedureState extends State { onTap: () { if (widget.isProcedure) { setState(() { - if (widget.isEntityFavListSelected!(itemProcedure)) { + if (widget.isEntityFavListSelected(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); } }); } else { - widget.selectProcedures!(itemProcedure); + widget.selectProcedures(itemProcedure); } }, child: Container( @@ -140,11 +140,11 @@ class _ExpansionProcedureState extends State { padding: const EdgeInsets.symmetric(horizontal: 11), child: widget.isProcedure ? Checkbox( - value: widget.isEntityFavListSelected!(itemProcedure), + value: widget.isEntityFavListSelected(itemProcedure), activeColor: Color(0xffD02127), - onChanged: (bool? newValue) { + onChanged: (bool newValue) { setState(() { - if (widget.isEntityFavListSelected!(itemProcedure)) { + if (widget.isEntityFavListSelected(itemProcedure)) { widget.removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); @@ -155,8 +155,8 @@ class _ExpansionProcedureState extends State { value: itemProcedure, groupValue: widget.groupProcedures, activeColor: Color(0xffD02127), - onChanged: (ProcedureTempleteDetailsModel? newValue) { - widget.selectProcedures!(newValue!); + onChanged: (newValue) { + widget.selectProcedures(newValue); })), Expanded( child: Padding( diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 83896e2c..82bb649c 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -12,21 +12,21 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ProcedureCard extends StatelessWidget { - final GestureTapCallback onTap; + final Function onTap; final EntityList entityList; - final String? categoryName; + final String categoryName; final int categoryID; final PatiantInformtion patient; final int doctorID; final bool isInpatient; const ProcedureCard({ - Key? key, - required this.onTap, - required this.entityList, - required this.categoryID, + Key key, + this.onTap, + this.entityList, + this.categoryID, this.categoryName, - required this.patient, - required this.doctorID, + this.patient, + this.doctorID, this.isInpatient = false, }) : super(key: key); @@ -97,13 +97,13 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate ?? ""))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -150,7 +150,7 @@ class ProcedureCard extends StatelessWidget { 'assets/images/male_avatar.png', height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, ))), @@ -190,7 +190,7 @@ class ProcedureCard extends StatelessWidget { children: [ Expanded( child: AppText( - entityList.remarks.toString(), + entityList.remarks.toString() ?? '', fontSize: 12, ), ), diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 47fe2a4b..28a72041 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -10,19 +10,19 @@ enum ProcedureType { extension procedureType on ProcedureType { String getFavouriteTabName(BuildContext context) { - return TranslationBase.of(context).favoriteTemplates!; + return TranslationBase.of(context).favoriteTemplates; } String getAllLabelName(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).allProcedures!; + return TranslationBase.of(context).allProcedures; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).allLab!; + return TranslationBase.of(context).allLab; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).allRadiology!; + return TranslationBase.of(context).allRadiology; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).allPrescription!; + return TranslationBase.of(context).allPrescription; default: return ""; } @@ -31,13 +31,13 @@ extension procedureType on ProcedureType { String getToolbarLabel(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures!; + return TranslationBase.of(context).addProcedures; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder!; + return TranslationBase.of(context).addLabOrder; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder!; + return TranslationBase.of(context).addRadiologyOrder; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription!; + return TranslationBase.of(context).addPrescription; default: return ""; } @@ -46,19 +46,19 @@ extension procedureType on ProcedureType { String getAddButtonTitle(BuildContext context) { switch (this) { case ProcedureType.PROCEDURE: - return TranslationBase.of(context).addProcedures!; + return TranslationBase.of(context).addProcedures; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addLabOrder!; + return TranslationBase.of(context).addLabOrder; case ProcedureType.RADIOLOGY: - return TranslationBase.of(context).addRadiologyOrder!; + return TranslationBase.of(context).addRadiologyOrder; case ProcedureType.PRESCRIPTION: - return TranslationBase.of(context).addPrescription!; + return TranslationBase.of(context).addPrescription; default: return ""; } } - String ? getCategoryId() { + String getCategoryId() { switch (this) { case ProcedureType.PROCEDURE: return null; @@ -76,13 +76,13 @@ extension procedureType on ProcedureType { String getCategoryName() { switch (this) { case ProcedureType.PROCEDURE: - return ''; + return null; case ProcedureType.LAB_RESULT: return "Laboratory"; case ProcedureType.RADIOLOGY: return "Radiology"; default: - return ''; + return null; } } } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 8ff817e5..7f4e49b2 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -12,23 +12,24 @@ 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/cupertino.dart'; import 'package:flutter/material.dart'; import 'ProcedureType.dart'; class AddFavouriteProcedure extends StatefulWidget { - final ProcedureViewModel? model; - final PrescriptionViewModel? prescriptionModel; + final ProcedureViewModel model; + final PrescriptionViewModel prescriptionModel; final PatiantInformtion patient; final ProcedureType procedureType; AddFavouriteProcedure({ - Key? key, + Key key, this.model, this.prescriptionModel, - required this.patient, - required this.procedureType, + this.patient, + @required this.procedureType, }); @override @@ -38,47 +39,47 @@ class AddFavouriteProcedure extends StatefulWidget { class _AddFavouriteProcedureState extends State { _AddFavouriteProcedureState({this.patient, this.model}); - ProcedureViewModel? model; - PatiantInformtion? patient; - List entityList = []; - ProcedureTempleteDetailsModel? groupProcedures; + ProcedureViewModel model; + PatiantInformtion patient; + List entityList = List(); + ProcedureTempleteDetailsModel groupProcedures; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, baseViewModel: model, body: Column( children: [ Container( - height: MediaQuery.of(context!).size.height * 0.070, + height: MediaQuery.of(context).size.height * 0.070, ), - (model!.templateList.length != 0) - ?Expanded( - child: EntityListCheckboxSearchFavProceduresWidget( - isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), - model: model, - removeFavProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addFavProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - isEntityFavListSelected: (master) => isEntityListSelected(master), - groupProcedures: groupProcedures, - selectProcedures: (selectedProcedure) { - setState(() { - groupProcedures = selectedProcedure; - }); - }, - ), - ) + (model.templateList.length != 0) + ? Expanded( + child: EntityListCheckboxSearchFavProceduresWidget( + isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), + model: model, + removeFavProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addFavProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + isEntityFavListSelected: (master) => isEntityListSelected(master), + groupProcedures: groupProcedures, + selectProcedures: (selectedProcedure) { + setState(() { + groupProcedures = selectedProcedure; + }); + }, + ), + ) : Container( child: Padding( padding: EdgeInsets.symmetric(vertical: 50.0), @@ -87,23 +88,25 @@ class _AddFavouriteProcedureState extends State { ), ], ), - bottomSheet: Container(margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.procedureType.getAddButtonTitle(context), + bottomSheet: Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.procedureType.getAddButtonTitle(context) ?? + TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), disabled: model.templateList.length == 0 ? true : false, - fontWeight: FontWeight.w700, - onPressed: () { - if (widget.procedureType == ProcedureType.PRESCRIPTION) { - if (groupProcedures == null) { - DrAppToastMsg.showErrorToast( - 'Please Select item ', - ); - return; - } + fontWeight: FontWeight.w700, + onPressed: () { + if (widget.procedureType == ProcedureType.PRESCRIPTION) { + if (groupProcedures == null) { + DrAppToastMsg.showErrorToast( + 'Please Select item ', + ); + return; + } Navigator.push( context, diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index 41331c08..e0b7374f 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -16,29 +16,31 @@ import 'ProcedureType.dart'; import 'entity_list_checkbox_search_widget.dart'; class AddProcedurePage extends StatefulWidget { - final ProcedureViewModel? model; + final ProcedureViewModel model; final PatiantInformtion patient; final ProcedureType procedureType; - const AddProcedurePage({Key? key, this.model, required this.patient, required this.procedureType}) : super(key: key); + const AddProcedurePage( + {Key key, this.model, this.patient, @required this.procedureType}) + : super(key: key); @override - _AddProcedurePageState createState() => - _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType); + _AddProcedurePageState createState() => _AddProcedurePageState( + patient: patient, model: model, procedureType: this.procedureType); } class _AddProcedurePageState extends State { - int? selectedType; - ProcedureViewModel? model; - PatiantInformtion? patient; - ProcedureType? procedureType; + int selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + ProcedureType procedureType; _AddProcedurePageState({this.patient, this.model, this.procedureType}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = []; - List entityListProcedure = []; + List entityList = List(); + List entityListProcedure = List(); TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -54,16 +56,17 @@ class _AddProcedurePageState extends State { return BaseView( onModelReady: (model) { model.getProcedureCategory( - categoryName: procedureType!.getCategoryName(), - categoryID: procedureType!.getCategoryId(), - patientId: patient!.patientId); + categoryName: procedureType.getCategoryName(), + categoryID: procedureType.getCategoryId(), + patientId: patient.patientId); }, - builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( isShowAppBar: false, body: Column( children: [ Container( - height: MediaQuery.of(context!).size.height * 0.070, + height: MediaQuery.of(context).size.height * 0.070, ), Expanded( child: NetworkBaseView( @@ -79,24 +82,29 @@ class _AddProcedurePageState extends State { Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context).pleaseEnterProcedure, + TranslationBase.of(context) + .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), ], ), SizedBox( - height: MediaQuery.of(context).size.height * 0.02, + height: + MediaQuery.of(context).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.79, + width: MediaQuery.of(context).size.width * + 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context).searchProcedureHere, + hintText: TranslationBase.of(context) + .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, @@ -105,17 +113,22 @@ class _AddProcedurePageState extends State { ), ), SizedBox( - width: MediaQuery.of(context).size.width * 0.02, + 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); + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + patientId: patient.patientId, + categoryName: + procedureName.text); else DrAppToastMsg.showErrorToast( - TranslationBase.of(context).atLeastThreeCharacters, + TranslationBase.of(context) + .atLeastThreeCharacters, ); }, child: Icon( @@ -128,13 +141,16 @@ class _AddProcedurePageState extends State { ), ], ), - if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && - model!.categoriesList.length != 0) + if ((procedureType == ProcedureType.PROCEDURE + ? procedureName.text.isNotEmpty + : true) && + model.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( - model: widget.model!, - masterList: model.categoriesList[0].entityList!, + model: widget.model, + masterList: + model.categoriesList[0].entityList, removeHistory: (item) { setState(() { entityList.remove(item); @@ -149,7 +165,8 @@ class _AddProcedurePageState extends State { //TODO build your fun herr // widget.addSelectedHistories(); }, - isEntityListSelected: (master) => isEntityListSelected(master), + isEntityListSelected: (master) => + isEntityListSelected(master), )), ], ), @@ -164,18 +181,19 @@ class _AddProcedurePageState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: procedureType!.getAddButtonTitle(context), + title: procedureType.getAddButtonTitle(context), fontWeight: FontWeight.w700, color: Color(0xff359846), onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).fillTheMandatoryProcedureDetails, + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, ); return; } - await this.model!.preparePostProcedure( + await this.model.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, @@ -193,7 +211,8 @@ class _AddProcedurePageState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 10bbe773..e9ab695b 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -15,28 +15,33 @@ import 'add-favourite-procedure.dart'; import 'add-procedure-page.dart'; class BaseAddProcedureTabPage extends StatefulWidget { - final ProcedureViewModel? model; - final PrescriptionViewModel? prescriptionModel; - final PatiantInformtion? patient; - final ProcedureType? procedureType; + final ProcedureViewModel model; + final PrescriptionViewModel prescriptionModel; + final PatiantInformtion patient; + final ProcedureType procedureType; const BaseAddProcedureTabPage( - {Key? key, this.model, this.prescriptionModel, this.patient, required this.procedureType}) + {Key key, + this.model, + this.prescriptionModel, + this.patient, + @required this.procedureType}) : 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 with SingleTickerProviderStateMixin { - final ProcedureViewModel? model; +class _BaseAddProcedureTabPageState extends State + with SingleTickerProviderStateMixin { + final ProcedureViewModel model; final PatiantInformtion patient; final ProcedureType procedureType; - _BaseAddProcedureTabPageState({required this.patient, required this.model, required this.procedureType}); + _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); - late TabController _tabController; + TabController _tabController; int _activeTab = 0; @override @@ -63,7 +68,8 @@ class _BaseAddProcedureTabPageState extends State with final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (BuildContext? context, ProcedureViewModel? model, Widget? child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( isShowAppBar: false, body: NetworkBaseView( baseViewModel: model, @@ -71,7 +77,8 @@ class _BaseAddProcedureTabPageState extends State with minChildSize: 0.90, initialChildSize: 0.95, maxChildSize: 1.0, - builder: (BuildContext context, ScrollController scrollController) { + builder: + (BuildContext context, ScrollController scrollController) { return Container( height: MediaQuery.of(context).size.height * 1.25, child: Padding( @@ -79,22 +86,24 @@ class _BaseAddProcedureTabPageState extends State with child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText( - procedureType.getToolbarLabel(context), - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + procedureType.getToolbarLabel(context), + 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, ), @@ -102,13 +111,16 @@ class _BaseAddProcedureTabPageState extends State with child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), child: Container( - height: MediaQuery.of(context).size.height * 0.070, + 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 + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 ), color: Colors.white), child: Center( @@ -119,13 +131,15 @@ class _BaseAddProcedureTabPageState extends State with indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget( screenSize, _activeTab == 0, - procedureType.getFavouriteTabName(context), + procedureType + .getFavouriteTabName(context), ), tabWidget( screenSize, @@ -145,15 +159,22 @@ class _BaseAddProcedureTabPageState extends State with controller: _tabController, children: [ AddFavouriteProcedure( + model: this.model, + prescriptionModel: + widget.prescriptionModel, patient: patient, procedureType: procedureType, ), - if (widget.procedureType == ProcedureType.PRESCRIPTION) - PrescriptionFormWidget(widget.prescriptionModel!, widget.patient!, - widget.prescriptionModel!.prescriptionList) + if (widget.procedureType == + ProcedureType.PRESCRIPTION) + PrescriptionFormWidget( + widget.prescriptionModel, + widget.patient, + widget.prescriptionModel + .prescriptionList) else AddProcedurePage( - model: this.model!, + model: this.model, patient: patient, procedureType: procedureType, ), @@ -174,13 +195,16 @@ class _BaseAddProcedureTabPageState extends State with ); } - Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { + 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) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, borderWidth: 0), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index a93d8195..725bb007 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,7 +1,7 @@ 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 '../../widgets/shared/text_fields/TextFields.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'; @@ -14,31 +14,33 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final Function addSelectedHistories; final Function(EntityList) removeHistory; final Function(EntityList) addHistory; - final Function(EntityList)? addRemarks; + final Function(EntityList) addRemarks; final bool Function(EntityList) isEntityListSelected; final List masterList; /// todo clear the function here EntityListCheckboxSearchWidget( - {Key? key, - required this.model, - required this.addSelectedHistories, - required this.removeHistory, - required this.masterList, - required this.addHistory, - required this.isEntityListSelected, + {Key key, + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isEntityListSelected, this.addRemarks}) : super(key: key); @override - _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); + _EntityListCheckboxSearchWidgetState createState() => + _EntityListCheckboxSearchWidgetState(); } -class _EntityListCheckboxSearchWidgetState extends State { +class _EntityListCheckboxSearchWidgetState + extends State { int selectedType = 0; - late int typeUrgent; - late int typeRegular; + int typeUrgent; + int typeRegular; setSelectedType(int val) { setState(() { @@ -46,9 +48,9 @@ class _EntityListCheckboxSearchWidgetState extends State items = []; - List remarksList = []; - List typeList = []; + List items = List(); + List remarksList = List(); + List typeList = List(); @override void initState() { @@ -69,7 +71,9 @@ class _EntityListCheckboxSearchWidgetState extends State dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { - if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 2172172b..8d4f93ed 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel. 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/util/translations_delegate_base.dart'; -import '../../widgets/shared/text_fields/TextFields.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'; @@ -15,32 +15,32 @@ import 'ExpansionProcedure.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { final ProcedureViewModel model; - final Function? addSelectedHistories; - final Function(ProcedureTempleteModel)? removeHistory; - final Function(ProcedureTempleteModel)? addHistory; - final Function(ProcedureTempleteModel)? addRemarks; + final Function addSelectedHistories; + final Function(ProcedureTempleteModel) removeHistory; + final Function(ProcedureTempleteModel) addHistory; + final Function(ProcedureTempleteModel) addRemarks; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; - final Function(ProcedureTempleteDetailsModel)? selectProcedures; - final ProcedureTempleteDetailsModel? groupProcedures; + final Function(ProcedureTempleteDetailsModel) selectProcedures; + final ProcedureTempleteDetailsModel groupProcedures; - final bool Function(ProcedureTempleteModel)? isEntityListSelected; - final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected; - final List? masterList; + final bool Function(ProcedureTempleteModel) isEntityListSelected; + final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; + final List masterList; final bool isProcedure; EntityListCheckboxSearchFavProceduresWidget( - {Key? key, - required this.model, + {Key key, + this.model, this.addSelectedHistories, this.removeHistory, this.masterList, this.addHistory, - required this.addFavProcedure, + this.addFavProcedure, this.selectProcedures, - required this.removeFavProcedure, + this.removeFavProcedure, this.isEntityListSelected, this.isEntityFavListSelected, this.addRemarks, @@ -55,8 +55,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class _EntityListCheckboxSearchFavProceduresWidgetState extends State { int selectedType = 0; - late int typeUrgent; - late int typeRegular; + int typeUrgent; + int typeRegular; setSelectedType(int val) { setState(() { @@ -64,10 +64,10 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State items = []; - List itemsProcedure = []; - List remarksList = []; - List typeList = []; + List items = List(); + List itemsProcedure = List(); + List remarksList = List(); + List typeList = List(); @override void initState() { @@ -112,11 +112,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State dummySearchList = []; - dummySearchList.addAll(widget.masterList!); + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { - if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { + if (item.templateName.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -152,7 +152,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State _ProcedureCheckOutScreenState(); } class _ProcedureCheckOutScreenState extends State { - List remarksList = []; + List remarksList = List(); final TextEditingController remarksController = TextEditingController(); - List typeList = []; + List typeList = List(); @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), isShowAppBar: false, body: SingleChildScrollView( @@ -71,7 +67,7 @@ class _ProcedureCheckOutScreenState extends State { width: 5.0, ), AppText( - widget.toolbarTitle, + widget.toolbarTitle ?? 'Add Procedure', fontWeight: FontWeight.w700, fontSize: 20, ), @@ -198,11 +194,11 @@ class _ProcedureCheckOutScreenState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.addButtonTitle, + title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - List entityList = []; + List entityList = List(); widget.items.forEach((element) { entityList.add( EntityList( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index f4e3d676..79fb961c 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:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; @@ -19,7 +19,7 @@ import 'ProcedureType.dart'; import 'base_add_procedure_tab_page.dart'; class ProcedureScreen extends StatelessWidget { - int? doctorNameP; + int doctorNameP; void initState() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -29,7 +29,7 @@ class ProcedureScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -38,12 +38,12 @@ class ProcedureScreen extends StatelessWidget { return BaseView( onModelReady: (model) => model.getProcedure(mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo), - builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, + appBar: PatientProfileAppBar( + patient, isInpatient: isInpatient, ), body: SingleChildScrollView( @@ -152,33 +152,33 @@ class ProcedureScreen extends StatelessWidget { ), if (model.procedureList.isNotEmpty) ...List.generate( - model.procedureList[0].rowcount!, + model.procedureList[0].rowcount, (index) => ProcedureCard( - categoryID: model.procedureList[0].entityList![index].categoryID!, - entityList: model.procedureList[0].entityList![index], + categoryID: model.procedureList[0].entityList[index].categoryID, + entityList: model.procedureList[0].entityList[index], onTap: () { - if (model.procedureList[0].entityList![index].categoryID == 2 || - model.procedureList[0].entityList![index].categoryID == 4) + if (model.procedureList[0].entityList[index].categoryID == 2 || + model.procedureList[0].entityList[index].categoryID == 4) updateProcedureForm(context, model: model, patient: patient, - remarks: model.procedureList[0].entityList![index].remarks!, - orderType: model.procedureList[0].entityList![index].orderType.toString(), - orderNo: model.procedureList[0].entityList![index].orderNo!, - procedureName: model.procedureList[0].entityList![index].procedureName!, - categoreId: model.procedureList[0].entityList![index].categoryID.toString(), - procedureId: model.procedureList[0].entityList![index].procedureId!, - limetNo: model.procedureList[0].entityList![index].lineItemNo!); + remarks: model.procedureList[0].entityList[index].remarks, + orderType: model.procedureList[0].entityList[index].orderType.toString(), + orderNo: model.procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0].entityList[index].procedureName, + categoreId: model.procedureList[0].entityList[index].categoryID.toString(), + procedureId: model.procedureList[0].entityList[index].procedureId, + limetNo: model.procedureList[0].entityList[index].lineItemNo); // } else // Helpers.showErrorToast( // 'You Cant Update This Procedure'); }, patient: patient, - doctorID: model.doctorProfile!.doctorID!, + doctorID: model?.doctorProfile?.doctorID, ), ), if (model.state == ViewState.ErrorLocal || - (model.procedureList.isNotEmpty && model.procedureList[0].entityList!.isEmpty)) + (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 1909fec7..24c4ea41 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -9,7 +9,7 @@ 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 '../../widgets/shared/text_fields/TextFields.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -17,15 +17,15 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, - {required String procedureName, - required int orderNo, - required int limetNo, - required PatiantInformtion patient, - required String orderType, - required String procedureId, - required String remarks, - required ProcedureViewModel model, - required String categoreId}) { + {String procedureName, + int orderNo, + int limetNo, + PatiantInformtion patient, + String orderType, + String procedureId, + String remarks, + ProcedureViewModel model, + String categoreId}) { //ProcedureViewModel model2 = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); @@ -59,15 +59,15 @@ class UpdateProcedureWidget extends StatefulWidget { final int limetNo; UpdateProcedureWidget( - {required this.model, - required this.procedureName, - required this.remarks, - required this.remarksController, - required this.patient, - required this.procedureId, - required this.categoryId, - required this.orderNo, - required this.limetNo}); + {this.model, + this.procedureName, + this.remarks, + this.remarksController, + this.patient, + this.procedureId, + this.categoryId, + this.orderNo, + this.limetNo}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } @@ -85,22 +85,26 @@ class _UpdateProcedureWidgetState extends State { widget.remarksController.text = widget.remarks; } - List entityList = []; + List entityList = List(); dynamic selectedCategory; @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { + return StatefulBuilder(builder: + (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) => model.getCategory(), - builder: (BuildContext context, ProcedureViewModel model, Widget? child) => NetworkBaseView( + builder: + (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 0.9, child: Form( child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -242,8 +246,8 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), value: 0, groupValue: selectedType, - onChanged: (int? value) { - setSelectedType(value!); + onChanged: (value) { + setSelectedType(value); }, ), Text('routine'), @@ -251,11 +255,11 @@ class _UpdateProcedureWidgetState extends State { activeColor: Color(0xFFB9382C), groupValue: selectedType, value: 1, - onChanged: (int? value) { - setSelectedType(value!); + onChanged: (value) { + setSelectedType(value); }, ), - Text(TranslationBase.of(context).urgent ?? ""), + Text(TranslationBase.of(context).urgent), ], ), ), @@ -264,12 +268,16 @@ class _UpdateProcedureWidgetState extends State { ), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( fontSize: 15.0, controller: widget.remarksController, - hintText: widget.remarksController.text.isEmpty ? 'No Remarks Added' : '', + hintText: widget.remarksController.text.isEmpty + ? 'No Remarks Added' + : '', maxLines: 3, minLines: 2, onChanged: (value) {}, @@ -279,13 +287,16 @@ class _UpdateProcedureWidgetState extends State { height: 70.0, ), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 2), child: Column( //alignment: WrapAlignment.center, children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of(context).updateProcedure!.toUpperCase(), + title: TranslationBase.of(context) + .updateProcedure + .toUpperCase(), onPressed: () { // if (entityList.isEmpty == true && // widget.remarksController.text == @@ -332,19 +343,20 @@ class _UpdateProcedureWidgetState extends State { } updateProcedure( - {required ProcedureViewModel model, - required String remarks, - required int limetNO, - required int orderNo, - String? newProcedureId, - String? newCategorieId, - required List entityList, - required String orderType, - required String procedureId, - required PatiantInformtion patient, - required String categorieId}) async { - UpdateProcedureRequestModel updateProcedureReqModel = new UpdateProcedureRequestModel(); - List controls = []; + {ProcedureViewModel model, + String remarks, + int limetNO, + int orderNo, + String newProcedureId, + String newCategorieId, + List entityList, + String orderType, + String procedureId, + PatiantInformtion patient, + String categorieId}) async { + UpdateProcedureRequestModel updateProcedureReqModel = + new UpdateProcedureRequestModel(); + List controls = List(); ProcedureDetail controlsProcedure = new ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -373,7 +385,8 @@ class _UpdateProcedureWidgetState extends State { // else { { controls.add( - Controls(code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), + Controls( + code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: orderType), @@ -388,7 +401,9 @@ class _UpdateProcedureWidgetState extends State { // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; - await model.updateProcedure(updateProcedureRequestModel: updateProcedureReqModel, mrn: patient.patientMRN); + await model.updateProcedure( + updateProcedureRequestModel: updateProcedureReqModel, + mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); @@ -400,15 +415,17 @@ class _UpdateProcedureWidgetState extends State { } bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); + 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}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index c0b905fe..c06a8722 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -32,7 +32,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), @@ -100,7 +100,6 @@ class _QrReaderScreenState extends State { "isInpatient": true, }); } else { - DrAppToastMsg.showErrorToast(model.error); } }).catchError((error) { diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 3337364f..f6e1b8d7 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -17,7 +17,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { - late ProjectViewModel projectsProvider; + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); @@ -26,25 +26,25 @@ class AddRescheduleLeavScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", + appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: SingleChildScrollView( child: Column(children: [ Padding( padding: const EdgeInsets.all(8.0), - child:AddNewOrder( - onTap: () async { + child: AddNewOrder( + onTap: () async { await locator().logEvent( eventCategory: "Add Reschedule" "Leave Screen", eventAction: "apply For Reschedule", ); - openLeave( - context, - false, - ); - }, - label: TranslationBase.of(context).applyForReschedule ?? "", - ), + openLeave( + context, + false, + ); + }, + label: TranslationBase.of(context).applyForReschedule, + ), ), Column( children: model.getReschduleLeave.map((GetRescheduleLeavesResponse item) { @@ -58,74 +58,74 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.red[800]! - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - width: 5.0, - ))), - padding: EdgeInsets.only(left: 10, right: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - padding: EdgeInsets.all(3), - margin: EdgeInsets.only(top: 10), - child: AppText( - item.statusDescription, - fontWeight: FontWeight.bold, - color: item.status == 10 - ? Colors.red[800] - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? Colors.green - : Colors.red, - fontSize: 14, + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + width: 5.0, + ))), + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Container( + padding: EdgeInsets.all(3), + margin: EdgeInsets.only(top: 10), + child: AppText( + item.statusDescription, + fontWeight: FontWeight.bold, + color: item.status == 10 + ? Colors.red[800] + : item.status == 2 + ? HexColor('#CC9B14') + : item.status == 9 + ? Colors.green + : Colors.red, + fontSize: 14, + ), ), + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + AppDateUtils.convertStringToDateFormat( + item.createdOn, 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + )) + ]), + SizedBox( + height: 5, ), - Padding( - padding: EdgeInsets.only(top: 10), + Container( child: AppText( - AppDateUtils.convertStringToDateFormat( - item.createdOn ?? "", 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - )) - ]), - SizedBox( - height: 5, - ), - Container( - child: AppText( - item.requisitionType == 1 - ? TranslationBase.of(context).offTime - : item.requisitionType == 2 - ? TranslationBase.of(context).holiday - : item.requisitionType == 3 - ? TranslationBase.of(context).changeOfSchedule - : TranslationBase.of(context).newSchedule, - fontWeight: FontWeight.bold, - )), - SizedBox( - height: 5, - ), - Row(children: [ - AppText(TranslationBase.of(context).startDate), - AppText( - AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom ?? "", 'yyyy-MM-dd HH:mm'), + item.requisitionType == 1 + ? TranslationBase.of(context).offTime + : item.requisitionType == 2 + ? TranslationBase.of(context).holiday + : item.requisitionType == 3 + ? TranslationBase.of(context).changeOfSchedule + : TranslationBase.of(context).newSchedule, fontWeight: FontWeight.bold, - ) + )), + SizedBox( + height: 5, + ), + Row(children: [ + AppText(TranslationBase.of(context).startDate), + AppText( + AppDateUtils.convertStringToDateFormat( + item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) // overflow: // TextOverflow.ellipsis, @@ -134,63 +134,63 @@ class AddRescheduleLeavScreen extends StatelessWidget { // overflow: // TextOverflow.ellipsis, - SizedBox( - height: 5, - ), - Row( - children: [ - AppText(TranslationBase.of(context).endDate), - AppText( - AppDateUtils.convertStringToDateFormat( - item.dateTimeTo ?? "", 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - ) - ], - ), + SizedBox( + height: 5, + ), + Row( + children: [ + AppText(TranslationBase.of(context).endDate), + AppText( + AppDateUtils.convertStringToDateFormat( + item.dateTimeTo, 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + ], + ), - SizedBox( - height: 5, - ), - model.coveringDoctors.length > 0 - ? Row(children: [ - AppText( - TranslationBase.of(context).coveringDoctor, - ), - AppText( - getDoctor(model.coveringDoctors, item.coveringDoctorId), - fontWeight: FontWeight.bold, - ) - ]) - : SizedBox(), - // AppText( - // TranslationBase.of(context) - // .reasons, - // fontWeight: FontWeight.bold, - // ), - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: EdgeInsets.only(bottom: 5), - child: AppText(getReasons(model.allReasons, item.reasonId))), - (item.status == 2) - ? IconButton( - icon: Image.asset('assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => {openLeave(context, true, extendedData: item)}, + SizedBox( + height: 5, + ), + model.coveringDoctors.length > 0 + ? Row(children: [ + AppText( + TranslationBase.of(context).coveringDoctor, + ), + AppText( + getDoctor(model.coveringDoctors, item.coveringDoctorId), + fontWeight: FontWeight.bold, ) - + ]) : SizedBox(), - ]), - ], - ), - SizedBox( - width: 10, - ), - ], + // AppText( + // TranslationBase.of(context) + // .reasons, + // fontWeight: FontWeight.bold, + // ), + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Padding( + padding: EdgeInsets.only(bottom: 5), + child: AppText(getReasons(model.allReasons, item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset('assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => {openLeave(context, true, extendedData: item)}, + ) + : SizedBox(), + ]), + ], + ), + SizedBox( + width: 10, + ), + ], + ), ), - ), - ], - )), - ],), + ], + )), + ], + ), ), ); }).toList(), diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 7d90c9a8..925d0bb7 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -104,615 +104,615 @@ class _RescheduleLeaveScreen extends State { onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( onModelReady: (model2) => { - model2.getOffTime(), - model2.getReasons(offTime == '1' - ? 18 - : offTime == '2' - ? 19 - : 102), - model2.getCoveringDoctors() - }, + model2.getOffTime(), + model2.getReasons(offTime == '1' + ? 18 + : offTime == '2' + ? 19 + : 102), + model2.getCoveringDoctors() + }, builder: (_, model2, w) => GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - baseViewModel: model2, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // width: double.infinity, - // child: Padding( - // padding: EdgeInsets.only( - // top: SizeConfig.widthMultiplier * 0.9, - // bottom: - // SizeConfig.widthMultiplier * 0.9, - // right: SizeConfig.widthMultiplier * 3, - // left: SizeConfig.widthMultiplier * 3), - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Expanded( - // // add Expanded to have your dropdown button fill remaining space - // child: - // DropdownButtonHideUnderline( - // child: new IgnorePointer( - // ignoring: true, - // child: DropdownButton( - // focusColor: - // Colors.grey, - // isExpanded: true, - // dropdownColor: - // Colors.grey, - // value: getClinicName( - // model) ?? - // "", - // iconSize: 0, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext - // context) { - // return model - // .getClinicNameList() - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize - // .max, - // children: < - // Widget>[ - // AppText( - // item, - // fontSize: - // SizeConfig.textMultiplier * - // 2.1, - // color: Colors - // .grey[ - // 500], - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: - // (newValue) => - // {}, - // items: model - // .getClinicNameList() - // .map((item) { - // return DropdownMenuItem( - // value: item - // .toString(), - // child: Text( - // item, - // textAlign: - // TextAlign - // .end, - // ), - // ); - // }).toList(), - // ))), - // ), - // ], - // ) - // ], - // ), - // )), - - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.all(Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // padding: EdgeInsets.all(5), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // new IgnorePointer( - // ignoring: true, - // child: AppTextFormField( - // readOnly: true, - // hintText: profile != null - // ? profile['DoctorName'] - // : "", - // borderColor: Colors.white, - // onSaved: (value) {}, - // inputFormatter: ONLY_NUMBERS)) - // ], - // ), - // ), + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model2, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // width: double.infinity, + // child: Padding( + // padding: EdgeInsets.only( + // top: SizeConfig.widthMultiplier * 0.9, + // bottom: + // SizeConfig.widthMultiplier * 0.9, + // right: SizeConfig.widthMultiplier * 3, + // left: SizeConfig.widthMultiplier * 3), + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // // add Expanded to have your dropdown button fill remaining space + // child: + // DropdownButtonHideUnderline( + // child: new IgnorePointer( + // ignoring: true, + // child: DropdownButton( + // focusColor: + // Colors.grey, + // isExpanded: true, + // dropdownColor: + // Colors.grey, + // value: getClinicName( + // model) ?? + // "", + // iconSize: 0, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext + // context) { + // return model + // .getClinicNameList() + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize + // .max, + // children: < + // Widget>[ + // AppText( + // item, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors + // .grey[ + // 500], + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: + // (newValue) => + // {}, + // items: model + // .getClinicNameList() + // .map((item) { + // return DropdownMenuItem( + // value: item + // .toString(), + // child: Text( + // item, + // textAlign: + // TextAlign + // .end, + // ), + // ); + // }).toList(), + // ))), + // ), + // ], + // ) + // ], + // ), + // )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allOffTime.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - // focusColor: Colors.grey, - isExpanded: true, - value: offTime == null ? model2.allOffTime[0]['code'] : offTime, - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allOffTime.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item['description'], + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // padding: EdgeInsets.all(5), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // new IgnorePointer( + // ignoring: true, + // child: AppTextFormField( + // readOnly: true, + // hintText: profile != null + // ? profile['DoctorName'] + // : "", + // borderColor: Colors.white, + // onSaved: (value) {}, + // inputFormatter: ONLY_NUMBERS)) + // ], + // ), + // ), - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - setState(() { - offTime = newValue; - }); - if (offTime == '1') { - model2.getReasons(18); - } else if (offTime == '2') { - model2.getReasons(19); - } else if (offTime == '3' || offTime == '5') { - model2.getReasons(102); - setState(() { - offTime = newValue; - }); - } - }, - items: model2.allOffTime.map((item) { - return DropdownMenuItem( - value: item['code'].toString(), - child: Text( - item['description'], - textAlign: TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), - )), - offTime == '1' - ? Column( - children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (val) => fromDate = val, - onSaved: (val) => fromDate = val, - ) - ], - )), - Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).fromTime, - type: DateTimePickerType.time, - controller: _controller4, - onChanged: (val) => fromTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => fromTime = val, - ) - ], - ), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allOffTime.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + // focusColor: Colors.grey, + isExpanded: true, + value: offTime == null ? model2.allOffTime[0]['code'] : offTime, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item['description'], + + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + setState(() { + offTime = newValue; + }); + if (offTime == '1') { + model2.getReasons(18); + } else if (offTime == '2') { + model2.getReasons(19); + } else if (offTime == '3' || offTime == '5') { + model2.getReasons(102); + setState(() { + offTime = newValue; + }); + } + }, + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), + child: Text( + item['description'], + textAlign: TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], ), - ), - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).toTime, - type: DateTimePickerType.time, - controller: _controller5, - onChanged: (val) => toTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => toTime = val, - ) - ], - ), + )), + offTime == '1' + ? Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, + ) + ], + )), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, + controller: _controller4, + onChanged: (val) => fromTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => fromTime = val, + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, + controller: _controller5, + onChanged: (val) => toTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => toTime = val, + ) + ], + ), + ), + ) + ], + ) + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + readOnly: true, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + fromDate = value; + }); + }), + ], + )), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).toDate, + readOnly: true, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, + onTap: () { + _presentDatePicker('toDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + toDate = value; + }); + }), + ], + )) + ], ), - ) - ], - ) - ], - ) - : Column( - children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - readOnly: true, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - fromDate = value; - }); - }), - ], + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allReasons.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: model2.allReasons[0]['id'].toString() ?? "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + projectsProvider.isArabic + ? item['nameAr'] + : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + reason = newValue; + }) + }, + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), + child: Text( + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], + ), )), + Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).toDate, - readOnly: true, - borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController2, - onTap: () { - _presentDatePicker('toDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - toDate = value; - }); - }), - ], - )) - ], - ), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allReasons.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - value: model2.allReasons[0]['id'].toString() ?? "", - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allReasons.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - projectsProvider.isArabic - ? item['nameAr'] - : item['nameEn'], - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.coveringDoctors.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownSearch( + mode: Mode.BOTTOM_SHEET, + + dropdownSearchDecoration: InputDecoration( + contentPadding: EdgeInsets.all(0), border: InputBorder.none), + //maxHeight: 300, + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic + ? item['doctorNameN'] + : item['doctorName']; + }).toList(), + // label: "Doctor List", + onChanged: (item) { + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorName'] == item) + doctorID = newVal['DoctorID'] + }); + }, + selectedItem: getSelectedDoctor(model2), + showSearchBox: true, + searchBoxDecoration: InputDecoration( + border: OutlineInputBorder(), + contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), + labelText: "Search Doctor", + ), + popupTitle: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Center( + child: Text( + '', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - reason = newValue; - }) - }, - items: model2.allReasons.map((item) { - return DropdownMenuItem( - value: item['id'].toString(), - child: Text( - projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], - textAlign: TextAlign.end, + ), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), + ), + ), ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), - )), - - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.coveringDoctors.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownSearch( - mode: Mode.BOTTOM_SHEET, - - dropdownSearchDecoration: InputDecoration( - contentPadding: EdgeInsets.all(0), border: InputBorder.none), - //maxHeight: 300, - items: model2.coveringDoctors.map((item) { - return projectsProvider.isArabic - ? item['doctorNameN'] - : item['doctorName']; - }).toList(), - // label: "Doctor List", - onChanged: (item) { - model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorName'] == item) - doctorID = newVal['DoctorID'] - }); - }, - selectedItem: getSelectedDoctor(model2), - showSearchBox: true, - searchBoxDecoration: InputDecoration( - border: OutlineInputBorder(), - contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), - labelText: "Search Doctor", - ), - popupTitle: Container( - height: 50, - decoration: BoxDecoration( - color: Theme.of(context).primaryColorDark, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), - topRight: Radius.circular(20), - ), - ), - child: Center( - child: Text( - '', - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - ), - ), - popupShape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), - topRight: Radius.circular(24), - ), - ), - ), - // DropdownButtonHideUnderline( - // child: DropdownButton( - // focusColor: Colors.grey, - // isExpanded: true, - // value: doctorID == null - // ? model2 - // .coveringDoctors[0] - // ['doctorID'] - // .toString() - // : doctorID, - // iconSize: 40, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext context) { - // return model2 - // .coveringDoctors - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // AppText( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // fontSize: SizeConfig - // .textMultiplier * - // 2.1, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) => { - // setState(() { - // doctorID = newValue; - // }) - // }, - // items: model2 - // .coveringDoctors - // .map((item) { - // return DropdownMenuItem< - // String>( - // value: item['doctorID'] - // .toString(), - // child: Text( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // textAlign: - // TextAlign.start, - // ), - // ); - // }).toList(), - // )), + // DropdownButtonHideUnderline( + // child: DropdownButton( + // focusColor: Colors.grey, + // isExpanded: true, + // value: doctorID == null + // ? model2 + // .coveringDoctors[0] + // ['doctorID'] + // .toString() + // : doctorID, + // iconSize: 40, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return model2 + // .coveringDoctors + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // AppText( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // fontSize: SizeConfig + // .textMultiplier * + // 2.1, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) => { + // setState(() { + // doctorID = newValue; + // }) + // }, + // items: model2 + // .coveringDoctors + // .map((item) { + // return DropdownMenuItem< + // String>( + // value: item['doctorID'] + // .toString(), + // child: Text( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // textAlign: + // TextAlign.start, + // ), + // ); + // }).toList(), + // )), + ) + : SizedBox(), + ], ) - : SizedBox(), ], - ) + ), + )), + SizedBox(height: SizeConfig.screenHeight * .3), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.isUpdate == true + ? TranslationBase.of(context).updateReschedule + : TranslationBase.of(context).addReschedule, + color: HexColor('#359846'), + onPressed: () { + if (offTime == '1' || offTime == '2') { + if (widget.isUpdate == true) { + updateRecheduleLeave(model2); + } else { + addRecheduleLeave(model2); + } + } else { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); + } + }, + ), ], ), - )), - SizedBox(height: SizeConfig.screenHeight * .3), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.isUpdate == true - ? TranslationBase.of(context).updateReschedule - : TranslationBase.of(context).addReschedule, - color: HexColor('#359846'), - onPressed: () { - if (offTime == '1' || offTime == '2') { - if (widget.isUpdate == true) { - updateRecheduleLeave(model2); - } else { - addRecheduleLeave(model2); - } - } else { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); - } - }, - ), - ], - ), + ), + // Column( + // children: [ + // AppText(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) + ], ), - // Column( - // children: [ - // AppText(TranslationBase.of(context) - // .previousSickLeaveIssue + - // ' ') - // ], - // ) - ], + ), ), ), ), - ), - ), - ))); + ))); } getProfile() async { @@ -796,8 +796,8 @@ class _RescheduleLeaveScreen extends State { context, MaterialPageRoute( builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') - // MyReferredPatient(), - ), + // MyReferredPatient(), + ), ); } }); @@ -867,8 +867,8 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} - }); + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} + }); return doctorName; } } diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart index 550fedc5..8950fae3 100644 --- a/lib/util/NotificationPermissionUtils.dart +++ b/lib/util/NotificationPermissionUtils.dart @@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart'; class AppPermissionsUtils { - static requestVideoCallPermission({required BuildContext context, required String type,required Function onTapGrant}) async { + static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index a5e0f581..0239bf57 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -1,3 +1,4 @@ + import 'dart:convert'; import 'dart:io' show Platform; @@ -6,22 +7,12 @@ import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -class VideoChannel { +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, - required String patientName, bool isRecording = false, Function()? onCallEnd, - Function(SessionStatusModel sessionStatusModel)? onCallNotRespond, - Function(String error)? onFailure, VoidCallback? onCallConnected, VoidCallback? onCallDisconnected}) async { + static openVideoCallScreen({kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID, + String generalId,int doctorId, String patientName, bool isRecording = false, Function() onCallEnd , + Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { onCallConnected = onCallConnected ?? (){}; onCallDisconnected = onCallDisconnected ?? (){}; @@ -29,10 +20,10 @@ class VideoChannel { try { _channel.setMethodCallHandler((call) { if(call.method == 'onCallConnected'){ - onCallConnected!(); + onCallConnected(); } if(call.method == 'onCallDisconnected'){ - onCallDisconnected!(); + onCallDisconnected(); } return true as dynamic; }); @@ -48,20 +39,24 @@ class VideoChannel { "VC_ID": vcId, "TokenID": tokenID, "generalId": generalId, - "DoctorId": doctorId, + "DoctorId": doctorId , "patientName": patientName, "isRecording": isRecording, }, ); - if (result['callResponse'] == 'CallEnd') { - onCallEnd!(); - } else { - SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson( - Platform.isIOS ? result['sessionStatus'] : json.decode(result['sessionStatus'])); - onCallNotRespond!(sessionStatusModel); + if(result['callResponse'] == 'CallEnd') { + onCallEnd(); + } + else { + SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); + onCallNotRespond(sessionStatusModel); } + } catch (e) { - onFailure!(e.toString()); + onFailure(e.toString()); } + } -} + + +} \ No newline at end of file diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 26df2120..a10a18e3 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -431,7 +431,7 @@ class AppDateUtils { } static convertDateFormatImproved(String str) { - String newDate =''; + String newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -448,6 +448,6 @@ class AppDateUtils { date.day.toString().padLeft(2, '0'); } - return newDate ; + return newDate ?? ''; } } diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index f08a6e3c..bac296bf 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -40,7 +40,7 @@ class DrAppSharedPreferances { /// Get String [key] the key was saved getStringWithDefaultValue(String key, String defaultVal) async { final SharedPreferences prefs = await _prefs; - String? value = prefs.getString(key); + String value = prefs.getString(key); return value == null ? defaultVal : value; } @@ -81,10 +81,10 @@ class DrAppSharedPreferances { return prefs.getInt(key); } - getObj(String key) async { + getObj(String key) async{ final SharedPreferences prefs = await _prefs; var string = prefs.getString(key); - if (string == null) { + if (string == null ){ return null; } return json.decode(string); @@ -92,8 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - var vvas = await prefs.clear(); - var asd; + var vvas= await prefs.clear(); + var asd; } remove(String key) async { diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index a0fd8082..da353ad0 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,5 +1,10 @@ extension Extension on Object { - bool isNullOrEmpty() => this == ''; + bool isNullOrEmpty() => this == null || this == ''; + + bool isNullEmptyOrFalse() => this == null || this == '' || !this; + + bool isNullEmptyZeroOrFalse() => + this == null || this == '' || !this || this == 0; } /// truncate the [String] without cutting words. The length is calculated with the suffix. diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index d1a6d0a5..169ad81c 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,9 +1,12 @@ 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/service/NavigationService.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'; @@ -26,7 +29,8 @@ class Helpers { get currentLanguage => null; - static showConfirmationDialog(BuildContext context, String message, Function okFunction) { + static showConfirmationDialog( + BuildContext context, String message, Function okFunction) { return showDialog( context: context, barrierDismissible: false, // user must tap button! @@ -42,7 +46,7 @@ class Helpers { ), actions: [ AppButton( - onPressed: okFunction(), + onPressed: okFunction, title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, color: Colors.green[600], @@ -63,8 +67,8 @@ class Helpers { }); } - static showCupertinoPicker( - context, List items, decKey, onSelectFun, AuthenticationViewModel model) { + static showCupertinoPicker(context, List items, + decKey, onSelectFun, AuthenticationViewModel model) { showModalBottomSheet( isDismissible: false, context: context, @@ -82,14 +86,15 @@ class Helpers { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: Text(TranslationBase.of(context).cancel ?? "", style: textStyle(context)), + child: Text(TranslationBase.of(context).cancel, + style: textStyle(context)), onPressed: () { Navigator.pop(context); }, ), CupertinoButton( child: Text( - TranslationBase.of(context).done ?? "", + TranslationBase.of(context).done, style: textStyle(context), ), onPressed: () { @@ -103,19 +108,23 @@ class Helpers { Container( height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), - child: buildPickerItems(context, items, decKey, onSelectFun, model)) + child: buildPickerItems( + context, items, decKey, onSelectFun, model)) ], ), ); }); } - static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); + static TextStyle textStyle(context) => + TextStyle(color: Theme.of(context).primaryColor); - static buildPickerItems(context, List items, decKey, onSelectFun, model) { + static buildPickerItems(context, List items, + decKey, onSelectFun, model) { return CupertinoPicker( magnification: 1.5, - scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), + scrollController: + FixedExtentScrollController(initialItem: cupertinoPickerIndex), children: items.map((item) { return Text( '${item.facilityName}', @@ -141,8 +150,10 @@ class Helpers { } static Future checkConnection() async { - ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); - if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { + ConnectivityResult connectivityResult = + await (Connectivity().checkConnectivity()); + if ((connectivityResult == ConnectivityResult.mobile) || + (connectivityResult == ConnectivityResult.wifi)) { return true; } else { return false; @@ -154,8 +165,9 @@ class Helpers { List listOfHours = workingHours.split('a'); listOfHours.forEach((element) { - WorkingHours? workingHours = WorkingHours(); - var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1); + WorkingHours workingHours = WorkingHours(); + var from = element.substring( + element.indexOf('m ') + 2, element.indexOf('To') - 1); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); @@ -202,13 +214,14 @@ class Helpers { static String parseHtmlString(String htmlString) { final document = parse(htmlString); - final String parsedString = parse(document.body!.text).documentElement!.text; + final String parsedString = parse(document.body.text).documentElement.text; return parsedString; } - static InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, - {Icon? suffixIcon, Color? dropDownColor}) { + static InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon, Color dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -238,7 +251,9 @@ class Helpers { ); } - static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) { + static BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, + {double borderWidth = -1}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -268,23 +283,9 @@ class Helpers { 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 ''; - } - - static String timeFrom({Duration? duration}) { + static String timeFrom({Duration duration}) { String twoDigits(int n) => n.toString().padLeft(2, "0"); - String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60)); + String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 114de3d3..397f8b36 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -7,1111 +7,1112 @@ import 'package:flutter/material.dart'; class TranslationBase { TranslationBase(this.locale); - late Locale locale; + final Locale locale; static TranslationBase of(BuildContext context) { - return Localizations.of(context, TranslationBase)!; + return Localizations.of(context, TranslationBase); } - String? get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle']![locale.languageCode]; + String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; - String? get settings => localizedValues['settings']![locale.languageCode]; + String get settings => localizedValues['settings'][locale.languageCode]; - String? get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo']![locale.languageCode]; + String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; - String? get language => localizedValues['language']![locale.languageCode]; + String get language => localizedValues['language'][locale.languageCode]; - String? get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]; + String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; - String? get lanArabic => localizedValues['lanArabic']![locale.languageCode]; + String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; - String? get theDoctor => localizedValues['theDoctor']![locale.languageCode]; + String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; - String? get reply => localizedValues['reply']![locale.languageCode]; + String get reply => localizedValues['reply'][locale.languageCode]; - String? get time => localizedValues['time']![locale.languageCode]; + String get time => localizedValues['time'][locale.languageCode]; - String? get fileNo => localizedValues['fileNo']![locale.languageCode]; + String get fileNo => localizedValues['fileNo'][locale.languageCode]; - String? get mobileNo => localizedValues['mobileNo']![locale.languageCode]; + String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String? get replySuccessfully => localizedValues['replySuccessfully']![locale.languageCode]; + String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; - String? get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle']![locale.languageCode]; + String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; - String? get mySchedule => localizedValues['mySchedule']![locale.languageCode]; + String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String? get errorNoSchedule => localizedValues['errorNoSchedule']![locale.languageCode]; + String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; - String? get verify => localizedValues['verify']![locale.languageCode]; + String get verify => localizedValues['verify'][locale.languageCode]; - String? get referralDoctor => localizedValues['referralDoctor']![locale.languageCode]; + String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; - String? get referringClinic => localizedValues['referringClinic']![locale.languageCode]; + String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; - String? get frequency => localizedValues['frequency']![locale.languageCode]; + String get frequency => localizedValues['frequency'][locale.languageCode]; - String? get priority => localizedValues['priority']![locale.languageCode]; + String get priority => localizedValues['priority'][locale.languageCode]; - String? get maxResponseTime => localizedValues['maxResponseTime']![locale.languageCode]; + String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; - String? get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks']![locale.languageCode]; + String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String? get answerSuggestions => localizedValues['answerSuggestions']![locale.languageCode]; + String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; - String? get outPatients => localizedValues['outPatients']![locale.languageCode]; + String get outPatients => localizedValues['outPatients'][locale.languageCode]; - String? get searchPatient => localizedValues['searchPatient']![locale.languageCode]; - String? get searchPatientDashBoard => localizedValues['searchPatientDashBoard']![locale.languageCode]; - String? get searchPatientName => localizedValues['searchPatient-name']![locale.languageCode]; + String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; + String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; - String? get searchAbout => localizedValues['searchAbout']![locale.languageCode]; + String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; - String? get patient => localizedValues['patient']![locale.languageCode]; - String? get patients => localizedValues['patients']![locale.languageCode]; - String? get labResult => localizedValues['labResult']![locale.languageCode]; + String get patient => localizedValues['patient'][locale.languageCode]; + String get patients => localizedValues['patients'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; - String? get todayStatistics => localizedValues['todayStatistics']![locale.languageCode]; + String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; - String? get familyMedicine => localizedValues['familyMedicine']![locale.languageCode]; + String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; - String? get arrived => localizedValues['arrived']![locale.languageCode]; + String get arrived => localizedValues['arrived'][locale.languageCode]; - String? get er => localizedValues['er']![locale.languageCode]; + String get er => localizedValues['er'][locale.languageCode]; - String? get walkIn => localizedValues['walkIn']![locale.languageCode]; + String get walkIn => localizedValues['walkIn'][locale.languageCode]; - String? get notArrived => localizedValues['notArrived']![locale.languageCode]; + String get notArrived => localizedValues['notArrived'][locale.languageCode]; - String? get radiology => localizedValues['radiology']![locale.languageCode]; + String get radiology => localizedValues['radiology'][locale.languageCode]; - String? get service => localizedValues['service']![locale.languageCode]; + String get service => localizedValues['service'][locale.languageCode]; - String? get referral => localizedValues['referral']![locale.languageCode]; + String get referral => localizedValues['referral'][locale.languageCode]; - String? get inPatient => localizedValues['inPatient']![locale.languageCode]; - String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; - String? get myInPatientTitle => localizedValues['myInPatientTitle']![locale.languageCode]; - String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; + String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; + String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; + String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; - String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; - String? get operations => localizedValues['operations']![locale.languageCode]; + String get operations => localizedValues['operations'][locale.languageCode]; - String? get patientServices => localizedValues['patientServices']![locale.languageCode]; + String get patientServices => localizedValues['patientServices'][locale.languageCode]; - String? get searchMedicine => localizedValues['searchMedicine']![locale.languageCode]; - String? get searchMedicineDashboard => localizedValues['searchMedicineDashboard']![locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; - String? get myReferralPatient => localizedValues['myReferralPatient']![locale.languageCode]; + String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; - String? get referPatient => localizedValues['referPatient']![locale.languageCode]; + String get referPatient => localizedValues['referPatient'][locale.languageCode]; - String? get myReferral => localizedValues['myReferral']![locale.languageCode]; + String get myReferral => localizedValues['myReferral'][locale.languageCode]; - String? get myReferredPatient => localizedValues['myReferredPatient']![locale.languageCode]; - String? get referredPatient => localizedValues['referredPatient']![locale.languageCode]; - String? get referredOn => localizedValues['referredOn']![locale.languageCode]; + String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; + String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; + String get referredOn => localizedValues['referredOn'][locale.languageCode]; - String? get firstName => localizedValues['firstName']![locale.languageCode]; + String get firstName => localizedValues['firstName'][locale.languageCode]; - String? get middleName => localizedValues['middleName']![locale.languageCode]; + String get middleName => localizedValues['middleName'][locale.languageCode]; - String? get lastName => localizedValues['lastName']![locale.languageCode]; + String get lastName => localizedValues['lastName'][locale.languageCode]; - String? get phoneNumber => localizedValues['phoneNumber']![locale.languageCode]; + String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; - String? get patientID => localizedValues['patientID']![locale.languageCode]; + String get patientID => localizedValues['patientID'][locale.languageCode]; - String? get patientFile => localizedValues['patientFile']![locale.languageCode]; + String get patientFile => localizedValues['patientFile'][locale.languageCode]; - String? get search => localizedValues['search']![locale.languageCode]; + String get search => localizedValues['search'][locale.languageCode]; - String? get onlyArrivedPatient => localizedValues['onlyArrivedPatient']![locale.languageCode]; + String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; - String? get searchMedicineNameHere => localizedValues['searchMedicineNameHere']![locale.languageCode]; + String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; - String? get youCanFind => localizedValues['youCanFind']![locale.languageCode]; + String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String? get itemsInSearch => localizedValues['itemsInSearch']![locale.languageCode]; + String get itemsInSearch => localizedValues['itemsInSearch'][locale.languageCode]; - String? get qr => localizedValues['qr']![locale.languageCode]; + String get qr => localizedValues['qr'][locale.languageCode]; - String? get reader => localizedValues['reader']![locale.languageCode]; + String get reader => localizedValues['reader'][locale.languageCode]; - String? get startScanning => localizedValues['startScanning']![locale.languageCode]; + String get startScanning => localizedValues['startScanning'][locale.languageCode]; - String? get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]; + String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; - String? get scanQr => localizedValues['scanQr']![locale.languageCode]; + String get scanQr => localizedValues['scanQr'][locale.languageCode]; - String? get profile => localizedValues['profile']![locale.languageCode]; + String get profile => localizedValues['profile'][locale.languageCode]; - String? get gender => localizedValues['gender']![locale.languageCode]; + String get gender => localizedValues['gender'][locale.languageCode]; - String? get clinic => localizedValues['clinic']![locale.languageCode]; + String get clinic => localizedValues['clinic'][locale.languageCode]; - String? get clinicSelect => localizedValues['clinicSelect']![locale.languageCode]; + String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; - String? get doctorSelect => localizedValues['doctorSelect']![locale.languageCode]; + String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; - String? get hospital => localizedValues['hospital']![locale.languageCode]; + String get hospital => localizedValues['hospital'][locale.languageCode]; - String? get speciality => localizedValues['speciality']![locale.languageCode]; + String get speciality => localizedValues['speciality'][locale.languageCode]; - String? get errorMessage => localizedValues['errorMessage']![locale.languageCode]; + String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; - String? get patientProfile => localizedValues['patientProfile']![locale.languageCode]; + String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; - String? get vitalSign => localizedValues['vitalSign']![locale.languageCode]; + String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; - String? get vital => localizedValues['vital']![locale.languageCode]; + String get vital => localizedValues['vital'][locale.languageCode]; - String? get signs => localizedValues['signs']![locale.languageCode]; + String get signs => localizedValues['signs'][locale.languageCode]; - String? get labOrder => localizedValues['labOrder']![locale.languageCode]; + String get labOrder => localizedValues['labOrder'][locale.languageCode]; - String? get lab => localizedValues['lab']![locale.languageCode]; + String get lab => localizedValues['lab'][locale.languageCode]; - String? get result => localizedValues['result']![locale.languageCode]; + String get result => localizedValues['result'][locale.languageCode]; - String? get medicines => localizedValues['medicines']![locale.languageCode]; + String get medicines => localizedValues['medicines'][locale.languageCode]; - String? get prescription => localizedValues['prescription']![locale.languageCode]; + String get prescription => localizedValues['prescription'][locale.languageCode]; - String? get insuranceApprovals => localizedValues['insuranceApprovals']![locale.languageCode]; + String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; - String? get insurance => localizedValues['insurance']![locale.languageCode]; + String get insurance => localizedValues['insurance'][locale.languageCode]; - String? get approvals => localizedValues['approvals']![locale.languageCode]; + String get approvals => localizedValues['approvals'][locale.languageCode]; - String? get bodyMeasurements => localizedValues['bodyMeasurements']![locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; - String? get temperature => localizedValues['temperature']![locale.languageCode]; + String get temperature => localizedValues['temperature'][locale.languageCode]; - String? get pulse => localizedValues['pulse']![locale.languageCode]; + String get pulse => localizedValues['pulse'][locale.languageCode]; - String? get respiration => localizedValues['respiration']![locale.languageCode]; + String get respiration => localizedValues['respiration'][locale.languageCode]; - String? get bloodPressure => localizedValues['bloodPressure']![locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; - String? get oxygenation => localizedValues['oxygenation']![locale.languageCode]; + String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; - String? get painScale => localizedValues['painScale']![locale.languageCode]; + String get painScale => localizedValues['painScale'][locale.languageCode]; - String? get errorNoVitalSign => localizedValues['errorNoVitalSign']![locale.languageCode]; + String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; - String? get labOrders => localizedValues['labOrders']![locale.languageCode]; + String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String? get errorNoLabOrders => localizedValues['errorNoLabOrders']![locale.languageCode]; + String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; - String? get answerThePatient => localizedValues['answerThePatient']![locale.languageCode]; + String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; - String? get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer']![locale.languageCode]; + String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; - String? get replay => localizedValues['replay']![locale.languageCode]; + String get replay => localizedValues['replay'][locale.languageCode]; - String? get progressNote =>localizedValues['progressNote']![locale.languageCode]; - String? get operationReports => localizedValues['operationReports']![locale.languageCode]; + String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get operationReports => localizedValues['operationReports'][locale.languageCode]; - String? get progress => localizedValues['progress']![locale.languageCode]; + String get progress => localizedValues['progress'][locale.languageCode]; - String? get note => localizedValues['note']![locale.languageCode]; + String get note => localizedValues['note'][locale.languageCode]; - String? get searchNote => localizedValues['searchNote']![locale.languageCode]; + String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String? get errorNoProgressNote => localizedValues['errorNoProgressNote']![locale.languageCode]; + String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; - String? get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]; - String? get orderNo => localizedValues['orderNo']![locale.languageCode]; + String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String? get generalResult => localizedValues['generalResult']![locale.languageCode]; + String get generalResult => localizedValues['generalResult'][locale.languageCode]; - String? get description => localizedValues['description']![locale.languageCode]; + String get description => localizedValues['description'][locale.languageCode]; - String? get value => localizedValues['value']![locale.languageCode]; + String get value => localizedValues['value'][locale.languageCode]; - String? get range => localizedValues['range']![locale.languageCode]; + String get range => localizedValues['range'][locale.languageCode]; - String? get enterId => localizedValues['enterId']![locale.languageCode]; + String get enterId => localizedValues['enterId'][locale.languageCode]; - String? get pleaseEnterYourID => localizedValues['pleaseEnterYourID']![locale.languageCode]; + String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; - String? get enterPassword => localizedValues['enterPassword']![locale.languageCode]; + String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; - String? get pleaseEnterPassword => localizedValues['pleaseEnterPassword']![locale.languageCode]; + String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; - String? get selectYourProject => localizedValues['selectYourProject']![locale.languageCode]; + String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; - String? get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject']![locale.languageCode]; + String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; - String? get login => localizedValues['login']![locale.languageCode]; + String get login => localizedValues['login'][locale.languageCode]; - String? get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib']![locale.languageCode]; + String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; - String? get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]; + String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String? get welcomeBackTo => localizedValues['welcomeBackTo']![locale.languageCode]; + String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; - String? get home => localizedValues['home']![locale.languageCode]; + String get home => localizedValues['home'][locale.languageCode]; - String? get services => localizedValues['services']![locale.languageCode]; + String get services => localizedValues['services'][locale.languageCode]; - String? get sms => localizedValues['sms']![locale.languageCode]; + String get sms => localizedValues['sms'][locale.languageCode]; - String? get fingerprint => localizedValues['fingerprint']![locale.languageCode]; + String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; - String? get faceId => localizedValues['faceId']![locale.languageCode]; + String get faceId => localizedValues['faceId'][locale.languageCode]; - String? get whatsApp => localizedValues['whatsApp']![locale.languageCode]; + String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; - String? get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]; + String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String? get pleaseChoose => localizedValues['pleaseChoose']![locale.languageCode]; + String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; - String? get choose => localizedValues['choose']![locale.languageCode]; + String get choose => localizedValues['choose'][locale.languageCode]; - String? get verification => localizedValues['verification']![locale.languageCode]; + String get verification => localizedValues['verification'][locale.languageCode]; - String? get firstStep => localizedValues['firstStep']![locale.languageCode]; + String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String? get yourAccount => localizedValues['yourAccount!']![locale.languageCode]; + String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; - String? get verify1 => localizedValues['verify1']![locale.languageCode]; + String get verify1 => localizedValues['verify1'][locale.languageCode]; - String? get youWillReceiveA => localizedValues['youWillReceiveA']![locale.languageCode]; + String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; - String? get loginCode => localizedValues['loginCode']![locale.languageCode]; + String get loginCode => localizedValues['loginCode'][locale.languageCode]; - String? get smsBy => localizedValues['smsBy']![locale.languageCode]; + String get smsBy => localizedValues['smsBy'][locale.languageCode]; - String? get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode']![locale.languageCode]; + String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode'][locale.languageCode]; - String? get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient']![locale.languageCode]; + String get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient'][locale.languageCode]; - String? get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem']![locale.languageCode]; + String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; - String? get age => localizedValues['age']![locale.languageCode]; + String get age => localizedValues['age'][locale.languageCode]; - String? get nationality => localizedValues['nationality']![locale.languageCode]; - String? get occupation => localizedValues['occupation']![locale.languageCode]; - String? get healthID => localizedValues['healthID']![locale.languageCode]; - String? get identityNumber => localizedValues['identityNumber']![locale.languageCode]; - String? get maritalStatus => localizedValues['maritalStatus']![locale.languageCode]; + String get nationality => localizedValues['nationality'][locale.languageCode]; + String get occupation => localizedValues['occupation'][locale.languageCode]; + String get healthID => localizedValues['healthID'][locale.languageCode]; + String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; - String? get today => localizedValues['today']![locale.languageCode]; + String get today => localizedValues['today'][locale.languageCode]; - String? get tomorrow => localizedValues['tomorrow']![locale.languageCode]; + String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; - String? get all => localizedValues['all']![locale.languageCode]; + String get all => localizedValues['all'][locale.languageCode]; - String? get nextWeek => localizedValues['nextWeek']![locale.languageCode]; + String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; - String? get yesterday => localizedValues['yesterday']![locale.languageCode]; + String get yesterday => localizedValues['yesterday'][locale.languageCode]; - String? get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals']![locale.languageCode]; + String get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; - String? get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals']![locale.languageCode]; + String get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals'][locale.languageCode]; - String? get status => localizedValues['status']![locale.languageCode]; + String get status => localizedValues['status'][locale.languageCode]; - String? get expiryDate => localizedValues['expiryDate']![locale.languageCode]; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String? get producerName => localizedValues['producerName']![locale.languageCode]; + String get producerName => localizedValues['producerName'][locale.languageCode]; - String? get receiptOn => localizedValues['receiptOn']![locale.languageCode]; + String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; - String? get approvalNo => localizedValues['approvalNo']![locale.languageCode]; + String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; - String? get doctor => localizedValues['doctor']![locale.languageCode]; + String get doctor => localizedValues['doctor'][locale.languageCode]; - String? get ext => localizedValues['ext']![locale.languageCode]; + String get ext => localizedValues['ext'][locale.languageCode]; - String? get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]; + String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; - String? get urgent => localizedValues['urgent']![locale.languageCode]; + String get urgent => localizedValues['urgent'][locale.languageCode]; - String? get routine => localizedValues['routine']![locale.languageCode]; + String get routine => localizedValues['routine'][locale.languageCode]; - String? get send => localizedValues['send']![locale.languageCode]; + String get send => localizedValues['send'][locale.languageCode]; - String? get referralFrequency => localizedValues['referralFrequency']![locale.languageCode]; + String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; - String? get selectReferralFrequency => localizedValues['selectReferralFrequency']![locale.languageCode]; + String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; - String? get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]; + String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; - String? get remarks => localizedValues['remarks']![locale.languageCode]; + String get remarks => localizedValues['remarks'][locale.languageCode]; - String? get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]; + String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; - String? get replay2 => localizedValues['replay2']![locale.languageCode]; + String get replay2 => localizedValues['replay2'][locale.languageCode]; - String? get outPatient => localizedValues['outPatients']![locale.languageCode]; + String get outPatient => localizedValues['outPatients'][locale.languageCode]; - String? get myOutPatient => localizedValues['myOutPatient']![locale.languageCode]; - String? get myOutPatient_2lines => localizedValues['myOutPatient_2lines']![locale.languageCode]; + String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; + String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; - String? get logout => localizedValues['logout']![locale.languageCode]; + String get logout => localizedValues['logout'][locale.languageCode]; - String? get pharmaciesList => localizedValues['pharmaciesList']![locale.languageCode]; + String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; - String? get price => localizedValues['price']![locale.languageCode]; + String get price => localizedValues['price'][locale.languageCode]; - String? get youCanFindItIn => localizedValues['youCanFindItIn']![locale.languageCode]; + String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; - String? get radiologyReport => localizedValues['radiologyReport']![locale.languageCode]; + String get radiologyReport => localizedValues['radiologyReport'][locale.languageCode]; - String? get orders => localizedValues['orders']![locale.languageCode]; + String get orders => localizedValues['orders'][locale.languageCode]; - String? get list => localizedValues['list']![locale.languageCode]; + String get list => localizedValues['list'][locale.languageCode]; - String? get searchOrders => localizedValues['searchOrders']![locale.languageCode]; + String get searchOrders => localizedValues['searchOrders'][locale.languageCode]; - String? get prescriptionDetails => localizedValues['prescriptionDetails']![locale.languageCode]; + String get prescriptionDetails => localizedValues['prescriptionDetails'][locale.languageCode]; - String? get prescriptionInfo => localizedValues['prescriptionInfo']![locale.languageCode]; + String get prescriptionInfo => localizedValues['prescriptionInfo'][locale.languageCode]; - String? get errorNoOrders => localizedValues['errorNoOrders']![locale.languageCode]; + String get errorNoOrders => localizedValues['errorNoOrders'][locale.languageCode]; - String? get livecare => localizedValues['livecare']![locale.languageCode]; + String get livecare => localizedValues['livecare'][locale.languageCode]; - String? get beingBad => localizedValues['beingBad']![locale.languageCode]; + String get beingBad => localizedValues['beingBad'][locale.languageCode]; - String? get beingGreat => localizedValues['beingGreat']![locale.languageCode]; + String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; - String? get cancel => localizedValues['cancel']![locale.languageCode]; + String get cancel => localizedValues['cancel'][locale.languageCode]; - String? get ok => localizedValues['ok']![locale.languageCode]; + String get ok => localizedValues['ok'][locale.languageCode]; - String? get done => localizedValues['done']![locale.languageCode]; + String get done => localizedValues['done'][locale.languageCode]; - String? get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption']![locale.languageCode]; + String get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption'][locale.languageCode]; - String? get type => localizedValues['type']![locale.languageCode]; + String get type => localizedValues['type'][locale.languageCode]; - String? get resumecall => localizedValues['resumecall']![locale.languageCode]; + String get resumecall => localizedValues['resumecall'][locale.languageCode]; - String? get endcallwithcharge => localizedValues['endcallwithcharge']![locale.languageCode]; + String get endcallwithcharge => localizedValues['endcallwithcharge'][locale.languageCode]; - String? get endcall => localizedValues['endcall']![locale.languageCode]; + String get endcall => localizedValues['endcall'][locale.languageCode]; - String? get transfertoadmin => localizedValues['transfertoadmin']![locale.languageCode]; + String get transfertoadmin => localizedValues['transfertoadmin'][locale.languageCode]; - String? get fromDate => localizedValues['fromDate']![locale.languageCode]; + String get fromDate => localizedValues['fromDate'][locale.languageCode]; - String? get toDate => localizedValues['toDate']![locale.languageCode]; + String get toDate => localizedValues['toDate'][locale.languageCode]; - String? get fromTime => localizedValues['fromTime']![locale.languageCode]; + String get fromTime => localizedValues['fromTime'][locale.languageCode]; - String? get toTime => localizedValues['toTime']![locale.languageCode]; + String get toTime => localizedValues['toTime'][locale.languageCode]; - String? get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]; + String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; - String? get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody']![locale.languageCode]; + String get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; - String? get welcome => localizedValues['welcome']![locale.languageCode]; + String get welcome => localizedValues['welcome'][locale.languageCode]; - String? get typeMedicineName => localizedValues['typeMedicineName']![locale.languageCode]; + String get typeMedicineName => localizedValues['typeMedicineName'][locale.languageCode]; - String? get moreThan3Letter => localizedValues['moreThan3Letter']![locale.languageCode]; + String get moreThan3Letter => localizedValues['moreThan3Letter'][locale.languageCode]; - String? get gender2 => localizedValues['gender2']![locale.languageCode]; + String get gender2 => localizedValues['gender2'][locale.languageCode]; - String? get age2 => localizedValues['age2']![locale.languageCode]; + String get age2 => localizedValues['age2'][locale.languageCode]; - String? get sickleave => localizedValues['sick-leaves']![locale.languageCode]; + String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; - String? get patientSick => localizedValues['patient-sick']![locale.languageCode]; + String get patientSick => localizedValues['patient-sick'][locale.languageCode]; - String? get leave => localizedValues['leave']![locale.languageCode]; + String get leave => localizedValues['leave'][locale.languageCode]; - String? get submit => localizedValues['submit']![locale.languageCode]; + String get submit => localizedValues['submit'][locale.languageCode]; - String? get doctorName => localizedValues['doc-name']![locale.languageCode]; + String get doctorName => localizedValues['doc-name'][locale.languageCode]; - String? get clinicName => localizedValues['clinicname']![locale.languageCode]; + String get clinicName => localizedValues['clinicname'][locale.languageCode]; - String? get sickLeaveDate => localizedValues['sick-leave-date']![locale.languageCode]; + String get sickLeaveDate => localizedValues['sick-leave-date'][locale.languageCode]; - String? get sickLeaveDays => localizedValues['sick-leave-days']![locale.languageCode]; + String get sickLeaveDays => localizedValues['sick-leave-days'][locale.languageCode]; - String? get admissionDetail => localizedValues['admissionDetail']![locale.languageCode]; + String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; - String? get dateTime => localizedValues['dateTime']![locale.languageCode]; + String get dateTime => localizedValues['dateTime'][locale.languageCode]; - String? get date => localizedValues['date']![locale.languageCode]; + String get date => localizedValues['date'][locale.languageCode]; - String? get admissionNo => localizedValues['admissionNo']![locale.languageCode]; + String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; - String? get losNo => localizedValues['losNo']![locale.languageCode]; + String get losNo => localizedValues['losNo'][locale.languageCode]; - String? get area => localizedValues['area']![locale.languageCode]; + String get area => localizedValues['area'][locale.languageCode]; - String? get room => localizedValues['room']![locale.languageCode]; + String get room => localizedValues['room'][locale.languageCode]; - String? get bed => localizedValues['bed']![locale.languageCode]; + String get bed => localizedValues['bed'][locale.languageCode]; - String? get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed']![locale.languageCode]; + String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed'][locale.languageCode]; - String? get noSickLeaveApplied => localizedValues['no-sickleve-applied']![locale.languageCode]; + String get noSickLeaveApplied => localizedValues['no-sickleve-applied'][locale.languageCode]; - String? get applyNow => localizedValues['applynow']![locale.languageCode]; + String get applyNow => localizedValues['applynow'][locale.languageCode]; - String? get addSickLeave => localizedValues['add-sickleave']![locale.languageCode]; + String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; - String? get add => localizedValues['add']![locale.languageCode]; - String? get addSickLeaverequest => localizedValues['addSickLeaveRequest']![locale.languageCode]; - String? get extendSickLeaverequest => localizedValues['extendSickLeaveRequest']![locale.languageCode]; - String? get approved => localizedValues['approved']![locale.languageCode]; + String get add => localizedValues['add'][locale.languageCode]; + String get addSickLeaverequest => localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get extendSickLeaverequest => localizedValues['extendSickLeaveRequest'][locale.languageCode]; + String get approved => localizedValues['approved'][locale.languageCode]; - String? get extended => localizedValues['extended']![locale.languageCode]; + String get extended => localizedValues['extended'][locale.languageCode]; - String? get pending => localizedValues['pending']![locale.languageCode]; + String get pending => localizedValues['pending'][locale.languageCode]; - String? get leaveStartDate => localizedValues['leave-start-date']![locale.languageCode]; + String get leaveStartDate => localizedValues['leave-start-date'][locale.languageCode]; - String? get daysSickleave => localizedValues['days-sick-leave']![locale.languageCode]; + String get daysSickleave => localizedValues['days-sick-leave'][locale.languageCode]; - String? get extend => localizedValues['extend']![locale.languageCode]; + String get extend => localizedValues['extend'][locale.languageCode]; - String? get extendSickLeave => localizedValues['extend-sickleave']![locale.languageCode]; + String get extendSickLeave => localizedValues['extend-sickleave'][locale.languageCode]; - String? get targetPatient => localizedValues['patient-target']![locale.languageCode]; + String get targetPatient => localizedValues['patient-target'][locale.languageCode]; - String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; + String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; - String? get next => localizedValues['next']![locale.languageCode]; - String? get finish => localizedValues['finish']![locale.languageCode]; + String get next => localizedValues['next'][locale.languageCode]; + String get finish => localizedValues['finish'][locale.languageCode]; - String? get previous => localizedValues['previous']![locale.languageCode]; + String get previous => localizedValues['previous'][locale.languageCode]; - String? get emptyMessage => localizedValues['empty-message']![locale.languageCode]; + String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; - String? get healthRecordInformation => localizedValues['healthRecordInformation']![locale.languageCode]; + String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; - String? get chiefComplaintLength => localizedValues['chiefComplaintLength']![locale.languageCode]; + String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; - String? get referTo => localizedValues['referTo']![locale.languageCode]; + String get referTo => localizedValues['referTo'][locale.languageCode]; - String? get referredFrom => localizedValues['referredFrom']![locale.languageCode]; - String? get refClinic => localizedValues['refClinic']![locale.languageCode]; + String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get refClinic => localizedValues['refClinic'][locale.languageCode]; - String? get branch => localizedValues['branch']![locale.languageCode]; + String get branch => localizedValues['branch'][locale.languageCode]; - String? get chooseAppointment => localizedValues['chooseAppointment']![locale.languageCode]; + String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; - String? get appointmentNo => localizedValues['appointmentNo']![locale.languageCode]; + String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; - String? get refer => localizedValues['refer']![locale.languageCode]; + String get refer => localizedValues['refer'][locale.languageCode]; - String? get rejected => localizedValues['rejected']![locale.languageCode]; + String get rejected => localizedValues['rejected'][locale.languageCode]; - String? get sameBranch => localizedValues['sameBranch']![locale.languageCode]; + String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; - String? get otherBranch => localizedValues['otherBranch']![locale.languageCode]; + String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; - String? get dr => localizedValues['dr']![locale.languageCode]; + String get dr => localizedValues['dr'][locale.languageCode]; - String? get previewHealth => localizedValues['previewHealth']![locale.languageCode]; + String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; - String? get summaryReport => localizedValues['summaryReport']![locale.languageCode]; + String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; - String? get accept => localizedValues['accept']![locale.languageCode]; + String get accept => localizedValues['accept'][locale.languageCode]; - String? get reject => localizedValues['reject']![locale.languageCode]; + String get reject => localizedValues['reject'][locale.languageCode]; - String? get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg']![locale.languageCode]; + String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; - String? get referralPatient => localizedValues['referralPatient']![locale.languageCode]; + String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; - String? get noPrescriptionListed => localizedValues['noPrescriptionListed']![locale.languageCode]; + String get noPrescriptionListed => localizedValues['noPrescriptionListed'][locale.languageCode]; - String? get addNow => localizedValues['addNow']![locale.languageCode]; + String get addNow => localizedValues['addNow'][locale.languageCode]; - String? get orderType => localizedValues['orderType']![locale.languageCode]; + String get orderType => localizedValues['orderType'][locale.languageCode]; - String? get strength => localizedValues['strength']![locale.languageCode]; + String get strength => localizedValues['strength'][locale.languageCode]; - String? get doseTime => localizedValues['doseTime']![locale.languageCode]; + String get doseTime => localizedValues['doseTime'][locale.languageCode]; - String? get indication => localizedValues['indication']![locale.languageCode]; + String get indication => localizedValues['indication'][locale.languageCode]; - String? get duration => localizedValues['duration']![locale.languageCode]; + String get duration => localizedValues['duration'][locale.languageCode]; - String? get instruction => localizedValues['instruction']![locale.languageCode]; + String get instruction => localizedValues['instruction'][locale.languageCode]; - String? get rescheduleLeaves => localizedValues['reschedule-leave']![locale.languageCode]; + String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; - String? get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave']![locale.languageCode]; - String? get myQRCode => localizedValues['myQRCode']![locale.languageCode]; + String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; - String? get addMedication => localizedValues['addMedication']![locale.languageCode]; + String get addMedication => localizedValues['addMedication'][locale.languageCode]; - String? get route => localizedValues['route']![locale.languageCode]; + String get route => localizedValues['route'][locale.languageCode]; - String? get noReScheduleLeave => localizedValues['no-reschedule-leave']![locale.languageCode]; + String get noReScheduleLeave => localizedValues['no-reschedule-leave'][locale.languageCode]; - String? get weight => localizedValues['weight']![locale.languageCode]; + String get weight => localizedValues['weight'][locale.languageCode]; - String? get kg => localizedValues['kg']![locale.languageCode]; + String get kg => localizedValues['kg'][locale.languageCode]; - String? get height => localizedValues['height']![locale.languageCode]; + String get height => localizedValues['height'][locale.languageCode]; - String? get cm => localizedValues['cm']![locale.languageCode]; + String get cm => localizedValues['cm'][locale.languageCode]; - String? get idealBodyWeight => localizedValues['idealBodyWeight']![locale.languageCode]; + String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode]; - String? get waistSize => localizedValues['waistSize']![locale.languageCode]; + String get waistSize => localizedValues['waistSize'][locale.languageCode]; - String? get inch => localizedValues['inch']![locale.languageCode]; + String get inch => localizedValues['inch'][locale.languageCode]; - String? get headCircum => localizedValues['headCircum']![locale.languageCode]; + String get headCircum => localizedValues['headCircum'][locale.languageCode]; - String? get leanBodyWeight => localizedValues['leanBodyWeight']![locale.languageCode]; + String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; - String? get bodyMassIndex => localizedValues['bodyMassIndex']![locale.languageCode]; + String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; - String? get yourBodyMassIndex => localizedValues['yourBodyMassIndex']![locale.languageCode]; - String? get bmiUnderWeight => localizedValues['bmiUnderWeight']![locale.languageCode]; - String? get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]; - String? get bmiOverWeight => localizedValues['bmiOverWeight']![locale.languageCode]; - String? get bmiObese => localizedValues['bmiObese']![locale.languageCode]; - String? get bmiObeseExtreme => localizedValues['bmiObeseExtreme']![locale.languageCode]; + String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; + String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; + String get bmiObeseExtreme => localizedValues['bmiObeseExtreme'][locale.languageCode]; - String? get method => localizedValues['method']![locale.languageCode]; + String get method => localizedValues['method'][locale.languageCode]; - String? get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]; + String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; - String? get rhythm => localizedValues['rhythm']![locale.languageCode]; + String get rhythm => localizedValues['rhythm'][locale.languageCode]; - String? get respBeats => localizedValues['respBeats']![locale.languageCode]; + String get respBeats => localizedValues['respBeats'][locale.languageCode]; - String? get patternOfRespiration => localizedValues['patternOfRespiration']![locale.languageCode]; + String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode]; - String? get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; + String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; - String? get cuffLocation => localizedValues['cuffLocation']![locale.languageCode]; + String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode]; - String? get cuffSize => localizedValues['cuffSize']![locale.languageCode]; + String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; - String? get patientPosition => localizedValues['patientPosition']![locale.languageCode]; + String get patientPosition => localizedValues['patientPosition'][locale.languageCode]; - String? get fio2 => localizedValues['fio2']![locale.languageCode]; + String get fio2 => localizedValues['fio2'][locale.languageCode]; - String? get sao2 => localizedValues['sao2']![locale.languageCode]; + String get sao2 => localizedValues['sao2'][locale.languageCode]; - String? get painManagement => localizedValues['painManagement']![locale.languageCode]; + String get painManagement => localizedValues['painManagement'][locale.languageCode]; - String? get holiday => localizedValues['holiday']![locale.languageCode]; + String get holiday => localizedValues['holiday'][locale.languageCode]; - String? get to => localizedValues['to']![locale.languageCode]; + String get to => localizedValues['to'][locale.languageCode]; - String? get coveringDoctor => localizedValues['coveringDoctor']![locale.languageCode]; + String get coveringDoctor => localizedValues['coveringDoctor'][locale.languageCode]; - String? get requestLeave => localizedValues['requestLeave']![locale.languageCode]; + String get requestLeave => localizedValues['requestLeave'][locale.languageCode]; - String? get pleaseEnterDate => localizedValues['pleaseEnterDate']![locale.languageCode]; + String get pleaseEnterDate => localizedValues['pleaseEnterDate'][locale.languageCode]; - String? get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays']![locale.languageCode]; + String get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; - String? get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks']![locale.languageCode]; + String get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks'][locale.languageCode]; - String? get update => localizedValues['update']![locale.languageCode]; + String get update => localizedValues['update'][locale.languageCode]; - String? get admission => localizedValues['admission']![locale.languageCode]; + String get admission => localizedValues['admission'][locale.languageCode]; - String? get request => localizedValues['request']![locale.languageCode]; + String get request => localizedValues['request'][locale.languageCode]; - String? get admissionRequest => localizedValues['admissionRequest']![locale.languageCode]; + String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; - String? get patientDetails => localizedValues['patientDetails']![locale.languageCode]; + String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; - String? get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail']![locale.languageCode]; + String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; - String? get referringDate => localizedValues['referringDate']![locale.languageCode]; + String get referringDate => localizedValues['referringDate'][locale.languageCode]; - String? get referringDoctor => localizedValues['referringDoctor']![locale.languageCode]; + String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; - String? get otherInformation => localizedValues['otherInformation']![locale.languageCode]; + String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; - String? get expectedDays => localizedValues['expectedDays']![locale.languageCode]; + String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; - String? get expectedAdmissionDate => localizedValues['expectedAdmissionDate']![locale.languageCode]; + String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; - String? get emergencyAdmission => localizedValues['emergencyAdmission']![locale.languageCode]; - String? get isSickLeaveRequired => localizedValues['isSickLeaveRequired']![locale.languageCode]; + String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; + String get isSickLeaveRequired => localizedValues['isSickLeaveRequired'][locale.languageCode]; - String? get patientPregnant => localizedValues['patientPregnant']![locale.languageCode]; + String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; - String? get treatmentLine => localizedValues['treatmentLine']![locale.languageCode]; + String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; - String? get ward => localizedValues['ward']![locale.languageCode]; + String get ward => localizedValues['ward'][locale.languageCode]; - String? get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred']![locale.languageCode]; + String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; - String? get admissionType => localizedValues['admissionType']![locale.languageCode]; + String get admissionType => localizedValues['admissionType'][locale.languageCode]; - String? get diagnosis => localizedValues['diagnosis']![locale.languageCode]; + String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; - String? get allergies => localizedValues['allergies']![locale.languageCode]; + String get allergies => localizedValues['allergies'][locale.languageCode]; - String? get preOperativeOrders => localizedValues['preOperativeOrders']![locale.languageCode]; + String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; - String? get elementForImprovement => localizedValues['elementForImprovement']![locale.languageCode]; + String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; - String? get dischargeDate => localizedValues['dischargeDate']![locale.languageCode]; + String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; - String? get dietType => localizedValues['dietType']![locale.languageCode]; + String get dietType => localizedValues['dietType'][locale.languageCode]; - String? get dietTypeRemarks => localizedValues['dietTypeRemarks']![locale.languageCode]; + String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; - String? get save => localizedValues['save']![locale.languageCode]; + String get save => localizedValues['save'][locale.languageCode]; - String? get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost']![locale.languageCode]; - String? get postPlans => localizedValues['postPlans']![locale.languageCode]; + String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get postPlans => localizedValues['postPlans'][locale.languageCode]; - String? get ucaf => localizedValues['ucaf']![locale.languageCode]; + String get ucaf => localizedValues['ucaf'][locale.languageCode]; - String? get emergencyCase => localizedValues['emergencyCase']![locale.languageCode]; + String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; - String? get durationOfIllness => localizedValues['durationOfIllness']![locale.languageCode]; + String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; - String? get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]; + String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; - String? get patientFeelsPainInHisBackAndCough => - localizedValues['patientFeelsPainInHisBackAndCough']![locale.languageCode]; + String get patientFeelsPainInHisBackAndCough => + localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; - String? get additionalTextComplaints => localizedValues['additionalTextComplaints']![locale.languageCode]; + String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; - String? get otherConditions => localizedValues['otherConditions']![locale.languageCode]; + String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; - String? get other => localizedValues['other']![locale.languageCode]; + String get other => localizedValues['other'][locale.languageCode]; - String? get how => localizedValues['how']![locale.languageCode]; + String get how => localizedValues['how'][locale.languageCode]; - String? get when => localizedValues['when']![locale.languageCode]; + String get when => localizedValues['when'][locale.languageCode]; - String? get where => localizedValues['where']![locale.languageCode]; + String get where => localizedValues['where'][locale.languageCode]; - String? get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement']![locale.languageCode]; + String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; - String? get significantSigns => localizedValues['significantSigns']![locale.languageCode]; + String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; - String? get backAbdomen => localizedValues['backAbdomen']![locale.languageCode]; + String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; - String? get reasons => localizedValues['reasons']![locale.languageCode]; + String get reasons => localizedValues['reasons'][locale.languageCode]; - String? get createNew => localizedValues['createNew']![locale.languageCode]; + String get createNew => localizedValues['createNew'][locale.languageCode]; - String? get episode => localizedValues['episode']![locale.languageCode]; + String get episode => localizedValues['episode'][locale.languageCode]; - String? get medications => localizedValues['medications']![locale.languageCode]; + String get medications => localizedValues['medications'][locale.languageCode]; - String? get procedures => localizedValues['procedures']![locale.languageCode]; + String get procedures => localizedValues['procedures'][locale.languageCode]; - String? get chiefComplaints => localizedValues['chiefComplaints']![locale.languageCode]; + String get chiefComplaints => localizedValues['chiefComplaints'][locale.languageCode]; - String? get histories => localizedValues['histories']![locale.languageCode]; + String get histories => localizedValues['histories'][locale.languageCode]; - String? get allergiesSoap => localizedValues['allergiesSoap']![locale.languageCode]; + String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; - String? get addChiefComplaints => localizedValues['addChiefComplaints']![locale.languageCode]; + String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; - String? get historyOfPresentIllness => localizedValues['historyOfPresentIllness']![locale.languageCode]; + String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; - String? get requiredMsg => localizedValues['requiredMsg']![locale.languageCode]; + String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; - String? get addHistory => localizedValues['addHistory']![locale.languageCode]; + String get addHistory => localizedValues['addHistory'][locale.languageCode]; - String? get searchHistory => localizedValues['searchHistory']![locale.languageCode]; + String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; - String? get addSelectedHistories => localizedValues['addSelectedHistories']![locale.languageCode]; + String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; - String? get addAllergies => localizedValues['addAllergies']![locale.languageCode]; + String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; - String? get itemExist => localizedValues['itemExist']![locale.languageCode]; + String get itemExist => localizedValues['itemExist'][locale.languageCode]; - String? get selectAllergy => localizedValues['selectAllergy']![locale.languageCode]; + String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; - String? get selectSeverity => localizedValues['selectSeverity']![locale.languageCode]; + String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; - String? get leaveCreated => localizedValues['leaveCreated']![locale.languageCode]; + String get leaveCreated => localizedValues['leaveCreated'][locale.languageCode]; - String? get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg']![locale.languageCode]; + String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; - String? get referralEmptyMsg => localizedValues['referralEmptyMsg']![locale.languageCode]; + String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; - String? get referralSuccessMsg => localizedValues['referralSuccessMsg']![locale.languageCode]; + String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; - String? get diagnoseType => localizedValues['diagnoseType']![locale.languageCode]; + String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; - String? get condition => localizedValues['condition']![locale.languageCode]; + String get condition => localizedValues['condition'][locale.languageCode]; - String? get id => localizedValues['id']![locale.languageCode]; + String get id => localizedValues['id'][locale.languageCode]; - String? get quantity => localizedValues['quantity']![locale.languageCode]; + String get quantity => localizedValues['quantity'][locale.languageCode]; - String? get durDays => localizedValues['durDays']![locale.languageCode]; + String get durDays => localizedValues['durDays'][locale.languageCode]; - String? get codeNo => localizedValues['codeNo']![locale.languageCode]; + String get codeNo => localizedValues['codeNo'][locale.languageCode]; - String? get covered => localizedValues['covered']![locale.languageCode]; + String get covered => localizedValues['covered'][locale.languageCode]; - String? get approvalRequired => localizedValues['approvalRequired']![locale.languageCode]; + String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; - String? get uncoveredByDoctor => localizedValues['uncoveredByDoctor']![locale.languageCode]; + String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; - String? get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]; + String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String? get moreVerification => localizedValues['more-verify']![locale.languageCode]; + String get moreVerification => localizedValues['more-verify'][locale.languageCode]; - String? get welcomeBack => localizedValues['welcome-back']![locale.languageCode]; + String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; - String? get accountInfo => localizedValues['account-info']![locale.languageCode]; + String get accountInfo => localizedValues['account-info'][locale.languageCode]; - String? get useAnotherAccount => localizedValues['another-acc']![locale.languageCode]; + String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; - String? get verifyLoginWith => localizedValues['verify-login-with']![locale.languageCode]; + String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; - String? get register => localizedValues['register-user']![locale.languageCode]; + String get register => localizedValues['register-user'][locale.languageCode]; - String? get verifyFingerprint => localizedValues['verify-with-fingerprint']![locale.languageCode]; + String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; - String? get verifyFaceID => localizedValues['verify-with-faceid']![locale.languageCode]; + String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; - String? get verifySMS => localizedValues['verify-with-sms']![locale.languageCode]; - String? get verifyWith => localizedValues['verify-with']![locale.languageCode]; + String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifyWith => localizedValues['verify-with'][locale.languageCode]; - String? get verifyWhatsApp => localizedValues['verify-with-whatsapp']![locale.languageCode]; + String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; - String? get lastLoginAt => localizedValues['last-login']![locale.languageCode]; + String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String? get lastLoginWith => localizedValues['last-login-with']![locale.languageCode]; + String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; - String? get verifyFingerprint2 => localizedValues['verify-fingerprint']![locale.languageCode]; + String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; - String? get verificationMessage => localizedValues['verification_message']![locale.languageCode]; + String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; - String? get validationMessage => localizedValues['validation_message']![locale.languageCode]; + String get validationMessage => localizedValues['validation_message'][locale.languageCode]; - String? get addAssessment => localizedValues['addAssessment']![locale.languageCode]; + String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; - String? get assessment => localizedValues['assessment']![locale.languageCode]; + String get assessment => localizedValues['assessment'][locale.languageCode]; - String? get physicalSystemExamination => localizedValues['physicalSystemExamination']![locale.languageCode]; + String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; - String? get searchExamination => localizedValues['searchExamination']![locale.languageCode]; + String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; - String? get addExamination => localizedValues['addExamination']![locale.languageCode]; + String get addExamination => localizedValues['addExamination'][locale.languageCode]; - String? get doc => localizedValues['doc']![locale.languageCode]; + String get doc => localizedValues['doc'][locale.languageCode]; - String? get allergicTO => localizedValues['allergicTO']![locale.languageCode]; + String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; - String? get normal => localizedValues['normal']![locale.languageCode]; - String? get notExamined => localizedValues['notExamined']![locale.languageCode]; + String get normal => localizedValues['normal'][locale.languageCode]; + String get notExamined => localizedValues['notExamined'][locale.languageCode]; - String? get abnormal => localizedValues['abnormal']![locale.languageCode]; + String get abnormal => localizedValues['abnormal'][locale.languageCode]; - String? get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg']![locale.languageCode]; + String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; - String? get systolicLng => localizedValues['systolic-lng']![locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; - String? get diastolicLng => localizedValues['diastolic-lng']![locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; - String? get mass => localizedValues['mass']![locale.languageCode]; + String get mass => localizedValues['mass'][locale.languageCode]; - String? get tempC => localizedValues['temp-c']![locale.languageCode]; + String get tempC => localizedValues['temp-c'][locale.languageCode]; - String? get bpm => localizedValues['bpm']![locale.languageCode]; + String get bpm => localizedValues['bpm'][locale.languageCode]; - String? get respirationSigns => localizedValues['respiration-signs']![locale.languageCode]; + String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; - String? get sysDias => localizedValues['sys-dias']![locale.languageCode]; + String get sysDias => localizedValues['sys-dias'][locale.languageCode]; - String? get body => localizedValues['body']![locale.languageCode]; + String get body => localizedValues['body'][locale.languageCode]; - String? get respirationRate => localizedValues['respirationRate']![locale.languageCode]; + String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; - String? get heart => localizedValues['heart']![locale.languageCode]; + String get heart => localizedValues['heart'][locale.languageCode]; - String? get medicalReport => localizedValues['medicalReport']![locale.languageCode]; + String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; - String? get visitDate => localizedValues['visitDate']![locale.languageCode]; + String get visitDate => localizedValues['visitDate'][locale.languageCode]; - String? get test => localizedValues['test']![locale.languageCode]; + String get test => localizedValues['test'][locale.languageCode]; - String? get addMoreProcedure => localizedValues['addMoreProcedure']![locale.languageCode]; + String get addMoreProcedure => localizedValues['addMoreProcedure'][locale.languageCode]; - String? get regular => localizedValues['regular']![locale.languageCode]; + String get regular => localizedValues['regular'][locale.languageCode]; - String? get searchProcedures => localizedValues['searchProcedures']![locale.languageCode]; + String get searchProcedures => localizedValues['searchProcedures'][locale.languageCode]; - String? get procedureCategorise => localizedValues['procedureCategorise']![locale.languageCode]; + String get procedureCategorise => localizedValues['procedureCategorise'][locale.languageCode]; - String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; + String get selectProcedures => localizedValues['selectProcedures'][locale.languageCode]; - String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String? get addProcedures => localizedValues['addProcedures']![locale.languageCode]; + String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; + String get addProcedures => localizedValues['addProcedures'][locale.languageCode]; - String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; + String get updateProcedure => localizedValues['updateProcedure'][locale.languageCode]; - String? get orderProcedure => localizedValues['orderProcedure']![locale.languageCode]; + String get orderProcedure => localizedValues['orderProcedure'][locale.languageCode]; - String? get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]; + String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; - String? get dType => localizedValues['dType']![locale.languageCode]; + String get dType => localizedValues['dType'][locale.languageCode]; - String? get addAssessmentDetails => localizedValues['addAssessmentDetails']![locale.languageCode]; + String get addAssessmentDetails => localizedValues['addAssessmentDetails'][locale.languageCode]; - String? get progressNoteSOAP => localizedValues['progressNoteSOAP']![locale.languageCode]; + String get progressNoteSOAP => localizedValues['progressNoteSOAP'][locale.languageCode]; - String? get addProgressNote => localizedValues['addProgressNote']![locale.languageCode]; + String get addProgressNote => localizedValues['addProgressNote'][locale.languageCode]; - String? get createdBy => localizedValues['createdBy']![locale.languageCode]; + String get createdBy => localizedValues['createdBy'][locale.languageCode]; - String? get editedBy => localizedValues['editedBy']![locale.languageCode]; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; - String? get currentMedications => localizedValues['currentMedications']![locale.languageCode]; + String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; - String? get noItem => localizedValues['noItem']![locale.languageCode]; + String get noItem => localizedValues['noItem'][locale.languageCode]; - String? get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg']![locale.languageCode]; + String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; - String? get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty']![locale.languageCode]; + String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; - String? get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday']![locale.languageCode]; + String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday'][locale.languageCode]; - String? get active => localizedValues['active']![locale.languageCode]; + String get active => localizedValues['active'][locale.languageCode]; - String? get hold => localizedValues['hold']![locale.languageCode]; + String get hold => localizedValues['hold'][locale.languageCode]; - String? get loading => localizedValues['loading']![locale.languageCode]; + String get loading => localizedValues['loading'][locale.languageCode]; - String? get assessmentErrorMsg => localizedValues['assessmentErrorMsg']![locale.languageCode]; + String get assessmentErrorMsg => localizedValues['assessmentErrorMsg'][locale.languageCode]; - String? get examinationErrorMsg => localizedValues['examinationErrorMsg']![locale.languageCode]; + String get examinationErrorMsg => localizedValues['examinationErrorMsg'][locale.languageCode]; - String? get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg']![locale.languageCode]; + String get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg'][locale.languageCode]; - String? get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg']![locale.languageCode]; - String? get ICDName => localizedValues['ICDName']![locale.languageCode]; + String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get ICDName => localizedValues['ICDName'][locale.languageCode]; - String? get referralStatus => localizedValues['referralStatus']![locale.languageCode]; + String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; - String? get referralRemark => localizedValues['referralRemark']![locale.languageCode]; - String? get offTime => localizedValues['offTime']![locale.languageCode]; + String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + String get offTime => localizedValues['offTime'][locale.languageCode]; - String? get icd => localizedValues['icd']![locale.languageCode]; - String? get days => localizedValues['days']![locale.languageCode]; - String? get hr => localizedValues['hr']![locale.languageCode]; - String? get min => localizedValues['min']![locale.languageCode]; - String? get months => localizedValues['months']![locale.languageCode]; - String? get years => localizedValues['years']![locale.languageCode]; - String? get referralStatusHold => localizedValues['referralStatusHold']![locale.languageCode]; - String? get referralStatusActive => localizedValues['referralStatusActive']![locale.languageCode]; - String? get referralStatusCancelled => localizedValues['referralStatusCancelled']![locale.languageCode]; - String? get referralStatusCompleted => localizedValues['referralStatusCompleted']![locale.languageCode]; - String? get referralStatusNotSeen => localizedValues['referralStatusNotSeen']![locale.languageCode]; - String? get clinicSearch => localizedValues['clinicSearch']![locale.languageCode]; - String? get doctorSearch => localizedValues['doctorSearch']![locale.languageCode]; - String? get referralResponse => localizedValues['referralResponse']![locale.languageCode]; - String? get estimatedCost => localizedValues['estimatedCost']![locale.languageCode]; - String? get diagnosisDetail => localizedValues['diagnosisDetail']![locale.languageCode]; - String? get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept']![locale.languageCode]; - String? get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject']![locale.languageCode]; + String get icd => localizedValues['icd'][locale.languageCode]; + String get days => localizedValues['days'][locale.languageCode]; + String get hr => localizedValues['hr'][locale.languageCode]; + String get min => localizedValues['min'][locale.languageCode]; + String get months => localizedValues['months'][locale.languageCode]; + String get years => localizedValues['years'][locale.languageCode]; + String get referralStatusHold => localizedValues['referralStatusHold'][locale.languageCode]; + String get referralStatusActive => localizedValues['referralStatusActive'][locale.languageCode]; + String get referralStatusCancelled => localizedValues['referralStatusCancelled'][locale.languageCode]; + String get referralStatusCompleted => localizedValues['referralStatusCompleted'][locale.languageCode]; + String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; + String get clinicSearch => localizedValues['clinicSearch'][locale.languageCode]; + String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; + String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; + String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; + String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; - String? get patientName => localizedValues['patient-name']![locale.languageCode]; + String get patientName => localizedValues['patient-name'][locale.languageCode]; + + String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; + String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; + String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; + String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get complications => localizedValues['complications'][locale.languageCode]; + String get floor => localizedValues['floor'][locale.languageCode]; + String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; + String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; + String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; + String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; + String get sickleaveonhold => localizedValues['sickleaveonhold'][locale.languageCode]; + String get noClinic => localizedValues['no-clinic'][locale.languageCode]; + + String get otherStatistic => localizedValues['otherStatistic'][locale.languageCode]; + + String get patientsreferral => localizedValues['ptientsreferral'][locale.languageCode]; + String get myPatientsReferral => localizedValues['myPatientsReferral'][locale.languageCode]; + String get arrivalpatient => localizedValues['arrivalpatient'][locale.languageCode]; + String get searchmedicinepatient => localizedValues['searchmedicinepatient'][locale.languageCode]; + String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; + String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; + + String get details => localizedValues['details'][locale.languageCode]; + String get liveCare => localizedValues['liveCare'][locale.languageCode]; + String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get labResults => localizedValues['labResults'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get showDetail => localizedValues['showDetail'][locale.languageCode]; + String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; + + String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; + String get reschedule => localizedValues['reschedule'][locale.languageCode]; + String get leaves => localizedValues['leaves'][locale.languageCode]; + String get openRad => localizedValues['open-rad'][locale.languageCode]; + + String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; + String get companyName => localizedValues['companyName'][locale.languageCode]; + String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get notes => localizedValues['notes'][locale.languageCode]; + String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; + String get searchWithOther => localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => localizedValues['applyForReschedule'][locale.languageCode]; + + String get startDate => localizedValues['startDate'][locale.languageCode]; + String get endDate => localizedValues['endDate'][locale.languageCode]; + + String get addReschedule => localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; + String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; + String get accepted => localizedValues['accepted'][locale.languageCode]; + String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get unReplied => localizedValues['unReplied'][locale.languageCode]; + String get replied => localizedValues['replied'][locale.languageCode]; + String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; + String get searchHere => localizedValues['searchHere'][locale.languageCode]; + String get remove => localizedValues['remove'][locale.languageCode]; + String get inProgress => localizedValues['inProgress'][locale.languageCode]; + String get completed => localizedValues['Completed'][locale.languageCode]; + String get locked => localizedValues['Locked'][locale.languageCode]; + + String get step => localizedValues['step'][locale.languageCode]; + String get fieldRequired => localizedValues['fieldRequired'][locale.languageCode]; + String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; + String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; + String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; + String get enterCredentials => localizedValues['enter_credentials'][locale.languageCode]; + String get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational'][locale.languageCode]; + + String get updateNow => localizedValues['updateNow'][locale.languageCode]; + String get updateTheApp => localizedValues['updateTheApp'][locale.languageCode]; + String get admissionDate => localizedValues['admission-date'][locale.languageCode]; + String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; + String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; + String get replayBefore => localizedValues['replayBefore'][locale.languageCode]; + String get trySaying => localizedValues["try-saying"][locale.languageCode]; + String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; + String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; + String get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get procedure => localizedValues["procedure"][locale.languageCode]; + String get stopDate => localizedValues["stopDate"][locale.languageCode]; + String get processed => localizedValues["processed"][locale.languageCode]; + String get direction => localizedValues["direction"][locale.languageCode]; + String get refill => localizedValues["refill"][locale.languageCode]; + String get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"][locale.languageCode]; + String get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + String get unit => localizedValues["unit"][locale.languageCode]; + String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; + String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; + String get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; + String get addRadiologyOrder => localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => localizedValues["newRadiologyOrder"][locale.languageCode]; + String get orderDate => localizedValues["orderDate"][locale.languageCode]; + String get examType => localizedValues["examType"][locale.languageCode]; + String get health => localizedValues["health"][locale.languageCode]; + String get summary => localizedValues["summary"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => localizedValues["noMedicalFileFound"][locale.languageCode]; + String get insurance22 => localizedValues["insurance22"][locale.languageCode]; + String get approvals22 => localizedValues["approvals22"][locale.languageCode]; + String get severe => localizedValues["severe"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get discharged => localizedValues["discharged"][locale.languageCode]; + String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; + String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; + String get notePending => localizedValues["notePending"][locale.languageCode]; + String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; + String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; + String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; + String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; + String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; + + String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; + + String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get order => localizedValues["order"][locale.languageCode]; + String get sheet => localizedValues["sheet"][locale.languageCode]; + String get medical => localizedValues["medical"][locale.languageCode]; + String get report => localizedValues["report"][locale.languageCode]; + String get discharge => localizedValues["discharge"][locale.languageCode]; + String get none => localizedValues["none"][locale.languageCode]; + String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get clearText => localizedValues["clearText"][locale.languageCode]; + String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; + String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; + String get comments => localizedValues['comments'][locale.languageCode]; + String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; + String get endCall => localizedValues['endCall'][locale.languageCode]; + + String get transferTo => localizedValues['transferTo'][locale.languageCode]; + String get admin => localizedValues['admin'][locale.languageCode]; + String get instructions => localizedValues['instructions'][locale.languageCode]; + String get sendLC => localizedValues['sendLC'][locale.languageCode]; + String get endLC => localizedValues['endLC'][locale.languageCode]; + String get consultation => localizedValues['consultation'][locale.languageCode]; + String get resume => localizedValues['resume'][locale.languageCode]; + String get theCall => localizedValues['theCall'][locale.languageCode]; + String get createNewMedicalReport => localizedValues['createNewMedicalReport'][locale.languageCode]; + String get historyPhysicalFinding => localizedValues['historyPhysicalFinding'][locale.languageCode]; + String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData'][locale.languageCode]; + 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]; + 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]; + String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; + String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; + String get roomNo => localizedValues['roomNo'][locale.languageCode]; + String get seeMore => localizedValues['seeMore'][locale.languageCode]; + String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; + String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; + String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; + String get underProcess => localizedValues['underProcess'][locale.languageCode]; + String get textResponse => localizedValues['textResponse'][locale.languageCode]; + String get special => localizedValues['special'][locale.languageCode]; + String get requestType => localizedValues['requestType'][locale.languageCode]; + String get allClinic => localizedValues['allClinic'][locale.languageCode]; + String get notReplied => localizedValues['notReplied'][locale.languageCode]; + String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; + String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; - String? get appointmentNumber => localizedValues['appointmentNumber']![locale.languageCode]; - String? get sickLeaveComments => localizedValues['sickLeaveComments']![locale.languageCode]; - String? get pastMedicalHistory => localizedValues['pastMedicalHistory']![locale.languageCode]; - String? get pastSurgicalHistory => localizedValues['pastSurgicalHistory']![locale.languageCode]; - String? get complications => localizedValues['complications']![locale.languageCode]; - String? get floor => localizedValues['floor']![locale.languageCode]; - String? get roomCategory => localizedValues['roomCategory']![locale.languageCode]; - String? get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions']![locale.languageCode]; - String? get otherProcedure => localizedValues['otherProcedure']![locale.languageCode]; - String? get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg']![locale.languageCode]; - String? get infoStatus => localizedValues['infoStatus']![locale.languageCode]; - String? get doctorResponse => localizedValues['doctorResponse']![locale.languageCode]; - String? get sickleaveonhold => localizedValues['sickleaveonhold']![locale.languageCode]; - String? get noClinic => localizedValues['no-clinic']![locale.languageCode]; - - String? get otherStatistic => localizedValues['otherStatistic']![locale.languageCode]; - - String? get patientsreferral => localizedValues['ptientsreferral']![locale.languageCode]; - String? get myPatientsReferral => localizedValues['myPatientsReferral']![locale.languageCode]; - String? get arrivalpatient => localizedValues['arrivalpatient']![locale.languageCode]; - String? get searchmedicinepatient => localizedValues['searchmedicinepatient']![locale.languageCode]; - String? get appointmentDate => localizedValues['appointmentDate']![locale.languageCode]; - String? get arrivedP => localizedValues['arrived_p']![locale.languageCode]; - - String? get details => localizedValues['details']![locale.languageCode]; - String? get liveCare => localizedValues['liveCare']![locale.languageCode]; - String? get outpatient => localizedValues['out-patient']![locale.languageCode]; - String? get billNo => localizedValues['BillNo']![locale.languageCode]; - String? get labResults => localizedValues['labResults']![locale.languageCode]; - String? get sendSuc => localizedValues['sendSuc']![locale.languageCode]; - String? get specialResult => localizedValues['SpecialResult']![locale.languageCode]; - String? get noDataAvailable => localizedValues['noDataAvailable']![locale.languageCode]; - String? get showMoreBtn => localizedValues['show-more-btn']![locale.languageCode]; - String? get showDetail => localizedValues['showDetail']![locale.languageCode]; - String? get viewProfile => localizedValues['viewProfile']![locale.languageCode]; - - String? get fileNumber => localizedValues['fileNumber']![locale.languageCode]; - String? get reschedule => localizedValues['reschedule']![locale.languageCode]; - String? get leaves => localizedValues['leaves']![locale.languageCode]; - String? get openRad => localizedValues['open-rad']![locale.languageCode]; - - String? get totalApproval => localizedValues['totalApproval']![locale.languageCode]; - String? get procedureStatus => localizedValues['procedureStatus']![locale.languageCode]; - String? get unusedCount => localizedValues['unusedCount']![locale.languageCode]; - String? get companyName => localizedValues['companyName']![locale.languageCode]; - String? get procedureName => localizedValues['procedureName']![locale.languageCode]; - String? get usageStatus => localizedValues['usageStatus']![locale.languageCode]; - String? get prescriptions => localizedValues['prescriptions']![locale.languageCode]; - String? get notes => localizedValues['notes']![locale.languageCode]; - String? get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]; - String? get searchWithOther => localizedValues['searchWithOther']![locale.languageCode]; - String? get hideOtherCriteria => localizedValues['hideOtherCriteria']![locale.languageCode]; - String? get applyForReschedule => localizedValues['applyForReschedule']![locale.languageCode]; - - String? get startDate => localizedValues['startDate']![locale.languageCode]; - String? get endDate => localizedValues['endDate']![locale.languageCode]; - - String? get addReschedule => localizedValues['add-reschedule']![locale.languageCode]; - String? get updateReschedule => localizedValues['update-reschedule']![locale.languageCode]; - String? get sickLeave => localizedValues['sick_leave']![locale.languageCode]; - String? get accepted => localizedValues['accepted']![locale.languageCode]; - String? get cancelled => localizedValues['cancelled']![locale.languageCode]; - String? get unReplied => localizedValues['unReplied']![locale.languageCode]; - String? get replied => localizedValues['replied']![locale.languageCode]; - String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]; - String? get searchHere => localizedValues['searchHere']![locale.languageCode]; - String? get remove => localizedValues['remove']![locale.languageCode]; - String? get inProgress => localizedValues['inProgress']![locale.languageCode]; - String? get completed => localizedValues['Completed']![locale.languageCode]; - String? get locked => localizedValues['Locked']![locale.languageCode]; - - String? get step => localizedValues['step']![locale.languageCode]; - String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]; - String? get noSickLeave => localizedValues['no-sickleve']![locale.languageCode]; - String? get changeOfSchedule => localizedValues['changeOfSchedule']![locale.languageCode]; - String? get newSchedule => localizedValues['newSchedule']![locale.languageCode]; - String? get enterCredentials => localizedValues['enter_credentials']![locale.languageCode]; - String? get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational']![locale.languageCode]; - - String? get updateNow => localizedValues['updateNow']![locale.languageCode]; - String? get updateTheApp => localizedValues['updateTheApp']![locale.languageCode]; - String? get admissionDate => localizedValues['admission-date']![locale.languageCode]; - String? get noOfDays => localizedValues['noOfDays']![locale.languageCode]; - String? get numOfDays => localizedValues['numOfDays']![locale.languageCode]; - String? get replayBefore => localizedValues['replayBefore']![locale.languageCode]; - String? get trySaying => localizedValues["try-saying"]![locale.languageCode]; - String? get acknowledged => localizedValues['acknowledged']![locale.languageCode]; - String? get didntCatch => localizedValues["didntCatch"]![locale.languageCode]; - String? get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"]![locale.languageCode]; - String? get fillTheMandatoryProcedureDetails => - localizedValues["fillTheMandatoryProcedureDetails"]![locale.languageCode]; - String? get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"]![locale.languageCode]; - String? get searchProcedureHere => localizedValues["searchProcedureHere"]![locale.languageCode]; - String? get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"]![locale.languageCode]; - String? get procedure => localizedValues["procedure"]![locale.languageCode]; - String? get stopDate => localizedValues["stopDate"]![locale.languageCode]; - String? get processed => localizedValues["processed"]![locale.languageCode]; - String? get direction => localizedValues["direction"]![locale.languageCode]; - String? get refill => localizedValues["refill"]![locale.languageCode]; - String? get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"]![locale.languageCode]; - String? get newPrescriptionOrder => localizedValues["newPrescriptionOrder"]![locale.languageCode]; - String? get pleaseFillAllFields => localizedValues["pleaseFillAllFields"]![locale.languageCode]; - String? get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"]![locale.languageCode]; - String? get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]; - String? get unit => localizedValues["unit"]![locale.languageCode]; - String? get boxQuantity => localizedValues["boxQuantity"]![locale.languageCode]; - String? get orderTestOr => localizedValues["orderTestOr"]![locale.languageCode]; - String? get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"]![locale.languageCode]; - String? get applyForNewLabOrder => localizedValues["applyForNewLabOrder"]![locale.languageCode]; - String? get addLabOrder => localizedValues["addLabOrder"]![locale.languageCode]; - String? get addRadiologyOrder => localizedValues["addRadiologyOrder"]![locale.languageCode]; - String? get newRadiologyOrder => localizedValues["newRadiologyOrder"]![locale.languageCode]; - String? get orderDate => localizedValues["orderDate"]![locale.languageCode]; - String? get examType => localizedValues["examType"]![locale.languageCode]; - String? get health => localizedValues["health"]![locale.languageCode]; - String? get summary => localizedValues["summary"]![locale.languageCode]; - String? get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]; - String? get noPrescriptionsFound => localizedValues["noPrescriptionsFound"]![locale.languageCode]; - String? get noMedicalFileFound => localizedValues["noMedicalFileFound"]![locale.languageCode]; - String? get insurance22 => localizedValues["insurance22"]![locale.languageCode]; - String? get approvals22 => localizedValues["approvals22"]![locale.languageCode]; - String? get severe => localizedValues["severe"]![locale.languageCode]; - String? get graphDetails => localizedValues["graphDetails"]![locale.languageCode]; - String? get discharged => localizedValues["discharged"]![locale.languageCode]; - String? get addNewOrderSheet => localizedValues["addNewOrderSheet"]![locale.languageCode]; - String? get addNewProgressNote => localizedValues["addNewProgressNote"]![locale.languageCode]; - String? get notePending => localizedValues["notePending"]![locale.languageCode]; - String? get noteCanceled => localizedValues["noteCanceled"]![locale.languageCode]; - String? get noteVerified => localizedValues["noteVerified"]![locale.languageCode]; - String? get noteVerify => localizedValues["noteVerify"]![locale.languageCode]; - String? get noteConfirm => localizedValues["noteConfirm"]![locale.languageCode]; - String? get noteAdd => localizedValues["noteAdd"]![locale.languageCode]; - - String? get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]; - - String? get orderSheet => localizedValues["orderSheet"]![locale.languageCode]; - String? get order => localizedValues["order"]![locale.languageCode]; - String? get sheet => localizedValues["sheet"]![locale.languageCode]; - String? get medical => localizedValues["medical"]![locale.languageCode]; - String? get report => localizedValues["report"]![locale.languageCode]; - String? get discharge => localizedValues["discharge"]![locale.languageCode]; - String? get none => localizedValues["none"]![locale.languageCode]; - String? get notRepliedYet => localizedValues["notRepliedYet"]![locale.languageCode]; - String? get clearText => localizedValues["clearText"]![locale.languageCode]; - String? get medicalReportAdd => localizedValues['medicalReportAdd']![locale.languageCode]; - String? get medicalReportVerify => localizedValues['medicalReportVerify']![locale.languageCode]; - String? get comments => localizedValues['comments']![locale.languageCode]; - String? get initiateCall => localizedValues['initiateCall']![locale.languageCode]; - String? get endCall => localizedValues['endCall']![locale.languageCode]; - - String? get transferTo => localizedValues['transferTo']![locale.languageCode]; - String? get admin => localizedValues['admin']![locale.languageCode]; - String? get instructions => localizedValues['instructions']![locale.languageCode]; - String? get sendLC => localizedValues['sendLC']![locale.languageCode]; - String? get endLC => localizedValues['endLC']![locale.languageCode]; - String? get consultation => localizedValues['consultation']![locale.languageCode]; - String? get resume => localizedValues['resume']![locale.languageCode]; - String? get theCall => localizedValues['theCall']![locale.languageCode]; - String? get createNewMedicalReport => localizedValues['createNewMedicalReport']![locale.languageCode]; - String? get historyPhysicalFinding => localizedValues['historyPhysicalFinding']![locale.languageCode]; - String? get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData']![locale.languageCode]; - 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]; - 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]; - String? get severityValidationError => localizedValues['severityValidationError']![locale.languageCode]; - String? get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully']![locale.languageCode]; - String? get roomNo => localizedValues['roomNo']![locale.languageCode]; - String? get seeMore => localizedValues['seeMore']![locale.languageCode]; - String? get replayCallStatus => localizedValues['replayCallStatus']![locale.languageCode]; - String? get patientArrived => localizedValues['patientArrived']![locale.languageCode]; - String? get calledAndNoResponse => localizedValues['calledAndNoResponse']![locale.languageCode]; - String? get underProcess => localizedValues['underProcess']![locale.languageCode]; - String? get textResponse => localizedValues['textResponse']![locale.languageCode]; - String? get special => localizedValues['special']![locale.languageCode]; - String? get requestType => localizedValues['requestType']![locale.languageCode]; - String? get allClinic => localizedValues['allClinic']![locale.languageCode]; - String? get notReplied => localizedValues['notReplied']![locale.languageCode]; - String? get registerNewPatient => localizedValues['registerNewPatient']![locale.languageCode]; - String? get registeraPatient => localizedValues['registeraPatient']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 08c0b193..6d091756 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -1,24 +1,21 @@ -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'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ - Key? key, - required this.assetPath, - required this.onTap, - required this.label, - this.height = 20, + Key key, + this.assetPath, + this.onTap, + this.label, this.height = 20, }) : super(key: key); final String assetPath; - final GestureTapCallback onTap; + final Function onTap; final String label; final double height; @override Widget build(BuildContext context) { - double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : SizeConfig.isHeightLarge?25:20); return InkWell( onTap: onTap, child: Container( @@ -28,28 +25,34 @@ class MethodTypeCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all(color: HexColor('#707070'), width: 0.1), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), ), - height: cardHeight, - child: Center( + height: 170, + child: Padding( + padding: EdgeInsets.fromLTRB(20, 15, 20, 15), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - assetPath, - width: SizeConfig.widthMultiplier* (12), - height: cardHeight * 0.35, - // height: , + Row( + children: [ + Image.asset( + assetPath, + height: 60, + width: 60, + ), + ], ), SizedBox( - height: height, + height:height , ), AppText( label, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, ) ], ), diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 91838dbd..0c374e58 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -1,5 +1,6 @@ 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'; @@ -8,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:provider/provider.dart'; - class SMSOTP { final AuthMethodTypes type; final mobileNo; @@ -16,7 +16,7 @@ class SMSOTP { final Function onFailure; final context; - late int remainingTime = 600; + int remainingTime = 600; SMSOTP( this.context, @@ -26,7 +26,7 @@ class SMSOTP { this.onFailure, ); - late final verifyAccountForm = GlobalKey(); + final verifyAccountForm = GlobalKey(); TextEditingController digit1 = TextEditingController(text: ""); TextEditingController digit2 = TextEditingController(text: ""); @@ -43,93 +43,94 @@ class SMSOTP { final focusD2 = FocusNode(); final focusD3 = FocusNode(); final focusD4 = FocusNode(); - late String errorMsg; - late ProjectViewModel projectProvider; - late String displayTime = ''; - late bool isClosed = false; + String errorMsg; + ProjectViewModel projectProvider; + String displayTime = ''; + 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, - - - builder: (ctx) => Center( - child: Container( - color: Colors.white, - height: dialogHeight, - width: dialogWidth, - child: Material( - color: Colors.white, - child: SingleChildScrollView( + 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: MediaQuery.of(context).size.height * 0.50, + width: MediaQuery.of(context).size.width * 0.84, 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,), - - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Icon(type == AuthMethodTypes.SMS - ? - 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; - 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! + + 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), + mobileNo + .toString() + .substring(mobileNo.toString().length - 3), textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - 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), + 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(), @@ -142,22 +143,23 @@ class SMSOTP { onSaved: (val) {}, validator: validateCodeDigit, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD2); + FocusScope.of(context) + .requestFocus(focusD2); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context).requestFocus(focusD2); - verifyAccountFormValue['digit1'] = val.trim(); + FocusScope.of(context) + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = + val.trim(); checkValue(); } }, ), ), Container( - width: dialogInputWidth, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, - - margin: EdgeInsets.symmetric(vertical: 2,horizontal:5), + width: SizeConfig.realScreenWidth * 0.16, + margin: EdgeInsets.all(5), child: TextFormField( focusNode: focusD2, textInputAction: TextInputAction.next, @@ -169,21 +171,23 @@ class SMSOTP { decoration: buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD3); + FocusScope.of(context) + .requestFocus(focusD3); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context).requestFocus(focusD3); - verifyAccountFormValue['digit2'] = val.trim(); + FocusScope.of(context) + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = + val.trim(); checkValue(); } }, validator: validateCodeDigit), ), Container( - margin: EdgeInsets.symmetric(vertical: 2,horizontal: 5), - width: dialogInputWidth, - height: SizeConfig.getHeightMultiplier(height:dialogHeight) * 30, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD3, textInputAction: TextInputAction.next, @@ -192,23 +196,26 @@ class SMSOTP { textAlign: TextAlign.center, style: buildTextStyle(), keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), + decoration: + buildInputDecoration(context), onSaved: (val) {}, onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD4); + FocusScope.of(context) + .requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - FocusScope.of(context).requestFocus(focusD4); - verifyAccountFormValue['digit3'] = val.trim(); + 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, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD4, maxLength: 1, @@ -216,13 +223,16 @@ class SMSOTP { style: buildTextStyle(), controller: digit4, keyboardType: TextInputType.number, - decoration: buildInputDecoration(context), + decoration: + buildInputDecoration(context), onFieldSubmitted: (_) { - FocusScope.of(context).requestFocus(focusD4); + FocusScope.of(context) + .requestFocus(focusD4); }, onChanged: (val) { if (val.length == 1) { - verifyAccountFormValue['digit4'] = val.trim(); + verifyAccountFormValue['digit4'] = + val.trim(); checkValue(); } }, @@ -231,46 +241,38 @@ class SMSOTP { )), ), ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).validationMessage! + ' ',textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - 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, - ) - ]) - ], + 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, + ) + ]), + ) + ], + ))), + ); + }), + ); + }); } TextStyle buildTextStyle() { return TextStyle( - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: SizeConfig.textMultiplier * 3, ); } @@ -279,15 +281,15 @@ class SMSOTP { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]!), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]!), + borderSide: BorderSide(color: Colors.grey[300]), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]!), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -297,7 +299,7 @@ class SMSOTP { } // ignore: missing_return - String? validateCodeDigit(value) { + String validateCodeDigit(value) { if (value.isEmpty) { return ' '; } else if (value.length == 3) { @@ -308,21 +310,28 @@ class SMSOTP { } checkValue() async { - if (verifyAccountForm.currentState!.validate()) { - onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString()); + if (verifyAccountForm.currentState.validate()) { + onSuccess(digit1.text.toString() + + digit2.text.toString() + + digit3.text.toString() + + digit4.text.toString()); this.isClosed = true; + } } getSecondsAsDigitalClock(int inputSeconds) { - var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param + var sec_num = + int.parse(inputSeconds.toString()); // don't forget the second param var hours = (sec_num / 3600).floor(); var minutes = ((sec_num - hours * 3600) / 60).floor(); var seconds = sec_num - hours * 3600 - minutes * 60; var minutesString = ""; var secondsString = ""; - minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString(); - secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString(); + minutesString = + minutes < 10 ? "0" + minutes.toString() : minutes.toString(); + secondsString = + seconds < 10 ? "0" + seconds.toString() : seconds.toString(); return minutesString + ":" + secondsString; } @@ -332,7 +341,7 @@ class SMSOTP { displayTime = this.getSecondsAsDigitalClock(this.remainingTime); }); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(Duration(seconds: 1), () { if (this.remainingTime > 0) { if (isClosed == false) { startTimer(setState); diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index cbd665ef..27dbe8bf 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -9,25 +9,26 @@ import 'package:provider/provider.dart'; class VerificationMethodsList extends StatefulWidget { final AuthMethodTypes authMethodType; - final Function(AuthMethodTypes type, bool isActive)? authenticateUser; - final GestureTapCallback? onShowMore; + final Function(AuthMethodTypes type, bool isActive) authenticateUser; + final Function onShowMore; final AuthenticationViewModel authenticationViewModel; const VerificationMethodsList( - {Key? key, - required this.authMethodType, + {Key key, + this.authMethodType, this.authenticateUser, this.onShowMore, - required this.authenticationViewModel}) + this.authenticationViewModel}) : super(key: key); @override - _VerificationMethodsListState createState() => _VerificationMethodsListState(); + _VerificationMethodsListState createState() => + _VerificationMethodsListState(); } class _VerificationMethodsListState extends State { final LocalAuthentication auth = LocalAuthentication(); - ProjectViewModel? projectsProvider; + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { @@ -37,46 +38,58 @@ class _VerificationMethodsListState extends State { case AuthMethodTypes.WhatsApp: return MethodTypeCard( assetPath: 'assets/images/verify-whtsapp.png', - onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, - label: TranslationBase.of(context).verifyWith! + "\n"+ TranslationBase.of(context).verifyWhatsApp!, + onTap: () => + {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, + label: TranslationBase + .of(context) + .verifyWith+ TranslationBase.of(context).verifyWhatsApp, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/verify-sms.png", - onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, - label: TranslationBase.of(context).verifyWith! + "\n"+ TranslationBase.of(context).verifySMS!, + onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, + label:TranslationBase + .of(context) + .verifyWith+ TranslationBase.of(context).verifySMS, ); break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( assetPath: 'assets/images/verification_fingerprint_icon.png', onTap: () async { - if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.fingerprint)) { - widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); + if (await widget.authenticationViewModel + .checkIfBiometricAvailable(BiometricType.fingerprint)) { + + widget.authenticateUser(AuthMethodTypes.Fingerprint, true); } }, - label: TranslationBase.of(context).verifyWith! + "\n"+TranslationBase.of(context).verifyFingerprint!, + label: TranslationBase + .of(context) + .verifyWith+TranslationBase.of(context).verifyFingerprint, ); break; case AuthMethodTypes.FaceID: return MethodTypeCard( assetPath: 'assets/images/verification_faceid_icon.png', onTap: () async { - if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.face)) { - widget.authenticateUser!(AuthMethodTypes.FaceID, true); + if (await widget.authenticationViewModel + .checkIfBiometricAvailable(BiometricType.face)) { + widget.authenticateUser(AuthMethodTypes.FaceID, true); } }, - label: TranslationBase.of(context).verifyWith! + "\n"+TranslationBase.of(context).verifyFaceID!, + label: TranslationBase + .of(context) + .verifyWith+TranslationBase.of(context).verifyFaceID, ); break; default: return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', - onTap: widget.onShowMore!, - label: TranslationBase.of(context).moreVerification!, - // height: 40, + onTap: widget.onShowMore, + label: TranslationBase.of(context).moreVerification, + height: 0, ); } } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart new file mode 100644 index 00000000..aa532306 --- /dev/null +++ b/lib/widgets/charts/app_bar_chart.dart @@ -0,0 +1,43 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:flutter/material.dart'; + +class AppBarChart extends StatelessWidget { + const AppBarChart({ + Key key, + @required this.seriesList, + }) : super(key: key); + + final List seriesList; + + @override + Widget build(BuildContext context) { + return Container( + height: 400, + margin: EdgeInsets.only(top: 60), + child: charts.BarChart( + seriesList, + // animate: animate, + + /// Customize the primary measure axis using a small tick renderer. + /// Use String instead of num for ordinal domain axis + /// (typically bar charts). + primaryMeasureAxis: new charts.NumericAxisSpec( + renderSpec: new charts.GridlineRendererSpec( + // Display the measure axis labels below the gridline. + // + // 'Before' & 'after' follow the axis value direction. + // Vertical axes draw 'before' below & 'after' above the tick. + // Horizontal axes draw 'before' left & 'after' right the tick. + labelAnchor: charts.TickLabelAnchor.before, + + // Left justify the text in the axis. + // + // Note: outside means that the secondary measure axis would right + // justify. + labelJustification: + charts.TickLabelJustification.outside, + )), + ), + ); + } +} diff --git a/lib/widgets/charts/app_line_chart.dart b/lib/widgets/charts/app_line_chart.dart index e3265595..1a29b1e6 100644 --- a/lib/widgets/charts/app_line_chart.dart +++ b/lib/widgets/charts/app_line_chart.dart @@ -15,9 +15,9 @@ class AppLineChart extends StatelessWidget { final bool stacked; AppLineChart( - {Key? key, - required this.seriesList, - required this.chartTitle, + {Key key, + @required this.seriesList, + this.chartTitle, this.animate = true, this.includeArea = false, this.stacked = true}); @@ -33,7 +33,9 @@ class AppLineChart extends StatelessWidget { ), Expanded( child: charts.LineChart(seriesList, - defaultRenderer: charts.LineRendererConfig(includeArea: false, stacked: true), animate: animate), + defaultRenderer: charts.LineRendererConfig( + includeArea: false, stacked: true), + animate: animate), ), ], ), diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index eed6289f..670284a1 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -12,11 +12,11 @@ import 'package:flutter/material.dart'; /// [endDate] the end date class AppTimeSeriesChart extends StatelessWidget { AppTimeSeriesChart({ - Key? key, - required this.seriesList, + Key key, + @required this.seriesList, this.chartName = '', - required this.startDate, - required this.endDate, + this.startDate, + this.endDate, }); final String chartName; @@ -41,7 +41,8 @@ class AppTimeSeriesChart extends StatelessWidget { behaviors: [ charts.RangeAnnotation( [ - charts.RangeAnnotationSegment(startDate, endDate, charts.RangeAnnotationAxisType.domain), + charts.RangeAnnotationSegment(startDate, endDate, + charts.RangeAnnotationAxisType.domain ), ], ), ], diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart new file mode 100644 index 00000000..ff9db962 --- /dev/null +++ b/lib/widgets/dashboard/activity_button.dart @@ -0,0 +1,44 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class GetActivityButton extends StatelessWidget { + final value; + + GetActivityButton(this.value); + + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.height * 0.125, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + ), + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + value.value.toString(), + fontSize: 27, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 10, + color: Color(0xFF2B353E), + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/dashboard/activity_card.dart b/lib/widgets/dashboard/activity_card.dart deleted file mode 100644 index 30e889f8..00000000 --- a/lib/widgets/dashboard/activity_card.dart +++ /dev/null @@ -1,50 +0,0 @@ -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 GetActivityCard extends StatelessWidget { - final value; - - GetActivityCard(this.value); - - @override - Widget build(BuildContext context) { - 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), - margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(8,8, 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), - letterSpacing: -0.93, - ), - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - letterSpacing: -0.33, - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart new file mode 100644 index 00000000..659e4562 --- /dev/null +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -0,0 +1,66 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../shared/app_texts_widget.dart'; +import '../shared/rounded_container_widget.dart'; + +class DashboardItemTexts extends StatefulWidget { + final String label; + final String value; + final Color backgroundColor; + final bool showBorder; + final Color borderColor; + +// OWNER : Ibrahim albitar +// DATE : 05-04-2020 +// DESCRIPTION : Custom widget for dashboard items has texts widgets + + DashboardItemTexts(this.label, this.value, + {this.backgroundColor = Colors.white, + this.showBorder = false, + this.borderColor = Colors.white}); + + @override + _DashboardItemTextsState createState() => _DashboardItemTextsState(); +} + +class _DashboardItemTextsState extends State { + ProjectViewModel projectsProvider; + @override + Widget build(BuildContext context) { + projectsProvider = Provider.of(context); + return new RoundedContainer( + child: Stack( + children: [ + Align( + alignment: projectsProvider.isArabic + ? FractionalOffset.topRight + : FractionalOffset.topLeft, + child: Container( + margin: EdgeInsets.all(5), + child: AppText( + widget.label, + fontSize: 12, + ), + )), + Align( + alignment: projectsProvider.isArabic + ? FractionalOffset.bottomLeft + : FractionalOffset.bottomRight, + child: Container( + margin: EdgeInsets.all(10), + child: AppText( + widget.value, + fontWeight: FontWeight.bold, + ), + )), + ], + ), + backgroundColor: widget.backgroundColor, + showBorder: widget.showBorder, + borderColor: widget.borderColor, + margin: EdgeInsets.all(4), + ); + } +} diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index 1980fe61..6769c568 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -1,9 +1,10 @@ + import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; class GaugeChart extends StatelessWidget { final List seriesList; - final bool? animate; + final bool animate; GaugeChart(this.seriesList, {this.animate}); @@ -18,16 +19,19 @@ class GaugeChart extends StatelessWidget { @override Widget build(BuildContext context) { return new charts.PieChart(seriesList, - animate: animate, defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); + animate: animate, + defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); //); } static List> _createSampleData() { final data = [ new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment('Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment( + 'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment('Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment( + 'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), ]; return [ diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 049f3fd8..fe05d69d 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,7 +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/screens/home/label.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -12,37 +9,22 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { - double barHeight = - SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); - value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!); + value.summaryoptions + .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); - var list = []; - value.summaryoptions.forEach((result) => {list.add(getStack(result, value.summaryoptions.first.value, context, barHeight)) - }); + var list = new List(); + value.summaryoptions.forEach((result) => + {list.add(getStack(result, value.summaryoptions.first.value,context))}); 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), - firstLineFontSize: - SizeConfig.getHeightMultiplier(height: barHeight) * - (SizeConfig.isHeightVeryShort - ? 10 - : SizeConfig.isHeightShort - ? 10 - : 8.5), - secondLineFontSize: - SizeConfig.getHeightMultiplier(height: barHeight) * - (SizeConfig.isHeightVeryShort - ? 15 - : SizeConfig.isHeightShort - ? 15 - : 14.5), + height: 30, + child: AppText( + value.kPIName, + medium: true, + fontSize: 14, ), ), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) @@ -50,18 +32,19 @@ class GetOutPatientStack extends StatelessWidget { ); } - getStack(Summaryoptions value, max, context, barHeight) { + getStack(Summaryoptions value, max,context) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, - end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[50]!], // red to yellow + end: Alignment( + 0.0, 1.0), // 10% of the width, so there are ten blinds. + colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(8), // color: Colors.red[50], ), child: Stack(children: [ @@ -72,15 +55,15 @@ class GetOutPatientStack extends StatelessWidget { child: Container( child: SizedBox(), padding: EdgeInsets.all(10), - height: max != 0 ? ((barHeight) * value.value!) / max : 0, + height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(8), color: Color(0x63D02127), ), ), ), Container( - height: barHeight, + height: (MediaQuery.of(context).size.height * 0.24 ), margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( @@ -92,18 +75,16 @@ class GetOutPatientStack extends StatelessWidget { children: [ AppText( value.kPIParameter, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + fontSize: 10, textAlign: TextAlign.center, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, - letterSpacing: -0.3, ), AppText( ' (' + value.value.toString() + ') ', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + fontSize: 12, textAlign: TextAlign.center, color: Color(0xFF2B353E), - letterSpacing: -0.3, fontWeight: FontWeight.bold, ), ], @@ -115,5 +96,4 @@ class GetOutPatientStack extends StatelessWidget { ), ); } - } diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index ce401b2f..a22932f4 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -1,17 +1,15 @@ -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 RowCounts extends StatelessWidget { final name; final int count; - final double? height; final Color c; - RowCounts(this.name, this.count, this.c, {this.height}); + RowCounts(this.name, this.count, this.c); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2), + padding: EdgeInsets.only(top: 5, bottom: 5), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -26,7 +24,7 @@ class RowCounts extends StatelessWidget { name, color: Colors.black, textAlign: TextAlign.start, // from TextAlign.center - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + fontSize: 11, textOverflow: TextOverflow.ellipsis, ), ), @@ -34,7 +32,7 @@ class RowCounts extends StatelessWidget { ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: 12, fontWeight: FontWeight.bold, ) ], @@ -47,8 +45,8 @@ class RowCounts extends StatelessWidget { Widget dot(Color c) { return Container( - padding: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 2), - margin: EdgeInsets.all(SizeConfig.getHeightMultiplier(height:height )* 1), + padding: EdgeInsets.all(5.0), + margin: EdgeInsets.all(5.0), decoration: BoxDecoration(color: c, shape: BoxShape.circle)); } } diff --git a/lib/widgets/dashboard/swiper_rounded_pagination.dart b/lib/widgets/dashboard/swiper_rounded_pagination.dart index c0360d96..7e5c2c70 100644 --- a/lib/widgets/dashboard/swiper_rounded_pagination.dart +++ b/lib/widgets/dashboard/swiper_rounded_pagination.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; class SwiperRoundedPagination extends StatelessWidget { @@ -8,14 +7,15 @@ class SwiperRoundedPagination extends StatelessWidget { Widget build(BuildContext context) { return active == true ? Container( - height: SizeConfig.heightMultiplier * .6, - width: SizeConfig.widthMultiplier * 6, + height: 5, + width: 30, + // margin: EdgeInsets.only(10), decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), color: Colors.black), ) : Container( - height: SizeConfig.heightMultiplier * .6, - width: SizeConfig.widthMultiplier * 2, + height: 5, + width: 8, margin: EdgeInsets.all(2), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.grey)); diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart index 4361749c..c11af999 100644 --- a/lib/widgets/data_display/list/custom_Item.dart +++ b/lib/widgets/data_display/list/custom_Item.dart @@ -27,17 +27,17 @@ class CustomItem extends StatelessWidget { final BoxDecoration decoration; CustomItem( - {Key? key, - required this.startIcon, + {Key key, + this.startIcon, this.disabled: false, - required this.onTap, - required this.startIconColor, + this.onTap, + this.startIconColor, this.endIcon = EvaIcons.chevronRight, - required this.padding, - required this.child, - required this.endIconColor, + this.padding, + this.child, + this.endIconColor, this.endIconSize = 20, - required this.decoration, + this.decoration, this.startIconSize = 19}) : super(key: key); @@ -52,7 +52,9 @@ class CustomItem extends StatelessWidget { if (onTap != null) onTap(); }, child: Padding( - padding: padding != null ? padding : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), + padding: padding != null + ? padding + : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), child: Row( children: [ if (startIcon != null) @@ -75,7 +77,9 @@ class CustomItem extends StatelessWidget { flex: 1, child: Icon( endIcon, - color: endIconColor != null ? endIconColor : Colors.grey[500], + color: endIconColor != null + ? endIconColor + : Colors.grey[500], size: endIconSize, ), ) diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index 7faf32b4..a35fa279 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - /// Flexible container widget /// [widthFactor] If non-null, the fraction of the incoming width given to the child. /// If non-null, the child is given a tight width constraint that is the max @@ -15,15 +14,15 @@ import 'package:flutter/material.dart'; class FlexibleContainer extends StatelessWidget { final double widthFactor; final double heightFactor; - final EdgeInsets? padding; + final EdgeInsets padding; final Widget child; FlexibleContainer({ - Key? key, + Key key, this.widthFactor = 0.9, this.heightFactor = 1, this.padding, - required this.child, + this.child, }) : super(key: key); @override @@ -39,7 +38,8 @@ class FlexibleContainer extends StatelessWidget { padding: padding, width: double.infinity, decoration: BoxDecoration( - border: Border.all(color: Theme.of(context).dividerColor, width: 2.0), + border: Border.all( + color: Theme.of(context).dividerColor, width: 2.0), borderRadius: BorderRadius.circular(8.0)), child: child, ), diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index f7a23925..58718373 100644 --- a/lib/widgets/dialog/AskPermissionDialog.dart +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -10,7 +10,7 @@ class AskPermissionDialog extends StatefulWidget { final String type; final Function onTapGrant; - AskPermissionDialog({required this.type, required this.onTapGrant}); + AskPermissionDialog({this.type, this.onTapGrant}); @override _AskPermissionDialogState createState() => _AskPermissionDialogState(); diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index 0a63a4e3..c4343a4b 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResultWidget extends StatefulWidget { final List labResult; - LabResultWidget({Key? key, required this.labResult}); + LabResultWidget({Key key, this.labResult}); @override _LabResultWidgetState createState() => _LabResultWidgetState(); @@ -41,7 +41,9 @@ class _LabResultWidgetState extends State { _showDetails = !_showDetails; }); }, - child: Icon(_showDetails ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + child: Icon(_showDetails + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), ], ), Divider( @@ -82,7 +84,9 @@ class _LabResultWidgetState extends State { child: Container( color: HexColor('#515B5D'), child: Center( - child: AppText(TranslationBase.of(context).value, color: Colors.white), + child: AppText( + TranslationBase.of(context).value, + color: Colors.white), ), height: 60), ), @@ -95,7 +99,9 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: AppText(TranslationBase.of(context).range, color: Colors.white), + child: AppText( + TranslationBase.of(context).range, + color: Colors.white), ), height: 60), ), @@ -108,7 +114,8 @@ class _LabResultWidgetState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), border: Border( - bottom: BorderSide(color: Colors.grey, width: 0.5), + bottom: + BorderSide(color: Colors.grey, width: 0.5), top: BorderSide(color: Colors.grey, width: 0.5), left: BorderSide(color: Colors.grey, width: 0.5), right: BorderSide(color: Colors.grey, width: 0.5), @@ -139,14 +146,17 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: AppText('${result.resultValue}', color: Colors.grey[800]), + child: AppText('${result.resultValue}', + color: Colors.grey[800]), ), height: 60), ), Expanded( child: Container( child: Center( - child: AppText('${result.referenceRange}', color: Colors.grey[800]), + child: AppText( + '${result.referenceRange}', + color: Colors.grey[800]), ), height: 60), ), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index e6469186..453cff30 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import '../shared/text_fields/TextFields.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; @@ -19,25 +19,27 @@ class MyReferralPatientWidget extends StatefulWidget { final Function expandClick; MyReferralPatientWidget( - {Key? key, - required this.myReferralPatientModel, - required this.model, - required this.isExpand, - required this.expandClick}); + {Key key, + this.myReferralPatientModel, + this.model, + this.isExpand, + this.expandClick}); @override - _MyReferralPatientWidgetState createState() => _MyReferralPatientWidgetState(); + _MyReferralPatientWidgetState createState() => + _MyReferralPatientWidgetState(); } class _MyReferralPatientWidgetState extends State { bool _isLoading = false; final _formKey = GlobalKey(); - late String error; - late TextEditingController answerController; + String error; + TextEditingController answerController; @override void initState() { - answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); + answerController = new TextEditingController( + text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); super.initState(); } @@ -63,7 +65,8 @@ class _MyReferralPatientWidgetState extends State { headerWidget: Column( children: [ Container( - padding: EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -73,7 +76,8 @@ class _MyReferralPatientWidgetState extends State { children: [ Container( color: Color(0xFFB8382C), - padding: EdgeInsets.symmetric(vertical: 4, horizontal: 4), + padding: EdgeInsets.symmetric( + vertical: 4, horizontal: 4), child: AppText( '${widget.myReferralPatientModel.priorityDescription}', fontSize: 1.7 * SizeConfig.textMultiplier, @@ -120,9 +124,10 @@ class _MyReferralPatientWidgetState extends State { ), ), Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + margin: + EdgeInsets.symmetric(horizontal: 8, vertical: 8), child: InkWell( - onTap: widget.expandClick(), + onTap: widget.expandClick, child: Image.asset( "assets/images/ic_circle_arrow.png", width: 25, @@ -151,7 +156,8 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -248,7 +254,8 @@ class _MyReferralPatientWidgetState extends State { ), Container( height: 1.8 * SizeConfig.textMultiplier * 6, - padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -316,7 +323,7 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime!)}', + '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}', fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.normal, textAlign: TextAlign.start, @@ -344,7 +351,8 @@ class _MyReferralPatientWidgetState extends State { height: 10, ), Container( - padding: EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), + padding: + EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), child: Expanded( child: Row( children: [ @@ -357,7 +365,8 @@ class _MyReferralPatientWidgetState extends State { ), SizedBox( child: AppText( - TranslationBase.of(context).clinicDetailsandRemarks, + TranslationBase.of(context) + .clinicDetailsandRemarks, fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, textAlign: TextAlign.start, @@ -405,12 +414,13 @@ class _MyReferralPatientWidgetState extends State { controller: answerController, maxLines: 3, minLines: 2, - hintText: TranslationBase.of(context).answerThePatient ?? "", + hintText: TranslationBase.of(context).answerThePatient, fontWeight: FontWeight.normal, readOnly: _isLoading, validator: (value) { if (value.isEmpty) - return TranslationBase.of(context).pleaseEnterAnswer; + return TranslationBase.of(context) + .pleaseEnterAnswer; else return null; }, @@ -421,13 +431,16 @@ class _MyReferralPatientWidgetState extends State { width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), child: AppButton( - title: TranslationBase.of(context).replay, + title : TranslationBase.of(context).replay, onPressed: () async { final form = _formKey.currentState; - if (form!.validate()) { + if (form.validate()) { try { - await widget.model.replay(answerController.text.toString(), widget.myReferralPatientModel); - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).replySuccessfully); + await widget.model.replay( + answerController.text.toString(), + widget.myReferralPatientModel); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).replySuccessfully); } catch (e) { DrAppToastMsg.showErrorToast(e); } diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index e7a571c5..54df8cd9 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -12,13 +12,13 @@ import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { final ListDoctorWorkingHoursTable workingHoursTable; - MyScheduleWidget({Key? key, required this.workingHoursTable}); + MyScheduleWidget({Key key, this.workingHoursTable}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); List workingHours = Helpers.getWorkingHours( - workingHoursTable.workingHours!, + workingHoursTable.workingHours, ); return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -33,15 +33,13 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - projectViewModel.isArabic - ? AppDateUtils.getWeekDayArabic(workingHoursTable.date!.weekday) - : AppDateUtils.getWeekDay(workingHoursTable.date!.weekday), + projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( - ' ${workingHoursTable.date!.day} ${(AppDateUtils.getMonth(workingHoursTable.date!.month).toString().substring(0, 3))}', + ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -53,14 +51,15 @@ class MyScheduleWidget extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( - bgColor: AppDateUtils.isToday(workingHoursTable.date!) ? Colors.green[500]! : Colors.transparent, - + bgColor: AppDateUtils.isToday(workingHoursTable.date) + ? Colors.green[500] + : Colors.transparent, // hasBorder: false, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (AppDateUtils.isToday(workingHoursTable.date!)) + if (AppDateUtils.isToday(workingHoursTable.date)) AppText( "Today", fontSize: 1.8 * SizeConfig.textMultiplier, @@ -75,33 +74,33 @@ class MyScheduleWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: workingHours.map((work) { return Container( - margin: EdgeInsets.only(bottom: workingHours.length > 1 ? 15 : 0), + margin: EdgeInsets.only(bottom:workingHours.length>1? 15:0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 5, ), - if (workingHoursTable.clinicName != null) - AppText( - workingHoursTable.clinicName ?? "", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if(workingHoursTable.clinicName!=null) + AppText( + workingHoursTable.clinicName??"", + fontSize: 15, + fontWeight: FontWeight.w700, + ), Container( - width: MediaQuery.of(context).size.width * 0.55, + width: MediaQuery.of(context).size.width*0.55, child: AppText( - '${work.from} - ${work.to}', + '${work.from} - ${work.to}', fontSize: 15, fontWeight: FontWeight.w300, ), ), - if (workingHoursTable.projectName != null) - AppText( - workingHoursTable.projectName ?? "", - fontSize: 15, - fontWeight: FontWeight.w700, - ), + if(workingHoursTable.projectName!=null) + AppText( + workingHoursTable.projectName??"", + fontSize: 15, + fontWeight: FontWeight.w700, + ), ], ), ); diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index 482a251b..f4f78c08 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -18,11 +18,11 @@ import '../shared/rounded_container_widget.dart'; */ class MedicineItemWidget extends StatefulWidget { - final String? label; + final String label; final Color backgroundColor; final bool showBorder; final Color borderColor; - final String? url; + final String url; MedicineItemWidget( {@required this.label, @@ -52,7 +52,7 @@ class _MedicineItemWidgetState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.network( - widget.url!, + widget.url, height: SizeConfig.imageSizeMultiplier * 15, width: SizeConfig.imageSizeMultiplier * 15, fit: BoxFit.cover, @@ -62,7 +62,9 @@ class _MedicineItemWidgetState extends State { Expanded( child: Padding( padding: EdgeInsets.all(5), - child: Align(alignment: Alignment.centerLeft, child: AppText(widget.label)))), + child: Align( + alignment: Alignment.centerLeft, + child: AppText(widget.label)))), Icon(EvaIcons.eye) ], ), diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart new file mode 100644 index 00000000..c903bd7b --- /dev/null +++ b/lib/widgets/patients/clinic_list_dropdwon.dart @@ -0,0 +1,99 @@ +// ignore: must_be_immutable +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/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 ClinicList extends StatelessWidget { + + ProjectViewModel projectsProvider; + final int clinicId; + final Function (int value) onClinicChange; + + ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); + + @override + Widget build(BuildContext context) { + // authProvider = Provider.of(context); + + projectsProvider = Provider.of(context); + return Container( + child: + projectsProvider + .doctorClinicsList.length > + 0 + ? FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width *0.8, + child: Center( + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: + Colors.white, + iconEnabledColor: + Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[ + 0] + .clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors + .black, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue){ + onClinicChange(newValue); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: + TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + ), + ), + ], + ), + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart new file mode 100644 index 00000000..d2a68acd --- /dev/null +++ b/lib/widgets/patients/dynamic_elements.dart @@ -0,0 +1,163 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; + +class DynamicElements extends StatefulWidget { + final PatientModel _patientSearchFormValues; + final bool isFormSubmitted; + DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); + @override + _DynamicElementsState createState() => _DynamicElementsState(); +} + +class _DynamicElementsState extends State { + TextEditingController _toDateController = new TextEditingController(); + TextEditingController _fromDateController = new TextEditingController(); + void _presentDatePicker(id) { + showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2019), + lastDate: DateTime.now(), + ).then((pickedDate) { + if (pickedDate == null) { + return; + } + setState(() { + print(id); + var selectedDate = DateFormat.yMd().format(pickedDate); + + if (id == '_selectedFromDate') { + // _fromDateController.text = selectedDate; + selectedDate = pickedDate.year.toString() + + "-" + + pickedDate.month.toString().padLeft(2, '0') + + "-" + + pickedDate.day.toString().padLeft(2, '0'); + + _fromDateController.text = selectedDate; + } else { + selectedDate = pickedDate.year.toString() + + "-" + + pickedDate.month.toString().padLeft(2, '0') + + "-" + + pickedDate.day.toString().padLeft(2, '0'); + + _toDateController.text = selectedDate; + // _toDateController.text = selectedDate; + } + }); + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + InputDecoration textFieldSelectorDecoration( + {String hintText, + String selectedText, + bool isDropDown, + IconData icon}) { + 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 ? Icon(icon ?? Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + return LayoutBuilder( + builder: (ctx, constraints) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + borderColor: Colors.white, + onTap: () => _presentDatePicker('_selectedFromDate'), + hintText: TranslationBase.of(context).fromDate, + controller: _fromDateController, + inputFormatter: ONLY_DATE, + onSaved: (value) { + if (_fromDateController.text.toString().trim().isEmpty) { + widget._patientSearchFormValues.From = "0"; + } else { + widget._patientSearchFormValues.From = + _fromDateController.text.replaceAll("/", "-"); + } + }, + readOnly: true, + )), + SizedBox( + height: 5, + ), + if (widget._patientSearchFormValues.From == "0" && + widget.isFormSubmitted) + CustomValidationError(), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6.0))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + readOnly: true, + borderColor: Colors.white, + hintText: TranslationBase.of(context).toDate, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onSaved: (value) { + if (_toDateController.text.toString().trim().isEmpty) { + widget._patientSearchFormValues.To = "0"; + } else { + widget._patientSearchFormValues.To = + _toDateController.text.replaceAll("/", "-"); + } + }, + )), + if (widget._patientSearchFormValues.To == "0" && + widget.isFormSubmitted) + CustomValidationError(), + SizedBox( + height: 10, + ), + ], + ); + }, + ); + } +} diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 1ef79976..ff1cb256 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,30 +1,32 @@ 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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { - final String? referralStatus; - final int? referralStatusCode; - final String? patientName; - final int? patientGender; - final String? referredDate; - final String? referredTime; - final String? patientID; + final String referralStatus; + final int referralStatusCode; + final String patientName; + final int patientGender; + final String referredDate; + final String referredTime; + final String patientID; final isSameBranch; - final bool? isReferral; - final bool? isReferralClinic; - final String? referralClinic; - final String? remark; - final String? nationality; - final String? nationalityFlag; - final String? doctorAvatar; - final String? referralDoctorName; - final String? clinicDescription; - final Widget? infoIcon; + final bool isReferral; + final bool isReferralClinic; + final String referralClinic; + final String remark; + final String nationality; + final String nationalityFlag; + final String doctorAvatar; + final String referralDoctorName; + final String clinicDescription; + final Widget infoIcon; PatientReferralItemWidget( {this.referralStatus, @@ -48,6 +50,8 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), child: Column( @@ -89,7 +93,7 @@ class PatientReferralItemWidget extends StatelessWidget { : Colors.red[900], ), AppText( - referredDate ?? '', + referredDate, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -102,7 +106,7 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Expanded( child: AppText( - patientName ?? '', + patientName, fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, color: Colors.black, @@ -125,7 +129,7 @@ class PatientReferralItemWidget extends StatelessWidget { width: 4, ), AppText( - referredTime ?? '', + referredTime, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -151,7 +155,7 @@ class PatientReferralItemWidget extends StatelessWidget { color: Color(0XFF575757), ), AppText( - patientID!, + patientID, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -176,11 +180,12 @@ class PatientReferralItemWidget extends StatelessWidget { Expanded( child: AppText( !isReferralClinic - ! ? isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch - : " " + referralClinic!, + ? TranslationBase.of(context) + .sameBranch + : TranslationBase.of(context) + .otherBranch + : " " + referralClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -195,7 +200,7 @@ class PatientReferralItemWidget extends StatelessWidget { Row( children: [ AppText( - nationality != null ? nationality! : "", + nationality != null ? nationality : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), fontSize: 1.4 * SizeConfig.textMultiplier, @@ -204,10 +209,12 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - nationalityFlag!, + nationalityFlag, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { return Text(''); }, )) @@ -221,7 +228,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks ?? "" + " : ", + TranslationBase.of(context).remarks + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -245,7 +252,7 @@ class PatientReferralItemWidget extends StatelessWidget { Container( margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( - isReferral! + isReferral ? 'assets/images/patient/ic_ref_arrow_up.png' : 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -253,7 +260,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only( + left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, @@ -262,10 +270,12 @@ class PatientReferralItemWidget extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - doctorAvatar!, + doctorAvatar, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { return Text('No Image'); }, )) @@ -282,12 +292,13 @@ class PatientReferralItemWidget extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only( + left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName ?? '', + referralDoctorName, fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -295,7 +306,7 @@ class PatientReferralItemWidget extends StatelessWidget { ), if (clinicDescription != null) AppText( - clinicDescription!, + clinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.4 * SizeConfig.textMultiplier, @@ -307,7 +318,10 @@ class PatientReferralItemWidget extends StatelessWidget { ), ], ), - Container(width: double.infinity, alignment: Alignment.centerRight, child: infoIcon ?? Container()) + Container( + width: double.infinity, + alignment: Alignment.centerRight, + child: infoIcon ?? Container()) ], ), // onTap: onTap, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 65876517..ea3a0940 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -16,7 +16,7 @@ import 'ShowTimer.dart'; class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; - final GestureTapCallback onTap; + final Function onTap; final String patientType; final String arrivalType; final bool isInpatient; @@ -25,12 +25,12 @@ class PatientCard extends StatelessWidget { final bool isFromLiveCare; PatientCard( - {Key? key, - required this.patientInfo, - required this.onTap, - required this.patientType, - required this.arrivalType, - required this.isInpatient, + {Key key, + this.patientInfo, + this.onTap, + this.patientType, + this.arrivalType, + this.isInpatient, this.isMyPatient = false, this.isFromSearch = false, this.isFromLiveCare = false}) @@ -38,10 +38,10 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - String? nationalityName = patientInfo.nationalityName != null - ? patientInfo.nationalityName!.trim() + String nationalityName = patientInfo.nationalityName != null + ? patientInfo.nationalityName.trim() : patientInfo.nationality != null - ? patientInfo.nationality!.trim() + ? patientInfo.nationality.trim() : patientInfo.nationalityId != null ? patientInfo.nationalityId @@ -63,15 +63,15 @@ class PatientCard extends StatelessWidget { bgColor: isFromLiveCare ? Colors.white : (isMyPatient && !isFromSearch) - ? Colors.green[500]! + ? Colors.green[500] : patientInfo.patientStatusType == 43 - ? Colors.green[500]! + ? Colors.green[500] : isMyPatient - ? Colors.green[500]! + ? Colors.green[500] : isInpatient ? Colors.white : !isFromSearch - ? Colors.red[800]! + ? Colors.red[800] : Colors.white, widget: Container( color: Colors.white, @@ -92,7 +92,8 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context).arrivedP, + TranslationBase.of(context) + .arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -112,8 +113,12 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 ? 'Confirmed' : 'Booked', - color: patientInfo.status == 2 ? Colors.green : Colors.grey, + patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? Colors.green + : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, @@ -124,7 +129,8 @@ class PatientCard extends StatelessWidget { ? Row( children: [ AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context) + .notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -144,19 +150,27 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 ? 'Confirmed' : 'Booked', - color: patientInfo.status == 2 ? Colors.green : Colors.grey, + patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? Colors.green + : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), ], ) - : !isFromSearch && !isFromLiveCare && patientInfo.patientStatusType == null + : !isFromSearch && + !isFromLiveCare && + patientInfo.patientStatusType == + null ? Row( children: [ AppText( - TranslationBase.of(context).notArrived, + TranslationBase.of(context) + .notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -176,8 +190,13 @@ class PatientCard extends StatelessWidget { width: 8, ), AppText( - patientInfo.status == 2 ? 'Booked' : 'Confirmed', - color: patientInfo.status == 2 ? Colors.grey : Colors.green, + patientInfo.status == 2 + ? 'Booked' + : 'Confirmed', + color: + patientInfo.status == 2 + ? Colors.grey + : Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -187,27 +206,33 @@ class PatientCard extends StatelessWidget { : SizedBox(), this.arrivalType == '1' ? AppText( - patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes, + patientInfo.startTime != null + ? patientInfo.startTime + : patientInfo.startTimes, fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null ? AppText( - AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.arrivedOn ?? "", + AppDateUtils.getDayMonthYearDate( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, )) + " " + - "${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", + "${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, ) - : (patientInfo.appointmentDate != null && - patientInfo.appointmentDate!.isNotEmpty) + : (patientInfo.appointmentDate != + null && + patientInfo + .appointmentDate.isNotEmpty) ? AppText( "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.appointmentDate ?? "", - ))} ${AppDateUtils.getStartTime(patientInfo.startTime ?? "")}", + patientInfo.appointmentDate, + ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, fontSize: 15, @@ -242,37 +267,41 @@ class PatientCard extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.start,children: [ - Expanded( - // width: MediaQuery.of(context).size.width*0.51, - child: AppText( - isFromLiveCare - ? Helpers.capitalize(patientInfo.fullName) - : (Helpers.capitalize(patientInfo.firstName) + - " " + - Helpers.capitalize(patientInfo.lastName)), - fontSize: 16, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, - ), - ), - if (patientInfo.gender == 1) - Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - else - Icon( - DoctorApp.female_1, - color: Colors.pink, - -), if (isFromLiveCare) - ShowTimer( - patientInfo: patientInfo, - ), - ]), + MainAxisAlignment.start, + children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + isFromLiveCare + ? Helpers.capitalize( + patientInfo.fullName) + : (Helpers.capitalize( + patientInfo.firstName) + + " " + + Helpers.capitalize( + patientInfo.lastName)), + fontSize: 16, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), + ), + if (patientInfo.gender == 1) + Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + else + Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + if (isFromLiveCare) + ShowTimer( + patientInfo: patientInfo, + ), + ]), ), Expanded( child: Row( @@ -283,7 +312,7 @@ class PatientCard extends StatelessWidget { child: Container( alignment: Alignment.centerRight, child: AppText( - nationalityName!.truncate(14), + nationalityName.truncate(14), fontWeight: FontWeight.bold, fontSize: 14, textOverflow: TextOverflow.ellipsis, @@ -352,16 +381,16 @@ class PatientCard extends StatelessWidget { ), CustomRow( label: - TranslationBase.of(context).age! + " : ", + TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) CustomRow( label: patientInfo.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate! + + .admissionDate + " : ", value: patientInfo.admissionDate == null ? "" @@ -370,22 +399,22 @@ class PatientCard extends StatelessWidget { if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .numOfDays! + + .numOfDays + " : ", value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", ), if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .clinicName! + + .clinicName + " : ", value: "${patientInfo.clinicDescription}", ), if (patientInfo.admissionDate != null) CustomRow( label: - TranslationBase.of(context).roomNo! + + TranslationBase.of(context).roomNo + " : ", value: "${patientInfo.roomId}", ), @@ -394,9 +423,9 @@ class PatientCard extends StatelessWidget { children: [ CustomRow( label: TranslationBase.of(context) - .clinic! + + .clinic + " : ", - value: patientInfo!.clinicName!, + value: patientInfo.clinicName, ), ], ), @@ -424,29 +453,36 @@ class PatientCard extends StatelessWidget { ], ) : !isInpatient && !isFromSearch - ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - padding: EdgeInsets.all(4), - child: Image.asset( - patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' - : patientInfo.appointmentType == 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', - height: 25, - width: 35, - )), - ]) - : (isInpatient == true) - ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ Container( padding: EdgeInsets.all(4), child: Image.asset( - 'assets/images/inpatient.png', + patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == + 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', height: 25, width: 35, )), ]) + : (isInpatient == true) + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + 'assets/images/inpatient.png', + height: 25, + width: 35, + )), + ]) : SizedBox() ], ), diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index 022571fa..b769588b 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -9,7 +9,7 @@ class ShowTimer extends StatefulWidget { const ShowTimer({ - Key? key, required this.patientInfo, + Key key, this.patientInfo, }) : super(key: key); @override @@ -50,7 +50,7 @@ class _ShowTimerState extends State { generateShowTimerString() { DateTime now = DateTime.now(); - DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!); + DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); String timer = AppDateUtils.differenceBetweenDateAndCurrent( liveCareDate, context, isShowSecond: true, isShowDays: false); diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 2bbb36a2..073a6d51 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -9,35 +9,35 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class PatientProfileButton extends StatelessWidget { - final String? nameLine1; - final String? nameLine2; + final String nameLine1; + final String nameLine2; final String icon; final dynamic route; final PatiantInformtion patient; final String patientType; String arrivalType; final bool isInPatient; - String? from; - String? to; + String from; + String to; final String url = "assets/images/"; final bool isDisable; final bool isLoading; - final GestureTapCallback? onTap; + final Function onTap; final bool isDischargedPatient; final bool isSelectInpatient; final bool isDartIcon; - final IconData? dartIcon; - final bool? isFromLiveCare; - final Color? color; + final IconData dartIcon; + final bool isFromLiveCare; + final Color color; PatientProfileButton({ - Key? key, - required this.patient, - required this.patientType, - required this.arrivalType, - this.nameLine1, - this.nameLine2, - required this.icon, + Key key, + this.patient, + this.patientType, + this.arrivalType, + this.nameLine1, + this.nameLine2, + this.icon, this.route, this.isDisable = false, this.onTap, diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart new file mode 100644 index 00000000..e0eb5b12 --- /dev/null +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/material.dart'; + +import './profile_general_info_content_widget.dart'; +import '../../../config/size_config.dart'; +import '../../shared/rounded_container_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:21/4/2020 + *@param: + *@return: ProfileGeneralInfoWidget + *@desc: Profile General Info Widget class + */ +class ProfileGeneralInfoWidget extends StatelessWidget { + ProfileGeneralInfoWidget({Key key, this.patient}) : super(key: key); + + PatiantInformtion patient; + + @override + Widget build(BuildContext context) { + // PatientsProvider patientsProv = Provider.of(context); + // patient = patientsProv.getSelectedPatient(); + return RoundedContainer( + child: ListView( + children: [ + ProfileGeneralInfoContentWidget( + title: "Age", + info: '${patient.age}', + ), + ProfileGeneralInfoContentWidget( + title: "Contact Number", + info: '${patient.mobileNumber}', + ), + ProfileGeneralInfoContentWidget( + title: "Email", + info: '${patient.emailAddress}', + ), + ], + ), + width: SizeConfig.screenWidth * 0.70, + height: SizeConfig.screenHeight * 0.25, + ); + } +} diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index 52929c86..275888e3 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -3,12 +3,11 @@ import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ - Key? key, - required this.onTap, - required this.label, + Key key, + this.onTap, this.label, }) : super(key: key); - final GestureTapCallback onTap; + final Function onTap; final String label; @override @@ -46,7 +45,7 @@ class AddNewOrder extends StatelessWidget { height: 10, ), AppText( - label, + label ??'', color: Colors.grey[600], fontWeight: FontWeight.w600, ) diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 62c23c6a..80f54e12 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; class LargeAvatar extends StatelessWidget { LargeAvatar( - {Key? key, - required this.name, + {Key key, + this.name, this.url, this.disableProfileView: false, this.radius = 60.0, @@ -15,21 +15,23 @@ class LargeAvatar extends StatelessWidget { : super(key: key); final String name; - final String? url; + final String url; final bool disableProfileView; final double radius; final double width; final double height; Widget _getAvatar() { - if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) { + if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { return CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, + radius: + SizeConfig.imageSizeMultiplier * 12, // radius: (52) child: ClipRRect( - borderRadius: BorderRadius.circular(50), + borderRadius:BorderRadius.circular(50), + child: Image.network( - url!, + url, fit: BoxFit.fill, width: 700, ), @@ -65,11 +67,19 @@ class LargeAvatar extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - gradient: LinearGradient(begin: Alignment(-1, -1), end: Alignment(1, 1), colors: [ - Colors.grey[100]!, - Colors.grey[800]!, - ]), - boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], + gradient: LinearGradient( + begin: Alignment(-1, -1), + end: Alignment(1, 1), + colors: [ + Colors.grey[100], + Colors.grey[800], + ]), + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], borderRadius: BorderRadius.all(Radius.circular(50.0)), ), width: width, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 05372d81..174da04d 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -2,7 +2,6 @@ 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,33 +13,29 @@ import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { - final PatiantInformtion? patient; - final PatientProfileAppBarModel? patientProfileAppBarModel; - final double? height; + 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; - final VoidCallback? onPressed; + 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; + final VoidCallback onPressed; PatientProfileAppBar(this.patient, - { this.patientProfileAppBarModel, - this.isFromLabResult = false, - this.onPressed, - this.height, + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, @@ -50,28 +45,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { this.profileUrl, this.invoiceNO, this.orderNo, - this.isPrescriptions, - this.isMedicalFile, + this.isPrescriptions = false, + this.clinic, + this.isMedicalFile = false, this.episode, this.visitDate, - this.clinic, - this.isAppointmentHeader}); - late PatiantInformtion localPatient; + this.isAppointmentHeader = false, + this.isFromLabResult = false, + this.onPressed}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - if (patient == null) { - localPatient = patientProfileAppBarModel!.patient!; - } else { - localPatient = patient!; - } int gender = 1; - if (localPatient!.patientDetails != null) { - gender = localPatient!.patientDetails!.gender!; + if (patient.patientDetails != null) { + gender = patient.patientDetails.gender; } else { - gender = localPatient!.gender!; + gender = patient.gender; } return Container( @@ -96,18 +87,18 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, onPressed: () { - if (onPressed != null) onPressed!(); + if (onPressed != null) onPressed(); Navigator.pop(context); }, ), Expanded( child: AppText( - localPatient!.firstName != null - ? (Helpers.capitalize(localPatient!.firstName) + + patient.firstName != null + ? (Helpers.capitalize(patient.firstName) + " " + - Helpers.capitalize(localPatient!.lastName)) - : Helpers.capitalize(localPatient!.fullName ?? - localPatient!.patientDetails!.fullName!), + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.fullName ?? + patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -128,7 +119,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + localPatient!.mobileNumber!); + launch("tel://" + patient.mobileNumber); }, child: Icon( Icons.phone, @@ -136,30 +127,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ), - if (patientProfileAppBarModel!.videoCallDurationStream != null) - StreamBuilder( - stream: patientProfileAppBarModel!.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: [ @@ -170,9 +137,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -184,12 +149,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - localPatient!.patientStatusType != null + patient.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - localPatient!.patientStatusType == 43 + patient.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, color: Colors.green, @@ -208,11 +173,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { .getTextMultiplierBasedOnWidth() * 3.5, ), - localPatient!.startTime != null - ? AppText( - localPatient!.startTime != null - ? localPatient!.startTime - : '', + patient.startTime != null + ? AppText(patient.startTime != null ? patient.startTime : '', fontWeight: FontWeight.w700, fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -240,7 +202,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 1, ), AppText( - localPatient!.patientId.toString(), + patient.patientId.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -253,25 +215,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Row( children: [ AppText( - localPatient!.nationalityName ?? - localPatient!.nationality ?? - localPatient!.nationalityId ?? + patient.nationalityName ?? + patient.nationality ?? + patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), - localPatient!.nationalityFlagURL != null + patient.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - localPatient!.nationalityFlagURL!, + patient.nationalityFlagURL, height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, - StackTrace? stackTrace) { + StackTrace stackTrace) { return Text('No Image'); }, )) @@ -282,48 +244,49 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), HeaderRow( - label: TranslationBase.of(context).age! + " : ", + label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), - if (localPatient!.appointmentDate != null && - localPatient!.appointmentDate!.isNotEmpty && - !isFromLabResult!) + + if (patient.appointmentDate != null && + patient.appointmentDate.isNotEmpty && + !isFromLabResult) HeaderRow( - label: TranslationBase.of(context).appointmentDate! + - " : ", + label: + TranslationBase.of(context).appointmentDate + " : ", value: AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate( - localPatient!.appointmentDate!)), + patient.appointmentDate)), ), - if (patientProfileAppBarModel!.isFromLabResult!) + if (isFromLabResult) HeaderRow( label: "Result Date: ", value: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel!.appointmentDate!, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (localPatient!.admissionDate != null && - localPatient!.admissionDate!.isNotEmpty) + if (patient.admissionDate != null && + patient.admissionDate.isNotEmpty) HeaderRow( - label: localPatient!.admissionDate == null + label: patient.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate! + + : TranslationBase.of(context).admissionDate + " : ", - value: localPatient!.admissionDate == null + value: patient.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", ), - if (localPatient!.admissionDate != null) + if (patient.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && - localPatient!.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(localPatient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}", + patient.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) ], ), @@ -331,7 +294,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ]), - if (patientProfileAppBarModel!.isAppointmentHeader!) + if (isAppointmentHeader) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -339,16 +302,13 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + 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), + BorderSide(color: Colors.grey[400], width: 2.5), + left: BorderSide(color: Colors.grey[400], width: 2.5), )), ), Expanded( @@ -359,8 +319,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { children: [ Container( child: LargeAvatar( - name: patientProfileAppBarModel!.doctorName ?? "", - url: patientProfileAppBarModel!.profileUrl, + name: doctorName ?? "", + url: profileUrl, ), width: 25, height: 25, @@ -382,14 +342,14 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { 3.5, isCopyable: true, ), - if (orderNo != null && !isPrescriptions!) + if (orderNo != null && !isPrescriptions) HeaderRow( label: 'Order No: ', value: orderNo ?? '', ), - if (invoiceNO != null && !isPrescriptions!) + if (invoiceNO != null && !isPrescriptions) HeaderRow( - label: 'Invoice: ', + label: 'Invoice: ', value: invoiceNO ?? "", ), if (branch != null) @@ -402,25 +362,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { label: 'Clinic: ', value: clinic ?? '', ), - if (isMedicalFile! && episode != null) + if (isMedicalFile && episode != null) HeaderRow( label: 'Episode: ', value: episode ?? '', ), - if (isMedicalFile! && visitDate != null) + if (isMedicalFile && visitDate != null) HeaderRow( label: 'Visit Date: ', value: visitDate ?? '', ), - if (!isMedicalFile!) + if (!isMedicalFile) HeaderRow( - label: !isPrescriptions! + label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', - ), - ]), + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ), + ]), ), ), ], @@ -438,28 +398,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size( double.maxFinite, - patientProfileAppBarModel!.height == 0 - ? patientProfileAppBarModel!.isAppointmentHeader! - ? 270 - : ((localPatient!.appointmentDate!.isNotEmpty) - ? patientProfileAppBarModel!.isFromLabResult! - ? 190 - : 170 - : localPatient!.admissionDate != null - ? patientProfileAppBarModel!.isFromLabResult! + height == 0 + ? isInpatient + ? (isFromLabResult ? 210 : 200) + : isAppointmentHeader + ? 290 + : SizeConfig.isHeightVeryShort + ? 137 + : SizeConfig.isHeightShort ? 190 - : 170 - : patientProfileAppBarModel!.isDischargedPatient! - ? 240 - : 130) - : patientProfileAppBarModel!.height!); + : SizeConfig.heightMultiplier * + (SizeConfig.isWidthLarge ? 25 : 20) + : height); } class HeaderRow extends StatelessWidget { - final String? label; - final String? value; + final String label; + final String value; - const HeaderRow({Key? key, this.label, this.value}) : super(key: key); + const HeaderRow({Key key, this.label, this.value}) : super(key: key); @override Widget build(BuildContext context) { 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 f1ab00e0..f0678e22 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 @@ -24,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; - final Stream? videoCallDurationStream; + final Stream videoCallDurationStream; PatientProfileHeaderNewDesignAppBar( this.patient, this.patientType, this.arrivalType, @@ -38,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails!.gender!; + gender = patient.patientDetails.gender; } else { - gender = patient!.gender!; + gender = patient.gender; } return Container( padding: EdgeInsets.only( @@ -76,7 +76,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.fullName ?? - patient.patientDetails!.fullName), + patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -99,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient!.mobileNumber!); + launch("tel://" + patient.mobileNumber); }, child: Icon( Icons.phone, @@ -121,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( - snapshot!.data!, + snapshot.data, style: TextStyle(color: Colors.white), ), ), @@ -186,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget patient.arrivedOn != null ? AppDateUtils .convertStringToDateFormat( - patient!.arrivedOn!, + patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', @@ -203,7 +203,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate! + + TranslationBase.of(context).appointmentDate + " : ", fontSize: 14, ), @@ -273,12 +273,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient!.nationalityFlagURL!, + patient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext? context, - Object? exception, - StackTrace? stackTrace) { + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { return Text(''); }, )) @@ -289,9 +289,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ], ), HeaderRow( - label: TranslationBase.of(context).age! + " : ", + label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) Column( @@ -300,7 +300,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget HeaderRow( label: patient.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate! + + : TranslationBase.of(context).admissionDate + " : ", value: patient.admissionDate == null ? "" @@ -310,8 +310,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate!)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) ], ) @@ -326,7 +326,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - late String newDate; + String newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -343,7 +343,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget date.day.toString().padLeft(2, '0'); } - return newDate??''; + return newDate ?? ''; } isToday(date) { diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 37a0d90a..9d22962a 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -13,7 +13,8 @@ import 'large_avatar.dart'; class PrescriptionInPatientWidget extends StatelessWidget { final List prescriptionReportForInPatientList; - PrescriptionInPatientWidget({Key? key, required this.prescriptionReportForInPatientList}); + PrescriptionInPatientWidget( + {Key key, this.prescriptionReportForInPatientList}); @override Widget build(BuildContext context) { @@ -27,7 +28,8 @@ class PrescriptionInPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: Border.all(color: HexColor('#B8382C'), width: 4), + border: + Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -54,14 +56,19 @@ class PrescriptionInPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, + SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: prescriptionReportForInPatientList.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.of(context).pushNamed(IN_PATIENT_PRESCRIPTIONS_DETAILS, - arguments: {'prescription': prescriptionReportForInPatientList[index]}); + Navigator.of(context).pushNamed( + IN_PATIENT_PRESCRIPTIONS_DETAILS, + arguments: { + 'prescription': + prescriptionReportForInPatientList[index] + }); }, child: CardWithBgWidgetNew( widget: Column( @@ -70,26 +77,34 @@ class PrescriptionInPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - name: prescriptionReportForInPatientList[index].createdByName ?? "", + name: + prescriptionReportForInPatientList[index] + .createdByName, radius: 10, width: 70, ), Expanded( child: Container( - margin: EdgeInsets.only(left: 15, right: 15), + margin: + EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( '${prescriptionReportForInPatientList[index].createdByName}', - fontSize: 2.5 * SizeConfig.textMultiplier, + fontSize: + 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText('${prescriptionReportForInPatientList[index].itemDescription}', - fontSize: 2.5 * SizeConfig.textMultiplier, - color: Theme.of(context).primaryColor), + AppText( + '${prescriptionReportForInPatientList[index].itemDescription}', + fontSize: + 2.5 * SizeConfig.textMultiplier, + color: + Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index f160d78e..50afbdcf 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -14,7 +14,7 @@ import 'large_avatar.dart'; class PrescriptionOutPatientWidget extends StatelessWidget { final List patientPrescriptionsList; - PrescriptionOutPatientWidget({Key? key, required this.patientPrescriptionsList}); + PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); @override Widget build(BuildContext context) { @@ -28,7 +28,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Container( padding: EdgeInsets.all(40), decoration: BoxDecoration( - border: Border.all(color: HexColor('#B8382C'), width: 4), + border: + Border.all(color: HexColor('#B8382C'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( @@ -55,7 +56,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), )) : Container( - margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), + margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, + SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( itemCount: patientPrescriptionsList.length, itemBuilder: (BuildContext context, int index) { @@ -64,8 +66,10 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Navigator.push( context, MaterialPageRoute( - builder: (context) => OutPatientPrescriptionDetailsScreen( - prescriptionResModel: patientPrescriptionsList[index], + builder: (context) => + OutPatientPrescriptionDetailsScreen( + prescriptionResModel: + patientPrescriptionsList[index], ), settings: RouteSettings(name: 'OutPatientPrescriptionDetailsScreen') ), @@ -78,27 +82,35 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Row( children: [ LargeAvatar( - url: patientPrescriptionsList[index].doctorImageURL, - name: patientPrescriptionsList[index].doctorName ?? "", + url: patientPrescriptionsList[index] + .doctorImageURL, + name: patientPrescriptionsList[index] + .doctorName, radius: 10, width: 70, ), Expanded( child: Container( - margin: EdgeInsets.only(left: 15, right: 15), + margin: + EdgeInsets.only(left: 15, right: 15), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( '${patientPrescriptionsList[index].name}', - fontSize: 2.5 * SizeConfig.textMultiplier, + fontSize: + 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), - AppText('${patientPrescriptionsList[index].clinicDescription}', - fontSize: 2.5 * SizeConfig.textMultiplier, - color: Theme.of(context).primaryColor), + AppText( + '${patientPrescriptionsList[index].clinicDescription}', + fontSize: + 2.5 * SizeConfig.textMultiplier, + color: + Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 5c6eb5f6..0a405d8d 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -1,4 +1,3 @@ -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'; @@ -23,19 +22,22 @@ class ProfileWelcomeWidget extends StatelessWidget { widthFactor: 0.9, child: Row( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ this.isClinic == true ? clinicWidget : SizedBox(), + SizedBox( + width: 20, + ), if (authenticationViewModel.doctorProfile != null) CircleAvatar( // radius: (52) child: ClipRRect( borderRadius: BorderRadius.circular(20), child: CachedNetworkImage( - imageUrl: authenticationViewModel.doctorProfile!.doctorImageURL ?? "", + imageUrl: authenticationViewModel.doctorProfile.doctorImageURL, fit: BoxFit.fill, - width: SizeConfig.widthMultiplier* 11, - height: SizeConfig.widthMultiplier* 11, + width: 75, + height: 75, ), ), backgroundColor: Colors.transparent, diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart new file mode 100644 index 00000000..f5c70ae6 --- /dev/null +++ b/lib/widgets/patients/profile/profile_general_info_content_widget.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../config/size_config.dart'; +import '../../shared/app_texts_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:22/4/2020 + *@param: title, info + *@return:ProfileGeneralInfoContentWidget + *@desc: Profile General Info Content Widget + */ +class ProfileGeneralInfoContentWidget extends StatelessWidget { + String title; + String info; + + ProfileGeneralInfoContentWidget({this.title, this.info}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 14), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + AppText( + title, + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.w700, + color: HexColor('#58434F'), + ), + AppText( + info, + color: HexColor('#707070'), + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 5f417a20..a7832481 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { final bool isInpatient; ProfileMedicalInfoWidget( - {Key? key, required this.patient, required this.patientType, required this.arrivalType, required this.from, required this.to, this.isInpatient = false}); + {Key key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); @override Widget build(BuildContext context) { @@ -57,7 +57,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab??'', + nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), PatientProfileButton( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart new file mode 100644 index 00000000..17feaf0a --- /dev/null +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -0,0 +1,176 @@ +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/routes.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/PatientProfileButton.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { + final String from; + final String to; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final bool isInpatient; + final bool isDischargedPatient; + + ProfileMedicalInfoWidgetInPatient( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.from, + this.to, + this.isInpatient, + this.isDischargedPatient = false}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: HEALTH_SUMMARY, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: HEALTH_SUMMARY, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index e457b6dd..573ada32 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -4,38 +4,31 @@ import 'package:doctor_app_flutter/routes.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/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class ProfileMedicalInfoWidgetSearch extends StatefulWidget { +class ProfileMedicalInfoWidgetSearch extends StatelessWidget { final String from; final String to; final PatiantInformtion patient; final String patientType; - final String? arrivalType; + final String arrivalType; final bool isInpatient; - final bool? isDischargedPatient; + final bool isDischargedPatient; ProfileMedicalInfoWidgetSearch( - {Key? key, - required this.patient, - required this.patientType, + {Key key, + this.patient, + this.patientType, this.arrivalType, - required this.from, - required this.to, - this.isInpatient = false, + this.from, + this.to, + this.isInpatient, this.isDischargedPatient}); - - @override - _ProfileMedicalInfoWidgetSearchState createState() => _ProfileMedicalInfoWidgetSearchState(); -} - -class _ProfileMedicalInfoWidgetSearchState extends State - with SingleTickerProviderStateMixin { - late TabController _tabController; - + TabController _tabController; void initState() { - _tabController = TabController(length: 2, vsync: this); + _tabController = TabController(length: 2); } void dispose() { @@ -48,7 +41,7 @@ class _ProfileMedicalInfoWidgetSearchState extends State DefaultTabController( length: 2, - initialIndex: widget.isInpatient! ? 0 : 1, + initialIndex: isInpatient ? 0 : 1, child: SizedBox( height: MediaQuery.of(context).size.height * 1.0, width: double.infinity, @@ -62,21 +55,22 @@ class _ProfileMedicalInfoWidgetSearchState extends State _VitalSignDetailsWidgetState(); @@ -24,7 +24,10 @@ class _VitalSignDetailsWidgetState extends State { return Container( decoration: BoxDecoration( color: Colors.transparent, - borderRadius: BorderRadius.only(topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + topRight: Radius.circular(10.0) + ), border: Border.all(color: Colors.grey, width: 1), ), margin: EdgeInsets.all(20), @@ -35,7 +38,7 @@ class _VitalSignDetailsWidgetState extends State { children: [ Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]!), + inside: BorderSide(width: 2.0,color: Colors.grey[300]), ), children: fullData(), ), @@ -45,7 +48,7 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData() { + List fullData(){ List tableRow = []; tableRow.add(TableRow(children: [ Container( @@ -87,7 +90,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ', + '${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', textAlign: TextAlign.center, ), ), @@ -109,4 +112,5 @@ class _VitalSignDetailsWidgetState extends State { }); return tableRow; } + } diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index 1caded9b..f391e7bf 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -8,21 +8,30 @@ class StarRating extends StatelessWidget { final int totalCount; final bool forceStars; - StarRating({Key? key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount = 5, this.forceStars = false}) + StarRating( + {Key key, + this.totalAverage: 0.0, + this.size: 16.0, + this.totalCount = 5, + this.forceStars = false}) : super(key: key); @override Widget build(BuildContext context) { return Row(mainAxisAlignment: MainAxisAlignment.start, children: [ - if (!forceStars && (totalAverage == null || totalAverage == 0)) AppText("New", style: "caption"), + if (!forceStars && (totalAverage == null || totalAverage == 0)) + AppText("New", style: "caption"), if (forceStars || (totalAverage != null && totalAverage > 0)) ...List.generate( 5, (index) => Padding( padding: EdgeInsets.only(right: 1.0), - child: Icon((index + 1) <= (totalAverage) ? EvaIcons.star : EvaIcons.starOutline, + child: Icon( + (index + 1) <= (totalAverage ?? 0) + ? EvaIcons.star + : EvaIcons.starOutline, size: size, - color: (index + 1) <= (totalAverage) + color: (index + 1) <= (totalAverage ?? 0) ? Color.fromRGBO(255, 186, 0, 1.0) : Theme.of(context).hintColor), )), diff --git a/lib/widgets/shared/text_fields/TextFields.dart b/lib/widgets/shared/TextFields.dart similarity index 52% rename from lib/widgets/shared/text_fields/TextFields.dart rename to lib/widgets/shared/TextFields.dart index ee86ad24..18d8e778 100644 --- a/lib/widgets/shared/text_fields/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -4,7 +4,8 @@ import 'package:flutter/services.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -26,7 +27,8 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -37,90 +39,87 @@ class NumberTextInputFormatter extends TextInputFormatter { final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { - TextFields({ - Key? key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction = TextInputAction.done, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.fillColor, - this.hintColor, - this.hasBorder = true, - this.onTapTextFields, - this.hasLabelText = false, - this.showLabelText = false, - this.borderRadius = 8.0, - this.borderColor, - this.borderWidth = 1, - }) : super(key: key); + TextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction = TextInputAction.done, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.fillColor, + this.hintColor, + this.hasBorder = true, + this.onTapTextFields, + this.hasLabelText = false, + this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) + : super(key: key); - final String? hintText; - final String? initialValue; - final String? type; - final bool? autoFocus; - final IconData? suffixIcon; - final Color? suffixIconColor; - final Icon? prefixIcon; - final VoidCallback? onTap; - final GestureTapCallback? onTapTextFields; - final TextEditingController? controller; - final TextInputType? keyboardType; - final FormFieldValidator? validator; - final FormFieldSetter? onSaved; - final GestureTapCallback? onSuffixTap; - final Function? onChanged; - final ValueChanged? onSubmit; - final bool? readOnly; - final int? maxLength; - final int? minLines; - final int? maxLines; - final bool? maxLengthEnforced; - final bool? bare; - final TextInputAction? inputAction; - final double? fontSize; - final FontWeight? fontWeight; - final bool? keepPadding; - final TextCapitalization? textCapitalization; - final List? inputFormatters; - final bool? autoValidate; - final EdgeInsets? padding; - final bool? focus; - final bool? borderOnlyError; - final Color? hintColor; - final Color? fillColor; - final bool? hasBorder; - final bool? showLabelText; - Color? borderColor; - final double? borderRadius; - final double? borderWidth; - bool? hasLabelText; + final String hintText; + final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final Function onTapTextFields; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final Color fillColor; + final bool hasBorder; + final bool showLabelText; + Color borderColor; + final double borderRadius; + final double borderWidth; + bool hasLabelText; @override _TextFieldsState createState() => _TextFieldsState(); @@ -143,7 +142,7 @@ class _TextFieldsState extends State { @override void didUpdateWidget(TextFields oldWidget) { - if (widget.focus!) _focusNode.requestFocus(); + if (widget.focus) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -153,7 +152,7 @@ class _TextFieldsState extends State { super.dispose(); } - Widget? _buildSuffixIcon() { + Widget _buildSuffixIcon() { switch (widget.type) { case "password": { @@ -166,30 +165,35 @@ class _TextFieldsState extends State { view = false; }); }, - child: Icon(EvaIcons.eye, size: 24.0, color: Color?.fromRGBO(78, 62, 253, 1.0))) + child: Icon(EvaIcons.eye, + size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) : InkWell( onTap: () { this.setState(() { view = true; }); }, - child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500]))); + child: Icon(EvaIcons.eyeOff, + size: 24.0, color: Colors.grey[500]))); } break; default: if (widget.suffixIcon != null) return InkWell( - onTap: widget.onSuffixTap??null, + onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, - size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); + size: 22.0, + color: widget.suffixIconColor != null + ? widget.suffixIconColor + : Colors.grey[500])); else return null; } } - bool? _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly!) { + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { _focusNode.unfocus(); return true; } else { @@ -199,18 +203,19 @@ class _TextFieldsState extends State { @override Widget build(BuildContext context) { - widget.borderColor = widget.borderColor ?? Colors.grey; + + widget.borderColor = widget.borderColor?? Colors.grey; return (AnimatedContainer( duration: Duration(milliseconds: 300), - decoration: widget.bare! + decoration: widget.bare ? null : BoxDecoration(boxShadow: [ // BoxShadow( - // color: Color?.fromRGBO(70, 68, 167, focus ? 0.20 : 0), + // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // offset: Offset(0.0, 13.0), // blurRadius: focus ? 34.0 : 12.0) BoxShadow( - color: Color?.fromRGBO(110, 68, 80, focus ? 0.20 : 0), + color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0) ]), @@ -220,10 +225,10 @@ class _TextFieldsState extends State { onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate!, - textCapitalization: widget.textCapitalization!, - onFieldSubmitted: widget.inputAction! == TextInputAction.next - ? (widget.onSubmit! != null + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null ? widget.onSubmit : (val) { _focusNode.nextFocus(); @@ -232,10 +237,10 @@ class _TextFieldsState extends State { textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced!, + maxLengthEnforced: widget.maxLengthEnforced, initialValue: widget.initialValue, onChanged: (value) { - if (widget.showLabelText!) { + if (widget.showLabelText) { if ((value == null || value == '')) { setState(() { widget.hasLabelText = false; @@ -246,21 +251,19 @@ class _TextFieldsState extends State { }); } } - if (widget.onChanged != null) widget.onChanged!(value); + if (widget.onChanged != null) widget.onChanged(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, keyboardType: widget.keyboardType, - readOnly: _determineReadOnly()!, + readOnly: _determineReadOnly(), obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context) - .textTheme - .bodyText1! - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context).textTheme.bodyText1.copyWith( + fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -268,7 +271,7 @@ class _TextFieldsState extends State { ] : widget.inputFormatters, decoration: InputDecoration( - labelText: widget.hasLabelText! ? widget.hintText : null, + labelText: widget.hasLabelText ? widget.hintText : null, labelStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, @@ -278,54 +281,68 @@ class _TextFieldsState extends State { hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, + fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric( - vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0, horizontal: 16.0), + vertical: + (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, + horizontal: 16.0), filled: true, - fillColor: widget.bare! ? Colors.transparent : Theme.of(context).backgroundColor, + fillColor: widget.bare + ? Colors.transparent + : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, errorStyle: TextStyle( - fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError! ? 0.0 : null), + fontSize: 12.0, + fontWeight: widget.fontWeight, + height: widget.borderOnlyError ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder! - ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) + borderSide: widget.hasBorder + ? BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder! - ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder! + borderSide: widget.hasBorder ? BorderSide( - color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0) + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder! - ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) + borderSide: widget.hasBorder + ? BorderSide(color: widget.borderColor,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder! - ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder! - ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) + borderSide: widget.hasBorder + ? BorderSide(color: widget.borderColor,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder! - ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder! - ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!) + borderSide: widget.hasBorder + ? BorderSide(color: widget.borderColor,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder! - ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!) + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), ), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index e5146645..49f7d4e8 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -4,6 +4,7 @@ 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'; @@ -16,6 +17,7 @@ import 'app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + class AppDrawer extends StatefulWidget { @override _AppDrawerState createState() => _AppDrawerState(); @@ -23,13 +25,12 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { Helpers helpers = new Helpers(); - late ProjectViewModel projectsProvider; + ProjectViewModel projectsProvider; @override 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, @@ -40,6 +41,7 @@ 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: [ @@ -48,11 +50,8 @@ class _AppDrawerState extends State { Container( child: Image.asset( 'assets/images/dr_app_logo.png', - width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightVeryShort? 25:SizeConfig.isHeightShort?32: 32), - ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?1:2), bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: 10, bottom: 10), ), Container( child: InkWell( @@ -61,16 +60,16 @@ class _AppDrawerState extends State { }, child: Icon( DoctorApp.close_1, - size: SizeConfig.heightMultiplier * 2, + size: 20, ), ), - margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?2:3), bottom: SizeConfig.heightMultiplier * 0.5), + margin: EdgeInsets.only(top: 20, bottom: 10), ) ], crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, ), - SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?0.5:1),), + SizedBox(height: 5), if (authenticationViewModel.doctorProfile != null) InkWell( onTap: () { @@ -86,41 +85,31 @@ 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: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?5: 8), + fontSize: 17, ), ), Padding( padding: EdgeInsets.only(top: 0), child: AppText( - authenticationViewModel.doctorProfile - ?.clinicDescription, + authenticationViewModel.doctorProfile?.clinicDescription, fontWeight: FontWeight.w600, color: Color(0xFF2E303A), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?3: 6), + fontSize: 15, fontFamily: 'Poppins', )) ], ), ), - SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?4:6),), + SizedBox(height: 40), InkWell( child: DrawerItem( - TranslationBase - .of(context) - .applyOrRescheduleLeave!, + TranslationBase.of(context).applyOrRescheduleLeave, icon: DoctorApp.reschedule__1, - drawerWidth: drawerWidth, // subTitle: , ), onTap: () { @@ -134,26 +123,19 @@ class _AppDrawerState extends State { )); }, ), - SizedBox(height: SizeConfig.heightMultiplier *2), + SizedBox(height: 15), InkWell( child: DrawerItem( - TranslationBase - .of(context) - .myQRCode!, + TranslationBase.of(context).myQRCode, icon: DoctorApp.qr_code_3, - drawerWidth: drawerWidth, - // subTitle: , ), ), - SizedBox(height: SizeConfig.heightMultiplier *1.5), + SizedBox(height: 15), InkWell( child: Container( - // height: 80, - child: Image.asset('assets/images/qr_code.png', - width: SizeConfig.getWidthMultiplier( - width: drawerWidth) * (SizeConfig.isHeightVeryShort?25:30), - ), + height: 80, + child: Image.asset('assets/images/qr_code.png'), ), onTap: () {}, ), @@ -161,7 +143,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier *(SizeConfig.isHeightVeryShort?8:SizeConfig.isHeightShort?10:16), + height: MediaQuery.of(context).size.height * 0.09, ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -169,19 +151,13 @@ 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) @@ -190,19 +166,16 @@ class _AppDrawerState extends State { projectsProvider.changeLanguage('ar'); }, ), - SizedBox(height: SizeConfig.heightMultiplier *(SizeConfig.isHeightVeryShort?0.5:1) ), + SizedBox(height: 10), InkWell( child: DrawerItem( - TranslationBase - .of(context) - .logout!, + TranslationBase.of(context).logout, icon: DoctorApp.logout_1, - drawerWidth: drawerWidth, - ), onTap: () async { Navigator.pop(context); await authenticationViewModel.logout(isFromLogin: false); + }, ), ], @@ -214,6 +187,7 @@ 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( @@ -228,9 +202,7 @@ class _AppDrawerState extends State { style: TextStyle( color: Color(0xFF989898), fontWeight: FontWeight.bold, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?4: 6), + fontSize: 14, fontFamily: 'Poppins', ), children: [ @@ -238,25 +210,24 @@ class _AppDrawerState extends State { text: ' Cloud Solutions', style: TextStyle( color: Color(0xFF2E303A), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth( - width: drawerWidth) * (SizeConfig.isWidthLarge?5: 7), + fontSize: 15, fontFamily: 'Poppins', ), ) ]), ), ), + // Text("Powered by"), Image.asset( 'assets/images/cs_logo_container.png', width: SizeConfig.imageSizeMultiplier * 20, ) ], - )))) + )))) ])) - ])), + ])), ), - width: drawerWidth, + width: SizeConfig.realScreenWidth * 0.60, margin: EdgeInsets.all(0), customCornerRaduis: false, diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart new file mode 100644 index 00000000..76a7f57e --- /dev/null +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -0,0 +1,58 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:expandable/expandable.dart'; +import 'package:flutter/material.dart'; + +class AppExpandableNotifier extends StatelessWidget { + final Widget headerWid; + final Widget bodyWid; + + AppExpandableNotifier({this.headerWid, this.bodyWid}); + + @override + Widget build(BuildContext context) { + return ExpandableNotifier( + child: Padding( + padding: const EdgeInsets.all(10), + child: Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + SizedBox( + child: headerWid, + ), + ScrollOnExpand( + scrollOnExpand: true, + scrollOnCollapse: false, + child: ExpandablePanel( + theme: const ExpandableThemeData( + headerAlignment: ExpandablePanelHeaderAlignment.center, + tapBodyToCollapse: true, + ), + header: Padding( + padding: EdgeInsets.all(10), + child: Text( + "${TranslationBase.of(context).graphDetails}", + style: TextStyle(fontWeight: FontWeight.bold), + )), + collapsed: Text(''), + expanded: bodyWid, + builder: (_, collapsed, expanded) { + return Padding( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + child: Expandable( + collapsed: collapsed, + expanded: expanded, + theme: const ExpandableThemeData(crossFadePoint: 0), + ), + ); + }, + ), + ), + ], + ), + ), + ), + initialExpanded: true, + ); + } +} diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart new file mode 100644 index 00000000..848f5265 --- /dev/null +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -0,0 +1,127 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:expandable/expandable.dart'; +import 'package:flutter/material.dart'; + + +/// App Expandable Notifier with animation +/// [headerWidget] widget want to show in the header +/// [bodyWidget] widget want to show in the body +/// [title] the widget title +/// [collapsed] The widget shown in the collapsed state +class AppExpandableNotifier extends StatefulWidget { + final Widget headerWidget; + final Widget bodyWidget; + final String title; + final Widget collapsed; + final bool isExpand; + bool expandFlag = false; + var controller = new ExpandableController(); + AppExpandableNotifier( + {this.headerWidget, + this.bodyWidget, + this.title, + this.collapsed, + this.isExpand = false}); + + _AppExpandableNotifier createState() => _AppExpandableNotifier(); +} + +class _AppExpandableNotifier extends State { + + @override + void initState() { + setState(() { + if (widget.isExpand) { + widget.expandFlag = widget.isExpand; + widget.controller.expanded = true; + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + + return ExpandableNotifier( + child: Padding( + padding: const EdgeInsets.only(left: 10, right: 10, top: 4), + child: Card( + color: Colors.grey[200], + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + SizedBox( + child: widget.headerWidget, + ), + ScrollOnExpand( + scrollOnExpand: true, + scrollOnCollapse: false, + child: ExpandablePanel( + hasIcon: false, + theme: const ExpandableThemeData( + headerAlignment: ExpandablePanelHeaderAlignment.center, + tapBodyToCollapse: true, + ), + header: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: Text( + widget.title ?? TranslationBase.of(context).details, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2, + ), + ), + ), + ), + IconButton( + icon: new Container( + height: 28.0, + width: 30.0, + decoration: new BoxDecoration( + color: Theme.of(context).primaryColor, + shape: BoxShape.circle, + ), + child: new Center( + child: new Icon( + widget.expandFlag + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 30.0, + ), + ), + ), + onPressed: () { + setState(() { + widget.expandFlag = !widget.expandFlag; + widget.controller.expanded = widget.expandFlag; + }); + }), + ]), + collapsed: widget.collapsed ?? Container(), + expanded: widget.bodyWidget, + builder: (_, collapsed, expanded) { + return Padding( + padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), + child: Expandable( + controller: widget.controller, + collapsed: collapsed, + expanded: expanded, + theme: const ExpandableThemeData(crossFadePoint: 0), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 40f87654..4b6d753b 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -1,29 +1,33 @@ import 'package:flutter/material.dart'; +import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; class AppLoaderWidget extends StatefulWidget { - AppLoaderWidget({Key? key, this.title, this.containerColor}) : super(key: key); + AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); - final String? title; - final Color? containerColor; + final String title; + final Color containerColor; @override _AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); } class _AppLoaderWidgetState extends State { + + @override Widget build(BuildContext context) { return Container( height: MediaQuery.of(context).size.height, + child: Stack( children: [ Container( - color: widget.containerColor ?? Colors.grey.withOpacity(0.6), + color: widget.containerColor??Colors.grey.withOpacity(0.6), ), - Container( - child: GifLoaderContainer(), margin: EdgeInsets.only(bottom: MediaQuery.of(context).size.height * 0.09)) + Container(child: GifLoaderContainer(), margin: EdgeInsets.only( + bottom: MediaQuery.of(context).size.height * 0.09)) ], ), ); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 5511f949..b930c21a 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -2,9 +2,7 @@ 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.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -14,20 +12,18 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; - final Widget? body; + final Widget body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel? baseViewModel; - final Widget? bottomSheet; - final Color? backgroundColor; - final PreferredSizeWidget? appBar; - final Widget? drawer; - final Widget? bottomNavigationBar; - final String? subtitle; + final BaseViewModel baseViewModel; + final Widget bottomSheet; + final Color backgroundColor; + final Widget appBar; + final Widget drawer; + final Widget bottomNavigationBar; + final String subtitle; final bool isHomeIcon; final bool extendBody; - final PatientProfileAppBarModel? patientProfileAppBarModel; - AppScaffold( {this.appBarTitle = '', this.body, @@ -37,10 +33,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - - this.subtitle, - this.patientProfileAppBarModel, - this.drawer, this.extendBody = false, this.bottomNavigationBar, this.appBar}); + this.appBar, this.subtitle, this.drawer, this.extendBody = false, this.bottomNavigationBar}); @override Widget build(BuildContext context) { @@ -56,26 +49,21 @@ class AppScaffold extends StatelessWidget { extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar - ? patientProfileAppBarModel != null ? PatientProfileAppBar(patientProfileAppBarModel!.patient!, - 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: [ + ? 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), - ), + if(subtitle!=null) + Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), ], ), leading: Builder(builder: (BuildContext context) { @@ -91,7 +79,8 @@ class AppScaffold extends StatelessWidget { ? IconButton( icon: Icon(DoctorApp.home_icon_active), color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false), + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), ) : SizedBox() ], @@ -104,7 +93,8 @@ class AppScaffold extends StatelessWidget { baseViewModel: baseViewModel, child: body, ) - : Stack(children: [body!, buildAppLoaderWidget(isLoading)]) + : Stack( + children: [body, buildAppLoaderWidget(isLoading)]) : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 57b85141..56a503a8 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -7,33 +7,33 @@ import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { - final String? text; - final String? variant; - final Color? color; - final FontWeight? fontWeight; - final double? fontSize; - final double? fontHeight; - final String? fontFamily; - final int? maxLength; - final bool? italic; - final double? margin; - final double? marginTop; - final double? marginRight; - final double? marginBottom; - final double? marginLeft; - final double? letterSpacing; - final TextAlign? textAlign; - final bool? bold; - final bool? regular; - final bool? medium; - final int? maxLines; - final bool? readMore; - final String? style; - final bool? allowExpand; - final bool? visibility; - final TextOverflow? textOverflow; - final TextDecoration? textDecoration; - final bool? isCopyable; + final String text; + final String variant; + final Color color; + final FontWeight fontWeight; + final double fontSize; + final double fontHeight; + final String fontFamily; + final int maxLength; + final bool italic; + final double margin; + final double marginTop; + final double marginRight; + final double marginBottom; + final double marginLeft; + final double letterSpacing; + final TextAlign textAlign; + final bool bold; + final bool regular; + final bool medium; + final int maxLines; + final bool readMore; + final String style; + final bool allowExpand; + final bool visibility; + final TextOverflow textOverflow; + final TextDecoration textDecoration; + final bool isCopyable; AppText( this.text, { @@ -77,9 +77,9 @@ class _AppTextState extends State { void didUpdateWidget(covariant AppText oldWidget) { setState(() { if (widget.style == "overline") - text = widget.text!.toUpperCase(); + text = widget.text.toUpperCase(); else { - text = widget.text!; + text = widget.text; } }); super.didUpdateWidget(oldWidget); @@ -87,11 +87,11 @@ class _AppTextState extends State { @override void initState() { - hidden = widget.readMore!; + hidden = widget.readMore; if (widget.style == "overline") - text = widget.text!.toUpperCase(); + text = widget.text.toUpperCase(); else { - text = widget.text!; + text = widget.text; } super.initState(); } @@ -101,9 +101,9 @@ class _AppTextState extends State { return GestureDetector( child: Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin!) + ? EdgeInsets.all(widget.margin) : EdgeInsets.only( - top: widget.marginTop!, right: widget.marginRight!, bottom: widget.marginBottom!, left: widget.marginLeft!), + top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -111,7 +111,7 @@ class _AppTextState extends State { Stack( children: [ _textWidget(), - if (widget.readMore! && text.length > widget.maxLength! && hidden) + if (widget.readMore && text.length > widget.maxLength && hidden) Positioned( bottom: 0, left: 0, @@ -127,7 +127,7 @@ class _AppTextState extends State { ) ], ), - if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) + if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -157,14 +157,14 @@ class _AppTextState extends State { } Widget _textWidget() { - if (widget.isCopyable!) { + if (widget.isCopyable) { return Theme( data: ThemeData( textSelectionColor: Colors.lightBlueAccent, ), child: Container( child: SelectableText( - !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, // overflow: widget.maxLines != null // ? ((widget.maxLines > 1) @@ -174,12 +174,12 @@ class _AppTextState extends State { maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic! ? FontStyle.italic : null, + fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic! ? FontStyle.italic : null, + fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), @@ -192,18 +192,18 @@ class _AppTextState extends State { ); } else { return Text( - !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic! ? FontStyle.italic : null, + fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic! ? FontStyle.italic : null, + fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), @@ -218,27 +218,27 @@ class _AppTextState extends State { TextStyle _getFontStyle() { switch (widget.style) { case "headline2": - return Theme.of(context).textTheme.headline2!; + return Theme.of(context).textTheme.headline2; case "headline3": - return Theme.of(context).textTheme.headline3!; + return Theme.of(context).textTheme.headline3; case "headline4": - return Theme.of(context).textTheme.headline4!; + return Theme.of(context).textTheme.headline4; case "headline5": - return Theme.of(context).textTheme.headline5!; + return Theme.of(context).textTheme.headline5; case "headline6": - return Theme.of(context).textTheme.headline6!; + return Theme.of(context).textTheme.headline6; case "bodyText2": - return Theme.of(context).textTheme.bodyText2!; + return Theme.of(context).textTheme.bodyText2; case "bodyText_15": - return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0); + return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); case "bodyText1": - return Theme.of(context).textTheme.bodyText1!; + return Theme.of(context).textTheme.bodyText1; case "caption": - return Theme.of(context).textTheme.caption!; + return Theme.of(context).textTheme.caption; case "overline": - return Theme.of(context).textTheme.overline!; + return Theme.of(context).textTheme.overline; case "button": - return Theme.of(context).textTheme.button!; + return Theme.of(context).textTheme.button; default: return TextStyle(); } @@ -323,7 +323,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return FontWeight.normal; + return null; } } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index edca36e4..16988d82 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -13,7 +13,7 @@ class BottomNavBar extends StatefulWidget { DashboardViewModel dashboardViewModel = DashboardViewModel(); - BottomNavBar({Key? key, required this.changeIndex, required this.index}) : super(key: key); + BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 37dbe28c..02b64c78 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -1,5 +1,4 @@ import 'package:badges/badges.dart'; -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/core/viewModel/doctor_replay_view_model.dart'; import 'package:flutter/cupertino.dart'; @@ -9,24 +8,30 @@ import 'package:provider/provider.dart'; import '../../locator.dart'; class BottomNavigationItem extends StatelessWidget { - final IconData? icon; - final IconData? activeIcon; + final IconData icon; + final IconData activeIcon; final ValueChanged changeIndex; - final int? index; + final int index; final int currentIndex; - final String? name; - final DashboardViewModel? dashboardViewModel; + final String name; + final DashboardViewModel dashboardViewModel; + BottomNavigationItem( - {this.icon, this.activeIcon, required this.changeIndex, this.index, required this.currentIndex, this.name, this.dashboardViewModel}); + {this.icon, + this.activeIcon, + this.changeIndex, + this.index, + this.currentIndex, + this.name, this.dashboardViewModel}); + @override Widget build(BuildContext context) { return Expanded( child: SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 :SizeConfig.isHeightShort ? 8: 8), + height: 70.0, child: Material( type: MaterialType.transparency, child: InkWell( @@ -42,30 +47,28 @@ class BottomNavigationItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - 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) : Color(0xFF989898), size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40,), - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 0.5, + SizedBox(height: 15,), + Container( + child: Icon(currentIndex == index ? activeIcon : icon, + color: currentIndex == index + ? Color(0xFF333C45) + : Theme.of(context).dividerColor, + size: 22.0), ), - Expanded( - child: Text( - name ?? "", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2,color: currentIndex == index ? Color(0xFF333C45) : Color(0xFF989898)//#989898, + SizedBox(height: 5,), + Expanded( + child: Text( + name, + style: TextStyle( + color: currentIndex == index + ? Theme.of(context).primaryColor + : Theme.of(context).dividerColor, ), ), ), ], ), - if(currentIndex == 3 && dashboardViewModel!.notRepliedCount != 0) + if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) Positioned( right: 18.0, bottom: 40.0, @@ -77,7 +80,7 @@ class BottomNavigationItem extends StatelessWidget { borderRadius: BorderRadius.circular(8), badgeContent: Container( // padding: EdgeInsets.all(2.0), - child: Text(dashboardViewModel!.notRepliedCount.toString(), + child: Text(dashboardViewModel.notRepliedCount.toString(), style: TextStyle( color: Colors.white, fontSize: 12.0)), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index a4dafc9e..acbd27fe 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -6,23 +6,23 @@ import 'package:hexcolor/hexcolor.dart'; import '../app_texts_widget.dart'; class AppButton extends StatefulWidget { - final GestureTapCallback? onPressed; - final String? title; - final IconData? iconData; - final Widget? icon; - final Color? color; - final double? fontSize; - final double? padding; - final Color? fontColor; - final bool? loading; - final bool? disabled; - final FontWeight? fontWeight; - final bool? hasBorder; - final Color? borderColor; - final double? radius; - final double? vPadding; - final double? hPadding; - final double? height; + final GestureTapCallback onPressed; + final String title; + final IconData iconData; + final Widget icon; + final Color color; + final double fontSize; + final double padding; + final Color fontColor; + final bool loading; + final bool disabled; + final FontWeight fontWeight; + final bool hasBorder; + final Color borderColor; + final double radius; + final double vPadding; + final double hPadding; + final double height; AppButton({ @required this.onPressed, @@ -40,7 +40,8 @@ class AppButton extends StatefulWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, this.height, + this.borderColor, + this.height, }); _AppButtonState createState() => _AppButtonState(); @@ -50,22 +51,21 @@ 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!, + ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( - fillColor: widget.disabled! - ? Colors.grey - : widget.color != null - ? widget.color - : HexColor("#B8382C"), + fillColor: widget.disabled + ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), splashColor: widget.color, child: Padding( - padding: (widget.hPadding! > 0 || widget.vPadding! > 0) - ? EdgeInsets.symmetric(vertical: widget.vPadding!, horizontal: widget.hPadding!) + padding: (widget.hPadding > 0 || widget.vPadding > 0) + ? EdgeInsets.symmetric( + vertical: widget.vPadding, horizontal: widget.hPadding) : EdgeInsets.only( - top: widget.padding!, - bottom: widget.padding!, + top: widget.padding, + bottom: widget.padding, //right: SizeConfig.widthMultiplier * widget.padding, //left: SizeConfig.widthMultiplier * widget.padding ), @@ -73,7 +73,8 @@ class _AppButtonState extends State { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ - if (widget.icon != null) Container(width: 25, height: 25, child: widget.icon), + if (widget.icon != null) + Container(width: 25, height: 25, child: widget.icon), if (widget.iconData != null) Icon( widget.iconData, @@ -83,7 +84,7 @@ class _AppButtonState extends State { SizedBox( width: 5.0, ), - widget.loading! + widget.loading ? Padding( padding: EdgeInsets.all(2.6), child: SizedBox( @@ -92,7 +93,7 @@ class _AppButtonState extends State { child: CircularProgressIndicator( backgroundColor: Colors.white, valueColor: AlwaysStoppedAnimation( - Colors.grey[300]!, + Colors.grey[300], ), ), ), @@ -101,24 +102,22 @@ class _AppButtonState extends State { child: AppText( widget.title, color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize!, + fontSize: SizeConfig.textMultiplier * widget.fontSize, fontWeight: widget.fontWeight, ), ), ], ), ), - onPressed: widget.disabled! ? () {} : widget.onPressed, + onPressed: widget.disabled ? (){} : widget.onPressed, shape: RoundedRectangleBorder( side: BorderSide( - color: widget.hasBorder! - ? widget.borderColor! - : widget.disabled! - ? Colors.grey - : widget.color ?? Color(0xFFB8382C), + color: + widget.hasBorder ? widget.borderColor : widget.disabled + ? Colors.grey : widget.color ?? Color(0xFFB8382C), width: 0.8, ), - borderRadius: BorderRadius.all(Radius.circular(widget.radius!))), + borderRadius: BorderRadius.all(Radius.circular(widget.radius))), ), ), ); diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 883a6a9b..3c5cc32d 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -3,25 +3,25 @@ import 'package:flutter/material.dart'; import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { - final GestureTapCallback? onPressed; - final String? title; - final IconData? iconData; - final Widget? icon; - final Color? color; - final double? fontSize; - final double? padding; - final Color? fontColor; - final bool? loading; - final bool? disabled; - final FontWeight? fontWeight; - final bool? hasBorder; - final Color? borderColor; - final double? radius; - final double? vPadding; - final double? hPadding; - ButtonBottomSheet({ - @required this.onPressed, + final GestureTapCallback onPressed; + final String title; + final IconData iconData; + final Widget icon; + final Color color; + final double fontSize; + final double padding; + final Color fontColor; + final bool loading; + final bool disabled; + final FontWeight fontWeight; + final bool hasBorder; + final Color borderColor; + final double radius; + final double vPadding; + final double hPadding; + + ButtonBottomSheet({@required this.onPressed, this.title, this.iconData, this.icon, @@ -36,8 +36,7 @@ class ButtonBottomSheet extends StatelessWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, - }); + this.borderColor,}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index 7fd680e3..48c65baf 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -15,7 +15,7 @@ import 'package:provider/provider.dart'; /// [noBorderRadius] remove border radius class SecondaryButton extends StatefulWidget { SecondaryButton( - {Key? key, + {Key key, this.label = "", this.icon, this.iconOnly = false, @@ -30,12 +30,12 @@ class SecondaryButton extends StatefulWidget { : super(key: key); final String label; - final Widget? icon; - final VoidCallback? onTap; + final Widget icon; + final VoidCallback onTap; final bool loading; - final Color? color; + final Color color; final Color textColor; - final Color? borderColor; + final Color borderColor; final bool small; final bool iconOnly; final bool disabled; @@ -45,14 +45,15 @@ class SecondaryButton extends StatefulWidget { _SecondaryButtonState createState() => _SecondaryButtonState(); } -class _SecondaryButtonState extends State with TickerProviderStateMixin { +class _SecondaryButtonState extends State + with TickerProviderStateMixin { double _buttonSize = 1.0; - late AnimationController _animationController; - late Animation _animation; + AnimationController _animationController; + Animation _animation; double _rippleSize = 0.0; - late AnimationController _rippleController; - late Animation _rippleAnimation; + AnimationController _rippleController; + Animation _rippleAnimation; @override void initState() { @@ -61,19 +62,28 @@ class _SecondaryButtonState extends State with TickerProviderSt _rippleSize = 1.0; }); } - _animationController = - AnimationController(vsync: this, lowerBound: 0.7, upperBound: 1.0, duration: Duration(milliseconds: 120)); - _animation = - CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuad, reverseCurve: Curves.easeOutQuad); + _animationController = AnimationController( + vsync: this, + lowerBound: 0.7, + upperBound: 1.0, + duration: Duration(milliseconds: 120)); + _animation = CurvedAnimation( + parent: _animationController, + curve: Curves.easeOutQuad, + reverseCurve: Curves.easeOutQuad); _animation.addListener(() { setState(() { _buttonSize = _animation.value; }); }); - _rippleController = - AnimationController(vsync: this, lowerBound: 0.0, upperBound: 1.0, duration: Duration(seconds: 1)); - _rippleAnimation = CurvedAnimation(parent: _rippleController, curve: Curves.easeInOutQuint); + _rippleController = AnimationController( + vsync: this, + lowerBound: 0.0, + upperBound: 1.0, + duration: Duration(seconds: 1)); + _rippleAnimation = CurvedAnimation( + parent: _rippleController, curve: Curves.easeInOutQuint); _rippleAnimation.addListener(() { setState(() { _rippleSize = _rippleAnimation.value; @@ -92,7 +102,8 @@ class _SecondaryButtonState extends State with TickerProviderSt Widget _buildIcon() { if (widget.icon != null && (widget.label != null && widget.label != "")) { return Container(height: 25.0, child: widget.icon); - } else if (widget.icon != null && (widget.label == null || widget.label == "")) { + } else if (widget.icon != null && + (widget.label == null || widget.label == "")) { return Container(height: 25.0, width: 25, child: widget.icon); } else { return Container(); @@ -103,7 +114,7 @@ class _SecondaryButtonState extends State with TickerProviderSt void didUpdateWidget(SecondaryButton oldWidget) { super.didUpdateWidget(oldWidget); if (oldWidget.disabled != widget.disabled) { - bool d = widget.disabled; + bool d = widget.disabled ?? false; if (!d) { _rippleController.forward(); } else { @@ -131,7 +142,7 @@ class _SecondaryButtonState extends State with TickerProviderSt _animationController.forward(); }, onTap: () => { - widget.disabled ? null : widget.onTap!(), + widget.disabled ? null : widget.onTap(), }, // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, @@ -140,12 +151,16 @@ class _SecondaryButtonState extends State with TickerProviderSt child: Container( decoration: BoxDecoration( border: widget.borderColor != null - ? Border.all(color: widget.borderColor!.withOpacity(0.1), width: 2.0) + ? Border.all( + color: widget.borderColor.withOpacity(0.1), width: 2.0) : null, borderRadius: BorderRadius.all(Radius.circular(100.0)), boxShadow: [ BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.04), spreadRadius: -0.0, offset: Offset(0, 4.0), blurRadius: 18.0) + color: Color.fromRGBO(0, 0, 0, 0.04), + spreadRadius: -0.0, + offset: Offset(0, 4.0), + blurRadius: 18.0) ], ), child: ClipRRect( @@ -161,7 +176,9 @@ class _SecondaryButtonState extends State with TickerProviderSt width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor), + color: widget.disabled + ? Colors.grey + : widget.color ?? Theme.of(context).buttonColor), ), ), Positioned( @@ -174,7 +191,9 @@ class _SecondaryButtonState extends State with TickerProviderSt height: MediaQuery.of(context).size.width * 2.2, decoration: BoxDecoration( shape: BoxShape.circle, - color: widget.disabled ? Colors.grey : widget.color ?? Theme.of(context).buttonColor, + color: widget.disabled + ? Colors.grey + : widget.color ?? Theme.of(context).buttonColor, ), ), ), @@ -183,7 +202,10 @@ class _SecondaryButtonState extends State with TickerProviderSt padding: widget.iconOnly ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) : EdgeInsets.only( - top: widget.small ? 8.0 : 14.0, bottom: widget.small ? 6.0 : 14.0, left: 18.0, right: 18.0), + top: widget.small ? 8.0 : 14.0, + bottom: widget.small ? 6.0 : 14.0, + left: 18.0, + right: 18.0), child: Stack( children: [ Positioned( @@ -202,20 +224,22 @@ class _SecondaryButtonState extends State with TickerProviderSt width: 19.0, child: CircularProgressIndicator( backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( - Colors.grey[300]!, + valueColor: + AlwaysStoppedAnimation( + Colors.grey[300], ), ), ), ) : Padding( - padding: EdgeInsets.only(bottom: widget.small ? 4.0 : 3.0), + padding: EdgeInsets.only( + bottom: widget.small ? 4.0 : 3.0), child: Text( widget.label, style: TextStyle( color: widget.textColor, fontSize: 16, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w700, fontFamily: 'Poppins'), ), ) diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 1b17236a..00b836bc 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -1,10 +1,18 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +/* + *@author: Amjad Amireh Modify for new design created by Mohammad Aljammal + *@Date:Modify date 21/5/2020 Original date 27/4/2020 + *@param: Widget + *@return: + *@desc: Card With Bg Widget + */ + class CardWithBgWidgetNew extends StatelessWidget { final Widget widget; - CardWithBgWidgetNew({required this.widget}); + CardWithBgWidgetNew({@required this.widget}); @override Widget build(BuildContext context) { @@ -13,10 +21,10 @@ class CardWithBgWidgetNew extends StatelessWidget { margin: EdgeInsets.symmetric(vertical: 10.0), width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), ), - ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), color: HexColor('#FFFFFF'), @@ -25,16 +33,18 @@ class CardWithBgWidgetNew extends StatelessWidget { Center( child: Container( - // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 - // margin: EdgeInsets.only(left: 10), + // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 + // margin: EdgeInsets.only(left: 10), child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center(child: widget), - )), + padding: const EdgeInsets.all(8.0), + child: Center(child: widget), + )), ) ], ), ), ); } + + } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 1fcee64c..c8e187a1 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -2,21 +2,17 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + class CardWithBgWidget extends StatelessWidget { final Widget widget; - final Color? bgColor; + final Color bgColor; final bool hasBorder; final double padding; final double marginLeft; final double marginSymmetric; CardWithBgWidget( - {required this.widget, - this.bgColor, - this.hasBorder = true, - this.padding = 15.0, - this.marginLeft = 10.0, - this.marginSymmetric = 10.0}); + {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); @override Widget build(BuildContext context) { @@ -28,7 +24,9 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: hasBorder ? Color(0xFF707070) : Colors.transparent, width: hasBorder ? 0.30 : 0), + border: Border.all( + color: hasBorder ? Color(0xFF707070) : Colors.transparent, + width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -36,14 +34,12 @@ class CardWithBgWidget extends StatelessWidget { children: [ if (projectProvider.isArabic) Positioned( - child: Container( + child: Container( decoration: BoxDecoration( color: bgColor ?? Color(0xFF58434F), borderRadius: BorderRadius.only( topRight: Radius.circular(10), - bottomRight: Radius.circular(10), - ), - ), + bottomRight: Radius.circular(10),),), width: 10, ), bottom: 1, @@ -64,7 +60,10 @@ class CardWithBgWidget extends StatelessWidget { top: 1, left: 1, ), - Container(padding: EdgeInsets.all(padding), margin: EdgeInsets.only(left: marginLeft), child: widget) + Container( + padding: EdgeInsets.all(padding), + margin: EdgeInsets.only(left: marginLeft), + child: widget) ], ), ), diff --git a/lib/widgets/shared/charts/app_line_chart.dart b/lib/widgets/shared/charts/app_line_chart.dart new file mode 100644 index 00000000..422468d7 --- /dev/null +++ b/lib/widgets/shared/charts/app_line_chart.dart @@ -0,0 +1,41 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:flutter/material.dart'; + +/* + *@author: Elham Rababah + *@Date:03/6/2020 + *@param: + *@return: + *@desc: AppLineChart + */ +class AppLineChart extends StatelessWidget { + const AppLineChart({ + Key key, + @required this.seriesList, + this.chartTitle, + }) : super(key: key); + + final List seriesList; + + final String chartTitle; + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + Text( + 'Body Mass Index', + style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold), + ), + Expanded( + child: charts.LineChart(seriesList, + defaultRenderer: new charts.LineRendererConfig( + includeArea: false, stacked: true), + animate: true), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/shared/charts/app_time_series_chart.dart b/lib/widgets/shared/charts/app_time_series_chart.dart new file mode 100644 index 00000000..f4bd354e --- /dev/null +++ b/lib/widgets/shared/charts/app_time_series_chart.dart @@ -0,0 +1,121 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:flutter/material.dart'; + +import '../../../config/size_config.dart'; +import '../../../models/patient/vital_sign/vital_sign_res_model.dart'; +import '../../../widgets/shared/rounded_container_widget.dart'; + +/* + *@author: Elham Rababah + *@Date:03/6/2020 + *@param: + *@return: + *@desc: AppTimeSeriesChart + */ +class AppTimeSeriesChart extends StatelessWidget { + AppTimeSeriesChart( + {Key key, + @required this.vitalList, + @required this.viewKey, + this.chartName = ''}); + + final List vitalList; + final String chartName; + final String viewKey; + List seriesList; + + @override + Widget build(BuildContext context) { + seriesList = generateData(); + return RoundedContainer( + height: SizeConfig.realScreenHeight * 0.47, + child: Column( + children: [ + Text( + chartName, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 3), + ), + Container( + height: SizeConfig.realScreenHeight * 0.37, + child: Center( + child: Container( + child: charts.TimeSeriesChart( + seriesList, + animate: true, + behaviors: [ + new charts.RangeAnnotation( + [ + new charts.RangeAnnotationSegment( + DateTime( + vitalList[vitalList.length - 1] + .vitalSignDate + .year, + vitalList[vitalList.length - 1] + .vitalSignDate + .month + + 3, + vitalList[vitalList.length - 1] + .vitalSignDate + .day), + vitalList[0].vitalSignDate, + charts.RangeAnnotationAxisType.domain), + ], + ), + ], + ), + ), + ), + ), + ], + ), + ); + } + + /* + *@author: Elham Rababah + *@Date:03/6/2020 + *@param: + *@return: + *@desc: generateData + */ + generateData() { + final List data = []; + if (vitalList.length > 0) { + vitalList.forEach( + (element) { + data.add( + TimeSeriesSales( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey].toInt(), + ), + ); + }, + ); + } + return [ + new charts.Series( + id: 'Sales', + domainFn: (TimeSeriesSales sales, _) => sales.time, + measureFn: (TimeSeriesSales sales, _) => sales.sales, + data: data, + ) + ]; + } +} + +/* + *@author: Elham Rababah + *@Date:03/6/2020 + *@param: + *@return: + *@desc: TimeSeriesSales + */ +class TimeSeriesSales { + final DateTime time; + final int sales; + + TimeSeriesSales(this.time, this.sales); +} diff --git a/lib/widgets/shared/custom_shape_clipper.dart b/lib/widgets/shared/custom_shape_clipper.dart new file mode 100644 index 00000000..81f5ee20 --- /dev/null +++ b/lib/widgets/shared/custom_shape_clipper.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +class CustomShapeClipper extends CustomClipper { + @override + Path getClip(Size size) { + final Path path = Path(); + path.lineTo(0.0, size.height); + + var firstEndPoint = Offset(size.width * .5, size.height / 2); + var firstControlpoint = Offset(size.width * 0.25, size.height * 0.95 + 30); + path.quadraticBezierTo(firstControlpoint.dx, firstControlpoint.dy, + firstEndPoint.dx, firstEndPoint.dy); + + var secondEndPoint = Offset(size.width, size.height * 0.10); + var secondControlPoint = Offset(size.width * .75, size.height * .10 - 20); + path.quadraticBezierTo(secondControlPoint.dx, secondControlPoint.dy, + secondEndPoint.dx, secondEndPoint.dy); + + path.lineTo(size.width, 0.0); + path.close(); + return path; + } + + @override + bool shouldReclip(CustomClipper oldClipper) => true; +} diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 06875fb4..302366b7 100644 --- a/lib/widgets/shared/dialogs/ShowImageDialog.dart +++ b/lib/widgets/shared/dialogs/ShowImageDialog.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class ShowImageDialog extends StatelessWidget { final String imageUrl; - const ShowImageDialog({Key? key, required this.imageUrl}) : super(key: key); + const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); @override Widget build(BuildContext context) { return SimpleDialog( @@ -12,8 +12,10 @@ class ShowImageDialog extends StatelessWidget { Container( width: 340, height: 340, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)), - child: Image.network( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12) + ), + child: Image.network( imageUrl, fit: BoxFit.fill, ), @@ -21,4 +23,4 @@ class ShowImageDialog extends StatelessWidget { ], ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 45b9f217..dfaf9143 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -9,16 +9,16 @@ class ListSelectDialog extends StatefulWidget { final okText; final Function(dynamic) okFunction; dynamic selectedValue; - final Widget? searchWidget; + final Widget searchWidget; final bool usingSearch; - final String? hintSearchText; + final String hintSearchText; ListSelectDialog({ - required this.list, - required this.attributeName, - required this.attributeValueId, + @required this.list, + @required this.attributeName, + @required this.attributeValueId, @required this.okText, - required this.okFunction, + @required this.okFunction, this.searchWidget, this.usingSearch = false, this.hintSearchText, @@ -29,7 +29,7 @@ class ListSelectDialog extends StatefulWidget { } class _ListSelectDialogState extends State { - List items = []; + List items = List(); @override void initState() { @@ -46,7 +46,7 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel ?? ""), + child: Text(TranslationBase.of(context).cancel), onPressed: () { Navigator.of(context).pop(); }); @@ -73,42 +73,44 @@ class _ListSelectDialogState extends State { height: MediaQuery.of(context).size.height * 0.5, child: Column( children: [ - if (widget.searchWidget != null) widget.searchWidget!, - if (widget.usingSearch) - Container( - height: MediaQuery.of(context).size.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - widget.hintSearchText ?? TranslationBase.of(context).search ?? "", "", false, - suffixIcon: Icon( - Icons.search, - )), - enabled: true, - keyboardType: TextInputType.text, - onChanged: (value) { - filterSearchResults(value); - }, - )),Expanded( + if (widget.searchWidget != null) widget.searchWidget, + if (widget.usingSearch) + Container( + height: MediaQuery.of(context).size.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + widget.hintSearchText ?? TranslationBase.of(context).search, null, false, + suffixIcon: Icon( + Icons.search, + )), + enabled: true, + keyboardType: TextInputType.text, + onChanged: (value) { + filterSearchResults(value); + }, + )), + Expanded( child: SingleChildScrollView( child: Column( children: [ - ...items - .map((item) => RadioListTile( - title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId].toString(), - value: item[widget.attributeValueId].toString(), - activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId].toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) - .toList() - ], - ),), + ...items + .map((item) => RadioListTile( + title: Text("${item[widget.attributeName].toString()}"), + groupValue: widget.selectedValue[widget.attributeValueId].toString(), + value: item[widget.attributeValueId].toString(), + activeColor: Colors.blue.shade700, + selected: item[widget.attributeValueId].toString() == + widget.selectedValue[widget.attributeValueId].toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) + .toList() + ], + ), + ), ), ], ), @@ -120,10 +122,10 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.list); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index a2a7e02d..7c12b54a 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -12,11 +12,15 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel? selectedValue; + MasterKeyModel selectedValue; final bool isICD; MasterKeyDailog( - {required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false}); + {@required this.list, + @required this.okText, + @required this.okFunction, + this.selectedValue, + this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -45,7 +49,7 @@ class _MasterKeyDailogState extends State { Widget continueButton = FlatButton( child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), onPressed: () { - this.widget.okFunction(widget.selectedValue!); + this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); }); // set up the AlertDialog @@ -68,15 +72,23 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: AppText('${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + - (widget.isICD ? '/${item.code}' : ''),), - groupValue: - widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(), - value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(), + title: AppText( + '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + + (widget.isICD ? '/${item.code}' : ''), + + ), + groupValue: widget.isICD + ? widget.selectedValue.code.toString() + : widget.selectedValue.id.toString(), + value: widget.isICD + ? widget.selectedValue.code.toString() + : item.id.toString(), activeColor: Colors.blue.shade700, selected: widget.isICD - ? item.code.toString() == widget.selectedValue!.code.toString() - : item.id.toString() == widget.selectedValue!.id.toString(), + ? item.code.toString() == + widget.selectedValue.code.toString() + : item.id.toString() == + widget.selectedValue.id.toString(), onChanged: (val) { setState(() { widget.selectedValue = item; diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart new file mode 100644 index 00000000..68dce5a4 --- /dev/null +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -0,0 +1,92 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class ListSelectDialog extends StatefulWidget { + final List list; + final String attributeName; + final String attributeValueId; + final okText; + final Function(dynamic) okFunction; + dynamic selectedValue; + + ListSelectDialog( + {@required this.list, + @required this.attributeName, + @required this.attributeValueId, + @required this.okText, + @required this.okFunction}); + + @override + _ListSelectDialogState createState() => _ListSelectDialogState(); +} + +class _ListSelectDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedValue = widget.selectedValue ?? widget.list[0]; + } + + @override + Widget build(BuildContext context) { + return showAlertDialog(context); + } + + showAlertDialog(BuildContext context) { + // set up the buttons + Widget cancelButton = FlatButton( + child: Text(TranslationBase.of(context).cancel), + onPressed: () { + Navigator.of(context).pop(); + }); + Widget continueButton = FlatButton( + child: Text(this.widget.okText), + onPressed: () { + this.widget.okFunction(widget.selectedValue); + Navigator.of(context).pop(); + }); +// set up the AlertDialog + AlertDialog alert = AlertDialog( + // title: Text(widget.title), + content: createDialogList(), + actions: [ + cancelButton, + continueButton, + ], + ); + return alert; + } + + Widget createDialogList() { + return Container( + height: MediaQuery.of(context).size.height * 0.5, + child: SingleChildScrollView( + child: Column( + children: [ + ...widget.list + .map((item) => RadioListTile( + title: Text("${item[widget.attributeName].toString()}"), + groupValue: widget.selectedValue[widget.attributeValueId] + .toString(), + value: item[widget.attributeValueId].toString(), + activeColor: Colors.blue.shade700, + selected: item[widget.attributeValueId].toString() == + widget.selectedValue[widget.attributeValueId] + .toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) + .toList() + ], + ), + ), + ); + } + + static closeAlertDialog(BuildContext context) { + Navigator.of(context).pop(); + } +} diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart index 63a5380e..b43557cb 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,10 +2,9 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key? key, - this.height = 0, + Key key, this.height = 0, }); - final double height; + final double height ; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 1c2872c7..5bd12bb8 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -13,9 +13,9 @@ class DoctorCard extends StatelessWidget { final String branch; final DateTime appointmentDate; final String profileUrl; - final String? invoiceNO; - final String? orderNo; - final GestureTapCallback? onTap; + final String invoiceNO; + final String orderNo; + final Function onTap; final bool isPrescriptions; final String clinic; final bool isShowEye; @@ -23,24 +23,22 @@ class DoctorCard extends StatelessWidget { final bool isNoMargin; DoctorCard( - {required this.doctorName, - required this.branch, - required this.profileUrl, + {this.doctorName, + this.branch, + this.profileUrl, this.invoiceNO, this.onTap, - required this.appointmentDate, + this.appointmentDate, this.orderNo, this.isPrescriptions = false, - required this.clinic, - this.isShowEye = true, - this.isShowTime = true, - this.isNoMargin = false}); + this.clinic, + this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(!isNoMargin ? 10 : 0), + margin: EdgeInsets.all(!isNoMargin? 10:0), decoration: BoxDecoration( border: Border.all( width: 0.5, @@ -61,7 +59,7 @@ class DoctorCard extends StatelessWidget { children: [ Expanded( child: AppText( - doctorName, + doctorName ?? "", fontSize: 15, bold: true, )), @@ -75,7 +73,7 @@ class DoctorCard extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions && isShowTime) + if (!isPrescriptions&& isShowTime) AppText( '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, @@ -105,68 +103,76 @@ class DoctorCard extends StatelessWidget { Expanded( child: Container( margin: EdgeInsets.all(10), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).orderNo ?? "" + " ", - color: Colors.grey[500], - fontSize: 14, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context).orderNo + + " ", + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + orderNo ?? '', + fontSize: 14, + ) + ], ), - AppText( - orderNo ?? '', - fontSize: 14, - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).invoiceNo ?? "" + " ", - fontSize: 14, - color: Colors.grey[500], + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + AppText( + TranslationBase.of(context) + .invoiceNo + + " ", + fontSize: 14, + color: Colors.grey[500], + ), + AppText( + invoiceNO, + fontSize: 14, + ) + ], ), - AppText( - invoiceNO, - fontSize: 14, - ) - ], - ), - if (clinic != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).clinic ?? "" + ": ", - color: Colors.grey[500], - fontSize: 14, + if (clinic != null) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).clinic + + ": ", + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: AppText( + clinic, + fontSize: 14, + ), + ) + ], ), - Expanded( - child: AppText( - clinic, - fontSize: 14, - ), + if (branch != null) + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).branch + + ": ", + fontSize: 14, + color: Colors.grey[500], + ), + Expanded( + child: AppText( + branch, + fontSize: 14, + ), + ) + ], ) - ], - ), - if (branch != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start,children: [ - AppText( - TranslationBase.of(context).branch ?? "" + ": ", - fontSize: 14, - color: Colors.grey[500], - ), - Expanded( - child:AppText( - branch, - fontSize: 14, - ), - ) - ], - ) ]), ), ), diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 6588e580..5615015e 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -8,18 +8,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class DoctorCardInsurance extends StatelessWidget { - final String? doctorName; - final String? branch; - final DateTime? appointmentDate; - final String? profileUrl; - final String? invoiceNO; - final String? orderNo; - final GestureTapCallback? onTap; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final Function onTap; final bool isPrescriptions; - final String? clinic; - final String? approvalStatus; - final String? patientOut; - final String? branch2; + final String clinic; + final String approvalStatus; + final String patientOut; + final String branch2; DoctorCardInsurance( {this.doctorName, @@ -113,7 +113,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Container( child: LargeAvatar( - name: doctorName ?? "", + name: doctorName, url: profileUrl, ), width: 55, @@ -152,7 +152,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).clinic ?? "" + ": ", + TranslationBase.of(context).clinic + ": ", color: Colors.grey[500], fontSize: 14, //fontWeight: FontWeight.w600, @@ -171,7 +171,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).branch ?? "" + ": ", + TranslationBase.of(context).branch + ": ", fontSize: 14, color: Colors.grey[500], ), @@ -184,7 +184,7 @@ class DoctorCardInsurance extends StatelessWidget { Row( children: [ AppText( - TranslationBase.of(context).approvalNo ?? "" + ": ", + TranslationBase.of(context).approvalNo + ": ", fontSize: 14, color: Colors.grey[500], //color: Colors.grey[500], diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 1c7db539..2c476ec8 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; - class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ - Key? key, + Key key, }) : super(key: key); @override @@ -12,4 +11,4 @@ class DrAppCircularProgressIndeicator extends StatelessWidget { child: Center(child: const CircularProgressIndicator()), ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 5da3f232..2b8ce40d 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -8,12 +8,11 @@ import '../shared/app_texts_widget.dart'; class DrawerItem extends StatefulWidget { final String title; final String subTitle; - final IconData? icon; - final Color? color; - final String? assetLink; - final double? drawerWidth; + final IconData icon; + final Color color; + final String assetLink; - DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth}); + DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -27,31 +26,31 @@ class _DrawerItemState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (widget.assetLink != null) + if(widget.assetLink!=null) Container( - 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 * (SizeConfig.isWidthLarge?3: 5), + height: 20, + width: 20, + child: Image.asset(widget.assetLink), ), + if(widget.assetLink==null) + Icon( + widget.icon, + color: widget.color ?? Colors.black87, + size: SizeConfig.imageSizeMultiplier * 5, + ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width * 0.45, + width: MediaQuery.of(context).size.width *0.45, child: AppText( widget.title, marginLeft: 5, marginRight: 5, - color: widget.color ?? Color(0xFF2E303A), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: widget.drawerWidth ) * (SizeConfig.isHeightVeryShort?5:(SizeConfig.isWidthLarge?4: 6)), + color:widget.color ??Color(0xFF2E303A), + fontSize: 14, fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart index 9948ad2a..de9fd698 100644 --- a/lib/widgets/shared/errors/dr_app_embedded_error.dart +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -2,10 +2,17 @@ import 'package:flutter/material.dart'; import '../app_texts_widget.dart'; +/* + *@author: Elham Rababah + *@Date:12/5/2020 + *@param: error + *@return: StatelessWidget + *@desc: DrAppEmbeddedError class + */ class DrAppEmbeddedError extends StatelessWidget { const DrAppEmbeddedError({ - Key? key, - required this.error, + Key key, + @required this.error, }) : super(key: key); final String error; @@ -13,12 +20,12 @@ class DrAppEmbeddedError extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: AppText( - error, - color: Theme.of(context).errorColor, - textAlign: TextAlign.center, - margin: 10, - ), - ); + child: AppText( + error, + color: Theme.of(context).errorColor, + textAlign: TextAlign.center, + margin: 10, + ), + ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 056f2fd7..21e04e6c 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -4,8 +4,8 @@ import '../app_texts_widget.dart'; class ErrorMessage extends StatelessWidget { const ErrorMessage({ - Key? key, - required this.error, + Key key, + @required this.error, }) : super(key: key); final String error; @@ -17,22 +17,17 @@ class ErrorMessage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( - height: 100, - ), + SizedBox(height: 100,), Image.asset('assets/images/no-data.png'), Center( child: Center( child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30), - child: Center( - child: AppText( - error, - textAlign: TextAlign.center, - )), + padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), + child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), ), ), ) + ], ), ), diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 13b1438c..20d95bcd 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -2,30 +2,33 @@ import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; class HeaderBodyExpandableNotifier extends StatefulWidget { - final Widget? headerWidget; - final Widget? bodyWidget; - final Widget? collapsed; - final bool? isExpand; + final Widget headerWidget; + final Widget bodyWidget; + final Widget collapsed; + final bool isExpand; bool expandFlag = false; var controller = new ExpandableController(); HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); @override - _HeaderBodyExpandableNotifierState createState() => _HeaderBodyExpandableNotifierState(); + _HeaderBodyExpandableNotifierState createState() => + _HeaderBodyExpandableNotifierState(); } -class _HeaderBodyExpandableNotifierState extends State { +class _HeaderBodyExpandableNotifierState + extends State { + @override void initState() { super.initState(); - } + } @override Widget build(BuildContext context) { setState(() { if (widget.isExpand == true) { - widget.expandFlag = widget.isExpand!; + widget.expandFlag = widget.isExpand; widget.controller.expanded = true; } }); @@ -47,7 +50,7 @@ class _HeaderBodyExpandableNotifierState extends StatelistItems; + final String headerTitle; + + ExpandableItem(this.headerTitle,this.listItems); + + @override + _ExpandableItemState createState() => _ExpandableItemState(); + +} +class _ExpandableItemState extends State +{ + bool isExpand=false; + @override + void initState() { + super.initState(); + isExpand=false; + } + @override + Widget build(BuildContext context) { + ListlistItem=this.widget.listItems; + return Container( + child: Padding( + padding: (isExpand==true)?const EdgeInsets.all(6.0):const EdgeInsets.all(8.0), + child: Container( + decoration:BoxDecoration( + color: Colors.white, + borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(50)):BorderRadius.all(Radius.circular(25)), + + + + + + ), + child: ExpansionTile( + key: PageStorageKey(this.widget.headerTitle), + title: Container( + width: double.infinity, + + child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22,color: Colors.black,fontWeight: FontWeight.bold),)), + + trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,color: Colors.black,):Icon(Icons.keyboard_arrow_down,color: Colors.black), + onExpansionChanged: (value){ + setState(() { + isExpand=value; + }); + }, + children: [ + for(final item in listItem) + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: (){ + print(Text("Selected Item $item "+this.widget.headerTitle )); + //========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle ))); + }, + child: Container( + width: double.infinity, + decoration:BoxDecoration( + color: Colors.white, + + border: Border(top: BorderSide(color: Theme.of(context).dividerColor)) + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(item,style: TextStyle(color: Colors.black),), + + )), + ), + ) + + + ], + + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/shared/in_patient_doctor_card.dart b/lib/widgets/shared/in_patient_doctor_card.dart deleted file mode 100644 index 483d040c..00000000 --- a/lib/widgets/shared/in_patient_doctor_card.dart +++ /dev/null @@ -1,194 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class InPatientDoctorCard extends StatelessWidget { - final String? doctorName; - final String? branch; - final DateTime? appointmentDate; - final String? profileUrl; - final String? invoiceNO; - final String? orderNo; - final Function? onTap; - final bool isPrescriptions; - final String? clinic; - final createdBy; - - InPatientDoctorCard( - {this.doctorName, - this.branch, - this.profileUrl, - this.invoiceNO, - this.onTap, - this.appointmentDate, - this.orderNo, - this.isPrescriptions = false, - this.clinic, - this.createdBy}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), - ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: InkWell( - onTap: onTap!(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: AppText( - doctorName, - bold: true, - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate ?? DateTime.now(), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - if (!isPrescriptions) - AppText( - '${AppDateUtils.getHour(appointmentDate ?? DateTime.now())}', - fontWeight: FontWeight.w600, - color: Colors.grey[700], - fontSize: 14, - ), - ], - ), - ), - ], - ), - Row( - children: [ - AppText( - 'CreatedBy ', - //bold: true, - ), - Expanded( - child: AppText( - createdBy, - bold: true, - ), - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // Container( - // child: LargeAvatar( - // name: doctorName, - // url: profileUrl, - // ), - // width: 55, - // height: 55, - // ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(10), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - // if (orderNo != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderNo + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // orderNo ?? '', - // fontSize: 14, - // ) - // ], - // ), - // if (invoiceNO != null && !isPrescriptions) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .invoiceNo + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // invoiceNO, - // fontSize: 14, - // ) - // ], - // ), - // if (clinic != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).clinic + - // ": ", - // color: Colors.grey[500], - // fontSize: 14, - // ), - // AppText( - // clinic, - // fontSize: 14, - // ) - // ], - // ), - // if (branch != null) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).branch + - // ": ", - // fontSize: 14, - // color: Colors.grey[500], - // ), - // AppText( - // branch, - // fontSize: 14, - // ) - // ], - // ) - ]), - ), - ), - Icon( - EvaIcons.eye, - ) - ], - ), - ), - ], - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index 0d7649ee..b2c2224b 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -6,15 +6,17 @@ class GifLoaderContainer extends StatefulWidget { _GifLoaderContainerState createState() => _GifLoaderContainerState(); } -class _GifLoaderContainerState extends State with TickerProviderStateMixin { - late GifController controller1; +class _GifLoaderContainerState extends State + with TickerProviderStateMixin { + GifController controller1; @override void initState() { controller1 = GifController(vsync: this); - WidgetsBinding.instance!.addPostFrameCallback((_) { - controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + WidgetsBinding.instance.addPostFrameCallback((_) { + controller1.repeat( + min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); }); super.initState(); } @@ -28,14 +30,15 @@ class _GifLoaderContainerState extends State with TickerProv @override Widget build(BuildContext context) { return Center( - //progress-loading.gif + //progress-loading.gif child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifImage( - controller: controller1, - image: AssetImage( - "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), - ), - )); + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + + controller: controller1, + image: AssetImage( + "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 2baa1c18..c61913a4 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -19,29 +19,32 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { final Function(MasterKeyModel) addHistory; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; - final String? buttonName; - final String? hintSearchText; + final String buttonName; + final String hintSearchText; MasterKeyCheckboxSearchWidget( - {Key? key, - required this.model, - required this.addSelectedHistories, - required this.removeHistory, - required this.masterList, - required this.addHistory, - required this.isServiceSelected, + {Key key, + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isServiceSelected, this.buttonName, this.hintSearchText}) : super(key: key); @override - _MasterKeyCheckboxSearchWidgetState createState() => _MasterKeyCheckboxSearchWidgetState(); + _MasterKeyCheckboxSearchWidgetState createState() => + _MasterKeyCheckboxSearchWidgetState(); } -class _MasterKeyCheckboxSearchWidgetState extends State { - List items = []; +class _MasterKeyCheckboxSearchWidgetState + extends State { + List items = List(); TextEditingController filteredSearchController = TextEditingController(); + @override void initState() { items.addAll(widget.masterList); @@ -68,7 +71,9 @@ class _MasterKeyCheckboxSearchWidgetState extends State dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { - if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || - item.nameEn!.toLowerCase().contains(query.toLowerCase())) { + if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || + item.nameEn.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 68b6c1cd..32232628 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -7,10 +7,10 @@ import 'app_loader_widget.dart'; import 'errors/error_message.dart'; class NetworkBaseView extends StatelessWidget { - final BaseViewModel? baseViewModel; - final Widget? child; + final BaseViewModel baseViewModel; + final Widget child; - NetworkBaseView({Key? key, this.baseViewModel, this.child}); + NetworkBaseView({Key key, this.baseViewModel, this.child}); @override Widget build(BuildContext context) { @@ -21,7 +21,7 @@ class NetworkBaseView extends StatelessWidget { } buildBaseViewWidget() { - switch (baseViewModel!.state) { + switch (baseViewModel.state) { case ViewState.ErrorLocal: case ViewState.Idle: case ViewState.BusyLocal: @@ -31,9 +31,7 @@ class NetworkBaseView extends StatelessWidget { return AppLoaderWidget(); break; case ViewState.Error: - return ErrorMessage( - error: baseViewModel!.error, - ); + return ErrorMessage(error: baseViewModel.error ,); break; } } diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index 804ffca8..3db93f9d 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -10,15 +10,21 @@ import 'package:flutter/material.dart'; *@desc: Profile Image Widget class */ class ProfileImageWidget extends StatelessWidget { - String? url; - String? name; - String? des; - double? height; - double? width; - Color? color; - double? fontsize; + String url; + String name; + String des; + double height; + double width; + Color color; + double fontsize; ProfileImageWidget( - {this.url, this.name, this.des, this.height, this.width, this.fontsize, this.color = Colors.black}); + {this.url, + this.name, + this.des, + this.height, + this.width, + this.fontsize, + this.color = Colors.black}); @override Widget build(BuildContext context) { @@ -26,21 +32,24 @@ class ProfileImageWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - height: height, - width: width, - child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Image.network( - url!, - fit: BoxFit.fill, - width: 700, - ), + height: height, + width: width, + child:CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius:BorderRadius.circular(50), + + child: Image.network( + url, + fit: BoxFit.fill, + width: 700, ), - backgroundColor: Colors.transparent, - )), + ), + backgroundColor: Colors.transparent, + ) + ), name == null || des == null ? SizedBox() : SizedBox( @@ -51,14 +60,18 @@ class ProfileImageWidget extends StatelessWidget { : AppText( name, fontWeight: FontWeight.bold, - fontSize: fontsize == null ? SizeConfig.textMultiplier * 3.5 : fontsize, + fontSize: fontsize == null + ? SizeConfig.textMultiplier * 3.5 + : fontsize, color: color, ), des == null ? SizedBox() : AppText( des, - fontSize: fontsize == null ? SizeConfig.textMultiplier * 2.5 : fontsize, + fontSize: fontsize == null + ? SizeConfig.textMultiplier * 2.5 + : fontsize, ) ], ); diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 3f8804de..9c622dd3 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -1,24 +1,24 @@ import 'package:flutter/material.dart'; class RoundedContainer extends StatefulWidget { - final double? width; - final double? height; - final double? raduis; - final Color? backgroundColor; - final EdgeInsets? margin; - final double? elevation; - final bool? showBorder; - final Color? borderColor; - final double? shadowWidth; - final double? shadowSpreadRadius; - final double? shadowDy; - final bool? customCornerRaduis; - final double? topLeft; - final double? bottomRight; - final double? topRight; - final double? bottomLeft; - final Widget? child; - final double? borderWidth; + final double width; + final double height; + final double raduis; + final Color backgroundColor; + final EdgeInsets margin; + final double elevation; + final bool showBorder; + final Color borderColor; + final double shadowWidth; + final double shadowSpreadRadius; + final double shadowDy; + final bool customCornerRaduis; + final double topLeft; + final double bottomRight; + final double topRight; + final double bottomLeft; + final Widget child; + final double borderWidth; RoundedContainer( {@required this.child, @@ -54,21 +54,22 @@ class _RoundedContainerState extends State { decoration: widget.showBorder == true ? BoxDecoration( color: Colors.white/*Theme.of(context).primaryColor*/, - border: Border.all(color: widget.borderColor!, width: widget.borderWidth!), - borderRadius: widget.customCornerRaduis! + border: Border.all( + color: widget.borderColor, width: widget.borderWidth), + borderRadius: widget.customCornerRaduis ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft!), - topRight: Radius.circular(widget.topRight!), - bottomRight: Radius.circular(widget.bottomRight!), - bottomLeft: Radius.circular(widget.bottomLeft!)) - : BorderRadius.circular(widget.raduis!), + topLeft: Radius.circular(widget.topLeft), + topRight: Radius.circular(widget.topRight), + bottomRight: Radius.circular(widget.bottomRight), + bottomLeft: Radius.circular(widget.bottomLeft)) + : BorderRadius.circular(widget.raduis), boxShadow: [ BoxShadow( - color: Colors.grey.withOpacity(widget.shadowWidth!), - spreadRadius: widget.shadowSpreadRadius!, + color: Colors.grey.withOpacity(widget.shadowWidth), + spreadRadius: widget.shadowSpreadRadius, blurRadius: 5, offset: Offset( - 0, widget.shadowDy!), // changes position of shadow + 0, widget.shadowDy), // changes position of shadow ), ], ) @@ -76,13 +77,13 @@ class _RoundedContainerState extends State { child: Card( margin: EdgeInsets.all(0), shape: RoundedRectangleBorder( - borderRadius: widget.customCornerRaduis! + borderRadius: widget.customCornerRaduis ? BorderRadius.only( - topLeft: Radius.circular(widget.topLeft!), - topRight: Radius.circular(widget.topRight!), - bottomRight: Radius.circular(widget.bottomRight!), - bottomLeft: Radius.circular(widget.bottomLeft!)) - : BorderRadius.circular(widget.raduis!), + topLeft: Radius.circular(widget.topLeft), + topRight: Radius.circular(widget.topRight), + bottomRight: Radius.circular(widget.bottomRight), + bottomLeft: Radius.circular(widget.bottomLeft)) + : BorderRadius.circular(widget.raduis), ), color: widget.backgroundColor, child: widget.child, diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index 48049274..dad7e2d1 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -15,7 +15,7 @@ class SpeechToText { static var dialog; static stt.SpeechToText speech = stt.SpeechToText(); SpeechToText({ - required this.context, + @required this.context, }); showAlertDialog(BuildContext context) { @@ -44,7 +44,7 @@ typedef Disposer = void Function(); class MyStatefulBuilder extends StatefulWidget { const MyStatefulBuilder({ // @required this.builder, - required this.dispose, + @required this.dispose, }); //final StatefulWidgetBuilder builder; @@ -57,12 +57,15 @@ class MyStatefulBuilder extends StatefulWidget { class _MyStatefulBuilderState extends State { var event = RobotProvider(); var searchText; - static StreamSubscription? streamSubscription; + static StreamSubscription streamSubscription; static var isClosed = false; @override void initState() { streamSubscription = event.controller.stream.listen((p) { - if ((p['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && isClosed == false) && + if ((p['searchText'] != 'null' && + p['searchText'] != null && + p['searchText'] != "" && + isClosed == false) && mounted) { setState(() { searchText = p['searchText']; @@ -101,7 +104,8 @@ class _MyStatefulBuilderState extends State { margin: EdgeInsets.all(20), padding: EdgeInsets.all(10), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), border: Border.all(width: 2, color: Colors.red)), + borderRadius: BorderRadius.circular(100), + border: Border.all(width: 2, color: Colors.red)), child: Icon( Icons.mic, color: Colors.blue, @@ -130,7 +134,8 @@ class _MyStatefulBuilderState extends State { ? Center( child: InkWell( child: Container( - decoration: BoxDecoration(border: Border.all(color: Colors.grey[300]!)), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey[300])), padding: EdgeInsets.all(5), child: AppText( 'Try Again', diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index a9da7546..086375bb 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -9,26 +9,26 @@ import 'package:provider/provider.dart'; import '../app_texts_widget.dart'; class AppTextFieldCustom extends StatefulWidget { - final double? height; - final GestureTapCallback? onClick; - final String? hintText; - final TextEditingController? controller; - final bool? isTextFieldHasSuffix; - final bool? hasBorder; - final String? dropDownText; - final IconButton? suffixIcon; - final Color? dropDownColor; - final bool? enabled; - final TextInputType? inputType; - final int? minLines; - final int? maxLines; - final List? inputFormatters; - final Function(String)? onChanged; - final Function? onFieldSubmitted; + final double height; + final Function onClick; + final String hintText; + final TextEditingController controller; + final bool isTextFieldHasSuffix; + final bool hasBorder; + final String dropDownText; + final IconButton suffixIcon; + final Color dropDownColor; + final bool enabled; + final TextInputType inputType; + final int minLines; + final int maxLines; + final List inputFormatters; + final Function(String) onChanged; + final Function onFieldSubmitted; - final String? validationError; - final bool? isPrscription; - final bool? isSecure; + final String validationError; + final bool isPrscription; + final bool isSecure; final bool focus; final bool isSearchTextField; @@ -94,12 +94,18 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height! + 8 : null, - decoration: widget.hasBorder! + height: widget.height != 0 && widget.maxLines == 1 + ? widget.height + 8 + : null, + decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), widget.validationError == null ? Color(0xFFEFEFEF) : Colors.red.shade700) + Color(0Xffffffff), + widget.validationError == null + ? Color(0xFFEFEFEF) + : Colors.red.shade700) : null, - padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + padding: + EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), child: InkWell( onTap: widget.onClick ?? null, child: Row( @@ -116,24 +122,34 @@ class _AppTextFieldCustomState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - if ((widget.controller != null && widget.controller!.text != "") || widget.dropDownText != null) + if ((widget.controller != null && + widget.controller.text != "") || + widget.dropDownText != null) AppText( widget.hintText, // marginTop: widget.hasHintmargin ? 0 : 30, color: Color(0xFF2E303A), - fontSize: widget.isPrscription == false ? SizeConfig.getHeightMultiplier() * + fontSize: widget.isPrscription == false + ? SizeConfig.getHeightMultiplier() * (SizeConfig.isWidthLarge ? 1.1 : 1.3) : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null ? Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height! - 22 : null, + height: + widget.height != 0 && widget.maxLines == 1 + ? widget.height - 22 + : null, child: TextFormField( - textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, + textAlign: projectViewModel.isArabic + ? TextAlign.right + : TextAlign.left, focusNode: _focusNode, textAlignVertical: TextAlignVertical.center, - decoration: TextFieldsUtils.textFieldSelectorDecoration(widget.hintText!, "", true), + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + widget.hintText, null, true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, fontFamily: 'Poppins', @@ -141,19 +157,24 @@ class _AppTextFieldCustomState extends State { ), controller: widget.controller, keyboardType: widget.inputType ?? - (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), + (widget.maxLines == 1 + ? TextInputType.text + : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [], + inputFormatters: + widget.inputFormatters != null + ? widget.inputFormatters + : [], onChanged: (value) { setState(() {}); if (widget.onChanged != null) { - widget.onChanged!(value); + widget.onChanged(value); } }, - onFieldSubmitted: widget.onFieldSubmitted!(), - obscureText: widget.isSecure!), + onFieldSubmitted: widget.onFieldSubmitted, + obscureText: widget.isSecure), ) : AppText( widget.dropDownText, @@ -165,12 +186,12 @@ class _AppTextFieldCustomState extends State { ), ), ), - widget.isTextFieldHasSuffix! + widget.isTextFieldHasSuffix ? widget.suffixIcon != null ? Container( margin: EdgeInsets.only( bottom: widget.isSearchTextField - ? (widget.controller!.text.isEmpty || + ? (widget.controller.text.isEmpty || widget.controller == null) ? 10 : 25 @@ -179,7 +200,9 @@ class _AppTextFieldCustomState extends State { : InkWell( child: Icon( Icons.keyboard_arrow_down, - color: widget.dropDownColor != null ? widget.dropDownColor : Colors.black, + color: widget.dropDownColor != null + ? widget.dropDownColor + : Colors.black, ), ) : Container(), @@ -187,7 +210,8 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget.validationError!), + if (widget.validationError != null && widget.validationError.isNotEmpty) + TextFieldsError(error: widget.validationError), ], ); } diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index cdc6b09d..2a5304e2 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -7,7 +7,7 @@ import 'app-textfield-custom.dart'; class AppTextFieldCustomSearch extends StatelessWidget { const AppTextFieldCustomSearch({ - Key? key, + Key key, this.onChangeFun, this.positionedChild, this.marginTop, @@ -20,23 +20,23 @@ class AppTextFieldCustomSearch extends StatelessWidget { this.hintText, }); - final TextEditingController? searchController; + final TextEditingController searchController; - final Function? onChangeFun; - final Function? onFieldSubmitted; + final Function onChangeFun; + final Function onFieldSubmitted; - final Widget ?positionedChild; - final IconButton? suffixIcon; - final double? marginTop; - final String? validationError; - final String? hintText; + final Widget positionedChild; + final IconButton suffixIcon; + final double marginTop; + final String validationError; + final String hintText; - final TextInputType? inputType; - final List? inputFormatters; + final TextInputType inputType; + final List inputFormatters; @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!), + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), child: Stack( children: [ AppTextFieldCustom( @@ -54,11 +54,11 @@ class AppTextFieldCustomSearch extends StatelessWidget { onPressed: () {}, ), controller: searchController, - onChanged: onChangeFun!(), + onChanged: onChangeFun, onFieldSubmitted: onFieldSubmitted, validationError: validationError), if (positionedChild != null) - Positioned(right: 35, top: 5, child: positionedChild!) + Positioned(right: 35, top: 5, child: positionedChild) ], ), ); diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index 1418b590..cf5f0abf 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart'; class AppTextFormField extends FormField { AppTextFormField( - {FormFieldSetter? onSaved, - String? inputFormatter, - FormFieldValidator? validator, - ValueChanged? onChanged, - GestureTapCallback? onTap, + {FormFieldSetter onSaved, + String inputFormatter, + FormFieldValidator validator, + ValueChanged onChanged, + GestureTapCallback onTap, bool obscureText = false, - TextEditingController? controller, + TextEditingController controller, bool autovalidate = true, - TextInputType? textInputType, - String? hintText, - FocusNode? focusNode, - TextInputAction textInputAction = TextInputAction.done, - ValueChanged? onFieldSubmitted, - IconButton? prefix, - String? labelText, - IconData? suffixIcon, + TextInputType textInputType, + String hintText, + FocusNode focusNode, + TextInputAction textInputAction=TextInputAction.done, + ValueChanged onFieldSubmitted, + IconButton prefix, + String labelText, + IconData suffixIcon, bool readOnly = false, borderColor}) : super( @@ -55,17 +55,24 @@ class AppTextFormField extends FormField { hintStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.8, ), - contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + contentPadding: + EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), labelText: labelText, labelStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(6)), - borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), ), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: borderColor != null ? borderColor : HexColor("#CCCCCC")), + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), borderRadius: BorderRadius.all(Radius.circular(6)), ) //BorderRadius.all(Radius.circular(20)); @@ -76,7 +83,7 @@ class AppTextFormField extends FormField { ), state.hasError ? Text( - state.errorText ?? "", + state.errorText, style: TextStyle(color: Colors.red), ) : Container() diff --git a/lib/widgets/shared/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/text_fields/auto_complete_text_field.dart index d5875d43..3b563f3f 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -8,11 +8,13 @@ class CustomAutoCompleteTextField extends StatelessWidget { final Widget child; const CustomAutoCompleteTextField({ - Key? key, - required this.isShowError, - required this.child, + Key key, + this.isShowError, + this.child, }) : super(key: key); + + @override Widget build(BuildContext context) { return Container( @@ -23,12 +25,13 @@ class CustomAutoCompleteTextField extends StatelessWidget { Color(0Xffffffff), isShowError ? Colors.red.shade700 : Color(0xFFEFEFEF), ), - padding: EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), + padding: + EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0), child: child, ), if (isShowError) TextFieldsError( - error: TranslationBase.of(context).emptyMessage ?? "", + error: TranslationBase.of(context).emptyMessage, ) ], ), diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart index 145ece5e..baed4995 100644 --- a/lib/widgets/shared/text_fields/country_textfield_custom.dart +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -7,16 +7,16 @@ import 'package:flutter/material.dart'; class CountryTextField extends StatefulWidget { final dynamic element; - final String? elementError; - final List? elementList; - final String? keyName; - final String? keyId; - final String? hintText; - final double? width; - final Function(dynamic)? okFunction; + final String elementError; + final List elementList; + final String keyName; + final String keyId; + final String hintText; + final double width; + final Function(dynamic) okFunction; CountryTextField( - {Key? key, + {Key key, @required this.element, @required this.elementError, this.width, @@ -41,14 +41,14 @@ class _CountryTextfieldState extends State { ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: widget.elementList!, + list: widget.elementList, attributeName: '${widget.keyName}', - attributeValueId: widget.elementList!.length == 1 - ? widget.elementList![0]['${widget.keyId}'] + attributeValueId: widget.elementList.length == 1 + ? widget.elementList[0]['${widget.keyId}'] : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => - widget.okFunction!(selectedValue), + widget.okFunction(selectedValue), ); showDialog( barrierDismissible: false, @@ -61,14 +61,14 @@ class _CountryTextfieldState extends State { : null, child: AppTextFieldCustom( hintText: widget.hintText, - dropDownText: widget.elementList!.length == 1 - ? widget.elementList![0]['${widget.keyName}'] + dropDownText: widget.elementList.length == 1 + ? widget.elementList[0]['${widget.keyName}'] : widget.element != null ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, validationError: - widget.elementList!.length != 1 ? widget.elementError : null, + widget.elementList.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index df174f47..71359604 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -12,16 +12,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { - final String hint; - final String? initialText; - final double height; - final BoxDecoration? decoration; - final bool darkMode; - final bool showBottomToolbar; - final List? toolbar; - final HtmlEditorController controller; - - HtmlRichEditor({ + HtmlRichEditor({ key, this.hint = "Your text here...", this.initialText, @@ -30,18 +21,26 @@ class HtmlRichEditor extends StatefulWidget { this.darkMode = false, this.showBottomToolbar = false, this.toolbar, - required this.controller, }) : super(key: key); + final String hint; + final String initialText; + final double height; + final BoxDecoration decoration; + final bool darkMode; + final bool showBottomToolbar; + final List toolbar; + @override _HtmlRichEditorState createState() => _HtmlRichEditorState(); } class _HtmlRichEditorState extends State { - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); + @override void initState() { @@ -56,6 +55,8 @@ class _HtmlRichEditorState extends State { super.initState(); } + + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -63,42 +64,51 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - controller: widget.controller, - htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ - StyleButtons(), - FontSettingButtons(), - FontButtons(), - // ColorButtons(), - ListButtons(), - ParagraphButtons(), - // InsertButtons(), - // OtherButtons(), - ]), - htmlEditorOptions: HtmlEditorOptions( - hint: widget.hint, - initialText: widget.initialText, - darkMode: widget.darkMode, - ), - otherOptions: OtherOptions( - height: widget.height, - decoration: widget.decoration ?? - BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.all( - Radius.circular(30.0), - ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), - ), - )), + hint: widget.hint, + height: widget.height, + initialText: widget.initialText, + showBottomToolbar: widget.showBottomToolbar, + darkMode: widget.darkMode, + decoration: widget.decoration ?? + BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.all( + Radius.circular(30.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + toolbar: widget.toolbar ?? + const [ + // Style(), + Font(buttons: [ + FontButtons.bold, + FontButtons.italic, + FontButtons.underline, + ]), + // ColorBar(buttons: [ColorButtons.color]), + Paragraph(buttons: [ + ParagraphButtons.ul, + ParagraphButtons.ol, + ParagraphButtons.paragraph + ]), + // Insert(buttons: [InsertButtons.link, InsertButtons.picture, InsertButtons.video, InsertButtons.table]), + // Misc(buttons: [MiscButtons.fullscreen, MiscButtons.codeview, MiscButtons.help]) + ], + ), Positioned( - top: 50, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, + top: + 50, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), onPressed: () { - initSpeechState().then((value) => {onVoiceText()}); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ], @@ -107,10 +117,12 @@ class _HtmlRichEditorState extends State { ); } + 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, @@ -138,15 +150,15 @@ class _HtmlRichEditorState extends State { ].request(); } - void resultListener(result) async { + void resultListener(result)async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await widget.controller.getText(); + String txt = await HtmlEditor.getText(); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - widget.controller.setText(txt + recognizedWord); + HtmlEditor.setText(txt+recognizedWord); }); } else { print(result.finalResult); @@ -154,7 +166,8 @@ class _HtmlRichEditorState extends State { } 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; } diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index 70729446..9917b04f 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -5,7 +5,8 @@ import 'package:hexcolor/hexcolor.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -27,7 +28,8 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -39,88 +41,77 @@ final _mobileFormatter = NumberTextInputFormatter(); class NewTextFields extends StatefulWidget { NewTextFields( - {Key? key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 15.0, - this.fontWeight = FontWeight.w500, - this.autoValidate = false, - this.hintColor, - this.isEnabled = true, - this.onTapTextFields, - this.fillColor, - this.hasBorder, - this.showLabelText, - this.borderRadius, - this.borderWidth}) + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 15.0, + this.fontWeight = FontWeight.w500, + this.autoValidate = false, + this.hintColor, + this.isEnabled = true}) : super(key: key); - final String? hintText; - final String? initialValue; - final String? type; - final bool? autoFocus; - final bool? isEnabled; - final IconData? suffixIcon; - final Color? suffixIconColor; - final Icon? prefixIcon; - final VoidCallback? onTap; - final GestureTapCallback? onTapTextFields; - final TextEditingController? controller; - final TextInputType? keyboardType; - final FormFieldValidator? validator; - final FormFieldSetter? onSaved; - final GestureTapCallback? onSuffixTap; - final ValueChanged? onChanged; - final ValueChanged? onSubmit; - final bool? readOnly; - final int? maxLength; - final int? minLines; - final int? maxLines; - final bool? maxLengthEnforced; - final bool? bare; - final TextInputAction? inputAction; - final double? fontSize; - final FontWeight? fontWeight; - final bool? keepPadding; - final TextCapitalization? textCapitalization; - final List? inputFormatters; - final bool? autoValidate; - final EdgeInsets? padding; - final bool? focus; - final bool? borderOnlyError; - final Color? hintColor; - final Color? fillColor; - final bool? hasBorder; - final bool? showLabelText; - Color? borderColor; - final double? borderRadius; - final double? borderWidth; - bool? hasLabelText; + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; @override _NewTextFieldsState createState() => _NewTextFieldsState(); } @@ -142,7 +133,7 @@ class _NewTextFieldsState extends State { @override void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus!) _focusNode.requestFocus(); + if (widget.focus) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -153,7 +144,7 @@ class _NewTextFieldsState extends State { } bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly!) { + if (widget.readOnly != null && widget.readOnly) { _focusNode.unfocus(); return true; } else { @@ -167,30 +158,34 @@ class _NewTextFieldsState extends State { duration: Duration(milliseconds: 300), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - border: Border.all(color: HexColor('#707070'), width: 0.30), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), color: Colors.white), child: Container( margin: EdgeInsets.only(top: 8), padding: EdgeInsets.only(top: 8), + + child: TextFormField( enabled: widget.isEnabled, initialValue: widget.initialValue, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate!, - textCapitalization: widget.textCapitalization!, + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) : widget.onSubmit, textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced!, - onChanged: widget.onChanged!, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, @@ -200,30 +195,34 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1!.copyWith( - fontSize: widget.fontSize, - fontWeight: widget.fontWeight, - color: Color(0xFF575757), - fontFamily: 'Poppins'), + style: Theme.of(context).textTheme.body2.copyWith( + fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] : widget.inputFormatters, decoration: InputDecoration( labelText: widget.hintText, - labelStyle: TextStyle(color: Color(0xFF2E303A), fontSize: 15, fontWeight: FontWeight.w700), + labelStyle: + TextStyle(color: Color(0xFF2E303A), fontSize:15,fontWeight: FontWeight.w700), errorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), + borderSide: BorderSide( + color: Theme.of(context).errorColor.withOpacity(0.5), + width: 1.0), borderRadius: BorderRadius.circular(12.0)), focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), + borderSide: BorderSide( + color: Theme.of(context).errorColor.withOpacity(0.5), + width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), + borderSide: BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12), diff --git a/lib/widgets/shared/text_fields/text_field_error.dart b/lib/widgets/shared/text_fields/text_field_error.dart index b327388c..9c781db0 100644 --- a/lib/widgets/shared/text_fields/text_field_error.dart +++ b/lib/widgets/shared/text_fields/text_field_error.dart @@ -6,8 +6,8 @@ import '../app_texts_widget.dart'; class TextFieldsError extends StatelessWidget { const TextFieldsError({ - Key? key, - required this.error, + Key key, + @required this.error, }) : super(key: key); final String error; diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 316e45ac..1f1ff2bb 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; -class TextFieldsUtils { - static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, +class TextFieldsUtils{ + + static BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, {double borderWidth = -1, double borderRadius = 12}) { return BoxDecoration( color: containerColor, @@ -14,8 +16,9 @@ class TextFieldsUtils { ); } - static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, - {IconData? suffixIcon, Color? dropDownColor}) { + static InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData suffixIcon, Color dropDownColor}) { return InputDecoration( isDense: true, contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), @@ -43,15 +46,13 @@ class TextFieldsUtils { borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderRadius: BorderRadius.circular(8), ),*/ - hintText: selectedText != "" ? selectedText : hintText??"", - suffixIcon: Icon( - suffixIcon ?? null, - color: Colors.grey.shade600, - ), + hintText: selectedText != null ? selectedText : hintText??"", + suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), + hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, ), ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index a88e89dd..b66d4926 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -5,17 +5,17 @@ import '../app_texts_widget.dart'; class CustomRow extends StatelessWidget { const CustomRow({ - Key? key, - this.label, - required this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, + Key key, + this.label, + this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, }) : super(key: key); - final String? label; + final String label; final String value; - final double? labelSize; - final double? valueSize; - final double? width; - final bool? isCopyable; + final double labelSize; + final double valueSize; + final double width; + final bool isCopyable; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart new file mode 100644 index 00000000..8a4891fd --- /dev/null +++ b/lib/widgets/shared/user-guid/app_anchored_overlay_widget.dart @@ -0,0 +1,183 @@ +/* + * Copyright © 2020, Simform Solutions + * All rights reserved. + * https://github.com/simformsolutions/flutter_showcaseview + */ + +/* +Customized By: Ibrahim Albitar + +*/ + +import 'package:flutter/material.dart'; + +/// Displays an overlay Widget anchored directly above the center of this +/// [AnchoredOverlay]. +/// +/// The overlay Widget is created by invoking the provided [overlayBuilder]. +/// +/// The [anchor] position is provided to the [overlayBuilder], but the builder +/// does not have to respect it. In other words, the [overlayBuilder] can +/// interpret the meaning of "anchor" however it wants - the overlay will not +/// be forced to be centered about the [anchor]. +/// +/// The overlay built by this [AnchoredOverlay] can be conditionally shown +/// and hidden by settings the [showOverlay] property to true or false. +/// +/// The [overlayBuilder] is invoked every time this Widget is rebuilt. +/// +class AnchoredOverlay extends StatelessWidget { + final bool showOverlay; + final Widget Function(BuildContext, Rect anchorBounds, Offset anchor) + overlayBuilder; + final Widget child; + + AnchoredOverlay({ + key, + this.showOverlay = false, + this.overlayBuilder, + this.child, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + return OverlayBuilder( + showOverlay: showOverlay, + overlayBuilder: (BuildContext overlayContext) { + // To calculate the "anchor" point we grab the render box of + // our parent Container and then we find the center of that box. + RenderBox box = context.findRenderObject() as RenderBox; + final topLeft = + box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); + final bottomRight = + box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); + final Rect anchorBounds = Rect.fromLTRB( + topLeft.dx, + topLeft.dy, + bottomRight.dx, + bottomRight.dy, + ); + final anchorCenter = box.size.center(topLeft); + return overlayBuilder(overlayContext, anchorBounds, anchorCenter); + }, + child: child, + ); + }, + ); + } +} + +// +// Displays an overlay Widget as constructed by the given [overlayBuilder]. +// +// The overlay built by the [overlayBuilder] can be conditionally shown and hidden by settings the [showOverlay] +// property to true or false. +// +// The [overlayBuilder] is invoked every time this Widget is rebuilt. +// +// Implementation note: the reason we rebuild the overlay every time our state changes is because there doesn't seem +// to be any better way to invalidate the overlay itself than to invalidate this Widget. +// Remember, overlay Widgets exist in [OverlayEntry]s which are inaccessible to outside Widgets. +// But if a better approach is found then feel free to use it. +// +class OverlayBuilder extends StatefulWidget { + final bool showOverlay; + final Widget Function(BuildContext) overlayBuilder; + final Widget child; + + OverlayBuilder({ + key, + this.showOverlay = false, + this.overlayBuilder, + this.child, + }) : super(key: key); + + @override + _OverlayBuilderState createState() => _OverlayBuilderState(); +} + +class _OverlayBuilderState extends State { + OverlayEntry _overlayEntry; + + @override + void initState() { + super.initState(); + + if (widget.showOverlay) { + WidgetsBinding.instance.addPostFrameCallback((_) => showOverlay()); + } + } + + @override + void didUpdateWidget(OverlayBuilder oldWidget) { + super.didUpdateWidget(oldWidget); + WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); + } + + @override + void reassemble() { + super.reassemble(); + WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay()); + } + + @override + void dispose() { + if (isShowingOverlay()) { + hideOverlay(); + } + + super.dispose(); + } + + bool isShowingOverlay() => _overlayEntry != null; + + void showOverlay() { + if (_overlayEntry == null) { + // Create the overlay. + _overlayEntry = OverlayEntry( + builder: widget.overlayBuilder, + ); + addToOverlay(_overlayEntry); + } else { + // Rebuild overlay. + buildOverlay(); + } + } + + void addToOverlay(OverlayEntry overlayEntry) async { + Overlay.of(context).insert(overlayEntry); + final overlay = Overlay.of(context); + if (overlayEntry == null) + WidgetsBinding.instance + .addPostFrameCallback((_) => overlay.insert(overlayEntry)); + } + + void hideOverlay() { + if (_overlayEntry != null) { + _overlayEntry.remove(); + _overlayEntry = null; + } + } + + void syncWidgetAndOverlay() { + if (isShowingOverlay() && !widget.showOverlay) { + hideOverlay(); + } else if (!isShowingOverlay() && widget.showOverlay) { + showOverlay(); + } + } + + void buildOverlay() async { + WidgetsBinding.instance + .addPostFrameCallback((_) => _overlayEntry?.markNeedsBuild()); + } + + @override + Widget build(BuildContext context) { + buildOverlay(); + + return widget.child; + } +} diff --git a/lib/widgets/shared/user-guid/app_get_position.dart b/lib/widgets/shared/user-guid/app_get_position.dart new file mode 100644 index 00000000..c0430994 --- /dev/null +++ b/lib/widgets/shared/user-guid/app_get_position.dart @@ -0,0 +1,75 @@ +/* + * Copyright © 2020, Simform Solutions + * All rights reserved. + * https://github.com/simformsolutions/flutter_showcaseview + */ + +/* +Customized By: Ibrahim Albitar + +*/ +import 'package:flutter/material.dart'; + +class GetPosition { + final GlobalKey key; + + GetPosition({this.key}); + + Rect getRect() { + RenderBox box = key.currentContext.findRenderObject(); + + final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); + final bottomRight = + box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); + + Rect rect = Rect.fromLTRB( + topLeft.dx, + topLeft.dy, + bottomRight.dx, + bottomRight.dy, + ); + return rect; + } + + ///Get the bottom position of the widget + double getBottom() { + RenderBox box = key.currentContext.findRenderObject(); + final bottomRight = + box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); + return bottomRight.dy; + } + + ///Get the top position of the widget + double getTop() { + RenderBox box = key.currentContext.findRenderObject(); + final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); + return topLeft.dy; + } + + ///Get the left position of the widget + double getLeft() { + RenderBox box = key.currentContext.findRenderObject(); + final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); + return topLeft.dx; + } + + ///Get the right position of the widget + double getRight() { + RenderBox box = key.currentContext.findRenderObject(); + final bottomRight = + box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); + return bottomRight.dx; + } + + double getHeight() { + return getBottom() - getTop(); + } + + double getWidth() { + return getRight() - getLeft(); + } + + double getCenter() { + return (getLeft() + getRight()) / 2; + } +} diff --git a/lib/widgets/shared/user-guid/app_shape_painter.dart b/lib/widgets/shared/user-guid/app_shape_painter.dart new file mode 100644 index 00000000..925d18d0 --- /dev/null +++ b/lib/widgets/shared/user-guid/app_shape_painter.dart @@ -0,0 +1,42 @@ +/* + * Copyright © 2020, Simform Solutions + * All rights reserved. + * https://github.com/simformsolutions/flutter_showcaseview + */ + +/* +Customized By: Ibrahim Albitar + +*/ + +import 'package:flutter/material.dart'; + +class ShapePainter extends CustomPainter { + Rect rect; + final ShapeBorder shapeBorder; + final Color color; + final double opacity; + + ShapePainter({ + @required this.rect, + this.color, + this.shapeBorder, + this.opacity, + }); + + @override + void paint(Canvas canvas, Size size) { + final paint = Paint(); + paint.color = color.withOpacity(opacity); + RRect outer = + RRect.fromLTRBR(0, 0, size.width, size.height, Radius.circular(0)); + + double radius = shapeBorder == CircleBorder() ? 50 : 3; + + RRect inner = RRect.fromRectAndRadius(rect, Radius.circular(radius)); + canvas.drawDRRect(outer, inner, paint); + } + + @override + bool shouldRepaint(CustomPainter oldDelegate) => false; +} diff --git a/lib/widgets/shared/user-guid/app_showcase.dart b/lib/widgets/shared/user-guid/app_showcase.dart new file mode 100644 index 00000000..38625279 --- /dev/null +++ b/lib/widgets/shared/user-guid/app_showcase.dart @@ -0,0 +1,349 @@ +/* + * Copyright © 2020, Simform Solutions + * All rights reserved. + * https://github.com/simformsolutions/flutter_showcaseview + */ + +/* +Customized By: Ibrahim Albitar + +*/ + +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; + +import 'app_anchored_overlay_widget.dart'; +import 'app_get_position.dart'; +import 'app_shape_painter.dart'; +import 'app_showcase_widget.dart'; +import 'app_tool_tip_widget.dart'; + +class AppShowcase extends StatefulWidget { + final Widget child; + final String title; + final String description; + final ShapeBorder shapeBorder; + final TextStyle titleTextStyle; + final TextStyle descTextStyle; + final GlobalKey key; + final Color overlayColor; + final double overlayOpacity; + final Widget container; + final Color showcaseBackgroundColor; + final Color textColor; + final bool showArrow; + final double height; + final double width; + final Duration animationDuration; + final VoidCallback onToolTipClick; + final VoidCallback onTargetClick; + final VoidCallback onSkipClick; + final bool disposeOnTap; + final bool disableAnimation; + + const AppShowcase( + {@required this.key, + @required this.child, + this.title, + @required this.description, + this.shapeBorder, + this.overlayColor = Colors.black, + this.overlayOpacity = 0.75, + this.titleTextStyle, + this.descTextStyle, + this.showcaseBackgroundColor = Colors.white, + this.textColor = Colors.black, + this.showArrow = true, + this.onTargetClick, + this.onSkipClick, + this.disposeOnTap, + this.animationDuration = const Duration(milliseconds: 2000), + this.disableAnimation = false}) + : height = null, + width = null, + container = null, + this.onToolTipClick = null, + assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, + "overlay opacity should be >= 0.0 and <= 1.0."), + assert( + onTargetClick == null + ? true + : (disposeOnTap == null ? false : true), + "disposeOnTap is required if you're using onTargetClick"), + assert( + disposeOnTap == null + ? true + : (onTargetClick == null ? false : true), + "onTargetClick is required if you're using disposeOnTap"), + assert(key != null || + child != null || + title != null || + showArrow != null || + description != null || + shapeBorder != null || + overlayColor != null || + titleTextStyle != null || + descTextStyle != null || + showcaseBackgroundColor != null || + textColor != null || + shapeBorder != null || + animationDuration != null); + + const AppShowcase.withWidget( + {this.key, + @required this.child, + @required this.container, + @required this.height, + @required this.width, + this.title, + this.description, + this.shapeBorder, + this.overlayColor = Colors.black, + this.overlayOpacity = 0.75, + this.titleTextStyle, + this.descTextStyle, + this.showcaseBackgroundColor = Colors.white, + this.textColor = Colors.black, + this.onTargetClick, + this.onSkipClick, + this.disposeOnTap, + this.animationDuration = const Duration(milliseconds: 2000), + this.disableAnimation = false}) + : this.showArrow = false, + this.onToolTipClick = null, + assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0, + "overlay opacity should be >= 0.0 and <= 1.0."), + assert(key != null || + child != null || + title != null || + description != null || + shapeBorder != null || + overlayColor != null || + titleTextStyle != null || + descTextStyle != null || + showcaseBackgroundColor != null || + textColor != null || + shapeBorder != null || + animationDuration != null); + + @override + _AppShowcaseState createState() => _AppShowcaseState(); +} + +class _AppShowcaseState extends State + with TickerProviderStateMixin { + bool _showShowCase = false; + Animation _slideAnimation; + AnimationController _slideAnimationController; + + GetPosition position; + + @override + void initState() { + super.initState(); + + _slideAnimationController = AnimationController( + duration: widget.animationDuration, + vsync: this, + )..addStatusListener((AnimationStatus status) { + if (status == AnimationStatus.completed) { + _slideAnimationController.reverse(); + } + if (_slideAnimationController.isDismissed) { + if (!widget.disableAnimation) { + _slideAnimationController.forward(); + } + } + }); + + _slideAnimation = CurvedAnimation( + parent: _slideAnimationController, + curve: Curves.easeInOut, + ); + + position = GetPosition(key: widget.key); + } + + @override + void dispose() { + _slideAnimationController.dispose(); + super.dispose(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + showOverlay(); + } + + /// + /// show overlay if there is any target widget + /// + void showOverlay() { + GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context); + setState(() { + _showShowCase = activeStep == widget.key; + }); + + if (activeStep == widget.key) { + if (!widget.disableAnimation) { + _slideAnimationController.forward(); + } + } + } + + @override + Widget build(BuildContext context) { + Size size = MediaQuery.of(context).size; + return AnchoredOverlay( + overlayBuilder: (BuildContext context, Rect rectBound, Offset offset) => + buildOverlayOnTarget(offset, rectBound.size, rectBound, size), + showOverlay: true, + child: widget.child, + ); + } + + _nextIfAny() { + ShowCaseWidget.of(context).completed(widget.key); + if (!widget.disableAnimation) { + _slideAnimationController.forward(); + } + } + + _getOnTargetTap() { + if (widget.disposeOnTap == true) { + return widget.onTargetClick == null + ? () { + ShowCaseWidget.of(context).dismiss(); + } + : () { + ShowCaseWidget.of(context).dismiss(); + widget.onTargetClick(); + }; + } else { + return widget.onTargetClick ?? _nextIfAny; + } + } + + _getOnTooltipTap() { + if (widget.disposeOnTap == true) { + return widget.onToolTipClick == null + ? () { + ShowCaseWidget.of(context).dismiss(); + } + : () { + ShowCaseWidget.of(context).dismiss(); + widget.onToolTipClick(); + }; + } else { + return widget.onToolTipClick ?? () {}; + } + } + + buildOverlayOnTarget( + Offset offset, + Size size, + Rect rectBound, + Size screenSize, + ) => + Visibility( + visible: _showShowCase, + maintainAnimation: true, + maintainState: true, + child: Stack( + children: [ + GestureDetector( + onTap: _nextIfAny, + child: Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + child: CustomPaint( + painter: ShapePainter( + opacity: widget.overlayOpacity, + rect: position.getRect(), + shapeBorder: widget.shapeBorder, + color: widget.overlayColor), + ), + ), + ), + _TargetWidget( + offset: offset, + size: size, + onTap: _getOnTargetTap(), + shapeBorder: widget.shapeBorder, + ), + AppToolTipWidget( + position: position, + offset: offset, + screenSize: screenSize, + title: widget.title, + description: widget.description, + animationOffset: _slideAnimation, + titleTextStyle: widget.titleTextStyle, + descTextStyle: widget.descTextStyle, + container: widget.container, + tooltipColor: widget.showcaseBackgroundColor, + textColor: widget.textColor, + showArrow: widget.showArrow, + contentHeight: widget.height, + contentWidth: widget.width, + onTooltipTap: _getOnTooltipTap(), + ), + GestureDetector( + child: AppText( + "Skip", + color: Colors.white, + fontSize: 20, + marginRight: 15, + marginLeft: 15, + marginTop: 15, + ), + onTap: widget.onSkipClick) + ], + ), + ); +} + +class _TargetWidget extends StatelessWidget { + final Offset offset; + final Size size; + final Animation widthAnimation; + final VoidCallback onTap; + final ShapeBorder shapeBorder; + + _TargetWidget({ + Key key, + @required this.offset, + this.size, + this.widthAnimation, + this.onTap, + this.shapeBorder, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Positioned( + top: offset.dy, + left: offset.dx, + child: FractionalTranslation( + translation: const Offset(-0.5, -0.5), + child: GestureDetector( + onTap: onTap, + child: Container( + height: size.height + 16, + width: size.width + 16, + decoration: ShapeDecoration( + shape: shapeBorder ?? + RoundedRectangleBorder( + borderRadius: const BorderRadius.all( + Radius.circular(8), + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/shared/user-guid/app_showcase_widget.dart b/lib/widgets/shared/user-guid/app_showcase_widget.dart new file mode 100644 index 00000000..07577b3b --- /dev/null +++ b/lib/widgets/shared/user-guid/app_showcase_widget.dart @@ -0,0 +1,97 @@ +/* + * Copyright © 2020, Simform Solutions + * All rights reserved. + * https://github.com/simformsolutions/flutter_showcaseview + */ + +/* +Customized By: Ibrahim Albitar + +*/ + +import 'package:flutter/material.dart'; + +class ShowCaseWidget extends StatefulWidget { + final Builder builder; + final VoidCallback onFinish; + + const ShowCaseWidget({@required this.builder, this.onFinish}); + + static activeTargetWidget(BuildContext context) { + return context + .dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>() + .activeWidgetIds; + } + + static ShowCaseWidgetState of(BuildContext context) { + ShowCaseWidgetState state = + context.findAncestorStateOfType(); + if (state != null) { + return context.findAncestorStateOfType(); + } else { + throw Exception('Please provide ShowCaseView context'); + } + } + + @override + ShowCaseWidgetState createState() => ShowCaseWidgetState(); +} + +class ShowCaseWidgetState extends State { + List ids; + int activeWidgetId; + + void startShowCase(List widgetIds) { + setState(() { + this.ids = widgetIds; + activeWidgetId = 0; + }); + } + + void completed(GlobalKey id) { + if (ids != null && ids[activeWidgetId] == id) { + setState(() { + ++activeWidgetId; + + if (activeWidgetId >= ids.length) { + _cleanupAfterSteps(); + if (widget.onFinish != null) { + widget.onFinish(); + } + } + }); + } + } + + void dismiss() { + setState(() { + _cleanupAfterSteps(); + }); + } + + void _cleanupAfterSteps() { + ids = null; + activeWidgetId = null; + } + + @override + Widget build(BuildContext context) { + return _InheritedShowCaseView( + child: widget.builder, + activeWidgetIds: ids?.elementAt(activeWidgetId), + ); + } +} + +class _InheritedShowCaseView extends InheritedWidget { + final GlobalKey activeWidgetIds; + + _InheritedShowCaseView({ + @required this.activeWidgetIds, + @required child, + }) : super(child: child); + + @override + bool updateShouldNotify(_InheritedShowCaseView oldWidget) => + oldWidget.activeWidgetIds != activeWidgetIds; +} diff --git a/lib/widgets/shared/user-guid/app_tool_tip_widget.dart b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart new file mode 100644 index 00000000..285caa8e --- /dev/null +++ b/lib/widgets/shared/user-guid/app_tool_tip_widget.dart @@ -0,0 +1,290 @@ +/* + * Copyright © 2020, Simform Solutions + * All rights reserved. + * https://github.com/simformsolutions/flutter_showcaseview + */ + +/* +Customized By: Ibrahim Albitar + +*/ + +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +import 'app_get_position.dart'; + +class AppToolTipWidget extends StatelessWidget { + final GetPosition position; + final Offset offset; + final Size screenSize; + final String title; + final String description; + final Animation animationOffset; + final TextStyle titleTextStyle; + final TextStyle descTextStyle; + final Widget container; + final Color tooltipColor; + final Color textColor; + final bool showArrow; + final double contentHeight; + final double contentWidth; + static bool isArrowUp; + final VoidCallback onTooltipTap; + + AppToolTipWidget({ + this.position, + this.offset, + this.screenSize, + this.title, + this.description, + this.animationOffset, + this.titleTextStyle, + this.descTextStyle, + this.container, + this.tooltipColor, + this.textColor, + this.showArrow, + this.contentHeight, + this.contentWidth, + this.onTooltipTap, + }); + + bool isCloseToTopOrBottom(Offset position) { + double height = 120; + if (contentHeight != null) { + height = contentHeight; + } + return (screenSize.height - position.dy) <= height; + } + + String findPositionForContent(Offset position) { + if (isCloseToTopOrBottom(position)) { + return 'ABOVE'; + } else { + return 'BELOW'; + } + } + + double _getTooltipWidth() { + double titleLength = title == null ? 0 : (title.length * 10.0); + double descriptionLength = (description.length * 7.0); + if (titleLength > descriptionLength) { + return titleLength + 10; + } else { + return descriptionLength + 10; + } + } + + bool _isLeft() { + double screenWidth = screenSize.width / 3; + return !(screenWidth <= position.getCenter()); + } + + bool _isRight() { + double screenWidth = screenSize.width / 3; + return ((screenWidth * 2) <= position.getCenter()); + } + + double _getLeft() { + if (_isLeft()) { + double leftPadding = position.getCenter() - (_getTooltipWidth() * 0.1); + if (leftPadding + _getTooltipWidth() > screenSize.width) { + leftPadding = (screenSize.width - 20) - _getTooltipWidth(); + } + if (leftPadding < 20) { + leftPadding = 14; + } + return leftPadding; + } else if (!(_isRight())) { + return position.getCenter() - (_getTooltipWidth() * 0.5); + } else { + return null; + } + } + + double _getRight() { + if (_isRight()) { + double rightPadding = position.getCenter() + (_getTooltipWidth() / 2); + if (rightPadding + _getTooltipWidth() > screenSize.width) { + rightPadding = 14; + } + return rightPadding; + } else if (!(_isLeft())) { + return position.getCenter() - (_getTooltipWidth() * 0.5); + } else { + return null; + } + } + + double _getSpace() { + double space = position.getCenter() - (contentWidth / 2); + if (space + contentWidth > screenSize.width) { + space = screenSize.width - contentWidth - 8; + } else if (space < (contentWidth / 2)) { + space = 16; + } + return space; + } + + @override + Widget build(BuildContext context) { + final contentOrientation = findPositionForContent(offset); + final contentOffsetMultiplier = contentOrientation == "BELOW" ? 1.0 : -1.0; + isArrowUp = contentOffsetMultiplier == 1.0 ? true : false; + + final contentY = isArrowUp + ? position.getBottom() + (contentOffsetMultiplier * 3) + : position.getTop() + (contentOffsetMultiplier * 3); + + final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); + + double paddingTop = isArrowUp ? 22 : 0; + double paddingBottom = isArrowUp ? 0 : 27; + + if (!showArrow) { + paddingTop = 10; + paddingBottom = 10; + } + + if (container == null) { + return Stack( + children: [ + showArrow ? _getArrow(contentOffsetMultiplier) : Container(), + Positioned( + top: contentY, + left: _getLeft(), + right: _getRight(), + child: FractionalTranslation( + translation: Offset(0.0, contentFractionalOffset), + child: SlideTransition( + position: Tween( + begin: Offset(0.0, contentFractionalOffset / 10), + end: Offset(0.0, 0.100), + ).animate(animationOffset), + child: Material( + color: Colors.transparent, + child: Container( + padding: + EdgeInsets.only(top: paddingTop, bottom: paddingBottom), + child: ClipRRect( + borderRadius: BorderRadius.circular(8), + child: GestureDetector( + onTap: onTooltipTap, + child: Container( + width: _getTooltipWidth(), + padding: EdgeInsets.symmetric(vertical: 8), + color: tooltipColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: Column( + crossAxisAlignment: title != null + ? CrossAxisAlignment.start + : CrossAxisAlignment.center, + children: [ + title != null + ? Row( + children: [ + Padding( + padding: + const EdgeInsets.all(8.0), + child: Icon( + DoctorApp.search_patient), + ), + AppText( + title, + color: textColor, + margin: 2, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ], + ) + : Container(), + AppText( + description, + color: textColor, + margin: 8, + ), + ], + ), + ) + ], + ), + ), + ), + ), + ), + ), + ), + ), + ) + ], + ); + } else { + return Stack( + children: [ + Positioned( + left: _getSpace(), + top: contentY - 10, + child: FractionalTranslation( + translation: Offset(0.0, contentFractionalOffset), + child: SlideTransition( + position: Tween( + begin: Offset(0.0, contentFractionalOffset / 5), + end: Offset(0.0, 0.100), + ).animate(animationOffset), + child: Material( + color: Colors.transparent, + child: GestureDetector( + onTap: onTooltipTap, + child: Container( + padding: EdgeInsets.only( + top: paddingTop, + ), + color: Colors.transparent, + child: Center( + child: container, + ), + ), + ), + ), + ), + ), + ), + ], + ); + } + } + + Widget _getArrow(contentOffsetMultiplier) { + final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0); + return Positioned( + top: isArrowUp ? position.getBottom() : position.getTop() - 1, + left: position.getCenter() - 24, + child: FractionalTranslation( + translation: Offset(0.0, contentFractionalOffset), + child: SlideTransition( + position: Tween( + begin: Offset(0.0, contentFractionalOffset / 5), + end: Offset(0.0, 0.150), + ).animate(animationOffset), + child: isArrowUp + ? Icon( + Icons.arrow_drop_up, + color: tooltipColor, + size: 50, + ) + : Icon( + Icons.arrow_drop_down, + color: tooltipColor, + size: 50, + ), + ), + ), + ); + } +} diff --git a/lib/widgets/shared/user-guid/custom_validation_error.dart b/lib/widgets/shared/user-guid/custom_validation_error.dart index bbdb1f1a..fd1f2125 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -1,18 +1,21 @@ + 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'; // ignore: must_be_immutable class CustomValidationError extends StatelessWidget { - String? error; + String error; CustomValidationError({ - Key? key, - this.error, + Key key, this.error, }) : super(key: key); @override Widget build(BuildContext context) { - if (error == null) error = TranslationBase.of(context).emptyMessage; + if(error == null ) + error = TranslationBase + .of(context) + .emptyMessage; return Column( children: [ SizedBox( @@ -20,13 +23,11 @@ class CustomValidationError extends StatelessWidget { ), Container( margin: EdgeInsets.symmetric(horizontal: 3), - child: AppText( - error, - color: Theme.of(context).errorColor, - fontSize: 14, - ), + child: AppText(error, color: Theme + .of(context) + .errorColor, fontSize: 14,), ), ], ); } -} +} \ No newline at end of file diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart new file mode 100644 index 00000000..9197a4a1 --- /dev/null +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -0,0 +1,196 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InPatientDoctorCard extends StatelessWidget { + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final Function onTap; + final bool isPrescriptions; + final String clinic; + final createdBy; + + InPatientDoctorCard( + {this.doctorName, + this.branch, + this.profileUrl, + this.invoiceNO, + this.onTap, + this.appointmentDate, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.createdBy}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: AppText( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (!isPrescriptions) + AppText( + '${AppDateUtils.getHour(appointmentDate)}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + Row( + children: [ + AppText( + 'CreatedBy ', + //bold: true, + ), + Expanded( + child: AppText( + createdBy, + bold: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Container( + // child: LargeAvatar( + // name: doctorName, + // url: profileUrl, + // ), + // width: 55, + // height: 55, + // ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // if (orderNo != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderNo + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // orderNo ?? '', + // fontSize: 14, + // ) + // ], + // ), + // if (invoiceNO != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .invoiceNo + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // invoiceNO, + // fontSize: 14, + // ) + // ], + // ), + // if (clinic != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).clinic + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // clinic, + // fontSize: 14, + // ) + // ], + // ), + // if (branch != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).branch + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // branch, + // fontSize: 14, + // ) + // ], + // ) + ]), + ), + ), + Icon( + EvaIcons.eye, + ) + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 242fd84b..7cd3826c 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -4,25 +4,30 @@ import 'package:flutter/material.dart'; /// [page] class FadePage extends PageRouteBuilder { final Widget page; - FadePage({required this.page}) - : super( - opaque: false, - settings: RouteSettings(name: page.runtimeType.toString()),fullscreenDialog: true, - barrierDismissible: true, - barrierColor: Colors.black.withOpacity(0.8), - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page, - transitionDuration: Duration(milliseconds: 300), - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) { - return FadeTransition(opacity: animation, child: child); - }); -} + FadePage({this.page}) + : super( + opaque: false, + settings: RouteSettings(name: page.runtimeType.toString()), + fullscreenDialog: true, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.8), + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionDuration: Duration(milliseconds: 300), + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return FadeTransition( + opacity: animation, + child: child + ); + } + ); +} \ No newline at end of file diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index 1893a172..ee0b7473 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; - final String? settingRoute; + final String settingRoute; - SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) + SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, diff --git a/pubspec.lock b/pubspec.lock index 957312ba..3e9968d3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,35 +7,35 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "30.0.0" + version: "12.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "0.40.6" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "2.0.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.5.0-nullsafety.1" autocomplete_textfield: dependency: "direct main" description: @@ -63,84 +63,84 @@ packages: name: bazel_worker url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.1.25" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "1.6.2" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.4.5" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.7" build_modules: dependency: transitive description: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "4.0.3" + version: "3.0.4" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "1.5.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "1.11.1" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.2.2" + version: "6.1.7" build_web_compilers: dependency: "direct dev" description: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "3.2.1" + version: "2.12.2" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.1.1" + version: "4.3.2" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.3" + version: "7.1.0" cached_network_image: dependency: "direct main" description: @@ -154,301 +154,287 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.2.0-nullsafety.1" charts_common: dependency: transitive description: name: charts_common url: "https://pub.dartlang.org" source: hosted - version: "0.10.0" + version: "0.9.0" charts_flutter: dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.10.0" + version: "0.9.0" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.4" chewie: dependency: transitive description: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "1.2.2" + version: "0.9.10" chewie_audio: dependency: transitive description: name: chewie_audio url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.0.0+1" cli_util: dependency: transitive description: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.3.5" + version: "0.2.0" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "3.7.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.15.0-nullsafety.3" connectivity: dependency: "direct main" description: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "3.0.6" + version: "0.4.9+5" connectivity_for_web: dependency: transitive description: name: connectivity_for_web url: "https://pub.dartlang.org" source: hosted - version: "0.4.0+1" + version: "0.3.1+4" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.2.1+2" + version: "0.1.0+7" connectivity_platform_interface: dependency: transitive description: name: connectivity_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.6" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.5" + css_colors: + dependency: transitive + description: + name: css_colors + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.17.1" + version: "0.16.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "0.1.3" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "1.3.10" date_time_picker: dependency: "direct main" description: name: date_time_picker url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.1.1" device_info: dependency: "direct main" description: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.4.2+10" device_info_platform_interface: dependency: transitive description: name: device_info_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.1" dropdown_search: dependency: "direct main" description: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.4.9" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "1.2.6" eva_icons_flutter: dependency: "direct main" description: name: eva_icons_flutter url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "2.0.1" expandable: dependency: "direct main" description: name: expandable url: "https://pub.dartlang.org" source: hosted - version: "5.0.1" + version: "4.1.4" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "0.1.3" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" - file_picker: - dependency: "direct main" - description: - name: file_picker - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" + version: "5.2.1" firebase: dependency: transitive description: name: firebase url: "https://pub.dartlang.org" source: hosted - version: "9.0.2" + version: "7.3.3" firebase_analytics: dependency: "direct main" description: name: firebase_analytics url: "https://pub.dartlang.org" source: hosted - version: "8.3.4" + version: "6.3.0" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.3" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.0+1" + version: "0.1.1" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "0.5.3" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "2.1.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "0.2.1+1" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "10.0.9" - firebase_messaging_platform_interface: - dependency: transitive - description: - name: firebase_messaging_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.9" - firebase_messaging_web: - dependency: transitive - description: - name: firebase_messaging_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" + version: "7.0.3" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.10.11" fl_chart: dependency: "direct main" description: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.36.4" + version: "0.12.3" flutter: dependency: "direct main" description: flutter @@ -468,20 +454,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" - flutter_colorpicker: - dependency: "direct main" - description: - name: flutter_colorpicker - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" flutter_device_type: dependency: "direct main" description: name: flutter_device_type url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.2.0" flutter_flexible_toast: dependency: "direct main" description: @@ -502,54 +481,19 @@ packages: name: flutter_html url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "1.0.2" flutter_inappwebview: dependency: transitive description: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "5.3.2" - flutter_keyboard_visibility: - dependency: transitive - description: - name: flutter_keyboard_visibility - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0" - flutter_keyboard_visibility_platform_interface: - dependency: transitive - description: - name: flutter_keyboard_visibility_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_web: - dependency: transitive - description: - name: flutter_keyboard_visibility_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_layout_grid: - dependency: transitive - description: - name: flutter_layout_grid - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" + version: "4.0.0+4" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_math_fork: - dependency: transitive - description: - name: flutter_math_fork - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3+1" flutter_page_indicator: dependency: transitive description: @@ -563,21 +507,21 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "1.0.11" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.3.4" flutter_svg: dependency: transitive description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.22.0" + version: "0.18.1" flutter_swiper: dependency: "direct main" description: @@ -601,42 +545,35 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "9.2.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" + version: "8.12.0" get_it: dependency: "direct main" description: name: get_it url: "https://pub.dartlang.org" source: hosted - version: "7.2.0" + version: "4.0.4" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "1.2.0" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "0.2.0" hexcolor: dependency: "direct main" description: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "1.0.6" hijri: dependency: transitive description: @@ -657,49 +594,49 @@ packages: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.15.0" + version: "0.14.0+4" html_editor_enhanced: dependency: "direct main" description: name: html_editor_enhanced url: "https://pub.dartlang.org" source: hosted - version: "2.2.0+1-dev.1" + version: "1.3.0" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.4" + version: "0.12.2" http_interceptor: dependency: "direct main" description: name: http_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.2.0" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.2.0" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "3.1.4" image: dependency: transitive description: name: image url: "https://pub.dartlang.org" source: hosted - version: "3.0.8" + version: "2.1.19" imei_plugin: dependency: "direct main" description: @@ -707,104 +644,97 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" - infinite_listview: - dependency: transitive - description: - name: infinite_listview - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.17.0" + version: "0.16.1" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "0.3.5" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.3.0" + version: "3.1.1" local_auth: dependency: "direct main" description: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "0.6.3+4" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "0.11.4" maps_launcher: dependency: "direct main" description: name: maps_launcher url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.2.2+2" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.9.7" nested: dependency: transitive description: name: nested url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" - numberpicker: + version: "0.0.4" + node_interop: dependency: transitive description: - name: numberpicker + name: node_interop url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" - numerus: + version: "1.2.1" + node_io: dependency: transitive description: - name: numerus + name: node_io url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.2.0" octo_image: dependency: transitive description: @@ -812,188 +742,181 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.3.0" + open_iconic_flutter: + dependency: transitive + description: + name: open_iconic_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "1.9.3" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.1" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.5.1+1" + version: "0.4.1+1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "0.1.4" path_provider: dependency: transitive description: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.7" + version: "1.6.28" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "0.0.1+2" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.0.4+8" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "0.0.4+3" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.1" + version: "1.9.2" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "3.4.0" + version: "2.1.9+1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.7.0" + version: "2.0.2" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "3.1.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "2.2.1" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" - pointer_interceptor: - dependency: transitive - description: - name: pointer_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+1" + version: "1.0.3" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.4.0" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.4" + version: "3.0.13" + progress_hud_v2: + dependency: "direct main" + description: + name: progress_hud_v2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" protobuf: dependency: transitive description: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.1.4" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "4.3.3" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.4.4" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "0.1.8" quiver: dependency: "direct main" description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1+1" + version: "2.1.5" rxdart: dependency: transitive description: @@ -1007,77 +930,70 @@ packages: name: scratch_space url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - shared_preferences_android: + version: "0.0.4+3" + screen: dependency: transitive description: - name: shared_preferences_android + name: screen url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" - shared_preferences_ios: - dependency: transitive + version: "0.0.5" + shared_preferences: + dependency: "direct main" description: - name: shared_preferences_ios + name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "0.5.12+4" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.0.2+4" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+11" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.0.4" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.1.2+7" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "0.0.2+3" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "0.7.9" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.2.4+1" sky_engine: dependency: transitive description: flutter @@ -1089,14 +1005,14 @@ packages: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.10" + version: "0.10.9" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.0-nullsafety.2" speech_to_text: dependency: "direct main" description: @@ -1110,77 +1026,77 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+4" + version: "1.3.2+4" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.0.1+1" + version: "1.0.3+3" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: name: sticky_headers url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.1.8+1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.2.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" synchronized: dependency: transitive description: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "2.2.0+2" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.2.19-nullsafety.2" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.1.1+3" transformer_page_view: dependency: transitive description: @@ -1188,209 +1104,146 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.6" - tuple: - dependency: transitive - description: - name: tuple - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "5.7.10" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+4" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+9" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "1.0.9" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "0.1.5+3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "0.0.1+3" uuid: dependency: transitive description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "3.0.5" + version: "2.2.2" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0-nullsafety.3" video_player: dependency: transitive description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.2.7" + version: "0.10.12+5" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "2.2.0" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" - visibility_detector: - dependency: transitive - description: - name: visibility_detector - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.2" + version: "0.1.4+1" wakelock: dependency: transitive description: name: wakelock url: "https://pub.dartlang.org" source: hosted - version: "0.5.6" - wakelock_macos: - dependency: transitive - description: - name: wakelock_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - wakelock_platform_interface: - dependency: transitive - description: - name: wakelock_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - wakelock_web: - dependency: transitive - description: - name: wakelock_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - wakelock_windows: - dependency: transitive - description: - name: wakelock_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" + version: "0.1.4+2" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.9.7+15" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.2.0" webview_flutter: dependency: transitive description: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.3.1" - webview_flutter_android: - dependency: transitive - description: - name: webview_flutter_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.0" - webview_flutter_platform_interface: - dependency: transitive - description: - name: webview_flutter_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.1" - webview_flutter_wkwebview: - dependency: transitive - description: - name: webview_flutter_wkwebview - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" + version: "0.3.24" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "1.7.4+1" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.1.2" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "4.5.1" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "2.2.1" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.10.2 <2.11.0" + flutter: ">=1.22.2 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 323cb1b0..23d6a2aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter project. version: 1.2.2+2 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.8.0 <3.0.0" #dependency_overrides: @@ -24,79 +24,77 @@ environment: dependencies: flutter: sdk: flutter - hexcolor: ^2.0.4 + hexcolor: ^1.0.1 flutter_localizations: sdk: flutter - flutter_device_type: ^0.4.0 - intl: ^0.17.0 - http: ^0.13.0 - provider: ^5.0.0 - shared_preferences: ^2.0.6 - imei_plugin: ^1.2.0 + flutter_device_type: ^0.2.0 + intl: ^0.16.0 + http: ^0.12.0+4 + provider: ^4.0.5+1 + shared_preferences: ^0.5.6+3 + imei_plugin: ^1.1.6 flutter_flexible_toast: ^0.1.4 - local_auth: ^1.1.6 - http_interceptor: ^0.4.1 - - connectivity: ^3.0.6 - maps_launcher: ^2.0.0 - url_launcher: ^6.0.6 - charts_flutter: ^0.10.0 + local_auth: ^0.6.1+3 + http_interceptor: ^0.2.0 + progress_hud_v2: ^2.0.0 + connectivity: ^0.4.8+2 + maps_launcher: ^1.2.0 + url_launcher: ^5.4.5 + charts_flutter: ^0.9.0 flutter_swiper: ^1.1.6 #Icons - eva_icons_flutter: ^3.0.0 - font_awesome_flutter: ^9.0.0 - dropdown_search: ^0.6.1 - flutter_staggered_grid_view: ^0.4.0 + eva_icons_flutter: ^2.0.0 + font_awesome_flutter: ^8.11.0 + dropdown_search: ^0.4.8 + flutter_staggered_grid_view: ^0.3.2 - expandable: ^5.0.1 + expandable: ^4.1.4 # Qr code Scanner barcode_scan_fix: ^1.0.2 # permissions - permission_handler: ^8.0.1 - device_info: ^2.0.2 + permission_handler: ^5.0.0+hotfix.3 + device_info: ^0.4.2+4 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.3 + cupertino_icons: ^0.1.2 # SVG #flutter_svg: ^0.17.4 - percent_indicator: ^3.0.1 + percent_indicator: ^2.1.1 #Dependency Injection - get_it: ^7.1.3 + get_it: ^4.0.2 #chart - fl_chart: ^0.36.1 + fl_chart: ^0.12.1 # Firebase - firebase_messaging: ^10.0.1 - firebase_analytics : ^8.3.4 + firebase_messaging: ^7.0.3 + firebase_analytics: 6.3.0 #GIF image flutter_gifimage: ^1.0.1 #Autocomplete TextField autocomplete_textfield: ^1.7.3 - date_time_picker: ^2.0.0 + date_time_picker: ^1.1.1 # Html - html: ^0.15.0 + html: ^0.14.0+4 # Flutter Html View - flutter_html: ^2.1.0 - sticky_headers: ^0.2.0 - file_picker: ^3.0.2+2 + flutter_html: 1.0.2 + sticky_headers: "^0.1.8" #speech to text speech_to_text: path: speech_to_text - quiver: ^3.0.0 - flutter_colorpicker: ^0.5.0 + quiver: ^2.1.5 # Html Editor Enhanced - html_editor_enhanced: ^2.1.1 + html_editor_enhanced: ^1.3.0 #Network Image cached_network_image: ^2.5.0 diff --git a/speech_to_text/example/pubspec.lock b/speech_to_text/example/pubspec.lock index 1538589c..6809f75f 100644 --- a/speech_to_text/example/pubspec.lock +++ b/speech_to_text/example/pubspec.lock @@ -7,42 +7,42 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.5.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.15.0-nullsafety.3" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" flutter: dependency: "direct main" description: flutter @@ -73,21 +73,21 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "3.0.1" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" nested: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.1" permission_handler: dependency: "direct main" description: @@ -141,7 +141,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.0-nullsafety.2" speech_to_text: dependency: "direct dev" description: @@ -155,49 +155,49 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.2.19-nullsafety.2" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.3" sdks: - dart: ">=2.12.0 <3.0.0" - flutter: ">=1.16.0" + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.16.0 <2.0.0" diff --git a/speech_to_text/pubspec.lock b/speech_to_text/pubspec.lock index 95b0d050..efc63cc7 100644 --- a/speech_to_text/pubspec.lock +++ b/speech_to_text/pubspec.lock @@ -7,182 +7,175 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "22.0.0" + version: "5.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.7.1" + version: "0.39.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.5.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" build: dependency: transitive description: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "1.3.0" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.4.2" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "2.1.4" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "1.3.10" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "1.10.0" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.0.0" + version: "5.2.0" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "4.3.2" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.0.6" + version: "7.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" + version: "1.0.2" clock: dependency: "direct main" description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "3.4.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.15.0-nullsafety.3" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "2.1.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.4" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.3.6" fake_async: dependency: "direct dev" description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.1" + version: "1.2.0-nullsafety.1" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.10.11" flutter: dependency: "direct main" description: flutter @@ -193,153 +186,174 @@ packages: description: flutter source: sdk version: "0.0.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.2.0" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "0.2.0" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+3" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.2.0" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "3.1.4" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.3.4" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.2" json_annotation: dependency: "direct main" description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "3.0.1" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "4.1.3" + version: "3.3.0" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.11.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.9.6+3" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.9.3" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.0-nullsafety.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.9.0" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.4.0" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.4.4" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.1.5" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.1.4" + version: "0.7.7" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.2.3" sky_engine: dependency: transitive description: flutter @@ -351,98 +365,98 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "0.9.6" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.0-nullsafety.2" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.1" stream_transform: dependency: transitive description: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.2.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.0-nullsafety.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.2.19-nullsafety.2" timing: dependency: transitive description: name: timing url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.1.1+2" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.0-nullsafety.3" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.0-nullsafety.3" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.9.7+15" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.1.0" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "2.2.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.10.0-110 <2.11.0" flutter: ">=1.10.0" diff --git a/speech_to_text/pubspec.yaml b/speech_to_text/pubspec.yaml index a40fe1ec..34b3da29 100644 --- a/speech_to_text/pubspec.yaml +++ b/speech_to_text/pubspec.yaml @@ -10,15 +10,15 @@ environment: dependencies: flutter: sdk: flutter - json_annotation: ^4.0.1 - clock: ^1.1.0 + json_annotation: ^3.0.0 + clock: ^1.0.1 dev_dependencies: flutter_test: sdk: flutter - build_runner: ^2.0.4 - json_serializable: ^4.1.3 - fake_async: ^1.2.0 + build_runner: ^1.0.0 + json_serializable: ^3.0.0 + fake_async: ^1.0.1 flutter: plugin: From bfd86f533a22ff82bb09e0b70ecd4b0d9625cc2a Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 09:39:40 +0200 Subject: [PATCH 140/199] small fixes --- .../admission_orders_screen.dart | 8 ++- .../diabetic_chart/diabetic_chart.dart | 2 +- .../profile/diagnosis/diagnosis_screen.dart | 29 ++++++----- .../all_discharge_summary.dart | 6 ++- .../pending_discharge_summary.dart | 8 +-- .../nursing_note/nursing_note_screen.dart | 11 ++-- .../operation_report/operation_report.dart | 8 +-- .../pending_orders/pending_orders_screen.dart | 51 +++++++++++-------- 8 files changed, 76 insertions(+), 47 deletions(-) diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index f83117e2..bc5df139 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -10,6 +10,7 @@ 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'; 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:provider/provider.dart'; @@ -49,8 +50,11 @@ class _AdmissionOrdersScreenState extends State { ), body: model.admissionOrderList == null || model.admissionOrderList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).noDataAvailable) + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) : Container( color: Colors.grey[200], child: Column( diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index 1aea89c2..593850a7 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -199,7 +199,7 @@ class _DiabeticChartState extends State { ], ), ) - : ErrorMessage(error: TranslationBase.of(context).noItem), + : Center(child: ErrorMessage(error: TranslationBase.of(context).noItem)), ], ), )), diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 65e483b5..e52a67df 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -23,6 +23,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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'; +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:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -50,10 +51,11 @@ class _ProgressNoteState extends State { print(type); GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = - GetDiagnosisForInPatientRequestModel( + GetDiagnosisForInPatientRequestModel( admissionNo: int.parse(patient.admissionNo), patientTypeID: patient.patientType, - patientID: patient.patientId, setupID: "010266"); + patientID: patient.patientId, + setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } @@ -76,8 +78,11 @@ class _ProgressNoteState extends State { ), body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).noItem) + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) : Container( color: Colors.grey[200], child: Column( @@ -85,8 +90,7 @@ class _ProgressNoteState extends State { Expanded( child: Container( child: ListView.builder( - itemCount: - model.diagnosisForInPatientList.length, + itemCount: model.diagnosisForInPatientList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, @@ -207,9 +211,9 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of( - context) - .icd + " : ", + TranslationBase.of(context) + .icd + + " : ", fontSize: 12, ), Expanded( @@ -228,16 +232,17 @@ class _ProgressNoteState extends State { ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ - AppText("Ascii Desc : ", + AppText( + "Ascii Desc : ", fontSize: 12, ), Expanded( child: AppText( model .diagnosisForInPatientList[ - index] + index] .asciiDesc, fontSize: 12, isCopyable: true, diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index f29315ae..6a8633da 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -35,8 +35,10 @@ class _AllDischargeSummaryState extends State { isShowAppBar: false, body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty - ? ErrorMessage( - error: TranslationBase.of(context).noDataAvailable) + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable), + ) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 4984999f..99176624 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -36,9 +36,11 @@ class _PendingDischargeSummaryState extends State { baseViewModel: model, isShowAppBar: false, body: model.pendingDischargeSummaryList.isEmpty - ? ErrorMessage( - error: TranslationBase.of(context) - .noDataAvailable) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .noDataAvailable), + ) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 0fbac8bf..80e13a84 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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'; +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:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -54,7 +55,8 @@ class _ProgressNoteState extends State { GetNursingProgressNoteRequestModel( admissionNo: int.parse(patient.admissionNo), patientTypeID: patient.patientType, - patientID: patient.patientId, setupID: "010266"); + patientID: patient.patientId, + setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } @@ -78,8 +80,11 @@ class _ProgressNoteState extends State { ), body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) : Container( color: Colors.grey[200], child: Column( diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index c2751424..63aaf458 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app- 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'; +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:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -70,9 +71,10 @@ class _ProgressNoteState extends State { children: [ model.reservationList == null || model.reservationList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) - : Expanded( + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, ), + ): Expanded( child: Container( child: ListView.builder( itemCount: model.reservationList.length, diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index e9e4f8b2..74d075e3 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -5,7 +5,9 @@ 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/card_with_bg_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'; class PendingOrdersScreen extends StatelessWidget { @@ -34,8 +36,10 @@ class PendingOrdersScreen extends StatelessWidget { appBarTitle: "Pending Orders", body: model.pendingOrdersList == null || model.pendingOrdersList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).noDataAvailable) + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, ), + ) : Column( children: [ Padding( @@ -64,30 +68,35 @@ class PendingOrdersScreen extends StatelessWidget { ], ), ), - Container( + Expanded( + child: Container( + height: MediaQuery.of(context).size.height *.9, child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.pendingOrdersList.length, + itemCount: + model.pendingOrdersList.length, itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all( - color: Color(0xFF707070), width: 0.30), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: AppText( - model.pendingOrdersList[index].notes), + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: AppText( + model.pendingOrdersList[index].notes), + ), + SizedBox( + height: 20, + ), + ], ), ), ); - })), + }), + ), + ), ], ), ), From d1060ba27a497c74be09428160f1db8c9dd2e611 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 09:57:38 +0200 Subject: [PATCH 141/199] small fixes --- lib/config/localized_values.dart | 2 + .../operation_report/operation_report.dart | 578 +++++++++--------- lib/util/translations_delegate_base.dart | 2 + 3 files changed, 306 insertions(+), 276 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a4eb5dbc..51b2e2c1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -711,6 +711,8 @@ const Map> localizedValues = { "special": {"en": "Special", "ar": "خاص"}, "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, + "reports": {"en": "Reports", "ar": "تقارير "}, + "operation": {"en": "Operation", "ar": " العملية"}, "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, "occupation": {"en": "Occupation", "ar": "مهنة"}, diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 63aaf458..34b43315 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -67,304 +67,330 @@ class _ProgressNoteState extends State { ), body: Container( color: Colors.grey[200], - child: Column( - children: [ - model.reservationList == null || - model.reservationList.length == 0 - ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, ), - ): Expanded( - child: Container( - child: ListView.builder( - itemCount: model.reservationList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: Colors.white, - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + child:model.reservationList == null || + model.reservationList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, ), + ): Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).operation, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).reports, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.reservationList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.white, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .createdBy, - fontSize: 10, - ), - Expanded( - child: AppText( - model - .reservationList[ - index] - .doctorName ?? - '', - fontWeight: - FontWeight.w600, - fontSize: 12, - ), - ), - ], - ), - ], - ), - ), - Column( - children: [ - AppText( - model - .reservationList[ - index] - .createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - model - .reservationList[ - index] - .createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], + Row( crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Reservation: ", - fontSize: 10, - ), - Expanded( - child: AppText( - model.reservationList[index].oTReservationID.toString(), - fontSize: 10, - ), - ) - ]), - SizedBox( - height: 8, - ), - if (model.reservationList[index] - .operationDate != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, + CrossAxisAlignment + .start, children: [ AppText( - "Operation Date : ", - fontSize: 10, - ), - Expanded( - child: AppText( - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .operationDate), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true), - fontSize: 10, - ), - ) - ]), - if (model.reservationList[index] - .timeStart != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Operation Time Start : ", + TranslationBase.of( + context) + .createdBy, fontSize: 10, ), Expanded( child: AppText( model .reservationList[ - index] - .timeStart, - fontSize: 10, - ), - ) - ]), - if (model.reservationList[index] - .remarks != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Remarks : ", - fontSize: 10, - ), - Expanded( - child: AppText( - model - .reservationList[ - index] - .remarks ?? + index] + .doctorName ?? '', - fontSize: 10, + fontWeight: + FontWeight.w600, + fontSize: 12, ), ), - ]) - ], - ), - - SizedBox( - height: 20, - ), - - // if ( - // authenticationViewModel - // .doctorProfile.doctorID == - // model - // .operationReportList[ - // index] - // .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .reservationList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model + .reservationList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( mainAxisAlignment: - MainAxisAlignment.end, + MainAxisAlignment.start, children: [ - InkWell( - onTap: () async { - await locator() - .logEvent( - eventCategory: - "Operation Report Screen", - eventAction: - "Update Operation Report ", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateOperationReport( - reservation: model - .reservationList[ - index], - patient: patient, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: - BorderRadius.circular(10), + AppText( + "Reservation: ", + fontSize: 10, + ), + Expanded( + child: AppText( + model.reservationList[index].oTReservationID.toString(), + fontSize: 10, + ), + ) + ]), + SizedBox( + height: 8, + ), + if (model.reservationList[index] + .operationDate != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Date : ", + fontSize: 10, + ), + Expanded( + child: AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .operationDate), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontSize: 10, ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - "Operation Reports", - fontSize: 10, - color: Colors.white, - ), - ], + ) + ]), + if (model.reservationList[index] + .timeStart != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Time Start : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .timeStart, + fontSize: 10, ), - padding: EdgeInsets.all(6), + ) + ]), + if (model.reservationList[index] + .remarks != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Remarks : ", + fontSize: 10, ), - ), - SizedBox( - width: 10, - ), - SizedBox( - width: 10, - ), - ], - ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .remarks ?? + '', + fontSize: 10, + ), + ), + ]) + ], + ), - SizedBox( - height: 10, + SizedBox( + height: 20, + ), + + // if ( + // authenticationViewModel + // .doctorProfile.doctorID == + // model + // .operationReportList[ + // index] + // .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { + await locator() + .logEvent( + eventCategory: + "Operation Report Screen", + eventAction: + "Update Operation Report ", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateOperationReport( + reservation: model + .reservationList[ + index], + patient: patient, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + "Operation Reports", + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - ], - ), + ), + SizedBox( + width: 10, + ), + SizedBox( + width: 10, + ), + ], ), - ); - }), - ), - ), + + SizedBox( + height: 10, + ), + ], + ), + ), + ); + }), + ), + ), ], ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 397f8b36..647cf39f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -213,6 +213,8 @@ class TranslationBase { String get progressNote => localizedValues['progressNote'][locale.languageCode]; String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get reports => localizedValues['reports'][locale.languageCode]; + String get operation => localizedValues['operation'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode]; From 6ae4d3a7cd27d42f53cad2d5003aad91b569609b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 10:05:41 +0200 Subject: [PATCH 142/199] small fixes --- .../patients/register_patient/RegisterSearchPatientPage.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 2afc593e..bc79800f 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -259,6 +259,10 @@ class _RegisterSearchPatientPageState extends State { }); }, ), + + SizedBox( + height: 70, + ), ], ), ), From 1c8d25c95cb025d830a1dc2b4f14907081be9f9e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Nov 2021 11:04:09 +0200 Subject: [PATCH 143/199] adding countries to registration --- .../RegisterSearchPatientPage.dart | 65 ++++++++++++++----- pubspec.lock | 6 +- 2 files changed, 52 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index bc79800f..57d436f5 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -70,9 +70,45 @@ class _RegisterSearchPatientPageState extends State { dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"}; dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"}; + dynamic bahrainCountry = {"id": 973, "name": "Bahrain"}; + dynamic kuwaitCountry = {"id": 965, "name": "Kuwait"}; + dynamic afghanistanCountry = {"id": 93, "name": "Afghanistan"}; + dynamic algeriaCountry = {"id": 213, "name": "Algeria"}; + dynamic argentinaCountry = {"id": 54, "name": "Argentina"}; + dynamic bangladeshCountry = {"id": 880, "name": "Bangladesh"}; + dynamic colombiaCountry = {"id": 57, "name": "Colombia"}; + dynamic croatiaCountry = {"id": 385, "name": "Croatia"}; + dynamic denmarkCountry = {"id": 45, "name": "Denmark"}; + dynamic ecuadorCountry = {"id": 593, "name": "Ecuador"}; + dynamic egyptCountry = {"id": 20, "name": "Egypt"}; + dynamic ethiopiaCountry = {"id": 251, "name": "Ethiopia"}; + dynamic greeceCountry = {"id": 30, "name": "Greece"}; + dynamic icelandCountry = {"id": 354, "name": "Iceland"}; + dynamic indonesiaCountry = {"id": 62, "name": "Indonesia"}; + dynamic iraqCountry = {"id": 971, "name": "Iraq"}; + dynamic liberiaCountry = {"id": 231, "name": "Liberia"}; + dynamic senegalCountry = {"id": 221, "name": "Senegal"}; countryList.add(ksaCountry); countryList.add(uaeCountry); + countryList.add(bahrainCountry); + countryList.add(kuwaitCountry); + countryList.add(afghanistanCountry); + countryList.add(algeriaCountry); + countryList.add(argentinaCountry); + countryList.add(bangladeshCountry); + countryList.add(colombiaCountry); + countryList.add(croatiaCountry); + countryList.add(denmarkCountry); + countryList.add(ecuadorCountry); + countryList.add(egyptCountry); + countryList.add(ethiopiaCountry); + countryList.add(greeceCountry); + countryList.add(icelandCountry); + countryList.add(indonesiaCountry); + countryList.add(iraqCountry); + countryList.add(liberiaCountry); + countryList.add(senegalCountry); } @override @@ -221,9 +257,10 @@ class _RegisterSearchPatientPageState extends State { dropDownText: getBirthdate(), enabled: false, isTextFieldHasSuffix: true, - validationError: _birthDateInGregorian == null && isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, + validationError: + _birthDateInGregorian == null && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, suffixIcon: IconButton( icon: Icon( Icons.calendar_today, @@ -240,17 +277,18 @@ class _RegisterSearchPatientPageState extends State { setState(() { if (calenderType == CalenderType.Hijri) { birthDateInHijri = selectedDate; - _birthDateInGregorian = HijriCalendar().hijriToGregorian( - birthDateInHijri.hYear, - birthDateInHijri.hMonth, - birthDateInHijri.hDay); + _birthDateInGregorian = HijriCalendar() + .hijriToGregorian( + birthDateInHijri.hYear, + birthDateInHijri.hMonth, + birthDateInHijri.hDay); print(_birthDateInGregorian); print(birthDateInHijri); } else { _birthDateInGregorian = selectedDate; birthDateInHijri = HijriCalendar() - .gregorianToHijri( - selectedDate.year, selectedDate.month, selectedDate.day); + .gregorianToHijri(selectedDate.year, + selectedDate.month, selectedDate.day); print(_birthDateInGregorian); print(birthDateInHijri); @@ -259,7 +297,6 @@ class _RegisterSearchPatientPageState extends State { }); }, ), - SizedBox( height: 70, ), @@ -436,16 +473,12 @@ class _RegisterSearchPatientPageState extends State { } getBirthdate() { - if (calenderType == CalenderType.Hijri) { - return birthDateInHijri != null - ? "$birthDateInHijri" - : null; - }else{ + return birthDateInHijri != null ? "$birthDateInHijri" : null; + } else { return _birthDateInGregorian != null ? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}" : null; } - } } diff --git a/pubspec.lock b/pubspec.lock index 3e9968d3..4fcb6792 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -706,7 +706,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: @@ -1040,7 +1040,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: @@ -1245,5 +1245,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <2.11.0" + dart: ">=2.10.2 <=2.11.0-213.1.beta" flutter: ">=1.22.2 <2.0.0" From c17397bf5ebd58171a3fe806ec18451c98dd988e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 14:41:28 +0200 Subject: [PATCH 144/199] fix operation reports --- lib/config/localized_values.dart | 19 +++ .../operation_report/operation_report.dart | 36 +----- .../update_operation_report.dart | 109 +++++++----------- lib/util/translations_delegate_base.dart | 20 +++- .../app_text_field_custom_serach.dart | 5 +- 5 files changed, 91 insertions(+), 98 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 51b2e2c1..6a536fae 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -719,4 +719,23 @@ const Map> localizedValues = { "healthID": {"en": "Health ID", "ar": "معرف الصحة"}, "identityNumber": {"en": "Identity Number", "ar": "رقم الهوية"}, "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, + "operationTimeStart": {"en": "Operation Time Start :", "ar": "بدء وقت العملية:"}, + "operationDate": {"en": "operation Date :", "ar": "تاريخ العملية:"}, + "reservation": {"en": "Reservation Number :", "ar": " رقم الحجز :"}, + "anesthetist": {"en": "Anesthetist", "ar": "طبيب تخدير "}, + "bloodTransfusedDetail": {"en": "blood Transfused Detail", "ar": "تفاصيل نقل الدم "}, + "circulatingNurse": {"en": "circulating Nurse", "ar": "ممرضة عمومية"}, + "scrubNurse": {"en": "Scrub Nurse", "ar": "ممرضة تدليك"}, + "otherSpecimen": {"en": "Other Specimen", "ar": "عينة أخرى"}, + "microbiologySpecimen": {"en": "Microbiology Specimen", "ar": "عينة علم الأحياء الدقيقة"}, + "histopathSpecimen": {"en": "Histopath Specimen", "ar": "عينة الأنسجة"}, + "bloodLossDetail": {"en": "Blood Loss Detail", "ar": "تفاصيل فقدان الدم"}, + "complicationDetails1": {"en": "Complication Details", "ar": "تفاصيل المضاعفات"}, + "postOperationInstruction": {"en": "Post Operation Instruction", "ar": "تعليمات ما بعد العملية"}, + "surgeryProcedure": {"en": "Surgery Procedures", "ar": "إجراءات الجراحة"}, + "finding": {"en": "Finding", "ar": "العثور على"}, + "preOperationDiagnosis": {"en": "Pre OperationOperation Diagnosis", "ar": "التشخيص قبل العملية"}, + "postOperationDiagnosis": {"en": "Post Operation Diagnosis", "ar": "تشخيص ما بعد العملية"}, + "surgeon": {"en": "surgeon", "ar": "دكتور جراح"}, + "assistant": {"en": "assistant", "ar": "مساعد"}, }; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 34b43315..6d912c3f 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -74,32 +74,6 @@ class _ProgressNoteState extends State { error: TranslationBase.of(context).noDataAvailable, ), ): Column( children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).operation, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).reports, - fontSize: 25.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), - ), Expanded( child: Container( child: ListView.builder( @@ -219,7 +193,7 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - "Reservation: ", + TranslationBase.of(context).reservation, fontSize: 10, ), Expanded( @@ -240,7 +214,7 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - "Operation Date : ", + TranslationBase.of(context).operationDate, fontSize: 10, ), Expanded( @@ -267,7 +241,7 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - "Operation Time Start : ", + TranslationBase.of(context).operationTimeStart , fontSize: 10, ), Expanded( @@ -288,7 +262,7 @@ class _ProgressNoteState extends State { MainAxisAlignment.start, children: [ AppText( - "Remarks : ", + TranslationBase.of(context).remarks, fontSize: 10, ), Expanded( @@ -363,7 +337,7 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - "Operation Reports", + TranslationBase.of(context).operationReports, fontSize: 10, color: Colors.white, ), diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index d042ff2f..28141d45 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -156,8 +156,7 @@ class _UpdateOperationReportState extends State { child: Column( children: [ AppTextFieldCustom( - hintText: "Reservation No", - //TranslationBase.of(context).addoperationReports, + hintText:TranslationBase.of(context).reservation, controller: OTReservationID, maxLines: 1, minLines: 1, @@ -168,11 +167,10 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Pre Op Diagmosis", - //TranslationBase.of(context).addoperationReports, + hintText:TranslationBase.of(context).preOperationDiagnosis, controller: preOpDiagmosisController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, @@ -187,13 +185,11 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Post Op Diagmosis", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).postOperationDiagnosis, controller: postOpDiagmosisNoteController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 8, hasBorder: true, - // isTextFieldHasSuffix: true, validationError: postOpDiagmosisNoteController @@ -207,13 +203,11 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Surgeon", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).surgeon, controller: surgeonController, maxLines: 1, minLines: 1, hasBorder: true, - // isTextFieldHasSuffix: true, validationError: surgeonController.text.isEmpty && @@ -226,8 +220,7 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "assistant", - //TranslationBase.of(context).addoperationReports, + hintText:TranslationBase.of(context).assistant, controller: assistantNoteController, maxLines: 1, minLines: 1, @@ -245,11 +238,11 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Operation", - //TranslationBase.of(context).addoperationReports, + hintText: + TranslationBase.of(context).operation, controller: operationController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, @@ -283,11 +276,10 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "finding", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).finding, controller: findingController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, @@ -302,11 +294,10 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Surgery Procedure", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).surgeryProcedure, controller: surgeryProcedureController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, @@ -322,11 +313,10 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Post Op Instruction", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).postOperationInstruction, controller: postOpInstructionController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, @@ -342,13 +332,11 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Complication Details", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).complicationDetails1, controller: complicationDetailsController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, - // isTextFieldHasSuffix: true, validationError: complicationDetailsController @@ -362,11 +350,10 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Blood Loss Detail", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).bloodLossDetail, controller: bloodLossDetailController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, @@ -381,11 +368,10 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "histopal the Specimen", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).histopathSpecimen, controller: histopathSpecimenController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, @@ -401,12 +387,11 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "microbiology Specimen ", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).microbiologySpecimen, controller: microbiologySpecimenController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, @@ -422,11 +407,10 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "other Specimen", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).otherSpecimen, controller: otherSpecimenController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, @@ -441,8 +425,7 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "scrub Nurse", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).scrubNurse, controller: scrubNurseController, maxLines: 1, minLines: 1, @@ -460,8 +443,7 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "circulating Nurse", - //TranslationBase.of(context).addoperationReports, + hintText:TranslationBase.of(context).circulatingNurse, controller: circulatingNurseController, maxLines: 1, minLines: 1, @@ -480,12 +462,11 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Blood Transfused Detail", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).bloodTransfusedDetail, controller: BloodTransfusedDetailController, - maxLines: 1, - minLines: 1, + maxLines: 20, + minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, @@ -501,8 +482,7 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: "Anasthetist", - //TranslationBase.of(context).addoperationReports, + hintText: TranslationBase.of(context).anesthetist, controller: anasthetistController, maxLines: 1, minLines: 1, @@ -540,7 +520,7 @@ class _UpdateOperationReportState extends State { child: AppButton( title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + + : TranslationBase.of(context).noteAdd) +" "+ TranslationBase.of(context).operationReports, color: Color(0xff359846), // disabled: operationReportsController.text.isEmpty, @@ -608,7 +588,6 @@ class _UpdateOperationReportState extends State { DrAppToastMsg.showSuccesToast( "Your Order added Successfully"); - Navigator.of(context).pop(); } GifLoaderDialogUtils.hideDialog(context); } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 647cf39f..d6410f5e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1114,7 +1114,25 @@ class TranslationBase { String get notReplied => localizedValues['notReplied'][locale.languageCode]; String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; - + String get operationTimeStart => localizedValues['operationTimeStart'][locale.languageCode]; + String get operationDate => localizedValues['operationDate'][locale.languageCode]; + String get reservation => localizedValues['reservation'][locale.languageCode]; + String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; + String get bloodTransfusedDetail => localizedValues['bloodTransfusedDetail'][locale.languageCode]; + String get circulatingNurse => localizedValues['circulatingNurse'][locale.languageCode]; + String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; + String get otherSpecimen => localizedValues['otherSpecimen'][locale.languageCode]; + String get microbiologySpecimen => localizedValues['microbiologySpecimen'][locale.languageCode]; + String get histopathSpecimen => localizedValues['histopathSpecimen'][locale.languageCode]; + String get bloodLossDetail => localizedValues['bloodLossDetail'][locale.languageCode]; + String get complicationDetails1 => localizedValues['complicationDetails1'][locale.languageCode]; + String get postOperationInstruction => localizedValues['postOperationInstruction'][locale.languageCode]; + String get surgeryProcedure => localizedValues['surgeryProcedure'][locale.languageCode]; + String get finding => localizedValues['finding'][locale.languageCode]; + String get preOperationDiagnosis => localizedValues['preOperationDiagnosis'][locale.languageCode]; + String get postOperationDiagnosis => localizedValues['postOperationDiagnosis'][locale.languageCode]; + String get surgeon => localizedValues['surgeon'][locale.languageCode]; + String get assistant => localizedValues['assistant'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index 2a5304e2..46fa78d1 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:provider/provider.dart'; import 'app-textfield-custom.dart'; @@ -35,6 +37,7 @@ class AppTextFieldCustomSearch extends StatelessWidget { final List inputFormatters; @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), child: Stack( @@ -58,7 +61,7 @@ class AppTextFieldCustomSearch extends StatelessWidget { onFieldSubmitted: onFieldSubmitted, validationError: validationError), if (positionedChild != null) - Positioned(right: 35, top: 5, child: positionedChild) + projectViewModel.isArabic?Positioned(left: 35, top: 5, child: positionedChild):Positioned(right: 35, top: 5, child: positionedChild) ], ), ); From 999c2a920d21a403037896ed3ef8ef1d87b1090b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Nov 2021 15:25:24 +0200 Subject: [PATCH 145/199] translation and ui fixes --- lib/config/localized_values.dart | 567 ++++++++--- .../admission_orders_screen.dart | 4 +- .../profile_gird_for_InPatient.dart | 36 +- lib/util/translations_delegate_base.dart | 948 ++++++++++++------ 4 files changed, 1103 insertions(+), 452 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 51b2e2c1..470bf3ef 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,7 +1,10 @@ const Map> localizedValues = { "dashboardScreenToolbarTitle": {"ar": "الرئيسة", "en": "Home"}, "settings": {"en": "Settings", "ar": "الاعدادات"}, - "areYouSureYouWantTo": {"en": "Are you sure you want to", "ar": "هل انت متاكد من انك تريد أن"}, + "areYouSureYouWantTo": { + "en": "Are you sure you want to", + "ar": "هل انت متاكد من انك تريد أن" + }, "language": {"en": "App Language", "ar": "لغة التطبيق"}, "lanEnglish": {"en": "English", "ar": "English"}, "lanArabic": {"en": "العربية", "ar": "العربية"}, @@ -12,18 +15,27 @@ const Map> localizedValues = { "mobileNo": {"en": "Mobile No", "ar": "رقم الجوال"}, "messagesScreenToolbarTitle": {"en": "Messages", "ar": "الرسائل"}, "mySchedule": {"en": "Schedule", "ar": "جدولي"}, - "errorNoSchedule": {"en": "You don't have any Schedule", "ar": "ليس لديك أي جدول"}, + "errorNoSchedule": { + "en": "You don't have any Schedule", + "ar": "ليس لديك أي جدول" + }, "verify": {"en": "VERIFY", "ar": "تحقق"}, "referralDoctor": {"en": "Referral Doctor", "ar": "الطبيب المُحول إليه"}, "referringClinic": {"en": "Referring Clinic", "ar": "العيادة المُحول إليها"}, "frequency": {"en": "Frequency", "ar": "تكرر"}, "priority": {"en": "Priority", "ar": "الأولوية"}, "maxResponseTime": {"en": "Max Response Time", "ar": "الوقت الأقصى للرد"}, - "clinicDetailsandRemarks": {"en": "Clinic Details and Remarks", "ar": "ملاحضات وتفاصيل العيادة"}, + "clinicDetailsandRemarks": { + "en": "Clinic Details and Remarks", + "ar": "ملاحضات وتفاصيل العيادة" + }, "answerSuggestions": {"en": "Answer/Suggestions", "ar": "الرد / الاقتراحات"}, "outPatients": {"en": "Out Patient", "ar": "العيادات الخارجية"}, "myOutPatient": {"en": "My OutPatients", "ar": "مرضى العيادات الخارجية"}, - "myOutPatient_2lines": {"en": "My\nOutPatients", "ar": "مريض\nالعيادات الخارجية"}, + "myOutPatient_2lines": { + "en": "My\nOutPatients", + "ar": "مريض\nالعيادات الخارجية" + }, "searchPatient": {"en": "Search Patients", "ar": "البحث عن مريض"}, "searchPatientDashBoard": {"en": "Search\nPatients", "ar": "البحث\nعن مريض"}, "searchAbout": {"en": "Search", "ar": "البحث عن"}, @@ -47,7 +59,10 @@ const Map> localizedValues = { "inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, "operations": {"en": "Operations", "ar": "عمليات"}, "patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"}, - "searchMedicineDashboard": {"en": "Search\nMedicines", "ar": "بحث\nعن الدواء"}, + "searchMedicineDashboard": { + "en": "Search\nMedicines", + "ar": "بحث\nعن الدواء" + }, "searchMedicine": {"en": "Search Medicines", "ar": "بحث عن الدواء"}, "myReferralPatient": {"en": "My Referral Patient", "ar": "مرضى الاحالة"}, "referPatient": {"en": "Referral Patient", "ar": "إحالة مريض"}, @@ -63,14 +78,20 @@ const Map> localizedValues = { "patientFile": {"en": "Patient File", "ar": "ملف المريض"}, "familyMedicine": {"en": "Family Medicine Clinic", "ar": "عيادة طب الأسرة"}, "search": {"en": "Search", "ar": "بحث "}, - "onlyArrivedPatient": {"en": "Only Arrived Patient", "ar": "المريض الذي حضر للموعد"}, + "onlyArrivedPatient": { + "en": "Only Arrived Patient", + "ar": "المريض الذي حضر للموعد" + }, "searchMedicineNameHere": {"en": "Search Medicine ", "ar": "ابحث هنا"}, "youCanFind": {"en": "You Can Find ", "ar": "تستطيع ان تجد "}, "itemsInSearch": {"en": "items in search", "ar": "عناصر في البحث"}, "qr": {"en": "QR", "ar": "QR"}, "reader": {"en": "Reader", "ar": "قارىء رمز ال"}, "startScanning": {"en": "Start Scanning", "ar": "بدء المسح"}, - "scanQrCode": {"en": "scan Qr code to retrieve patient profile", "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض"}, + "scanQrCode": { + "en": "scan Qr code to retrieve patient profile", + "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض" + }, "scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"}, "profile": {"en": "Profile", "ar": "ملفي الشخصي"}, "gender": {"en": "Gender", "ar": "الجنس"}, @@ -95,9 +116,15 @@ const Map> localizedValues = { "bloodPressure": {"en": "Blood Pressure", "ar": "ضغط الدم"}, "oxygenation": {"en": "Oxygenation", "ar": "الأوكسجين"}, "painScale": {"en": "Pain Scale", "ar": "مقياس الألم"}, - "errorNoVitalSign": {"en": "You don't have any Vital Sign", "ar": "ليس لديك اي مؤشرات حيوية"}, + "errorNoVitalSign": { + "en": "You don't have any Vital Sign", + "ar": "ليس لديك اي مؤشرات حيوية" + }, "labOrders": {"en": "Lab Orders", "ar": "طلبات المختبر"}, - "errorNoLabOrders": {"en": "You don\"t have any lab orders", "ar": "ليس لديك اي طلبات للمختبر"}, + "errorNoLabOrders": { + "en": "You don\"t have any lab orders", + "ar": "ليس لديك اي طلبات للمختبر" + }, "answerThePatient": {"en": "answer the patient", "ar": "الرد على المريض "}, "pleaseEnterAnswer": {"en": "please enter answer", "ar": "الرجاء ادخال الرد"}, "replay": {"en": "Reply", "ar": "تاكيد"}, @@ -105,18 +132,30 @@ const Map> localizedValues = { "progress": {"en": "Progress", "ar": "التقدم"}, "note": {"en": "Note", "ar": "ملاحظة"}, "searchNote": {"en": "Search Note", "ar": "بحث عن ملاحظة"}, - "errorNoProgressNote": {"en": "You don\"t have any Progress Note", "ar": "ليس لديك اي ملاحظة تقدم"}, + "errorNoProgressNote": { + "en": "You don\"t have any Progress Note", + "ar": "ليس لديك اي ملاحظة تقدم" + }, "invoiceNo:": {"en": "Invoice No :", "ar": "رقم الفاتورة"}, "generalResult": {"en": "General Result ", "ar": "النتيجة العامة"}, "description": {"en": "Description", "ar": "الوصف"}, "value": {"en": "Value", "ar": "القيمة"}, "range": {"en": "Range", "ar": "النطاق"}, "enterId": {"en": "User ID", "ar": "معرف المستخدم"}, - "pleaseEnterYourID": {"en": "Please enter your ID", "ar": "الرجاء ادخال الهوية"}, + "pleaseEnterYourID": { + "en": "Please enter your ID", + "ar": "الرجاء ادخال الهوية" + }, "enterPassword": {"en": "Password", "ar": "كلمه السر"}, - "pleaseEnterPassword": {"en": "Please Enter Password", "ar": "الرجاء ادخال الرقم السري"}, + "pleaseEnterPassword": { + "en": "Please Enter Password", + "ar": "الرجاء ادخال الرقم السري" + }, "selectYourProject": {"en": "Branch", "ar": "فرع"}, - "pleaseEnterYourProject": {"en": "Please Enter Your Project", "ar": "الرجاء ادخال مستشفى"}, + "pleaseEnterYourProject": { + "en": "Please Enter Your Project", + "ar": "الرجاء ادخال مستشفى" + }, "login": {"en": "Login", "ar": "تسجيل دخول"}, "drSulaimanAlHabib": {"en": "Dr Sulaiman Al Habib", "ar": "د.سليمان الحبيب"}, "welcomeTo": {"en": "Welcome to", "ar": "مرحبا بك"}, @@ -143,7 +182,10 @@ const Map> localizedValues = { "youWillReceiveA": {"en": "You will receive a", "ar": "سوف تتلقى "}, "loginCode": {"en": "Login Code", "ar": "رمز تسجيل دخول"}, "smsBy": {"en": "By SMS", "ar": "عن طريق رسالة قصيرة"}, - "pleaseEnterTheCode": {"en": "Please enter the code", "ar": "الرجاء ادخال الرمز"}, + "pleaseEnterTheCode": { + "en": "Please enter the code", + "ar": "الرجاء ادخال الرمز" + }, "youDontHaveAnyPatient": { "en": "No data found for the selected search criteria", "ar": "لا توجد بيانات لمعايير البحث المختارة" @@ -155,8 +197,14 @@ const Map> localizedValues = { "tomorrow": {"en": "Tomorrow", "ar": "الغد"}, "nextWeek": {"en": "Next Week", "ar": "الاسبوع القادم"}, "all": {"en": "All", "ar": "الجميع"}, - "errorNoInsuranceApprovals": {"en": "You don\"t have any Insurance Approvals", "ar": "ليس لديك اي موفقات تأمين"}, - "searchInsuranceApprovals": {"en": "Search InsuranceApprovals", "ar": "بحث عن موافقات التأمين"}, + "errorNoInsuranceApprovals": { + "en": "You don\"t have any Insurance Approvals", + "ar": "ليس لديك اي موفقات تأمين" + }, + "searchInsuranceApprovals": { + "en": "Search InsuranceApprovals", + "ar": "بحث عن موافقات التأمين" + }, "status": {"en": "STATUS", "ar": "الحالة"}, "expiryDate": {"en": "EXPIRY DATE", "ar": "تاريخ الانتهاء"}, "producerName": {"en": "PRODUCER NAME", "ar": "اسم المنتج"}, @@ -169,10 +217,19 @@ const Map> localizedValues = { "routine": {"en": "Routine", "ar": "روتيني"}, "send": {"en": "Send", "ar": "ارسال"}, "referralFrequency": {"en": "Referral Frequency:", "ar": "تواتر الحالة:"}, - "selectReferralFrequency": {"en": "Select Referral Frequency:", "ar": "اختار تواتر الحالة:"}, - "clinicalDetailsAndRemarks": {"en": "Clinical Details and Remarks", "ar": "التفاصيل السرسرية والملاحظات"}, + "selectReferralFrequency": { + "en": "Select Referral Frequency:", + "ar": "اختار تواتر الحالة:" + }, + "clinicalDetailsAndRemarks": { + "en": "Clinical Details and Remarks", + "ar": "التفاصيل السرسرية والملاحظات" + }, "remarks": {"en": "Remarks", "ar": "ملاحظات"}, - "pleaseFill": {"en": "Please fill all fields..!", "ar": "الرجاء ملأ جميع الحقول..!"}, + "pleaseFill": { + "en": "Please fill all fields..!", + "ar": "الرجاء ملأ جميع الحقول..!" + }, "replay2": {"en": "Reply", "ar": "رد الطبيب"}, "logout": {"en": "Logout", "ar": "تسجيل خروج"}, "pharmaciesList": {"en": "Pharmacies List", "ar": "قائمة الصيدليات"}, @@ -184,7 +241,10 @@ const Map> localizedValues = { "searchOrders": {"en": "Search Orders", "ar": " بحث عن الطلبات"}, "prescriptionDetails": {"en": "Prescription Details", "ar": "تفاصبل الوصفة"}, "prescriptionInfo": {"en": "Prescription Info", "ar": "معلومات الوصفة"}, - "errorNoOrders": {"en": "You don\"t have any Orders", "ar": "لا يوجد لديك اي طلبات"}, + "errorNoOrders": { + "en": "You don\"t have any Orders", + "ar": "لا يوجد لديك اي طلبات" + }, "livecare": {"en": "Live Care", "ar": "Live Care"}, "beingBad": {"en": "being bad", "ar": "سيء"}, "beingGreat": {"en": "being great", "ar": "رائع"}, @@ -195,14 +255,26 @@ const Map> localizedValues = { "endcallwithcharge": {"en": "End with charge", "ar": "انهاء مع خصم المبلغ"}, "endcall": {"en": "End Call", "ar": "إنهاء المكالمة"}, "transfertoadmin": {"en": "Transfer to admin", "ar": "تحويل للمشرف"}, - "searchMedicineImageCaption": {"en": "Type the medicine name to search", "ar": " اكتب اسم الدواء للبحث"}, + "searchMedicineImageCaption": { + "en": "Type the medicine name to search", + "ar": " اكتب اسم الدواء للبحث" + }, "type": {"en": "Type", "ar": "اكتب"}, "fromDate": {"en": "From Date", "ar": "من تاريخ"}, "toDate": {"en": "To Date", "ar": "الى تاريخ"}, - "searchPatientImageCaptionTitle": {"en": "SEARCH PATIENT", "ar": "البحث عن المريض"}, - "searchPatientImageCaptionBody": {"en": "Add Details Of Patient To search", "ar": " أضف تفاصيل المريض للبحث"}, + "searchPatientImageCaptionTitle": { + "en": "SEARCH PATIENT", + "ar": "البحث عن المريض" + }, + "searchPatientImageCaptionBody": { + "en": "Add Details Of Patient To search", + "ar": " أضف تفاصيل المريض للبحث" + }, "welcome": {"en": "Welcome", "ar": "أهلا بك"}, - "youDoNotHaveAnyItem": {"en": "You don\"t have any Items", "ar": "لا يوجد اي نتائج"}, + "youDoNotHaveAnyItem": { + "en": "You don\"t have any Items", + "ar": "لا يوجد اي نتائج" + }, "typeMedicineName": {"en": "Type Medicine Name", "ar": "اكتب اسم الدواء"}, "moreThan3Letter": { "en": "Medicine Name Should Be More Than 3 letter", @@ -229,14 +301,20 @@ const Map> localizedValues = { "bed": {"en": "BED:", "ar": "السرير"}, "next": {"en": "Next", "ar": "التالي"}, "previous": {"en": "Previous", "ar": "السابق"}, - "healthRecordInformation": {"en": "HEALTH RECORD INFORMATION", "ar": "معلومات السجل الصحي"}, + "healthRecordInformation": { + "en": "HEALTH RECORD INFORMATION", + "ar": "معلومات السجل الصحي" + }, "prevoius-sickleave-issed": { "en": "Total previous sick leave issued by the doctor", "ar": "مجموع الإجازات المرضية السابقة التي أصدرها الطبيب" }, "clinicSelect": {"en": "Select Clinic", "ar": "اختر عيادة"}, "doctorSelect": {"en": "Select Doctor", "ar": "اختر طبيب"}, - "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"}, + "empty-message": { + "en": "Please enter this field", + "ar": "يرجى ادخال هذا الحقل" + }, "no-sickleve-applied": { "en": "No sick leave available, apply Now", "ar": "لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن" @@ -251,13 +329,19 @@ const Map> localizedValues = { "leave-start-date": {"en": "Leave start date", "ar": "تاريخ بدء المغادرة"}, "days-sick-leave": {"en": "Leave Days: ", "ar": "أيام الإجازة "}, "extend": {"en": "Extend", "ar": "تمديد"}, - "extend-sickleave": {"en": "Extend Sick Leave", "ar": "قم بتمديد الإجازة المرضية"}, + "extend-sickleave": { + "en": "Extend Sick Leave", + "ar": "قم بتمديد الإجازة المرضية" + }, "chiefComplaintLength": { "en": "Chief Complaint length should be greater than 25", "ar": "يجب أن يكون طول شكوى الرئيسية أكبر من 25" }, "patient-target": {"en": "Target Patient", "ar": "المريض المستدف"}, - "no-priscription-listed": {"en": "No Prescription Listed", "ar": "لا يوجد وصفة طبية مدرجة"}, + "no-priscription-listed": { + "en": "No Prescription Listed", + "ar": "لا يوجد وصفة طبية مدرجة" + }, "referTo": {"en": "Refer To", "ar": "محال إلى"}, "referredFrom": {"en": "From : ", "ar": " : من"}, "branch": {"en": "Branch", "ar": "الفرع"}, @@ -272,9 +356,15 @@ const Map> localizedValues = { "summaryReport": {"en": "Summary", "ar": "ملخص"}, "accept": {"en": "ACCEPT", "ar": "قبول"}, "reject": {"en": "REJECT", "ar": "رفض"}, - "noAppointmentsErrorMsg": {"en": "There is no appointments for at this date", "ar": "لا توجد مواعيد في هذا التاريخ"}, + "noAppointmentsErrorMsg": { + "en": "There is no appointments for at this date", + "ar": "لا توجد مواعيد في هذا التاريخ" + }, "referralPatient": {"en": "Referral Patient", "ar": "المريض المحال "}, - "noPrescriptionListed": {"en": "NO PRESCRIPTION LISTED", "ar": "لأيوجد وصفة طبية"}, + "noPrescriptionListed": { + "en": "NO PRESCRIPTION LISTED", + "ar": "لأيوجد وصفة طبية" + }, "addNow": {"en": "ADD Now", "ar": "اضف الآن"}, "orderType": {"en": "Order Type", "ar": "نوع الطلب"}, "strength": {"en": "Strength", "ar": "شديد"}, @@ -284,8 +374,14 @@ const Map> localizedValues = { "instruction": {"en": "Instructions", "ar": "إرشادات"}, "addMedication": {"en": "Add Medication", "ar": "اضف دواء"}, "route": {"en": "Route", "ar": "طريقة الاستخدام"}, - "reschedule-leave": {"en": "Reschedule and leaves", "ar": "إعادة الجدولة والمغادرة"}, - "no-reschedule-leave": {"en": "No Reschedule and leaves", "ar": "لايوجد طلبات اعادة جدولة او مغادرة"}, + "reschedule-leave": { + "en": "Reschedule and leaves", + "ar": "إعادة الجدولة والمغادرة" + }, + "no-reschedule-leave": { + "en": "No Reschedule and leaves", + "ar": "لايوجد طلبات اعادة جدولة او مغادرة" + }, "weight": {"en": "Weight", "ar": "الوزن"}, "kg": {"en": "kg", "ar": "كغ"}, "height": {"en": "Height", "ar": "الطول"}, @@ -307,7 +403,10 @@ const Map> localizedValues = { "rhythm": {"en": "Rhythm", "ar": "الإيقاع"}, "respBeats": {"en": "RESP (beats/minute)", "ar": " (دقة/دقيقة)التنفس"}, "patternOfRespiration": {"en": "Pattern Of Respiration", "ar": "نمط التنفس"}, - "bloodPressureDiastoleAndSystole": {"en": "Blood Pressure (Sys, Dias)", "ar": "ضغط الدم (الانقباض, الإنبساط)"}, + "bloodPressureDiastoleAndSystole": { + "en": "Blood Pressure (Sys, Dias)", + "ar": "ضغط الدم (الانقباض, الإنبساط)" + }, "cuffLocation": {"en": "Cuff Location", "ar": "موقع الكف"}, "cuffSize": {"en": "Cuff Size", "ar": "حجم الكف"}, "patientPosition": {"en": "Patient Position", "ar": "موقع المريض"}, @@ -318,41 +417,80 @@ const Map> localizedValues = { "to": {"en": "To", "ar": "إلى"}, "coveringDoctor": {"en": "Covering Doctor: ", "ar": " :تغطية دكتور"}, "requestLeave": {"en": "Request Leave", "ar": "طلب إجازة"}, - "pleaseEnterDate": {"en": "Please enter leave start date", "ar": "الرجاء إدخال تاريخ بدء الإجازة"}, - "pleaseEnterNoOfDays": {"en": "Please enter sick leave days", "ar": "الرجاء إدخال أيام الإجازة المرضية"}, - "pleaseEnterRemarks": {"en": "Please enter remarks", "ar": "الرجاء إدخال الملاحظات"}, + "pleaseEnterDate": { + "en": "Please enter leave start date", + "ar": "الرجاء إدخال تاريخ بدء الإجازة" + }, + "pleaseEnterNoOfDays": { + "en": "Please enter sick leave days", + "ar": "الرجاء إدخال أيام الإجازة المرضية" + }, + "pleaseEnterRemarks": { + "en": "Please enter remarks", + "ar": "الرجاء إدخال الملاحظات" + }, "update": {"en": "Update", "ar": "تحديث"}, "admission": {"en": "Admission", "ar": "تنويم"}, "request": {"en": "Request", "ar": "طلب"}, "admissionRequest": {"en": "Admission Request", "ar": "طلب تنويم"}, "patientDetails": {"en": "Patient Details", "ar": "تفاصيل المريض"}, - "specialityAndDoctorDetail": {"en": "SPECIALITY AND DOCTOR DETAILS", "ar": "تفاصيل التخصص والطبيب"}, + "specialityAndDoctorDetail": { + "en": "SPECIALITY AND DOCTOR DETAILS", + "ar": "تفاصيل التخصص والطبيب" + }, "referringDate": {"en": "Referring Date", "ar": "تاريخ الإحالة"}, "referringDoctor": {"en": "Referring Doctor", "ar": "دكتور الإحالة"}, "otherInformation": {"en": "Other Information", "ar": "معلومات أخرى"}, "expectedDays": {"en": "Expected Days", "ar": "الأيام المتوقعة"}, - "expectedAdmissionDate": {"en": "Expected Admission Date", "ar": "تاريخ التنويم المتوقع"}, + "expectedAdmissionDate": { + "en": "Expected Admission Date", + "ar": "تاريخ التنويم المتوقع" + }, "admissionDate": {"en": "Admission Date", "ar": "تاريخ التنويم"}, - "isSickLeaveRequired": {"en": "Is Sick Leave Required", "ar": "هل الإجازة المرضية مطلوبة"}, + "isSickLeaveRequired": { + "en": "Is Sick Leave Required", + "ar": "هل الإجازة المرضية مطلوبة" + }, "patientPregnant": {"en": "Patient Pregnant", "ar": "المريض حامل"}, - "treatmentLine": {"en": "Main line of treatment", "ar": "الخط الرئيسي للعلاج"}, + "treatmentLine": { + "en": "Main line of treatment", + "ar": "الخط الرئيسي للعلاج" + }, "ward": {"en": "Ward", "ar": "جناح"}, - "preAnesthesiaReferred": {"en": "PRE ANESTHESIA REFERRED", "ar": "الاحالة قبل التخدير"}, + "preAnesthesiaReferred": { + "en": "PRE ANESTHESIA REFERRED", + "ar": "الاحالة قبل التخدير" + }, "admissionType": {"en": "Admission Type", "ar": "نوع التنويم"}, "diagnosis": {"en": "Diagnosis", "ar": "التشخيص"}, "allergies": {"en": "Allergies", "ar": "الحساسية"}, - "preOperativeOrders": {"en": "Pre Operative Orders", "ar": "أوامر ما قبل العملية"}, - "elementForImprovement": {"en": "Element For Improvement", "ar": "عنصر للتحسين"}, + "preOperativeOrders": { + "en": "Pre Operative Orders", + "ar": "أوامر ما قبل العملية" + }, + "elementForImprovement": { + "en": "Element For Improvement", + "ar": "عنصر للتحسين" + }, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ الخروج"}, "dietType": {"en": "Diet Type", "ar": "نوع النظام الغذائي"}, - "dietTypeRemarks": {"en": "Remarks on diet type", "ar": "ملاحظات على نوع النظام الغذائي"}, + "dietTypeRemarks": { + "en": "Remarks on diet type", + "ar": "ملاحظات على نوع النظام الغذائي" + }, "save": {"en": "SAVE", "ar": "حفظ"}, - "postPlansEstimatedCost": {"en": "POST PLANS & ESTIMATED COST", "ar": "خطط ما بعد العملية والتكلفة المقدرة"}, + "postPlansEstimatedCost": { + "en": "POST PLANS & ESTIMATED COST", + "ar": "خطط ما بعد العملية والتكلفة المقدرة" + }, "postPlans": {"en": "POST PLANS", "ar": "ما بعد العملية"}, "ucaf": {"en": "UCAF", "ar": "UCAF"}, "emergencyCase": {"en": "Emergency Case", "ar": "حالة طارئة"}, "durationOfIllness": {"en": "duration Of Illness", "ar": "مدة المرض"}, - "chiefComplaintsAndSymptoms": {"en": "CHIEF COMPLAINTS", "ar": "الشكوى الرئيسية"}, + "chiefComplaintsAndSymptoms": { + "en": "CHIEF COMPLAINTS", + "ar": "الشكوى الرئيسية" + }, "patientFeelsPainInHisBackAndCough": { "en": "Patient Feels pain in his back and cough", "ar": "يشعر المريض بألم في ظهره ويسعل" @@ -366,7 +504,10 @@ const Map> localizedValues = { "how": {"en": "How", "ar": "كيف"}, "when": {"en": "When", "ar": "متى"}, "where": {"en": "Where", "ar": "أين"}, - "specifyPossibleLineManagement": {"en": "Specify possible line of management", "ar": "حدد خط الإدارة المحتمل"}, + "specifyPossibleLineManagement": { + "en": "Specify possible line of management", + "ar": "حدد خط الإدارة المحتمل" + }, "significantSigns": {"en": "SIGNIFICANT SIGNS", "ar": "علامات مهمة"}, "backAbdomen": {"en": "Back : Abdomen", "ar": "الظهر: البطن"}, "reasons": {"en": "Reasons", "ar": "الأسباب"}, @@ -376,11 +517,20 @@ const Map> localizedValues = { "addChiefComplaints": {"en": "Add Chief Complaints", "ar": " اضافه الشكاوى"}, "histories": {"en": "Histories", "ar": "التاريخ المرضي"}, "allergiesSoap": {"en": "Allergies", "ar": "الحساسية"}, - "historyOfPresentIllness": {"en": "History of Present Illness", "ar": "تاريخ المرض الحالي"}, - "requiredMsg": {"en": "Please add required field correctly", "ar": "الرجاء إضافة الحقل المطلوب بشكل صحيح"}, + "historyOfPresentIllness": { + "en": "History of Present Illness", + "ar": "تاريخ المرض الحالي" + }, + "requiredMsg": { + "en": "Please add required field correctly", + "ar": "الرجاء إضافة الحقل المطلوب بشكل صحيح" + }, "addHistory": {"en": "Add History", "ar": "اضافه تاريخ مرضي"}, "searchHistory": {"en": "Search History", "ar": " البحث"}, - "addSelectedHistories": {"en": "Add Selected Histories", "ar": " اضافه تاريخ مرضي"}, + "addSelectedHistories": { + "en": "Add Selected Histories", + "ar": " اضافه تاريخ مرضي" + }, "addAllergies": {"en": "Add Allergies", "ar": "أضف الحساسية"}, "itemExist": {"en": "This item already exist", "ar": "هذا العنصر موجود"}, "selectAllergy": {"en": "Select Allergy", "ar": "أختر الحساسية"}, @@ -388,9 +538,18 @@ const Map> localizedValues = { "leaveCreated": {"en": "Leave has been created", "ar": "تم إنشاء الإجازة"}, "medications": {"en": "Medications", "ar": "الأدوية"}, "procedures": {"en": "Procedures", "ar": "الإجراءات"}, - "vitalSignEmptyMsg": {"en": "There is no vital signs for this patient", "ar": "لا توجد علامات حيوية لهذا المريض"}, - "referralEmptyMsg": {"en": "There is no referral data", "ar": "لا توجد بيانات إحالة"}, - "referralSuccessMsg": {"en": "You make referral successfully", "ar": "تمت الاحالة بنجاح"}, + "vitalSignEmptyMsg": { + "en": "There is no vital signs for this patient", + "ar": "لا توجد علامات حيوية لهذا المريض" + }, + "referralEmptyMsg": { + "en": "There is no referral data", + "ar": "لا توجد بيانات إحالة" + }, + "referralSuccessMsg": { + "en": "You make referral successfully", + "ar": "تمت الاحالة بنجاح" + }, "fromTime": {"en": "From Time", "ar": "من وقت"}, "toTime": {"en": "To Time", "ar": "الى وقت"}, "diagnoseType": {"en": "Diagnose Type", "ar": "نوع التشخيص"}, @@ -401,9 +560,18 @@ const Map> localizedValues = { "codeNo": {"en": "Code #", "ar": "# الرمز"}, "covered": {"en": "Covered", "ar": "مغطى"}, "approvalRequired": {"en": "Approval Required", "ar": "الموافقة مطلوبة"}, - "uncoveredByDoctor": {"en": "Uncovered By Doctor", "ar": "غير مغطى من قبل الدكتور"}, - "chiefComplaintEmptyMsg": {"en": "There is no Chief Complaint", "ar": "ليس هناك شكوى رئيسية"}, - "more-verify": {"en": "More Verification Options", "ar": "المزيد من خيارات التحقق"}, + "uncoveredByDoctor": { + "en": "Uncovered By Doctor", + "ar": "غير مغطى من قبل الدكتور" + }, + "chiefComplaintEmptyMsg": { + "en": "There is no Chief Complaint", + "ar": "ليس هناك شكوى رئيسية" + }, + "more-verify": { + "en": "More Verification Options", + "ar": "المزيد من خيارات التحقق" + }, "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بك!"}, "account-info": { "en": "Would you like to login with current username?", @@ -420,24 +588,37 @@ const Map> localizedValues = { "verify-with-sms": {"en": " SMS", "ar": "الرسائل القصيرة"}, "verify-with-whatsapp": {"en": "WhatsApp", "ar": " الواتس اب"}, "verify-with": {"en": "Verify through ", "ar": " الواتس اب"}, - "last-login": {"en": "Last login details:", "ar": "تفاصيل تسجيل الدخول الأخير:"}, + "last-login": { + "en": "Last login details:", + "ar": "تفاصيل تسجيل الدخول الأخير:" + }, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { - "en": "To activate the fingerprint login service, please verify data by using one of the following options.", + "en": + "To activate the fingerprint login service, please verify data by using one of the following options.", "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية" }, "verification_message": { "en": "Please enter the Verification Code sent to", "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" }, - "validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"}, + "validation_message": { + "en": "The verification code expires in", + "ar": "تنتهي صلاحية رمز التحقق خلال" + }, "addAssessment": {"en": "Add Assessment", "ar": "أضف التقييم"}, "assessment": {"en": "Assessment", "ar": " التقييم"}, - "physicalSystemExamination": {"en": "Physical System / Examination", "ar": "الفحص البدني / النظام"}, + "physicalSystemExamination": { + "en": "Physical System / Examination", + "ar": "الفحص البدني / النظام" + }, "searchExamination": {"en": "Search Examination", "ar": "بحث عن فحص"}, "addExamination": {"en": "Add Examination", "ar": "اضافة فحص"}, "doc": {"en": "Doc : ", "ar": " د : "}, - "patientNoDetailErrMsg": {"en": "There is no detail for this patient", "ar": "لا توجد تفاصيل لهذا المريض"}, + "patientNoDetailErrMsg": { + "en": "There is no detail for this patient", + "ar": "لا توجد تفاصيل لهذا المريض" + }, "allergicTO": {"en": "ALLERGIC TO ", "ar": "حساس من"}, "normal": {"en": "Normal", "ar": "عادي"}, "abnormal": {"en": "Abnormal", "ar": " غير عادي"}, @@ -456,25 +637,46 @@ const Map> localizedValues = { "visitDate": {"en": "Visit Date", "ar": "تاريخ الزيارة"}, "test": {"en": "Procedures/Test", "ar": "اجراءات/تحاليل"}, "regular": {"en": "Regular", "ar": "اعتيادي"}, - "addMoreProcedure": {"en": "Add More Procedures", "ar": "اضف المزيد من اجراءات"}, + "addMoreProcedure": { + "en": "Add More Procedures", + "ar": "اضف المزيد من اجراءات" + }, "searchProcedures": {"en": "Search Procedures", "ar": "البحث في اجراءات"}, "selectProcedures": {"en": "Select procedure", "ar": "اختر الاجراء"}, - "procedureCategorise": {"en": "Select Procedure Category", "ar": "اختر نوع الاجراء "}, - "addSelectedProcedures": {"en": "add Selected Procedures", "ar": "اضافة الاجراءات المختارة "}, + "procedureCategorise": { + "en": "Select Procedure Category", + "ar": "اختر نوع الاجراء " + }, + "addSelectedProcedures": { + "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": "Name or ICD"}, "dType": {"en": "Type", "ar": "النوع"}, - "addAssessmentDetails": {"en": "Add Assessment Details", "ar": "أضف تفاصيل التقييم"}, + "addAssessmentDetails": { + "en": "Add Assessment Details", + "ar": "أضف تفاصيل التقييم" + }, "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, "editedBy": {"en": "Edited By :", "ar": "عدلت من : "}, "currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"}, - "noItem": {"en": "No items exists in this list", "ar": "لا توجد عناصر في هذه القائمة"}, - "postUcafSuccessMsg": {"en": "UCAF request send successfully", "ar": "تم ارسال طلب UCAF بنجاح"}, - "vitalSignDetailEmpty": {"en": "There is no data for this vital sign", "ar": "لا توجد بيانات لهذه العلامة الحيوية"}, + "noItem": { + "en": "No items exists in this list", + "ar": "لا توجد عناصر في هذه القائمة" + }, + "postUcafSuccessMsg": { + "en": "UCAF request send successfully", + "ar": "تم ارسال طلب UCAF بنجاح" + }, + "vitalSignDetailEmpty": { + "en": "There is no data for this vital sign", + "ar": "لا توجد بيانات لهذه العلامة الحيوية" + }, "onlyOfftimeHoliday": { "en": "You can only apply holiday or offtime from mobile app", "ar": "يمكنك تقديم عطلة أو إجازة فقط" @@ -490,7 +692,10 @@ const Map> localizedValues = { "en": "You have to add at least one examination.", "ar": "يجب عليك إضافة فحص واحد على الأقل." }, - "progressNoteErrorMsg": {"en": "You have to add progress Note.", "ar": "يجب عليك إضافة ملاحظة التقدم."}, + "progressNoteErrorMsg": { + "en": "You have to add progress Note.", + "ar": "يجب عليك إضافة ملاحظة التقدم." + }, "chiefComplaintErrorMsg": { "en": "You have to add chief complaint fields correctly .", "ar": "يجب عليك إضافة الشكوى الرئيسية بشكل صحيح" @@ -514,20 +719,41 @@ const Map> localizedValues = { "referralStatusNotSeen": {"en": "NotSeen", "ar": "لم يحضر"}, "clinicSearch": {"en": "Search Clinic", "ar": "بحث عن عيادة"}, "doctorSearch": {"en": "Search Doctor", "ar": "بحث عن طبيب"}, - "referralResponse": {"en": "Referral Response : ", "ar": " : استجابة الإحالة"}, + "referralResponse": { + "en": "Referral Response : ", + "ar": " : استجابة الإحالة" + }, "estimatedCost": {"en": "Estimated Cost", "ar": "التكلفة المتوقعة"}, "diagnosisDetail": {"en": "Diagnosis Details", "ar": "تفاصيل التشخيص"}, - "referralSuccessMsgAccept": {"en": "Referral Accepted Successfully", "ar": "تم قبول الإحالة بنجاح"}, - "referralSuccessMsgReject": {"en": "Referral Rejected Successfully", "ar": "تم رفض الإحالة بنجاح"}, - "sickLeaveComments": {"en": "Sick leave comments", "ar": "ملاحظات الإجازة المرضية"}, + "referralSuccessMsgAccept": { + "en": "Referral Accepted Successfully", + "ar": "تم قبول الإحالة بنجاح" + }, + "referralSuccessMsgReject": { + "en": "Referral Rejected Successfully", + "ar": "تم رفض الإحالة بنجاح" + }, + "sickLeaveComments": { + "en": "Sick leave comments", + "ar": "ملاحظات الإجازة المرضية" + }, "pastMedicalHistory": {"en": "Past medical history", "ar": "التاريخ الطبي"}, - "pastSurgicalHistory": {"en": "Past surgical history", "ar": "التاريخ الجراحي"}, + "pastSurgicalHistory": { + "en": "Past surgical history", + "ar": "التاريخ الجراحي" + }, "complications": {"en": "Complications", "ar": "المضاعفات"}, "floor": {"en": "Floor", "ar": "الطابق"}, "roomCategory": {"en": "Room category", "ar": "فئة الغرفة"}, - "otherDepartmentsInterventions": {"en": "Other departments interventions", "ar": "ملاحظات الأقسام الأخرى"}, + "otherDepartmentsInterventions": { + "en": "Other departments interventions", + "ar": "ملاحظات الأقسام الأخرى" + }, "otherProcedure": {"en": "Other procedure", "ar": "إجراء آخر"}, - "admissionRequestSuccessMsg": {"en": "Admission Request Created Successfully", "ar": "تم إنشاء طلب التنويم بنجاح"}, + "admissionRequestSuccessMsg": { + "en": "Admission Request Created Successfully", + "ar": "تم إنشاء طلب التنويم بنجاح" + }, "orderNo": {"en": "Order No : ", "ar": "رقم الطلب"}, "infoStatus": {"en": "Info Status", "ar": "حالة المعلومات"}, "doctorResponse": {"en": "Doctor Response", "ar": "استجابة الطبيب"}, @@ -540,7 +766,10 @@ const Map> localizedValues = { "ptientsreferral": {"en": "Patients Referrals", "ar": "إحالات المريض"}, "myPatientsReferral": {"en": "Patient's\nReferrals", "ar": "إحالات\nالمريض"}, "arrivalpatient": {"en": "Arrival Patients", "ar": "المرضى الواصلون"}, - "searchmedicinepatient": {"en": "Search patient or Medicines", "ar": "ابحث عن المريض أو الأدوية"}, + "searchmedicinepatient": { + "en": "Search patient or Medicines", + "ar": "ابحث عن المريض أو الأدوية" + }, "appointmentDate": {"en": "Appointment Date", "ar": "تاريخ الموعد"}, "arrived_p": {"en": "Arrived", "ar": "وصل"}, "details": {"en": "Details", "ar": "التفاصيل"}, @@ -548,16 +777,28 @@ const Map> localizedValues = { "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, - "sendSuc": {"en": "A copy has been sent to the email", "ar": "تم إرسال نسخة إلى البريد الإلكتروني"}, + "sendSuc": { + "en": "A copy has been sent to the email", + "ar": "تم إرسال نسخة إلى البريد الإلكتروني" + }, "SpecialResult": {"en": "Special Result", "ar": "نتيجة خاصة"}, - "noDataAvailable": {"en": "No data available", "ar": " لا يوجد بيانات متاحة "}, + "noDataAvailable": { + "en": "No data available", + "ar": " لا يوجد بيانات متاحة " + }, "show-more-btn": {"en": "Flowchart", "ar": "النتائج التراكمية"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, "fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "}, - "searchPatient-name": {"en": "Search Name, Medical File, Phone Number", "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف"}, + "searchPatient-name": { + "en": "Search Name, Medical File, Phone Number", + "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف" + }, "reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"}, "leaves": {"en": "Leaves", "ar": "يغادر"}, - "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, + "totalApproval": { + "en": "Total approval unused", + "ar": "اجمالي الموافقات الغير مستخدمة" + }, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, @@ -566,16 +807,31 @@ const Map> localizedValues = { "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, - "searchWithOther": {"en": "Search With Other Criteria", "ar": "المزيد من خيارات البحث"}, - "hideOtherCriteria": {"en": "Hide Other Criteria", "ar": "إخفاء الخيارات الأخرى"}, - "applyForReschedule": {"en": "Apply for leave or reschedule", "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة"}, + "searchWithOther": { + "en": "Search With Other Criteria", + "ar": "المزيد من خيارات البحث" + }, + "hideOtherCriteria": { + "en": "Hide Other Criteria", + "ar": "إخفاء الخيارات الأخرى" + }, + "applyForReschedule": { + "en": "Apply for leave or reschedule", + "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة" + }, "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"}, - "addSickLeaveRequest": {"en": "Add Sick Leave Request", "ar": "إضافة طلب إجازة مرضية"}, - "extendSickLeaveRequest": {"en": "Extend Sick Leave Request", "ar": "تمديد طلب الإجازة المرضية"}, + "addSickLeaveRequest": { + "en": "Add Sick Leave Request", + "ar": "إضافة طلب إجازة مرضية" + }, + "extendSickLeaveRequest": { + "en": "Extend Sick Leave Request", + "ar": "تمديد طلب الإجازة المرضية" + }, "accepted": {"en": "Accepted", "ar": "موافق"}, "cancelled": {"en": "Cancelled", "ar": "ألغي"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, @@ -585,10 +841,16 @@ const Map> localizedValues = { "remove": {"en": "Remove", "ar": "حذف"}, "changeOfSchedule": {"en": "Change of Schedule", "ar": "تغيير الجدول"}, "newSchedule": {"en": "New Schedule", "ar": "جدول جديد"}, - "enter_credentials": {"en": "Enter the user credentials below", "ar": "أدخل بيانات المستخدم أدناه"}, + "enter_credentials": { + "en": "Enter the user credentials below", + "ar": "أدخل بيانات المستخدم أدناه" + }, "step": {"en": "Step", "ar": "خطوة"}, "fieldRequired": {"en": "This field is required", "ar": "هذه الخانة مطلوبه"}, - "applyOrRescheduleLeave": {"en": "Apply Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة"}, + "applyOrRescheduleLeave": { + "en": "Apply Reschedule Leave", + "ar": "التقدم بطلب أو إعادة جدولة الإجازة" + }, "myQRCode": {"en": "My QR Code", "ar": " كود QR "}, "patientIDMobilenational": { "en": "Patient ID, National ID, Mobile Number", @@ -603,32 +865,68 @@ const Map> localizedValues = { "try-saying": {"en": "Try saying something", "ar": "حاول قول شيء ما"}, "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, - "didntCatch": {"en": "Didn't catch that. Try Speaking again", "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى"}, + "didntCatch": { + "en": "Didn't catch that. Try Speaking again", + "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" + }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, - "pleaseEnterProcedure": {"en": "Please Enter Procedure", "ar": "الرجاء إدخال الإجراء "}, - "fillTheMandatoryProcedureDetails": {"en": "Fill The Mandatory Procedure Details", "ar": "املأ تفاصيل الإجراء"}, - "atLeastThreeCharacters": {"en": "At least three Characters", "ar": "ثلاثة أحرف على الأقل "}, - "searchProcedureHere": {"en": "Search Procedure here...", "ar": "إجراء البحث هنا ... "}, - "noInsuranceApprovalFound": {"en": "No Insurance Approval Found", "ar": "لم يتم العثور على موافقة التأمين"}, + "pleaseEnterProcedure": { + "en": "Please Enter Procedure", + "ar": "الرجاء إدخال الإجراء " + }, + "fillTheMandatoryProcedureDetails": { + "en": "Fill The Mandatory Procedure Details", + "ar": "املأ تفاصيل الإجراء" + }, + "atLeastThreeCharacters": { + "en": "At least three Characters", + "ar": "ثلاثة أحرف على الأقل " + }, + "searchProcedureHere": { + "en": "Search Procedure here...", + "ar": "إجراء البحث هنا ... " + }, + "noInsuranceApprovalFound": { + "en": "No Insurance Approval Found", + "ar": "لم يتم العثور على موافقة التأمين" + }, "procedure": {"en": "Procedure", "ar": "اجراء"}, "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, "processed": {"en": "processed", "ar": "معالجتها"}, "direction": {"en": "Direction", "ar": "توجيه"}, "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, - "medicationHasBeenAdded": {"en": "Medication has been added", "ar": "تمت إضافة الدواء"}, - "newPrescriptionOrder": {"en": "New Prescription Order", "ar": "طلب وصفة طبية جديد "}, - "pleaseFillAllFields": {"en": "Please Fill All Fields", "ar": "الرجاء أملأ جميع الحقول"}, + "medicationHasBeenAdded": { + "en": "Medication has been added", + "ar": "تمت إضافة الدواء" + }, + "newPrescriptionOrder": { + "en": "New Prescription Order", + "ar": "طلب وصفة طبية جديد " + }, + "pleaseFillAllFields": { + "en": "Please Fill All Fields", + "ar": "الرجاء أملأ جميع الحقول" + }, "narcoticMedicineCanOnlyBePrescribedFromVida": { "en": "Narcotic medicine can only be prescribed from VIDA", "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " }, - "only5DigitsAllowedForStrength": {"en": "Only 5 Digits allowed for strength", "ar": "يسمح فقط بـ 5 أرقام للقوة"}, + "only5DigitsAllowedForStrength": { + "en": "Only 5 Digits allowed for strength", + "ar": "يسمح فقط بـ 5 أرقام للقوة" + }, "unit": {"en": "Unit", "ar": "وحدة"}, "boxQuantity": {"en": "Box Quantity", "ar": "كمية العبوة "}, "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, - "applyForRadiologyOrder": {"en": "Apply for Radiology Order", "ar": "التقدم بطلب للحصول على طلب الأشعة "}, - "applyForNewLabOrder": {"en": "Apply for New Lab Order", "ar": "تقدم بطلب جديد للمختبر الأشعة"}, + "applyForRadiologyOrder": { + "en": "Apply for Radiology Order", + "ar": "التقدم بطلب للحصول على طلب الأشعة " + }, + "applyForNewLabOrder": { + "en": "Apply for New Lab Order", + "ar": "تقدم بطلب جديد للمختبر الأشعة" + }, "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب مختبر"}, "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشعة"}, "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب أشعة جديد"}, @@ -640,14 +938,23 @@ const Map> localizedValues = { "en": "Apply for New Prescriptions Order", "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " }, - "noPrescriptionsFound": {"en": "No Prescriptions Found", "ar": "لم يتم العثور على وصفات طبية"}, - "noMedicalFileFound": {"en": "No Medical File Found", "ar": "لم يتم العثور على ملف طبي"}, + "noPrescriptionsFound": { + "en": "No Prescriptions Found", + "ar": "لم يتم العثور على وصفات طبية" + }, + "noMedicalFileFound": { + "en": "No Medical File Found", + "ar": "لم يتم العثور على ملف طبي" + }, "insurance22": {"en": "Insurance", "ar": "موافقات"}, "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف طلب جديد"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, + "addNewProgressNote": { + "en": "Add a New Progress Note", + "ar": "أضف ملاحظة جديدة" + }, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغي"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, @@ -666,7 +973,10 @@ const Map> localizedValues = { "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يتم الرد بعد"}, "clearText": {"en": "Clear Text", "ar": "نص واضح"}, "medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"}, - "medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"}, + "medicalReportVerify": { + "en": "Verify Medical Report", + "ar": "تحقق من التقرير الطبي" + }, "comments": {"en": "Comments", "ar": "ملاحظات"}, "initiateCall": {"en": "Initiate Call ", "ar": "بدء الاتصال"}, "transferTo": {"en": "Transfer To ", "ar": "حول إلى"}, @@ -677,10 +987,22 @@ const Map> localizedValues = { "consultation": {"en": "Consultation", "ar": "استشارة"}, "resume": {"en": "Resume", "ar": "استأنف"}, "theCall": {"en": "The Call", "ar": "الاتصال"}, - "createNewMedicalReport": {"en": "Create New Medical Report", "ar": "إنشاء تقرير طبي جديد"}, - "historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ"}, - "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المختبرات والبيانات الفيزيائية"}, - "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, + "createNewMedicalReport": { + "en": "Create New Medical Report", + "ar": "إنشاء تقرير طبي جديد" + }, + "historyPhysicalFinding": { + "en": "History and Physical Finding", + "ar": "التاريخ" + }, + "laboratoryPhysicalData": { + "en": "Laboratory and Physical Data", + "ar": "المختبرات والبيانات الفيزيائية" + }, + "impressionRecommendation": { + "en": "Impression and Recommendation", + "ar": "الانطباع والتوصية" + }, "onHold": {"en": "On Hold", "ar": "قيد الانتظار"}, "verified": {"en": "Verified", "ar": "تم التحقق"}, "endCall": {"en": "End Call", "ar": "انهاء"}, @@ -693,30 +1015,43 @@ const Map> localizedValues = { "edit": {"en": "Edit", "ar": "تعديل"}, "summeryReply": {"en": "Summary Reply", "ar": "ملخص الرد"}, "finish": {"en": "Finish", "ar": "انهاء"}, - "severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"}, + "severityValidationError": { + "en": "Please add allergy severity", + "ar": "الرجاء إضافة شدة الحساسية" + }, "inProgress": {"en": "inProgress", "ar": "تحت المعالجه"}, "Completed": {"en": "Completed", "ar": "مكتمل"}, "Locked": {"en": "Locked", "ar": "مقفل"}, - "textCopiedSuccessfully": {"en": "Text copied successfully", "ar": "تم نسخ النص بنجاح"}, + "textCopiedSuccessfully": { + "en": "Text copied successfully", + "ar": "تم نسخ النص بنجاح" + }, "roomNo": {"en": "Room No", "ar": "رقم الغرفة"}, "replayCallStatus": {"en": "Called", "ar": "تم الاتصال"}, "patientArrived": {"en": "Patient Arrived", "ar": "وصل المريض"}, - "calledAndNoResponse": {"en": "Called And No Response", "ar": "تم الاتصال ولا يوجد رد"}, + "calledAndNoResponse": { + "en": "Called And No Response", + "ar": "تم الاتصال ولا يوجد رد" + }, "underProcess": {"en": "Under Process", "ar": "تحت التجهيز"}, "textResponse": {"en": "Text Response", "ar": "استجابة النص"}, "notReplied": {"en": "Not Replied", "ar": "لم يتم يرد"}, - "requestType":{ - "en":"Request Type", - "ar":"نوع الطلب"}, + "requestType": {"en": "Request Type", "ar": "نوع الطلب"}, "special": {"en": "Special", "ar": "خاص"}, - "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , + "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"}, "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, "reports": {"en": "Reports", "ar": "تقارير "}, "operation": {"en": "Operation", "ar": " العملية"}, - "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, + "registerNewPatient": { + "en": "Register\nNew Patient", + "ar": "تسجيل\n مريض جديد" + }, "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, "occupation": {"en": "Occupation", "ar": "مهنة"}, "healthID": {"en": "Health ID", "ar": "معرف الصحة"}, "identityNumber": {"en": "Identity Number", "ar": "رقم الهوية"}, "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, + "nursing": {"en": "Nursing", "ar": "تمريض"}, + "diabetic": {"en": "Diabetic", "ar": "مرض السكري"}, + "chart": {"en": "Chart", "ar": "جدول"}, }; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index bc5df139..9719b525 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -39,7 +39,8 @@ class _AdmissionOrdersScreenState extends State { isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: 2014005178, patientId: patient.patientMRN), + admissionNo: int.parse(patient.admissionNo), + patientId: patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -94,6 +95,7 @@ class _AdmissionOrdersScreenState extends State { widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, + bgColor: Colors.white, widget: Column( children: [ Column( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index ca304986..53d16291 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -113,12 +113,12 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).discharge, - TranslationBase.of(context).report, - DISCHARGE_SUMMARY, - 'patient/patient_sick_leave.png', - isInPatient: isInpatient,) - , + TranslationBase.of(context).discharge, + TranslationBase.of(context).report, + DISCHARGE_SUMMARY, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), PatientProfileCardModel( TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, @@ -127,43 +127,43 @@ class ProfileGridForInPatient extends StatelessWidget { isInPatient: isInpatient, ), PatientProfileCardModel( - "Operation", - "Report", + TranslationBase.of(context).operation, + TranslationBase.of(context).report, GET_OPERATION_REPORT, 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), PatientProfileCardModel( - "Pending", - "Orders", + TranslationBase.of(context).pending, + TranslationBase.of(context).orders, PENDING_ORDERS, 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), PatientProfileCardModel( - "Admission", - "Orders", + TranslationBase.of(context).admission, + TranslationBase.of(context).orders, ADMISSION_ORDERS, - 'patient/patient_sick_leave.png', + 'patient/Progress_notes.png', isInPatient: isInpatient, ), PatientProfileCardModel( "Nursing", - "Progress Note", + TranslationBase.of(context).progressNote, NURSING_PROGRESS_NOTE, - 'patient/patient_sick_leave.png', + 'patient/Progress_notes.png', isInPatient: isInpatient, ), PatientProfileCardModel( - "Diagnosis", + TranslationBase.of(context).diagnosis, "", DIAGNOSIS_FOR_IN_PATIENT, 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), PatientProfileCardModel( - "Diabetic", - "Chart", + TranslationBase.of(context).diabetic, + TranslationBase.of(context).chart, DIABETIC_CHART_VALUES, 'patient/patient_sick_leave.png', isInPatient: isInpatient, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 647cf39f..388c38d3 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -13,11 +13,13 @@ class TranslationBase { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => + localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; - String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get areYouSureYouWantTo => + localizedValues['areYouSureYouWantTo'][locale.languageCode]; String get language => localizedValues['language'][locale.languageCode]; @@ -35,35 +37,46 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => + localizedValues['replySuccessfully'][locale.languageCode]; - String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String get messagesScreenToolbarTitle => + localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; + String get errorNoSchedule => + localizedValues['errorNoSchedule'][locale.languageCode]; String get verify => localizedValues['verify'][locale.languageCode]; - String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; + String get referralDoctor => + localizedValues['referralDoctor'][locale.languageCode]; - String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; + String get referringClinic => + localizedValues['referringClinic'][locale.languageCode]; String get frequency => localizedValues['frequency'][locale.languageCode]; String get priority => localizedValues['priority'][locale.languageCode]; - String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; + String get maxResponseTime => + localizedValues['maxResponseTime'][locale.languageCode]; - String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String get clinicDetailsandRemarks => + localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; + String get answerSuggestions => + localizedValues['answerSuggestions'][locale.languageCode]; String get outPatients => localizedValues['outPatients'][locale.languageCode]; - String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; + String get searchPatient => + localizedValues['searchPatient'][locale.languageCode]; + String get searchPatientDashBoard => + localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientName => + localizedValues['searchPatient-name'][locale.languageCode]; String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; @@ -71,9 +84,11 @@ class TranslationBase { String get patients => localizedValues['patients'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; - String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; + String get todayStatistics => + localizedValues['todayStatistics'][locale.languageCode]; - String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; + String get familyMedicine => + localizedValues['familyMedicine'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; @@ -91,26 +106,36 @@ class TranslationBase { String get inPatient => localizedValues['inPatient'][locale.languageCode]; String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get myInPatientTitle => + localizedValues['myInPatientTitle'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; - String get patientServices => localizedValues['patientServices'][locale.languageCode]; + String get patientServices => + localizedValues['patientServices'][locale.languageCode]; - String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; + String get searchMedicine => + localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicineDashboard => + localizedValues['searchMedicineDashboard'][locale.languageCode]; - String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferralPatient => + localizedValues['myReferralPatient'][locale.languageCode]; - String get referPatient => localizedValues['referPatient'][locale.languageCode]; + String get referPatient => + localizedValues['referPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; - String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; - String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; + String get myReferredPatient => + localizedValues['myReferredPatient'][locale.languageCode]; + String get referredPatient => + localizedValues['referredPatient'][locale.languageCode]; String get referredOn => localizedValues['referredOn'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; @@ -127,19 +152,23 @@ class TranslationBase { String get search => localizedValues['search'][locale.languageCode]; - String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get onlyArrivedPatient => + localizedValues['onlyArrivedPatient'][locale.languageCode]; - String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get searchMedicineNameHere => + localizedValues['searchMedicineNameHere'][locale.languageCode]; String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String get itemsInSearch => localizedValues['itemsInSearch'][locale.languageCode]; + String get itemsInSearch => + localizedValues['itemsInSearch'][locale.languageCode]; String get qr => localizedValues['qr'][locale.languageCode]; String get reader => localizedValues['reader'][locale.languageCode]; - String get startScanning => localizedValues['startScanning'][locale.languageCode]; + String get startScanning => + localizedValues['startScanning'][locale.languageCode]; String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; @@ -151,17 +180,21 @@ class TranslationBase { String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; + String get clinicSelect => + localizedValues['clinicSelect'][locale.languageCode]; - String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get doctorSelect => + localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; - String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; + String get errorMessage => + localizedValues['errorMessage'][locale.languageCode]; - String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; + String get patientProfile => + localizedValues['patientProfile'][locale.languageCode]; String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; @@ -177,15 +210,18 @@ class TranslationBase { String get medicines => localizedValues['medicines'][locale.languageCode]; - String get prescription => localizedValues['prescription'][locale.languageCode]; + String get prescription => + localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get insuranceApprovals => + localizedValues['insuranceApprovals'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; - String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => + localizedValues['bodyMeasurements'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -193,26 +229,33 @@ class TranslationBase { String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => + localizedValues['bloodPressure'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; - String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; + String get errorNoVitalSign => + localizedValues['errorNoVitalSign'][locale.languageCode]; String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; + String get errorNoLabOrders => + localizedValues['errorNoLabOrders'][locale.languageCode]; - String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; + String get answerThePatient => + localizedValues['answerThePatient'][locale.languageCode]; - String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get pleaseEnterAnswer => + localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => localizedValues['progressNote'][locale.languageCode]; - String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get progressNote => + localizedValues['progressNote'][locale.languageCode]; + String get operationReports => + localizedValues['operationReports'][locale.languageCode]; String get reports => localizedValues['reports'][locale.languageCode]; String get operation => localizedValues['operation'][locale.languageCode]; @@ -222,12 +265,14 @@ class TranslationBase { String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; + String get errorNoProgressNote => + localizedValues['errorNoProgressNote'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String get generalResult => localizedValues['generalResult'][locale.languageCode]; + String get generalResult => + localizedValues['generalResult'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; @@ -237,23 +282,30 @@ class TranslationBase { String get enterId => localizedValues['enterId'][locale.languageCode]; - String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get pleaseEnterYourID => + localizedValues['pleaseEnterYourID'][locale.languageCode]; - String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; + String get enterPassword => + localizedValues['enterPassword'][locale.languageCode]; - String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get pleaseEnterPassword => + localizedValues['pleaseEnterPassword'][locale.languageCode]; - String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; + String get selectYourProject => + localizedValues['selectYourProject'][locale.languageCode]; - String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get pleaseEnterYourProject => + localizedValues['pleaseEnterYourProject'][locale.languageCode]; String get login => localizedValues['login'][locale.languageCode]; - String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get drSulaimanAlHabib => + localizedValues['drSulaimanAlHabib'][locale.languageCode]; String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; + String get welcomeBackTo => + localizedValues['welcomeBackTo'][locale.languageCode]; String get home => localizedValues['home'][locale.languageCode]; @@ -269,37 +321,46 @@ class TranslationBase { String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; + String get pleaseChoose => + localizedValues['pleaseChoose'][locale.languageCode]; String get choose => localizedValues['choose'][locale.languageCode]; - String get verification => localizedValues['verification'][locale.languageCode]; + String get verification => + localizedValues['verification'][locale.languageCode]; String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; + String get yourAccount => + localizedValues['yourAccount!'][locale.languageCode]; String get verify1 => localizedValues['verify1'][locale.languageCode]; - String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; + String get youWillReceiveA => + localizedValues['youWillReceiveA'][locale.languageCode]; String get loginCode => localizedValues['loginCode'][locale.languageCode]; String get smsBy => localizedValues['smsBy'][locale.languageCode]; - String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String get pleaseEnterTheCode => + localizedValues['pleaseEnterTheCode'][locale.languageCode]; - String get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient'][locale.languageCode]; + String get youDontHaveAnyPatient => + localizedValues['youDontHaveAnyPatient'][locale.languageCode]; - String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String get youDoNotHaveAnyItem => + localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; String get age => localizedValues['age'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; String get occupation => localizedValues['occupation'][locale.languageCode]; String get healthID => localizedValues['healthID'][locale.languageCode]; - String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; - String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; + String get identityNumber => + localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => + localizedValues['maritalStatus'][locale.languageCode]; String get today => localizedValues['today'][locale.languageCode]; @@ -311,15 +372,18 @@ class TranslationBase { String get yesterday => localizedValues['yesterday'][locale.languageCode]; - String get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String get errorNoInsuranceApprovals => + localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; - String get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String get searchInsuranceApprovals => + localizedValues['searchInsuranceApprovals'][locale.languageCode]; String get status => localizedValues['status'][locale.languageCode]; String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String get producerName => localizedValues['producerName'][locale.languageCode]; + String get producerName => + localizedValues['producerName'][locale.languageCode]; String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; @@ -337,11 +401,14 @@ class TranslationBase { String get send => localizedValues['send'][locale.languageCode]; - String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; + String get referralFrequency => + localizedValues['referralFrequency'][locale.languageCode]; - String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; + String get selectReferralFrequency => + localizedValues['selectReferralFrequency'][locale.languageCode]; - String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String get clinicalDetailsAndRemarks => + localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode]; @@ -351,30 +418,39 @@ class TranslationBase { String get outPatient => localizedValues['outPatients'][locale.languageCode]; - String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; - String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; + String get myOutPatient => + localizedValues['myOutPatient'][locale.languageCode]; + String get myOutPatient_2lines => + localizedValues['myOutPatient_2lines'][locale.languageCode]; String get logout => localizedValues['logout'][locale.languageCode]; - String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; + String get pharmaciesList => + localizedValues['pharmaciesList'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode]; - String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; + String get youCanFindItIn => + localizedValues['youCanFindItIn'][locale.languageCode]; - String get radiologyReport => localizedValues['radiologyReport'][locale.languageCode]; + String get radiologyReport => + localizedValues['radiologyReport'][locale.languageCode]; String get orders => localizedValues['orders'][locale.languageCode]; String get list => localizedValues['list'][locale.languageCode]; - String get searchOrders => localizedValues['searchOrders'][locale.languageCode]; + String get searchOrders => + localizedValues['searchOrders'][locale.languageCode]; - String get prescriptionDetails => localizedValues['prescriptionDetails'][locale.languageCode]; + String get prescriptionDetails => + localizedValues['prescriptionDetails'][locale.languageCode]; - String get prescriptionInfo => localizedValues['prescriptionInfo'][locale.languageCode]; + String get prescriptionInfo => + localizedValues['prescriptionInfo'][locale.languageCode]; - String get errorNoOrders => localizedValues['errorNoOrders'][locale.languageCode]; + String get errorNoOrders => + localizedValues['errorNoOrders'][locale.languageCode]; String get livecare => localizedValues['livecare'][locale.languageCode]; @@ -388,17 +464,20 @@ class TranslationBase { String get done => localizedValues['done'][locale.languageCode]; - String get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String get searchMedicineImageCaption => + localizedValues['searchMedicineImageCaption'][locale.languageCode]; String get type => localizedValues['type'][locale.languageCode]; String get resumecall => localizedValues['resumecall'][locale.languageCode]; - String get endcallwithcharge => localizedValues['endcallwithcharge'][locale.languageCode]; + String get endcallwithcharge => + localizedValues['endcallwithcharge'][locale.languageCode]; String get endcall => localizedValues['endcall'][locale.languageCode]; - String get transfertoadmin => localizedValues['transfertoadmin'][locale.languageCode]; + String get transfertoadmin => + localizedValues['transfertoadmin'][locale.languageCode]; String get fromDate => localizedValues['fromDate'][locale.languageCode]; @@ -408,15 +487,19 @@ class TranslationBase { String get toTime => localizedValues['toTime'][locale.languageCode]; - String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String get searchPatientImageCaptionTitle => + localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; - String get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String get searchPatientImageCaptionBody => + localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode]; - String get typeMedicineName => localizedValues['typeMedicineName'][locale.languageCode]; + String get typeMedicineName => + localizedValues['typeMedicineName'][locale.languageCode]; - String get moreThan3Letter => localizedValues['moreThan3Letter'][locale.languageCode]; + String get moreThan3Letter => + localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; @@ -424,7 +507,8 @@ class TranslationBase { String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; - String get patientSick => localizedValues['patient-sick'][locale.languageCode]; + String get patientSick => + localizedValues['patient-sick'][locale.languageCode]; String get leave => localizedValues['leave'][locale.languageCode]; @@ -434,11 +518,14 @@ class TranslationBase { String get clinicName => localizedValues['clinicname'][locale.languageCode]; - String get sickLeaveDate => localizedValues['sick-leave-date'][locale.languageCode]; + String get sickLeaveDate => + localizedValues['sick-leave-date'][locale.languageCode]; - String get sickLeaveDays => localizedValues['sick-leave-days'][locale.languageCode]; + String get sickLeaveDays => + localizedValues['sick-leave-days'][locale.languageCode]; - String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; + String get admissionDetail => + localizedValues['admissionDetail'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode]; @@ -454,56 +541,72 @@ class TranslationBase { String get bed => localizedValues['bed'][locale.languageCode]; - String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String get previousSickLeaveIssue => + localizedValues['prevoius-sickleave-issed'][locale.languageCode]; - String get noSickLeaveApplied => localizedValues['no-sickleve-applied'][locale.languageCode]; + String get noSickLeaveApplied => + localizedValues['no-sickleve-applied'][locale.languageCode]; String get applyNow => localizedValues['applynow'][locale.languageCode]; - String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; + String get addSickLeave => + localizedValues['add-sickleave'][locale.languageCode]; String get add => localizedValues['add'][locale.languageCode]; - String get addSickLeaverequest => localizedValues['addSickLeaveRequest'][locale.languageCode]; - String get extendSickLeaverequest => localizedValues['extendSickLeaveRequest'][locale.languageCode]; + String get addSickLeaverequest => + localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get extendSickLeaverequest => + localizedValues['extendSickLeaveRequest'][locale.languageCode]; String get approved => localizedValues['approved'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode]; String get pending => localizedValues['pending'][locale.languageCode]; - String get leaveStartDate => localizedValues['leave-start-date'][locale.languageCode]; + String get leaveStartDate => + localizedValues['leave-start-date'][locale.languageCode]; - String get daysSickleave => localizedValues['days-sick-leave'][locale.languageCode]; + String get daysSickleave => + localizedValues['days-sick-leave'][locale.languageCode]; String get extend => localizedValues['extend'][locale.languageCode]; - String get extendSickLeave => localizedValues['extend-sickleave'][locale.languageCode]; + String get extendSickLeave => + localizedValues['extend-sickleave'][locale.languageCode]; - String get targetPatient => localizedValues['patient-target'][locale.languageCode]; + String get targetPatient => + localizedValues['patient-target'][locale.languageCode]; - String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; + String get noPrescription => + localizedValues['no-priscription-listed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; String get finish => localizedValues['finish'][locale.languageCode]; String get previous => localizedValues['previous'][locale.languageCode]; - String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get emptyMessage => + localizedValues['empty-message'][locale.languageCode]; - String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; + String get healthRecordInformation => + localizedValues['healthRecordInformation'][locale.languageCode]; - String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; + String get chiefComplaintLength => + localizedValues['chiefComplaintLength'][locale.languageCode]; String get referTo => localizedValues['referTo'][locale.languageCode]; - String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get referredFrom => + localizedValues['referredFrom'][locale.languageCode]; String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; - String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; + String get chooseAppointment => + localizedValues['chooseAppointment'][locale.languageCode]; - String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; + String get appointmentNo => + localizedValues['appointmentNo'][locale.languageCode]; String get refer => localizedValues['refer'][locale.languageCode]; @@ -515,19 +618,24 @@ class TranslationBase { String get dr => localizedValues['dr'][locale.languageCode]; - String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; + String get previewHealth => + localizedValues['previewHealth'][locale.languageCode]; - String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; + String get summaryReport => + localizedValues['summaryReport'][locale.languageCode]; String get accept => localizedValues['accept'][locale.languageCode]; String get reject => localizedValues['reject'][locale.languageCode]; - String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String get noAppointmentsErrorMsg => + localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; - String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; + String get referralPatient => + localizedValues['referralPatient'][locale.languageCode]; - String get noPrescriptionListed => localizedValues['noPrescriptionListed'][locale.languageCode]; + String get noPrescriptionListed => + localizedValues['noPrescriptionListed'][locale.languageCode]; String get addNow => localizedValues['addNow'][locale.languageCode]; @@ -543,16 +651,20 @@ class TranslationBase { String get instruction => localizedValues['instruction'][locale.languageCode]; - String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; + String get rescheduleLeaves => + localizedValues['reschedule-leave'][locale.languageCode]; - String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get applyOrRescheduleLeave => + localizedValues['applyOrRescheduleLeave'][locale.languageCode]; String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; - String get addMedication => localizedValues['addMedication'][locale.languageCode]; + String get addMedication => + localizedValues['addMedication'][locale.languageCode]; String get route => localizedValues['route'][locale.languageCode]; - String get noReScheduleLeave => localizedValues['no-reschedule-leave'][locale.languageCode]; + String get noReScheduleLeave => + localizedValues['no-reschedule-leave'][locale.languageCode]; String get weight => localizedValues['weight'][locale.languageCode]; @@ -562,7 +674,8 @@ class TranslationBase { String get cm => localizedValues['cm'][locale.languageCode]; - String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode]; + String get idealBodyWeight => + localizedValues['idealBodyWeight'][locale.languageCode]; String get waistSize => localizedValues['waistSize'][locale.languageCode]; @@ -570,16 +683,22 @@ class TranslationBase { String get headCircum => localizedValues['headCircum'][locale.languageCode]; - String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; + String get leanBodyWeight => + localizedValues['leanBodyWeight'][locale.languageCode]; - String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; + String get bodyMassIndex => + localizedValues['bodyMassIndex'][locale.languageCode]; - String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get yourBodyMassIndex => + localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => + localizedValues['bmiUnderWeight'][locale.languageCode]; String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiOverWeight => + localizedValues['bmiOverWeight'][locale.languageCode]; String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => localizedValues['bmiObeseExtreme'][locale.languageCode]; + String get bmiObeseExtreme => + localizedValues['bmiObeseExtreme'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode]; @@ -589,35 +708,45 @@ class TranslationBase { String get respBeats => localizedValues['respBeats'][locale.languageCode]; - String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode]; + String get patternOfRespiration => + localizedValues['patternOfRespiration'][locale.languageCode]; - String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String get bloodPressureDiastoleAndSystole => + localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; - String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode]; + String get cuffLocation => + localizedValues['cuffLocation'][locale.languageCode]; String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; - String get patientPosition => localizedValues['patientPosition'][locale.languageCode]; + String get patientPosition => + localizedValues['patientPosition'][locale.languageCode]; String get fio2 => localizedValues['fio2'][locale.languageCode]; String get sao2 => localizedValues['sao2'][locale.languageCode]; - String get painManagement => localizedValues['painManagement'][locale.languageCode]; + String get painManagement => + localizedValues['painManagement'][locale.languageCode]; String get holiday => localizedValues['holiday'][locale.languageCode]; String get to => localizedValues['to'][locale.languageCode]; - String get coveringDoctor => localizedValues['coveringDoctor'][locale.languageCode]; + String get coveringDoctor => + localizedValues['coveringDoctor'][locale.languageCode]; - String get requestLeave => localizedValues['requestLeave'][locale.languageCode]; + String get requestLeave => + localizedValues['requestLeave'][locale.languageCode]; - String get pleaseEnterDate => localizedValues['pleaseEnterDate'][locale.languageCode]; + String get pleaseEnterDate => + localizedValues['pleaseEnterDate'][locale.languageCode]; - String get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String get pleaseEnterNoOfDays => + localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; - String get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String get pleaseEnterRemarks => + localizedValues['pleaseEnterRemarks'][locale.languageCode]; String get update => localizedValues['update'][locale.languageCode]; @@ -625,68 +754,92 @@ class TranslationBase { String get request => localizedValues['request'][locale.languageCode]; - String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; + String get admissionRequest => + localizedValues['admissionRequest'][locale.languageCode]; - String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; + String get patientDetails => + localizedValues['patientDetails'][locale.languageCode]; - String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String get specialityAndDoctorDetail => + localizedValues['specialityAndDoctorDetail'][locale.languageCode]; - String get referringDate => localizedValues['referringDate'][locale.languageCode]; + String get referringDate => + localizedValues['referringDate'][locale.languageCode]; - String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; + String get referringDoctor => + localizedValues['referringDoctor'][locale.languageCode]; - String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; + String get otherInformation => + localizedValues['otherInformation'][locale.languageCode]; - String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; + String get expectedDays => + localizedValues['expectedDays'][locale.languageCode]; - String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; + String get expectedAdmissionDate => + localizedValues['expectedAdmissionDate'][locale.languageCode]; - String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; - String get isSickLeaveRequired => localizedValues['isSickLeaveRequired'][locale.languageCode]; + String get emergencyAdmission => + localizedValues['emergencyAdmission'][locale.languageCode]; + String get isSickLeaveRequired => + localizedValues['isSickLeaveRequired'][locale.languageCode]; - String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; + String get patientPregnant => + localizedValues['patientPregnant'][locale.languageCode]; - String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; + String get treatmentLine => + localizedValues['treatmentLine'][locale.languageCode]; String get ward => localizedValues['ward'][locale.languageCode]; - String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String get preAnesthesiaReferred => + localizedValues['preAnesthesiaReferred'][locale.languageCode]; - String get admissionType => localizedValues['admissionType'][locale.languageCode]; + String get admissionType => + localizedValues['admissionType'][locale.languageCode]; String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; String get allergies => localizedValues['allergies'][locale.languageCode]; - String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; + String get preOperativeOrders => + localizedValues['preOperativeOrders'][locale.languageCode]; - String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; + String get elementForImprovement => + localizedValues['elementForImprovement'][locale.languageCode]; - String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; + String get dischargeDate => + localizedValues['dischargeDate'][locale.languageCode]; String get dietType => localizedValues['dietType'][locale.languageCode]; - String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; + String get dietTypeRemarks => + localizedValues['dietTypeRemarks'][locale.languageCode]; String get save => localizedValues['save'][locale.languageCode]; - String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get postPlansEstimatedCost => + localizedValues['postPlansEstimatedCost'][locale.languageCode]; String get postPlans => localizedValues['postPlans'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode]; - String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; + String get emergencyCase => + localizedValues['emergencyCase'][locale.languageCode]; - String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; + String get durationOfIllness => + localizedValues['durationOfIllness'][locale.languageCode]; - String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String get chiefComplaintsAndSymptoms => + localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; String get patientFeelsPainInHisBackAndCough => localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; - String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; + String get additionalTextComplaints => + localizedValues['additionalTextComplaints'][locale.languageCode]; - String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; + String get otherConditions => + localizedValues['otherConditions'][locale.languageCode]; String get other => localizedValues['other'][locale.languageCode]; @@ -696,9 +849,11 @@ class TranslationBase { String get where => localizedValues['where'][locale.languageCode]; - String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String get specifyPossibleLineManagement => + localizedValues['specifyPossibleLineManagement'][locale.languageCode]; - String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; + String get significantSigns => + localizedValues['significantSigns'][locale.languageCode]; String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; @@ -712,41 +867,55 @@ class TranslationBase { String get procedures => localizedValues['procedures'][locale.languageCode]; - String get chiefComplaints => localizedValues['chiefComplaints'][locale.languageCode]; + String get chiefComplaints => + localizedValues['chiefComplaints'][locale.languageCode]; String get histories => localizedValues['histories'][locale.languageCode]; - String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; + String get allergiesSoap => + localizedValues['allergiesSoap'][locale.languageCode]; - String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; + String get addChiefComplaints => + localizedValues['addChiefComplaints'][locale.languageCode]; - String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; + String get historyOfPresentIllness => + localizedValues['historyOfPresentIllness'][locale.languageCode]; String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; String get addHistory => localizedValues['addHistory'][locale.languageCode]; - String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; + String get searchHistory => + localizedValues['searchHistory'][locale.languageCode]; - String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; + String get addSelectedHistories => + localizedValues['addSelectedHistories'][locale.languageCode]; - String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; + String get addAllergies => + localizedValues['addAllergies'][locale.languageCode]; String get itemExist => localizedValues['itemExist'][locale.languageCode]; - String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; + String get selectAllergy => + localizedValues['selectAllergy'][locale.languageCode]; - String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; + String get selectSeverity => + localizedValues['selectSeverity'][locale.languageCode]; - String get leaveCreated => localizedValues['leaveCreated'][locale.languageCode]; + String get leaveCreated => + localizedValues['leaveCreated'][locale.languageCode]; - String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String get vitalSignEmptyMsg => + localizedValues['vitalSignEmptyMsg'][locale.languageCode]; - String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; + String get referralEmptyMsg => + localizedValues['referralEmptyMsg'][locale.languageCode]; - String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; + String get referralSuccessMsg => + localizedValues['referralSuccessMsg'][locale.languageCode]; - String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get diagnoseType => + localizedValues['diagnoseType'][locale.languageCode]; String get condition => localizedValues['condition'][locale.languageCode]; @@ -760,52 +929,72 @@ class TranslationBase { String get covered => localizedValues['covered'][locale.languageCode]; - String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; + String get approvalRequired => + localizedValues['approvalRequired'][locale.languageCode]; - String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get uncoveredByDoctor => + localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get chiefComplaintEmptyMsg => + localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String get moreVerification => localizedValues['more-verify'][locale.languageCode]; + String get moreVerification => + localizedValues['more-verify'][locale.languageCode]; - String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; + String get welcomeBack => + localizedValues['welcome-back'][locale.languageCode]; - String get accountInfo => localizedValues['account-info'][locale.languageCode]; + String get accountInfo => + localizedValues['account-info'][locale.languageCode]; - String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; + String get useAnotherAccount => + localizedValues['another-acc'][locale.languageCode]; - String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; + String get verifyLoginWith => + localizedValues['verify-login-with'][locale.languageCode]; String get register => localizedValues['register-user'][locale.languageCode]; - String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFingerprint => + localizedValues['verify-with-fingerprint'][locale.languageCode]; - String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifyFaceID => + localizedValues['verify-with-faceid'][locale.languageCode]; - String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifySMS => + localizedValues['verify-with-sms'][locale.languageCode]; String get verifyWith => localizedValues['verify-with'][locale.languageCode]; - String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get verifyWhatsApp => + localizedValues['verify-with-whatsapp'][locale.languageCode]; String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; + String get lastLoginWith => + localizedValues['last-login-with'][locale.languageCode]; - String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; + String get verifyFingerprint2 => + localizedValues['verify-fingerprint'][locale.languageCode]; - String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; + String get verificationMessage => + localizedValues['verification_message'][locale.languageCode]; - String get validationMessage => localizedValues['validation_message'][locale.languageCode]; + String get validationMessage => + localizedValues['validation_message'][locale.languageCode]; - String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get addAssessment => + localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; - String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; + String get physicalSystemExamination => + localizedValues['physicalSystemExamination'][locale.languageCode]; - String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; + String get searchExamination => + localizedValues['searchExamination'][locale.languageCode]; - String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get addExamination => + localizedValues['addExamination'][locale.languageCode]; String get doc => localizedValues['doc'][locale.languageCode]; @@ -816,11 +1005,14 @@ class TranslationBase { String get abnormal => localizedValues['abnormal'][locale.languageCode]; - String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get patientNoDetailErrMsg => + localizedValues['patientNoDetailErrMsg'][locale.languageCode]; - String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get systolicLng => + localizedValues['systolic-lng'][locale.languageCode]; - String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get diastolicLng => + localizedValues['diastolic-lng'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; @@ -828,62 +1020,80 @@ class TranslationBase { String get bpm => localizedValues['bpm'][locale.languageCode]; - String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; + String get respirationSigns => + localizedValues['respiration-signs'][locale.languageCode]; String get sysDias => localizedValues['sys-dias'][locale.languageCode]; String get body => localizedValues['body'][locale.languageCode]; - String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; + String get respirationRate => + localizedValues['respirationRate'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; - String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; + String get medicalReport => + localizedValues['medicalReport'][locale.languageCode]; String get visitDate => localizedValues['visitDate'][locale.languageCode]; String get test => localizedValues['test'][locale.languageCode]; - String get addMoreProcedure => localizedValues['addMoreProcedure'][locale.languageCode]; + String get addMoreProcedure => + localizedValues['addMoreProcedure'][locale.languageCode]; String get regular => localizedValues['regular'][locale.languageCode]; - String get searchProcedures => localizedValues['searchProcedures'][locale.languageCode]; + String get searchProcedures => + localizedValues['searchProcedures'][locale.languageCode]; - String get procedureCategorise => localizedValues['procedureCategorise'][locale.languageCode]; + String get procedureCategorise => + localizedValues['procedureCategorise'][locale.languageCode]; - String get selectProcedures => localizedValues['selectProcedures'][locale.languageCode]; + String get selectProcedures => + localizedValues['selectProcedures'][locale.languageCode]; - String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; - String get addProcedures => localizedValues['addProcedures'][locale.languageCode]; + String get addSelectedProcedures => + localizedValues['addSelectedProcedures'][locale.languageCode]; + String get addProcedures => + localizedValues['addProcedures'][locale.languageCode]; - String get updateProcedure => localizedValues['updateProcedure'][locale.languageCode]; + String get updateProcedure => + localizedValues['updateProcedure'][locale.languageCode]; - String get orderProcedure => localizedValues['orderProcedure'][locale.languageCode]; + String get orderProcedure => + localizedValues['orderProcedure'][locale.languageCode]; String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; String get dType => localizedValues['dType'][locale.languageCode]; - String get addAssessmentDetails => localizedValues['addAssessmentDetails'][locale.languageCode]; + String get addAssessmentDetails => + localizedValues['addAssessmentDetails'][locale.languageCode]; - String get progressNoteSOAP => localizedValues['progressNoteSOAP'][locale.languageCode]; + String get progressNoteSOAP => + localizedValues['progressNoteSOAP'][locale.languageCode]; - String get addProgressNote => localizedValues['addProgressNote'][locale.languageCode]; + String get addProgressNote => + localizedValues['addProgressNote'][locale.languageCode]; String get createdBy => localizedValues['createdBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode]; - String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; + String get currentMedications => + localizedValues['currentMedications'][locale.languageCode]; String get noItem => localizedValues['noItem'][locale.languageCode]; - String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String get postUcafSuccessMsg => + localizedValues['postUcafSuccessMsg'][locale.languageCode]; - String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String get vitalSignDetailEmpty => + localizedValues['vitalSignDetailEmpty'][locale.languageCode]; - String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String get onlyOfftimeHoliday => + localizedValues['onlyOfftimeHoliday'][locale.languageCode]; String get active => localizedValues['active'][locale.languageCode]; @@ -891,18 +1101,24 @@ class TranslationBase { String get loading => localizedValues['loading'][locale.languageCode]; - String get assessmentErrorMsg => localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get assessmentErrorMsg => + localizedValues['assessmentErrorMsg'][locale.languageCode]; - String get examinationErrorMsg => localizedValues['examinationErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => + localizedValues['examinationErrorMsg'][locale.languageCode]; - String get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg'][locale.languageCode]; + String get progressNoteErrorMsg => + localizedValues['progressNoteErrorMsg'][locale.languageCode]; - String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get chiefComplaintErrorMsg => + localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; String get ICDName => localizedValues['ICDName'][locale.languageCode]; - String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; + String get referralStatus => + localizedValues['referralStatus'][locale.languageCode]; - String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + String get referralRemark => + localizedValues['referralRemark'][locale.languageCode]; String get offTime => localizedValues['offTime'][locale.languageCode]; String get icd => localizedValues['icd'][locale.languageCode]; @@ -911,43 +1127,73 @@ class TranslationBase { String get min => localizedValues['min'][locale.languageCode]; String get months => localizedValues['months'][locale.languageCode]; String get years => localizedValues['years'][locale.languageCode]; - String get referralStatusHold => localizedValues['referralStatusHold'][locale.languageCode]; - String get referralStatusActive => localizedValues['referralStatusActive'][locale.languageCode]; - String get referralStatusCancelled => localizedValues['referralStatusCancelled'][locale.languageCode]; - String get referralStatusCompleted => localizedValues['referralStatusCompleted'][locale.languageCode]; - String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; - String get clinicSearch => localizedValues['clinicSearch'][locale.languageCode]; - String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; - - String get patientName => localizedValues['patient-name'][locale.languageCode]; - - String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => localizedValues['complications'][locale.languageCode]; + String get referralStatusHold => + localizedValues['referralStatusHold'][locale.languageCode]; + String get referralStatusActive => + localizedValues['referralStatusActive'][locale.languageCode]; + String get referralStatusCancelled => + localizedValues['referralStatusCancelled'][locale.languageCode]; + String get referralStatusCompleted => + localizedValues['referralStatusCompleted'][locale.languageCode]; + String get referralStatusNotSeen => + localizedValues['referralStatusNotSeen'][locale.languageCode]; + String get clinicSearch => + localizedValues['clinicSearch'][locale.languageCode]; + String get doctorSearch => + localizedValues['doctorSearch'][locale.languageCode]; + String get referralResponse => + localizedValues['referralResponse'][locale.languageCode]; + String get estimatedCost => + localizedValues['estimatedCost'][locale.languageCode]; + String get diagnosisDetail => + localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => + localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => + localizedValues['referralSuccessMsgReject'][locale.languageCode]; + + String get patientName => + localizedValues['patient-name'][locale.languageCode]; + + String get appointmentNumber => + localizedValues['appointmentNumber'][locale.languageCode]; + String get sickLeaveComments => + localizedValues['sickLeaveComments'][locale.languageCode]; + String get pastMedicalHistory => + localizedValues['pastMedicalHistory'][locale.languageCode]; + String get pastSurgicalHistory => + localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get complications => + localizedValues['complications'][locale.languageCode]; String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get roomCategory => + localizedValues['roomCategory'][locale.languageCode]; + String get otherDepartmentsInterventions => + localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get otherProcedure => + localizedValues['otherProcedure'][locale.languageCode]; + String get admissionRequestSuccessMsg => + localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; - String get sickleaveonhold => localizedValues['sickleaveonhold'][locale.languageCode]; + String get doctorResponse => + localizedValues['doctorResponse'][locale.languageCode]; + String get sickleaveonhold => + localizedValues['sickleaveonhold'][locale.languageCode]; String get noClinic => localizedValues['no-clinic'][locale.languageCode]; - String get otherStatistic => localizedValues['otherStatistic'][locale.languageCode]; - - String get patientsreferral => localizedValues['ptientsreferral'][locale.languageCode]; - String get myPatientsReferral => localizedValues['myPatientsReferral'][locale.languageCode]; - String get arrivalpatient => localizedValues['arrivalpatient'][locale.languageCode]; - String get searchmedicinepatient => localizedValues['searchmedicinepatient'][locale.languageCode]; - String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; + String get otherStatistic => + localizedValues['otherStatistic'][locale.languageCode]; + + String get patientsreferral => + localizedValues['ptientsreferral'][locale.languageCode]; + String get myPatientsReferral => + localizedValues['myPatientsReferral'][locale.languageCode]; + String get arrivalpatient => + localizedValues['arrivalpatient'][locale.languageCode]; + String get searchmedicinepatient => + localizedValues['searchmedicinepatient'][locale.languageCode]; + String get appointmentDate => + localizedValues['appointmentDate'][locale.languageCode]; String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; @@ -956,9 +1202,12 @@ class TranslationBase { String get billNo => localizedValues['BillNo'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; @@ -967,30 +1216,40 @@ class TranslationBase { String get leaves => localizedValues['leaves'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; - String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get prescriptions => + localizedValues['prescriptions'][locale.languageCode]; String get notes => localizedValues['notes'][locale.languageCode]; String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - String get searchWithOther => localizedValues['searchWithOther'][locale.languageCode]; - String get hideOtherCriteria => localizedValues['hideOtherCriteria'][locale.languageCode]; - String get applyForReschedule => localizedValues['applyForReschedule'][locale.languageCode]; + String get searchWithOther => + localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => + localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => + localizedValues['applyForReschedule'][locale.languageCode]; String get startDate => localizedValues['startDate'][locale.languageCode]; String get endDate => localizedValues['endDate'][locale.languageCode]; - String get addReschedule => localizedValues['add-reschedule'][locale.languageCode]; - String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; + String get addReschedule => + localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => + localizedValues['update-reschedule'][locale.languageCode]; String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; String get accepted => localizedValues['accepted'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; + String get typeHereToReply => + localizedValues['typeHereToReply'][locale.languageCode]; String get searchHere => localizedValues['searchHere'][locale.languageCode]; String get remove => localizedValues['remove'][locale.languageCode]; String get inProgress => localizedValues['inProgress'][locale.languageCode]; @@ -998,64 +1257,93 @@ class TranslationBase { String get locked => localizedValues['Locked'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => localizedValues['fieldRequired'][locale.languageCode]; + String get fieldRequired => + localizedValues['fieldRequired'][locale.languageCode]; String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; - String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; + String get changeOfSchedule => + localizedValues['changeOfSchedule'][locale.languageCode]; String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; - String get enterCredentials => localizedValues['enter_credentials'][locale.languageCode]; - String get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational'][locale.languageCode]; + String get enterCredentials => + localizedValues['enter_credentials'][locale.languageCode]; + String get patpatientIDMobilenationalientID => + localizedValues['patientIDMobilenational'][locale.languageCode]; String get updateNow => localizedValues['updateNow'][locale.languageCode]; - String get updateTheApp => localizedValues['updateTheApp'][locale.languageCode]; - String get admissionDate => localizedValues['admission-date'][locale.languageCode]; + String get updateTheApp => + localizedValues['updateTheApp'][locale.languageCode]; + String get admissionDate => + localizedValues['admission-date'][locale.languageCode]; String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; - String get replayBefore => localizedValues['replayBefore'][locale.languageCode]; + String get replayBefore => + localizedValues['replayBefore'][locale.languageCode]; String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; + String get acknowledged => + localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; - String get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get pleaseEnterProcedure => + localizedValues["pleaseEnterProcedure"][locale.languageCode]; String get fillTheMandatoryProcedureDetails => localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; - String get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"][locale.languageCode]; - String get searchProcedureHere => localizedValues["searchProcedureHere"][locale.languageCode]; - String get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get atLeastThreeCharacters => + localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => + localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => + localizedValues["noInsuranceApprovalFound"][locale.languageCode]; String get procedure => localizedValues["procedure"][locale.languageCode]; String get stopDate => localizedValues["stopDate"][locale.languageCode]; String get processed => localizedValues["processed"][locale.languageCode]; String get direction => localizedValues["direction"][locale.languageCode]; String get refill => localizedValues["refill"][locale.languageCode]; - String get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"][locale.languageCode]; - String get newPrescriptionOrder => localizedValues["newPrescriptionOrder"][locale.languageCode]; - String get pleaseFillAllFields => localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get medicationHasBeenAdded => + localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => + localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => + localizedValues["pleaseFillAllFields"][locale.languageCode]; String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"][locale.languageCode]; - String get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] + [locale.languageCode]; + String get only5DigitsAllowedForStrength => + localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; String get unit => localizedValues["unit"][locale.languageCode]; String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; - String get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"][locale.languageCode]; - String get applyForNewLabOrder => localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get applyForRadiologyOrder => + localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => + localizedValues["applyForNewLabOrder"][locale.languageCode]; String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; - String get addRadiologyOrder => localizedValues["addRadiologyOrder"][locale.languageCode]; - String get newRadiologyOrder => localizedValues["newRadiologyOrder"][locale.languageCode]; + String get addRadiologyOrder => + localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => + localizedValues["newRadiologyOrder"][locale.languageCode]; String get orderDate => localizedValues["orderDate"][locale.languageCode]; String get examType => localizedValues["examType"][locale.languageCode]; String get health => localizedValues["health"][locale.languageCode]; String get summary => localizedValues["summary"][locale.languageCode]; - String get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; - String get noPrescriptionsFound => localizedValues["noPrescriptionsFound"][locale.languageCode]; - String get noMedicalFileFound => localizedValues["noMedicalFileFound"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => + localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => + localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => + localizedValues["noMedicalFileFound"][locale.languageCode]; String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; String get discharged => localizedValues["discharged"][locale.languageCode]; - String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; - String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; + String get addNewOrderSheet => + localizedValues["addNewOrderSheet"][locale.languageCode]; + String get addNewProgressNote => + localizedValues["addNewProgressNote"][locale.languageCode]; String get notePending => localizedValues["notePending"][locale.languageCode]; - String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; - String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; + String get noteCanceled => + localizedValues["noteCanceled"][locale.languageCode]; + String get noteVerified => + localizedValues["noteVerified"][locale.languageCode]; String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; @@ -1069,52 +1357,78 @@ class TranslationBase { String get report => localizedValues["report"][locale.languageCode]; String get discharge => localizedValues["discharge"][locale.languageCode]; String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get notRepliedYet => + localizedValues["notRepliedYet"][locale.languageCode]; String get clearText => localizedValues["clearText"][locale.languageCode]; - String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; - String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; + String get medicalReportAdd => + localizedValues['medicalReportAdd'][locale.languageCode]; + String get medicalReportVerify => + localizedValues['medicalReportVerify'][locale.languageCode]; String get comments => localizedValues['comments'][locale.languageCode]; - String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; + String get initiateCall => + localizedValues['initiateCall'][locale.languageCode]; String get endCall => localizedValues['endCall'][locale.languageCode]; String get transferTo => localizedValues['transferTo'][locale.languageCode]; String get admin => localizedValues['admin'][locale.languageCode]; - String get instructions => localizedValues['instructions'][locale.languageCode]; + String get instructions => + localizedValues['instructions'][locale.languageCode]; String get sendLC => localizedValues['sendLC'][locale.languageCode]; String get endLC => localizedValues['endLC'][locale.languageCode]; - String get consultation => localizedValues['consultation'][locale.languageCode]; + String get consultation => + localizedValues['consultation'][locale.languageCode]; String get resume => localizedValues['resume'][locale.languageCode]; String get theCall => localizedValues['theCall'][locale.languageCode]; - String get createNewMedicalReport => localizedValues['createNewMedicalReport'][locale.languageCode]; - String get historyPhysicalFinding => localizedValues['historyPhysicalFinding'][locale.languageCode]; - String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData'][locale.languageCode]; - String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode]; + String get createNewMedicalReport => + localizedValues['createNewMedicalReport'][locale.languageCode]; + String get historyPhysicalFinding => + localizedValues['historyPhysicalFinding'][locale.languageCode]; + String get laboratoryPhysicalData => + localizedValues['laboratoryPhysicalData'][locale.languageCode]; + 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 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]; - String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; - String get addPrescription => localizedValues['addPrescription'][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]; - String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; - String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; + String get summeryReply => + localizedValues['summeryReply'][locale.languageCode]; + String get severityValidationError => + localizedValues['severityValidationError'][locale.languageCode]; + String get textCopiedSuccessfully => + localizedValues['textCopiedSuccessfully'][locale.languageCode]; String get roomNo => localizedValues['roomNo'][locale.languageCode]; String get seeMore => localizedValues['seeMore'][locale.languageCode]; - String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; - String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; - String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; - String get underProcess => localizedValues['underProcess'][locale.languageCode]; - String get textResponse => localizedValues['textResponse'][locale.languageCode]; + String get replayCallStatus => + localizedValues['replayCallStatus'][locale.languageCode]; + String get patientArrived => + localizedValues['patientArrived'][locale.languageCode]; + String get calledAndNoResponse => + localizedValues['calledAndNoResponse'][locale.languageCode]; + String get underProcess => + localizedValues['underProcess'][locale.languageCode]; + String get textResponse => + localizedValues['textResponse'][locale.languageCode]; String get special => localizedValues['special'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode]; String get allClinic => localizedValues['allClinic'][locale.languageCode]; String get notReplied => localizedValues['notReplied'][locale.languageCode]; - String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; - String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; - + String get registerNewPatient => + localizedValues['registerNewPatient'][locale.languageCode]; + String get registeraPatient => + localizedValues['registeraPatient'][locale.languageCode]; + String get diabetic => localizedValues['diabetic'][locale.languageCode]; + String get chart => localizedValues['chart'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From cce0a8377cf39e6b2b83e05b5456463707a0582f Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 15:59:34 +0200 Subject: [PATCH 146/199] small fix --- .../patients/profile/discharge_summary/discharge_summary.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 31935fcf..0878994a 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -98,7 +98,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 0, - "Pending", + TranslationBase.of(context).pending, ), tabWidget( screenSize, From 92ceb9921215773d126bd4288fa62b1f41b3d1fb Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 16:55:53 +0200 Subject: [PATCH 147/199] translation for in patient --- lib/config/localized_values.dart | 11 +++++++++++ .../RegisterConfirmationPatientPage.dart | 6 +++--- .../register_patient/RegisterPatientPage.dart | 6 +++--- .../RegisterSearchPatientPage.dart | 16 ++++++++-------- .../register_patient/VerifyMethodPage.dart | 2 +- lib/util/translations_delegate_base.dart | 11 +++++++++++ 6 files changed, 37 insertions(+), 15 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6a536fae..0e24363d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -738,4 +738,15 @@ const Map> localizedValues = { "postOperationDiagnosis": {"en": "Post Operation Diagnosis", "ar": "تشخيص ما بعد العملية"}, "surgeon": {"en": "surgeon", "ar": "دكتور جراح"}, "assistant": {"en": "assistant", "ar": "مساعد"}, + "askForIdentification": {"en": "Please enter a mobile number or Identification number", "ar": "الرجاء إدخال رقم الهاتف المحمول أو رقم التعريف"}, + "iDNumber": {"en": "ID Number", "ar": "رقم معرف"}, + "calender": {"en": "Calender", "ar": "التقويم"}, + "gregorian": {"en": "Gregorian", "ar": "ميلادي"}, + "hijri": {"en": "Hijri", "ar": "هجري"}, + "birthdate": {"en": "Birthdate", "ar": "تاريخ الولادة"}, + "activation": {"en": "Activation", "ar": "تفعيل"}, + "confirmation": {"en": "Confirmation", "ar": "تفعيل"}, + "firstNameInAr": {"en": "First Name In Arabic", "ar": "الاسم الاول بالعربية"}, + "middleNameInAr": {"en": "Middle Name In Arabic", "ar": "الاسم الأوسط بالعربية"}, + "lastNameInAr": {"en": "Last Name In Arabic", "ar": "الاسم الأخير بالعربية"}, }; diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index c03c6f96..be79162b 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -134,7 +134,7 @@ class _RegisterConfirmationPatientPageState CustomEditableText( controller: firstNameAr, isSubmitted: isSubmitted, - hint: "First Name Arabic"), + hint: TranslationBase.of(context).firstNameInAr), SizedBox( height: 4, ), @@ -142,14 +142,14 @@ class _RegisterConfirmationPatientPageState controller: middleNameAr, isEditable: middleNameN.text.isEmpty, isSubmitted: isSubmitted, - hint: "Middle Name Arabic"), + hint: TranslationBase.of(context).middleNameInAr), SizedBox( height: 4, ), CustomEditableText( controller: lastNameAr, isSubmitted: isSubmitted, - hint: "Last Name Arabic"), + hint: TranslationBase.of(context).lastNameInAr), SizedBox( height: 20, ), diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 231ff3d1..28e44c6a 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -80,9 +80,9 @@ class _RegisterPatientPageState extends State currentStepIndex: _currentIndex + 1, screenSize: screenSize, stepsTitles: [ - "Search", - "Activation", - "Confirmation", + TranslationBase.of(context).search, + TranslationBase.of(context).activation, + TranslationBase.of(context).confirmation, ], ), SizedBox( diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 57d436f5..0d2e398c 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -131,7 +131,7 @@ class _RegisterSearchPatientPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Please enter mobile number or Identification number", + TranslationBase.of(context).askForIdentification, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.w800, @@ -164,7 +164,7 @@ class _RegisterSearchPatientPageState extends State { width: MediaQuery.of(context).size.width * 0.28, child: AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: "Code", + hintText: TranslationBase.of(context).codeNo, inputType: TextInputType.phone, controller: _phoneCode, validationError: phoneError, @@ -185,7 +185,7 @@ class _RegisterSearchPatientPageState extends State { // width: MediaQuery.of(context).size.width*0.7, child: AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: "Phone Number", + hintText: TranslationBase.of(context).phoneNumber, inputType: TextInputType.phone, controller: _phoneController, validationError: @@ -202,7 +202,7 @@ class _RegisterSearchPatientPageState extends State { ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: "ID Number", + hintText: TranslationBase.of(context).iDNumber, inputType: TextInputType.phone, controller: _idController, validationError: _idController.text.isEmpty && isSubmitted @@ -213,7 +213,7 @@ class _RegisterSearchPatientPageState extends State { height: 12, ), AppText( - "Calender", + TranslationBase.of(context).calender, fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w800, ), @@ -224,7 +224,7 @@ class _RegisterSearchPatientPageState extends State { children: [ Expanded( child: RadioListTile( - title: AppText("Gregorian"), + title: AppText(TranslationBase.of(context).gregorian), value: CalenderType.Gregorian, groupValue: calenderType, onChanged: (CalenderType value) { @@ -236,7 +236,7 @@ class _RegisterSearchPatientPageState extends State { ), Expanded( child: RadioListTile( - title: AppText("Hijri"), + title: AppText(TranslationBase.of(context).hijri), value: CalenderType.Hijri, groupValue: calenderType, onChanged: (CalenderType value) { @@ -253,7 +253,7 @@ class _RegisterSearchPatientPageState extends State { ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText: "Birthdate", + hintText:TranslationBase.of(context).birthdate, dropDownText: getBirthdate(), enabled: false, isTextFieldHasSuffix: true, diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 8634e76e..1bbb5edd 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -462,7 +462,7 @@ class _ActivationPageState extends State { if (widget.model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.model.error); //TODO Elham* remove this - //widget.changePageViewIndex(2); + widget.changePageViewIndex(2); GifLoaderDialogUtils.hideDialog(context); } else { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index d6410f5e..762d5242 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -114,10 +114,13 @@ class TranslationBase { String get referredOn => localizedValues['referredOn'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; + String get firstNameInAr => localizedValues['firstNameInAr'][locale.languageCode]; String get middleName => localizedValues['middleName'][locale.languageCode]; + String get middleNameInAr => localizedValues['middleNameInAr'][locale.languageCode]; String get lastName => localizedValues['lastName'][locale.languageCode]; + String get lastNameInAr => localizedValues['lastNameInAr'][locale.languageCode]; String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; @@ -1133,6 +1136,14 @@ class TranslationBase { String get postOperationDiagnosis => localizedValues['postOperationDiagnosis'][locale.languageCode]; String get surgeon => localizedValues['surgeon'][locale.languageCode]; String get assistant => localizedValues['assistant'][locale.languageCode]; + String get askForIdentification => localizedValues['askForIdentification'][locale.languageCode]; + String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; + String get calender => localizedValues['calender'][locale.languageCode]; + String get gregorian => localizedValues['gregorian'][locale.languageCode]; + String get hijri => localizedValues['hijri'][locale.languageCode]; + String get birthdate => localizedValues['birthdate'][locale.languageCode]; + String get activation => localizedValues['activation'][locale.languageCode]; + String get confirmation => localizedValues['confirmation'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From e31fadc9befa36da389bbb75178d933fabe4830b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 17:08:01 +0200 Subject: [PATCH 148/199] small fix --- lib/util/translations_delegate_base.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 762d5242..407bb198 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1144,6 +1144,8 @@ class TranslationBase { String get birthdate => localizedValues['birthdate'][locale.languageCode]; String get activation => localizedValues['activation'][locale.languageCode]; String get confirmation => localizedValues['confirmation'][locale.languageCode]; + String get diabetic => localizedValues['diabetic'][locale.languageCode]; + String get chart => localizedValues['chart'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From f16f54fee22ebebe180d7432e37ce3fb674c0390 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Nov 2021 17:08:37 +0200 Subject: [PATCH 149/199] translation and ui fixes --- lib/config/localized_values.dart | 606 ++++++++-- .../discharge_Summary_widget.dart | 18 +- .../discharge_summary/discharge_summary.dart | 2 +- .../register_patient/VerifyMethodPage.dart | 20 +- lib/util/translations_delegate_base.dart | 1005 +++++++++++------ 5 files changed, 1180 insertions(+), 471 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index bec329b1..d30b01ab 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,7 +1,10 @@ const Map> localizedValues = { "dashboardScreenToolbarTitle": {"ar": "الرئيسة", "en": "Home"}, "settings": {"en": "Settings", "ar": "الاعدادات"}, - "areYouSureYouWantTo": {"en": "Are you sure you want to", "ar": "هل انت متاكد من انك تريد أن"}, + "areYouSureYouWantTo": { + "en": "Are you sure you want to", + "ar": "هل انت متاكد من انك تريد أن" + }, "language": {"en": "App Language", "ar": "لغة التطبيق"}, "lanEnglish": {"en": "English", "ar": "English"}, "lanArabic": {"en": "العربية", "ar": "العربية"}, @@ -12,18 +15,27 @@ const Map> localizedValues = { "mobileNo": {"en": "Mobile No", "ar": "رقم الجوال"}, "messagesScreenToolbarTitle": {"en": "Messages", "ar": "الرسائل"}, "mySchedule": {"en": "Schedule", "ar": "جدولي"}, - "errorNoSchedule": {"en": "You don't have any Schedule", "ar": "ليس لديك أي جدول"}, + "errorNoSchedule": { + "en": "You don't have any Schedule", + "ar": "ليس لديك أي جدول" + }, "verify": {"en": "VERIFY", "ar": "تحقق"}, "referralDoctor": {"en": "Referral Doctor", "ar": "الطبيب المُحول إليه"}, "referringClinic": {"en": "Referring Clinic", "ar": "العيادة المُحول إليها"}, "frequency": {"en": "Frequency", "ar": "تكرر"}, "priority": {"en": "Priority", "ar": "الأولوية"}, "maxResponseTime": {"en": "Max Response Time", "ar": "الوقت الأقصى للرد"}, - "clinicDetailsandRemarks": {"en": "Clinic Details and Remarks", "ar": "ملاحضات وتفاصيل العيادة"}, + "clinicDetailsandRemarks": { + "en": "Clinic Details and Remarks", + "ar": "ملاحضات وتفاصيل العيادة" + }, "answerSuggestions": {"en": "Answer/Suggestions", "ar": "الرد / الاقتراحات"}, "outPatients": {"en": "Out Patient", "ar": "العيادات الخارجية"}, "myOutPatient": {"en": "My OutPatients", "ar": "مرضى العيادات الخارجية"}, - "myOutPatient_2lines": {"en": "My\nOutPatients", "ar": "مريض\nالعيادات الخارجية"}, + "myOutPatient_2lines": { + "en": "My\nOutPatients", + "ar": "مريض\nالعيادات الخارجية" + }, "searchPatient": {"en": "Search Patients", "ar": "البحث عن مريض"}, "searchPatientDashBoard": {"en": "Search\nPatients", "ar": "البحث\nعن مريض"}, "searchAbout": {"en": "Search", "ar": "البحث عن"}, @@ -47,7 +59,10 @@ const Map> localizedValues = { "inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, "operations": {"en": "Operations", "ar": "عمليات"}, "patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"}, - "searchMedicineDashboard": {"en": "Search\nMedicines", "ar": "بحث\nعن الدواء"}, + "searchMedicineDashboard": { + "en": "Search\nMedicines", + "ar": "بحث\nعن الدواء" + }, "searchMedicine": {"en": "Search Medicines", "ar": "بحث عن الدواء"}, "myReferralPatient": {"en": "My Referral Patient", "ar": "مرضى الاحالة"}, "referPatient": {"en": "Referral Patient", "ar": "إحالة مريض"}, @@ -63,14 +78,20 @@ const Map> localizedValues = { "patientFile": {"en": "Patient File", "ar": "ملف المريض"}, "familyMedicine": {"en": "Family Medicine Clinic", "ar": "عيادة طب الأسرة"}, "search": {"en": "Search", "ar": "بحث "}, - "onlyArrivedPatient": {"en": "Only Arrived Patient", "ar": "المريض الذي حضر للموعد"}, + "onlyArrivedPatient": { + "en": "Only Arrived Patient", + "ar": "المريض الذي حضر للموعد" + }, "searchMedicineNameHere": {"en": "Search Medicine ", "ar": "ابحث هنا"}, "youCanFind": {"en": "You Can Find ", "ar": "تستطيع ان تجد "}, "itemsInSearch": {"en": "items in search", "ar": "عناصر في البحث"}, "qr": {"en": "QR", "ar": "QR"}, "reader": {"en": "Reader", "ar": "قارىء رمز ال"}, "startScanning": {"en": "Start Scanning", "ar": "بدء المسح"}, - "scanQrCode": {"en": "scan Qr code to retrieve patient profile", "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض"}, + "scanQrCode": { + "en": "scan Qr code to retrieve patient profile", + "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض" + }, "scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"}, "profile": {"en": "Profile", "ar": "ملفي الشخصي"}, "gender": {"en": "Gender", "ar": "الجنس"}, @@ -95,9 +116,15 @@ const Map> localizedValues = { "bloodPressure": {"en": "Blood Pressure", "ar": "ضغط الدم"}, "oxygenation": {"en": "Oxygenation", "ar": "الأوكسجين"}, "painScale": {"en": "Pain Scale", "ar": "مقياس الألم"}, - "errorNoVitalSign": {"en": "You don't have any Vital Sign", "ar": "ليس لديك اي مؤشرات حيوية"}, + "errorNoVitalSign": { + "en": "You don't have any Vital Sign", + "ar": "ليس لديك اي مؤشرات حيوية" + }, "labOrders": {"en": "Lab Orders", "ar": "طلبات المختبر"}, - "errorNoLabOrders": {"en": "You don\"t have any lab orders", "ar": "ليس لديك اي طلبات للمختبر"}, + "errorNoLabOrders": { + "en": "You don\"t have any lab orders", + "ar": "ليس لديك اي طلبات للمختبر" + }, "answerThePatient": {"en": "answer the patient", "ar": "الرد على المريض "}, "pleaseEnterAnswer": {"en": "please enter answer", "ar": "الرجاء ادخال الرد"}, "replay": {"en": "Reply", "ar": "تاكيد"}, @@ -105,18 +132,30 @@ const Map> localizedValues = { "progress": {"en": "Progress", "ar": "التقدم"}, "note": {"en": "Note", "ar": "ملاحظة"}, "searchNote": {"en": "Search Note", "ar": "بحث عن ملاحظة"}, - "errorNoProgressNote": {"en": "You don\"t have any Progress Note", "ar": "ليس لديك اي ملاحظة تقدم"}, + "errorNoProgressNote": { + "en": "You don\"t have any Progress Note", + "ar": "ليس لديك اي ملاحظة تقدم" + }, "invoiceNo:": {"en": "Invoice No :", "ar": "رقم الفاتورة"}, "generalResult": {"en": "General Result ", "ar": "النتيجة العامة"}, "description": {"en": "Description", "ar": "الوصف"}, "value": {"en": "Value", "ar": "القيمة"}, "range": {"en": "Range", "ar": "النطاق"}, "enterId": {"en": "User ID", "ar": "معرف المستخدم"}, - "pleaseEnterYourID": {"en": "Please enter your ID", "ar": "الرجاء ادخال الهوية"}, + "pleaseEnterYourID": { + "en": "Please enter your ID", + "ar": "الرجاء ادخال الهوية" + }, "enterPassword": {"en": "Password", "ar": "كلمه السر"}, - "pleaseEnterPassword": {"en": "Please Enter Password", "ar": "الرجاء ادخال الرقم السري"}, + "pleaseEnterPassword": { + "en": "Please Enter Password", + "ar": "الرجاء ادخال الرقم السري" + }, "selectYourProject": {"en": "Branch", "ar": "فرع"}, - "pleaseEnterYourProject": {"en": "Please Enter Your Project", "ar": "الرجاء ادخال مستشفى"}, + "pleaseEnterYourProject": { + "en": "Please Enter Your Project", + "ar": "الرجاء ادخال مستشفى" + }, "login": {"en": "Login", "ar": "تسجيل دخول"}, "drSulaimanAlHabib": {"en": "Dr Sulaiman Al Habib", "ar": "د.سليمان الحبيب"}, "welcomeTo": {"en": "Welcome to", "ar": "مرحبا بك"}, @@ -143,7 +182,10 @@ const Map> localizedValues = { "youWillReceiveA": {"en": "You will receive a", "ar": "سوف تتلقى "}, "loginCode": {"en": "Login Code", "ar": "رمز تسجيل دخول"}, "smsBy": {"en": "By SMS", "ar": "عن طريق رسالة قصيرة"}, - "pleaseEnterTheCode": {"en": "Please enter the code", "ar": "الرجاء ادخال الرمز"}, + "pleaseEnterTheCode": { + "en": "Please enter the code", + "ar": "الرجاء ادخال الرمز" + }, "youDontHaveAnyPatient": { "en": "No data found for the selected search criteria", "ar": "لا توجد بيانات لمعايير البحث المختارة" @@ -155,8 +197,14 @@ const Map> localizedValues = { "tomorrow": {"en": "Tomorrow", "ar": "الغد"}, "nextWeek": {"en": "Next Week", "ar": "الاسبوع القادم"}, "all": {"en": "All", "ar": "الجميع"}, - "errorNoInsuranceApprovals": {"en": "You don\"t have any Insurance Approvals", "ar": "ليس لديك اي موفقات تأمين"}, - "searchInsuranceApprovals": {"en": "Search InsuranceApprovals", "ar": "بحث عن موافقات التأمين"}, + "errorNoInsuranceApprovals": { + "en": "You don\"t have any Insurance Approvals", + "ar": "ليس لديك اي موفقات تأمين" + }, + "searchInsuranceApprovals": { + "en": "Search InsuranceApprovals", + "ar": "بحث عن موافقات التأمين" + }, "status": {"en": "STATUS", "ar": "الحالة"}, "expiryDate": {"en": "EXPIRY DATE", "ar": "تاريخ الانتهاء"}, "producerName": {"en": "PRODUCER NAME", "ar": "اسم المنتج"}, @@ -169,10 +217,19 @@ const Map> localizedValues = { "routine": {"en": "Routine", "ar": "روتيني"}, "send": {"en": "Send", "ar": "ارسال"}, "referralFrequency": {"en": "Referral Frequency:", "ar": "تواتر الحالة:"}, - "selectReferralFrequency": {"en": "Select Referral Frequency:", "ar": "اختار تواتر الحالة:"}, - "clinicalDetailsAndRemarks": {"en": "Clinical Details and Remarks", "ar": "التفاصيل السرسرية والملاحظات"}, + "selectReferralFrequency": { + "en": "Select Referral Frequency:", + "ar": "اختار تواتر الحالة:" + }, + "clinicalDetailsAndRemarks": { + "en": "Clinical Details and Remarks", + "ar": "التفاصيل السرسرية والملاحظات" + }, "remarks": {"en": "Remarks", "ar": "ملاحظات"}, - "pleaseFill": {"en": "Please fill all fields..!", "ar": "الرجاء ملأ جميع الحقول..!"}, + "pleaseFill": { + "en": "Please fill all fields..!", + "ar": "الرجاء ملأ جميع الحقول..!" + }, "replay2": {"en": "Reply", "ar": "رد الطبيب"}, "logout": {"en": "Logout", "ar": "تسجيل خروج"}, "pharmaciesList": {"en": "Pharmacies List", "ar": "قائمة الصيدليات"}, @@ -184,7 +241,10 @@ const Map> localizedValues = { "searchOrders": {"en": "Search Orders", "ar": " بحث عن الطلبات"}, "prescriptionDetails": {"en": "Prescription Details", "ar": "تفاصبل الوصفة"}, "prescriptionInfo": {"en": "Prescription Info", "ar": "معلومات الوصفة"}, - "errorNoOrders": {"en": "You don\"t have any Orders", "ar": "لا يوجد لديك اي طلبات"}, + "errorNoOrders": { + "en": "You don\"t have any Orders", + "ar": "لا يوجد لديك اي طلبات" + }, "livecare": {"en": "Live Care", "ar": "Live Care"}, "beingBad": {"en": "being bad", "ar": "سيء"}, "beingGreat": {"en": "being great", "ar": "رائع"}, @@ -195,14 +255,26 @@ const Map> localizedValues = { "endcallwithcharge": {"en": "End with charge", "ar": "انهاء مع خصم المبلغ"}, "endcall": {"en": "End Call", "ar": "إنهاء المكالمة"}, "transfertoadmin": {"en": "Transfer to admin", "ar": "تحويل للمشرف"}, - "searchMedicineImageCaption": {"en": "Type the medicine name to search", "ar": " اكتب اسم الدواء للبحث"}, + "searchMedicineImageCaption": { + "en": "Type the medicine name to search", + "ar": " اكتب اسم الدواء للبحث" + }, "type": {"en": "Type", "ar": "اكتب"}, "fromDate": {"en": "From Date", "ar": "من تاريخ"}, "toDate": {"en": "To Date", "ar": "الى تاريخ"}, - "searchPatientImageCaptionTitle": {"en": "SEARCH PATIENT", "ar": "البحث عن المريض"}, - "searchPatientImageCaptionBody": {"en": "Add Details Of Patient To search", "ar": " أضف تفاصيل المريض للبحث"}, + "searchPatientImageCaptionTitle": { + "en": "SEARCH PATIENT", + "ar": "البحث عن المريض" + }, + "searchPatientImageCaptionBody": { + "en": "Add Details Of Patient To search", + "ar": " أضف تفاصيل المريض للبحث" + }, "welcome": {"en": "Welcome", "ar": "أهلا بك"}, - "youDoNotHaveAnyItem": {"en": "You don\"t have any Items", "ar": "لا يوجد اي نتائج"}, + "youDoNotHaveAnyItem": { + "en": "You don\"t have any Items", + "ar": "لا يوجد اي نتائج" + }, "typeMedicineName": {"en": "Type Medicine Name", "ar": "اكتب اسم الدواء"}, "moreThan3Letter": { "en": "Medicine Name Should Be More Than 3 letter", @@ -229,14 +301,20 @@ const Map> localizedValues = { "bed": {"en": "BED:", "ar": "السرير"}, "next": {"en": "Next", "ar": "التالي"}, "previous": {"en": "Previous", "ar": "السابق"}, - "healthRecordInformation": {"en": "HEALTH RECORD INFORMATION", "ar": "معلومات السجل الصحي"}, + "healthRecordInformation": { + "en": "HEALTH RECORD INFORMATION", + "ar": "معلومات السجل الصحي" + }, "prevoius-sickleave-issed": { "en": "Total previous sick leave issued by the doctor", "ar": "مجموع الإجازات المرضية السابقة التي أصدرها الطبيب" }, "clinicSelect": {"en": "Select Clinic", "ar": "اختر عيادة"}, "doctorSelect": {"en": "Select Doctor", "ar": "اختر طبيب"}, - "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"}, + "empty-message": { + "en": "Please enter this field", + "ar": "يرجى ادخال هذا الحقل" + }, "no-sickleve-applied": { "en": "No sick leave available, apply Now", "ar": "لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن" @@ -251,13 +329,19 @@ const Map> localizedValues = { "leave-start-date": {"en": "Leave start date", "ar": "تاريخ بدء المغادرة"}, "days-sick-leave": {"en": "Leave Days: ", "ar": "أيام الإجازة "}, "extend": {"en": "Extend", "ar": "تمديد"}, - "extend-sickleave": {"en": "Extend Sick Leave", "ar": "قم بتمديد الإجازة المرضية"}, + "extend-sickleave": { + "en": "Extend Sick Leave", + "ar": "قم بتمديد الإجازة المرضية" + }, "chiefComplaintLength": { "en": "Chief Complaint length should be greater than 25", "ar": "يجب أن يكون طول شكوى الرئيسية أكبر من 25" }, "patient-target": {"en": "Target Patient", "ar": "المريض المستدف"}, - "no-priscription-listed": {"en": "No Prescription Listed", "ar": "لا يوجد وصفة طبية مدرجة"}, + "no-priscription-listed": { + "en": "No Prescription Listed", + "ar": "لا يوجد وصفة طبية مدرجة" + }, "referTo": {"en": "Refer To", "ar": "محال إلى"}, "referredFrom": {"en": "From : ", "ar": " : من"}, "branch": {"en": "Branch", "ar": "الفرع"}, @@ -272,9 +356,15 @@ const Map> localizedValues = { "summaryReport": {"en": "Summary", "ar": "ملخص"}, "accept": {"en": "ACCEPT", "ar": "قبول"}, "reject": {"en": "REJECT", "ar": "رفض"}, - "noAppointmentsErrorMsg": {"en": "There is no appointments for at this date", "ar": "لا توجد مواعيد في هذا التاريخ"}, + "noAppointmentsErrorMsg": { + "en": "There is no appointments for at this date", + "ar": "لا توجد مواعيد في هذا التاريخ" + }, "referralPatient": {"en": "Referral Patient", "ar": "المريض المحال "}, - "noPrescriptionListed": {"en": "NO PRESCRIPTION LISTED", "ar": "لأيوجد وصفة طبية"}, + "noPrescriptionListed": { + "en": "NO PRESCRIPTION LISTED", + "ar": "لأيوجد وصفة طبية" + }, "addNow": {"en": "ADD Now", "ar": "اضف الآن"}, "orderType": {"en": "Order Type", "ar": "نوع الطلب"}, "strength": {"en": "Strength", "ar": "شديد"}, @@ -284,8 +374,14 @@ const Map> localizedValues = { "instruction": {"en": "Instructions", "ar": "إرشادات"}, "addMedication": {"en": "Add Medication", "ar": "اضف دواء"}, "route": {"en": "Route", "ar": "طريقة الاستخدام"}, - "reschedule-leave": {"en": "Reschedule and leaves", "ar": "إعادة الجدولة والمغادرة"}, - "no-reschedule-leave": {"en": "No Reschedule and leaves", "ar": "لايوجد طلبات اعادة جدولة او مغادرة"}, + "reschedule-leave": { + "en": "Reschedule and leaves", + "ar": "إعادة الجدولة والمغادرة" + }, + "no-reschedule-leave": { + "en": "No Reschedule and leaves", + "ar": "لايوجد طلبات اعادة جدولة او مغادرة" + }, "weight": {"en": "Weight", "ar": "الوزن"}, "kg": {"en": "kg", "ar": "كغ"}, "height": {"en": "Height", "ar": "الطول"}, @@ -307,7 +403,10 @@ const Map> localizedValues = { "rhythm": {"en": "Rhythm", "ar": "الإيقاع"}, "respBeats": {"en": "RESP (beats/minute)", "ar": " (دقة/دقيقة)التنفس"}, "patternOfRespiration": {"en": "Pattern Of Respiration", "ar": "نمط التنفس"}, - "bloodPressureDiastoleAndSystole": {"en": "Blood Pressure (Sys, Dias)", "ar": "ضغط الدم (الانقباض, الإنبساط)"}, + "bloodPressureDiastoleAndSystole": { + "en": "Blood Pressure (Sys, Dias)", + "ar": "ضغط الدم (الانقباض, الإنبساط)" + }, "cuffLocation": {"en": "Cuff Location", "ar": "موقع الكف"}, "cuffSize": {"en": "Cuff Size", "ar": "حجم الكف"}, "patientPosition": {"en": "Patient Position", "ar": "موقع المريض"}, @@ -318,41 +417,80 @@ const Map> localizedValues = { "to": {"en": "To", "ar": "إلى"}, "coveringDoctor": {"en": "Covering Doctor: ", "ar": " :تغطية دكتور"}, "requestLeave": {"en": "Request Leave", "ar": "طلب إجازة"}, - "pleaseEnterDate": {"en": "Please enter leave start date", "ar": "الرجاء إدخال تاريخ بدء الإجازة"}, - "pleaseEnterNoOfDays": {"en": "Please enter sick leave days", "ar": "الرجاء إدخال أيام الإجازة المرضية"}, - "pleaseEnterRemarks": {"en": "Please enter remarks", "ar": "الرجاء إدخال الملاحظات"}, + "pleaseEnterDate": { + "en": "Please enter leave start date", + "ar": "الرجاء إدخال تاريخ بدء الإجازة" + }, + "pleaseEnterNoOfDays": { + "en": "Please enter sick leave days", + "ar": "الرجاء إدخال أيام الإجازة المرضية" + }, + "pleaseEnterRemarks": { + "en": "Please enter remarks", + "ar": "الرجاء إدخال الملاحظات" + }, "update": {"en": "Update", "ar": "تحديث"}, "admission": {"en": "Admission", "ar": "تنويم"}, "request": {"en": "Request", "ar": "طلب"}, "admissionRequest": {"en": "Admission Request", "ar": "طلب تنويم"}, "patientDetails": {"en": "Patient Details", "ar": "تفاصيل المريض"}, - "specialityAndDoctorDetail": {"en": "SPECIALITY AND DOCTOR DETAILS", "ar": "تفاصيل التخصص والطبيب"}, + "specialityAndDoctorDetail": { + "en": "SPECIALITY AND DOCTOR DETAILS", + "ar": "تفاصيل التخصص والطبيب" + }, "referringDate": {"en": "Referring Date", "ar": "تاريخ الإحالة"}, "referringDoctor": {"en": "Referring Doctor", "ar": "دكتور الإحالة"}, "otherInformation": {"en": "Other Information", "ar": "معلومات أخرى"}, "expectedDays": {"en": "Expected Days", "ar": "الأيام المتوقعة"}, - "expectedAdmissionDate": {"en": "Expected Admission Date", "ar": "تاريخ التنويم المتوقع"}, + "expectedAdmissionDate": { + "en": "Expected Admission Date", + "ar": "تاريخ التنويم المتوقع" + }, "admissionDate": {"en": "Admission Date", "ar": "تاريخ التنويم"}, - "isSickLeaveRequired": {"en": "Is Sick Leave Required", "ar": "هل الإجازة المرضية مطلوبة"}, + "isSickLeaveRequired": { + "en": "Is Sick Leave Required", + "ar": "هل الإجازة المرضية مطلوبة" + }, "patientPregnant": {"en": "Patient Pregnant", "ar": "المريض حامل"}, - "treatmentLine": {"en": "Main line of treatment", "ar": "الخط الرئيسي للعلاج"}, + "treatmentLine": { + "en": "Main line of treatment", + "ar": "الخط الرئيسي للعلاج" + }, "ward": {"en": "Ward", "ar": "جناح"}, - "preAnesthesiaReferred": {"en": "PRE ANESTHESIA REFERRED", "ar": "الاحالة قبل التخدير"}, + "preAnesthesiaReferred": { + "en": "PRE ANESTHESIA REFERRED", + "ar": "الاحالة قبل التخدير" + }, "admissionType": {"en": "Admission Type", "ar": "نوع التنويم"}, "diagnosis": {"en": "Diagnosis", "ar": "التشخيص"}, "allergies": {"en": "Allergies", "ar": "الحساسية"}, - "preOperativeOrders": {"en": "Pre Operative Orders", "ar": "أوامر ما قبل العملية"}, - "elementForImprovement": {"en": "Element For Improvement", "ar": "عنصر للتحسين"}, + "preOperativeOrders": { + "en": "Pre Operative Orders", + "ar": "أوامر ما قبل العملية" + }, + "elementForImprovement": { + "en": "Element For Improvement", + "ar": "عنصر للتحسين" + }, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ الخروج"}, "dietType": {"en": "Diet Type", "ar": "نوع النظام الغذائي"}, - "dietTypeRemarks": {"en": "Remarks on diet type", "ar": "ملاحظات على نوع النظام الغذائي"}, + "dietTypeRemarks": { + "en": "Remarks on diet type", + "ar": "ملاحظات على نوع النظام الغذائي" + }, "save": {"en": "SAVE", "ar": "حفظ"}, - "postPlansEstimatedCost": {"en": "POST PLANS & ESTIMATED COST", "ar": "خطط ما بعد العملية والتكلفة المقدرة"}, + "postPlansEstimatedCost": { + "en": "POST PLANS & ESTIMATED COST", + "ar": "خطط ما بعد العملية والتكلفة المقدرة" + }, "postPlans": {"en": "POST PLANS", "ar": "ما بعد العملية"}, "ucaf": {"en": "UCAF", "ar": "UCAF"}, "emergencyCase": {"en": "Emergency Case", "ar": "حالة طارئة"}, "durationOfIllness": {"en": "duration Of Illness", "ar": "مدة المرض"}, - "chiefComplaintsAndSymptoms": {"en": "CHIEF COMPLAINTS", "ar": "الشكوى الرئيسية"}, + "chiefComplaintsAndSymptoms": { + "en": "CHIEF COMPLAINTS", + "ar": "الشكوى الرئيسية" + }, "patientFeelsPainInHisBackAndCough": { "en": "Patient Feels pain in his back and cough", "ar": "يشعر المريض بألم في ظهره ويسعل" @@ -366,7 +504,10 @@ const Map> localizedValues = { "how": {"en": "How", "ar": "كيف"}, "when": {"en": "When", "ar": "متى"}, "where": {"en": "Where", "ar": "أين"}, - "specifyPossibleLineManagement": {"en": "Specify possible line of management", "ar": "حدد خط الإدارة المحتمل"}, + "specifyPossibleLineManagement": { + "en": "Specify possible line of management", + "ar": "حدد خط الإدارة المحتمل" + }, "significantSigns": {"en": "SIGNIFICANT SIGNS", "ar": "علامات مهمة"}, "backAbdomen": {"en": "Back : Abdomen", "ar": "الظهر: البطن"}, "reasons": {"en": "Reasons", "ar": "الأسباب"}, @@ -376,11 +517,20 @@ const Map> localizedValues = { "addChiefComplaints": {"en": "Add Chief Complaints", "ar": " اضافه الشكاوى"}, "histories": {"en": "Histories", "ar": "التاريخ المرضي"}, "allergiesSoap": {"en": "Allergies", "ar": "الحساسية"}, - "historyOfPresentIllness": {"en": "History of Present Illness", "ar": "تاريخ المرض الحالي"}, - "requiredMsg": {"en": "Please add required field correctly", "ar": "الرجاء إضافة الحقل المطلوب بشكل صحيح"}, + "historyOfPresentIllness": { + "en": "History of Present Illness", + "ar": "تاريخ المرض الحالي" + }, + "requiredMsg": { + "en": "Please add required field correctly", + "ar": "الرجاء إضافة الحقل المطلوب بشكل صحيح" + }, "addHistory": {"en": "Add History", "ar": "اضافه تاريخ مرضي"}, "searchHistory": {"en": "Search History", "ar": " البحث"}, - "addSelectedHistories": {"en": "Add Selected Histories", "ar": " اضافه تاريخ مرضي"}, + "addSelectedHistories": { + "en": "Add Selected Histories", + "ar": " اضافه تاريخ مرضي" + }, "addAllergies": {"en": "Add Allergies", "ar": "أضف الحساسية"}, "itemExist": {"en": "This item already exist", "ar": "هذا العنصر موجود"}, "selectAllergy": {"en": "Select Allergy", "ar": "أختر الحساسية"}, @@ -388,9 +538,18 @@ const Map> localizedValues = { "leaveCreated": {"en": "Leave has been created", "ar": "تم إنشاء الإجازة"}, "medications": {"en": "Medications", "ar": "الأدوية"}, "procedures": {"en": "Procedures", "ar": "الإجراءات"}, - "vitalSignEmptyMsg": {"en": "There is no vital signs for this patient", "ar": "لا توجد علامات حيوية لهذا المريض"}, - "referralEmptyMsg": {"en": "There is no referral data", "ar": "لا توجد بيانات إحالة"}, - "referralSuccessMsg": {"en": "You make referral successfully", "ar": "تمت الاحالة بنجاح"}, + "vitalSignEmptyMsg": { + "en": "There is no vital signs for this patient", + "ar": "لا توجد علامات حيوية لهذا المريض" + }, + "referralEmptyMsg": { + "en": "There is no referral data", + "ar": "لا توجد بيانات إحالة" + }, + "referralSuccessMsg": { + "en": "You make referral successfully", + "ar": "تمت الاحالة بنجاح" + }, "fromTime": {"en": "From Time", "ar": "من وقت"}, "toTime": {"en": "To Time", "ar": "الى وقت"}, "diagnoseType": {"en": "Diagnose Type", "ar": "نوع التشخيص"}, @@ -401,9 +560,18 @@ const Map> localizedValues = { "codeNo": {"en": "Code #", "ar": "# الرمز"}, "covered": {"en": "Covered", "ar": "مغطى"}, "approvalRequired": {"en": "Approval Required", "ar": "الموافقة مطلوبة"}, - "uncoveredByDoctor": {"en": "Uncovered By Doctor", "ar": "غير مغطى من قبل الدكتور"}, - "chiefComplaintEmptyMsg": {"en": "There is no Chief Complaint", "ar": "ليس هناك شكوى رئيسية"}, - "more-verify": {"en": "More Verification Options", "ar": "المزيد من خيارات التحقق"}, + "uncoveredByDoctor": { + "en": "Uncovered By Doctor", + "ar": "غير مغطى من قبل الدكتور" + }, + "chiefComplaintEmptyMsg": { + "en": "There is no Chief Complaint", + "ar": "ليس هناك شكوى رئيسية" + }, + "more-verify": { + "en": "More Verification Options", + "ar": "المزيد من خيارات التحقق" + }, "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بك!"}, "account-info": { "en": "Would you like to login with current username?", @@ -420,24 +588,37 @@ const Map> localizedValues = { "verify-with-sms": {"en": " SMS", "ar": "الرسائل القصيرة"}, "verify-with-whatsapp": {"en": "WhatsApp", "ar": " الواتس اب"}, "verify-with": {"en": "Verify through ", "ar": " الواتس اب"}, - "last-login": {"en": "Last login details:", "ar": "تفاصيل تسجيل الدخول الأخير:"}, + "last-login": { + "en": "Last login details:", + "ar": "تفاصيل تسجيل الدخول الأخير:" + }, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { - "en": "To activate the fingerprint login service, please verify data by using one of the following options.", + "en": + "To activate the fingerprint login service, please verify data by using one of the following options.", "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية" }, "verification_message": { "en": "Please enter the Verification Code sent to", "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" }, - "validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"}, + "validation_message": { + "en": "The verification code expires in", + "ar": "تنتهي صلاحية رمز التحقق خلال" + }, "addAssessment": {"en": "Add Assessment", "ar": "أضف التقييم"}, "assessment": {"en": "Assessment", "ar": " التقييم"}, - "physicalSystemExamination": {"en": "Physical System / Examination", "ar": "الفحص البدني / النظام"}, + "physicalSystemExamination": { + "en": "Physical System / Examination", + "ar": "الفحص البدني / النظام" + }, "searchExamination": {"en": "Search Examination", "ar": "بحث عن فحص"}, "addExamination": {"en": "Add Examination", "ar": "اضافة فحص"}, "doc": {"en": "Doc : ", "ar": " د : "}, - "patientNoDetailErrMsg": {"en": "There is no detail for this patient", "ar": "لا توجد تفاصيل لهذا المريض"}, + "patientNoDetailErrMsg": { + "en": "There is no detail for this patient", + "ar": "لا توجد تفاصيل لهذا المريض" + }, "allergicTO": {"en": "ALLERGIC TO ", "ar": "حساس من"}, "normal": {"en": "Normal", "ar": "عادي"}, "abnormal": {"en": "Abnormal", "ar": " غير عادي"}, @@ -456,25 +637,46 @@ const Map> localizedValues = { "visitDate": {"en": "Visit Date", "ar": "تاريخ الزيارة"}, "test": {"en": "Procedures/Test", "ar": "اجراءات/تحاليل"}, "regular": {"en": "Regular", "ar": "اعتيادي"}, - "addMoreProcedure": {"en": "Add More Procedures", "ar": "اضف المزيد من اجراءات"}, + "addMoreProcedure": { + "en": "Add More Procedures", + "ar": "اضف المزيد من اجراءات" + }, "searchProcedures": {"en": "Search Procedures", "ar": "البحث في اجراءات"}, "selectProcedures": {"en": "Select procedure", "ar": "اختر الاجراء"}, - "procedureCategorise": {"en": "Select Procedure Category", "ar": "اختر نوع الاجراء "}, - "addSelectedProcedures": {"en": "add Selected Procedures", "ar": "اضافة الاجراءات المختارة "}, + "procedureCategorise": { + "en": "Select Procedure Category", + "ar": "اختر نوع الاجراء " + }, + "addSelectedProcedures": { + "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": "Name or ICD"}, "dType": {"en": "Type", "ar": "النوع"}, - "addAssessmentDetails": {"en": "Add Assessment Details", "ar": "أضف تفاصيل التقييم"}, + "addAssessmentDetails": { + "en": "Add Assessment Details", + "ar": "أضف تفاصيل التقييم" + }, "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, "editedBy": {"en": "Edited By :", "ar": "عدلت من : "}, "currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"}, - "noItem": {"en": "No items exists in this list", "ar": "لا توجد عناصر في هذه القائمة"}, - "postUcafSuccessMsg": {"en": "UCAF request send successfully", "ar": "تم ارسال طلب UCAF بنجاح"}, - "vitalSignDetailEmpty": {"en": "There is no data for this vital sign", "ar": "لا توجد بيانات لهذه العلامة الحيوية"}, + "noItem": { + "en": "No items exists in this list", + "ar": "لا توجد عناصر في هذه القائمة" + }, + "postUcafSuccessMsg": { + "en": "UCAF request send successfully", + "ar": "تم ارسال طلب UCAF بنجاح" + }, + "vitalSignDetailEmpty": { + "en": "There is no data for this vital sign", + "ar": "لا توجد بيانات لهذه العلامة الحيوية" + }, "onlyOfftimeHoliday": { "en": "You can only apply holiday or offtime from mobile app", "ar": "يمكنك تقديم عطلة أو إجازة فقط" @@ -490,7 +692,10 @@ const Map> localizedValues = { "en": "You have to add at least one examination.", "ar": "يجب عليك إضافة فحص واحد على الأقل." }, - "progressNoteErrorMsg": {"en": "You have to add progress Note.", "ar": "يجب عليك إضافة ملاحظة التقدم."}, + "progressNoteErrorMsg": { + "en": "You have to add progress Note.", + "ar": "يجب عليك إضافة ملاحظة التقدم." + }, "chiefComplaintErrorMsg": { "en": "You have to add chief complaint fields correctly .", "ar": "يجب عليك إضافة الشكوى الرئيسية بشكل صحيح" @@ -514,20 +719,41 @@ const Map> localizedValues = { "referralStatusNotSeen": {"en": "NotSeen", "ar": "لم يحضر"}, "clinicSearch": {"en": "Search Clinic", "ar": "بحث عن عيادة"}, "doctorSearch": {"en": "Search Doctor", "ar": "بحث عن طبيب"}, - "referralResponse": {"en": "Referral Response : ", "ar": " : استجابة الإحالة"}, + "referralResponse": { + "en": "Referral Response : ", + "ar": " : استجابة الإحالة" + }, "estimatedCost": {"en": "Estimated Cost", "ar": "التكلفة المتوقعة"}, "diagnosisDetail": {"en": "Diagnosis Details", "ar": "تفاصيل التشخيص"}, - "referralSuccessMsgAccept": {"en": "Referral Accepted Successfully", "ar": "تم قبول الإحالة بنجاح"}, - "referralSuccessMsgReject": {"en": "Referral Rejected Successfully", "ar": "تم رفض الإحالة بنجاح"}, - "sickLeaveComments": {"en": "Sick leave comments", "ar": "ملاحظات الإجازة المرضية"}, + "referralSuccessMsgAccept": { + "en": "Referral Accepted Successfully", + "ar": "تم قبول الإحالة بنجاح" + }, + "referralSuccessMsgReject": { + "en": "Referral Rejected Successfully", + "ar": "تم رفض الإحالة بنجاح" + }, + "sickLeaveComments": { + "en": "Sick leave comments", + "ar": "ملاحظات الإجازة المرضية" + }, "pastMedicalHistory": {"en": "Past medical history", "ar": "التاريخ الطبي"}, - "pastSurgicalHistory": {"en": "Past surgical history", "ar": "التاريخ الجراحي"}, + "pastSurgicalHistory": { + "en": "Past surgical history", + "ar": "التاريخ الجراحي" + }, "complications": {"en": "Complications", "ar": "المضاعفات"}, "floor": {"en": "Floor", "ar": "الطابق"}, "roomCategory": {"en": "Room category", "ar": "فئة الغرفة"}, - "otherDepartmentsInterventions": {"en": "Other departments interventions", "ar": "ملاحظات الأقسام الأخرى"}, + "otherDepartmentsInterventions": { + "en": "Other departments interventions", + "ar": "ملاحظات الأقسام الأخرى" + }, "otherProcedure": {"en": "Other procedure", "ar": "إجراء آخر"}, - "admissionRequestSuccessMsg": {"en": "Admission Request Created Successfully", "ar": "تم إنشاء طلب التنويم بنجاح"}, + "admissionRequestSuccessMsg": { + "en": "Admission Request Created Successfully", + "ar": "تم إنشاء طلب التنويم بنجاح" + }, "orderNo": {"en": "Order No : ", "ar": "رقم الطلب"}, "infoStatus": {"en": "Info Status", "ar": "حالة المعلومات"}, "doctorResponse": {"en": "Doctor Response", "ar": "استجابة الطبيب"}, @@ -540,7 +766,10 @@ const Map> localizedValues = { "ptientsreferral": {"en": "Patients Referrals", "ar": "إحالات المريض"}, "myPatientsReferral": {"en": "Patient's\nReferrals", "ar": "إحالات\nالمريض"}, "arrivalpatient": {"en": "Arrival Patients", "ar": "المرضى الواصلون"}, - "searchmedicinepatient": {"en": "Search patient or Medicines", "ar": "ابحث عن المريض أو الأدوية"}, + "searchmedicinepatient": { + "en": "Search patient or Medicines", + "ar": "ابحث عن المريض أو الأدوية" + }, "appointmentDate": {"en": "Appointment Date", "ar": "تاريخ الموعد"}, "arrived_p": {"en": "Arrived", "ar": "وصل"}, "details": {"en": "Details", "ar": "التفاصيل"}, @@ -548,16 +777,28 @@ const Map> localizedValues = { "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, - "sendSuc": {"en": "A copy has been sent to the email", "ar": "تم إرسال نسخة إلى البريد الإلكتروني"}, + "sendSuc": { + "en": "A copy has been sent to the email", + "ar": "تم إرسال نسخة إلى البريد الإلكتروني" + }, "SpecialResult": {"en": "Special Result", "ar": "نتيجة خاصة"}, - "noDataAvailable": {"en": "No data available", "ar": " لا يوجد بيانات متاحة "}, + "noDataAvailable": { + "en": "No data available", + "ar": " لا يوجد بيانات متاحة " + }, "show-more-btn": {"en": "Flowchart", "ar": "النتائج التراكمية"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, "fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "}, - "searchPatient-name": {"en": "Search Name, Medical File, Phone Number", "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف"}, + "searchPatient-name": { + "en": "Search Name, Medical File, Phone Number", + "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف" + }, "reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"}, "leaves": {"en": "Leaves", "ar": "يغادر"}, - "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, + "totalApproval": { + "en": "Total approval unused", + "ar": "اجمالي الموافقات الغير مستخدمة" + }, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, @@ -566,16 +807,31 @@ const Map> localizedValues = { "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, - "searchWithOther": {"en": "Search With Other Criteria", "ar": "المزيد من خيارات البحث"}, - "hideOtherCriteria": {"en": "Hide Other Criteria", "ar": "إخفاء الخيارات الأخرى"}, - "applyForReschedule": {"en": "Apply for leave or reschedule", "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة"}, + "searchWithOther": { + "en": "Search With Other Criteria", + "ar": "المزيد من خيارات البحث" + }, + "hideOtherCriteria": { + "en": "Hide Other Criteria", + "ar": "إخفاء الخيارات الأخرى" + }, + "applyForReschedule": { + "en": "Apply for leave or reschedule", + "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة" + }, "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"}, - "addSickLeaveRequest": {"en": "Add Sick Leave Request", "ar": "إضافة طلب إجازة مرضية"}, - "extendSickLeaveRequest": {"en": "Extend Sick Leave Request", "ar": "تمديد طلب الإجازة المرضية"}, + "addSickLeaveRequest": { + "en": "Add Sick Leave Request", + "ar": "إضافة طلب إجازة مرضية" + }, + "extendSickLeaveRequest": { + "en": "Extend Sick Leave Request", + "ar": "تمديد طلب الإجازة المرضية" + }, "accepted": {"en": "Accepted", "ar": "موافق"}, "cancelled": {"en": "Cancelled", "ar": "ألغي"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, @@ -585,10 +841,16 @@ const Map> localizedValues = { "remove": {"en": "Remove", "ar": "حذف"}, "changeOfSchedule": {"en": "Change of Schedule", "ar": "تغيير الجدول"}, "newSchedule": {"en": "New Schedule", "ar": "جدول جديد"}, - "enter_credentials": {"en": "Enter the user credentials below", "ar": "أدخل بيانات المستخدم أدناه"}, + "enter_credentials": { + "en": "Enter the user credentials below", + "ar": "أدخل بيانات المستخدم أدناه" + }, "step": {"en": "Step", "ar": "خطوة"}, "fieldRequired": {"en": "This field is required", "ar": "هذه الخانة مطلوبه"}, - "applyOrRescheduleLeave": {"en": "Apply Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة"}, + "applyOrRescheduleLeave": { + "en": "Apply Reschedule Leave", + "ar": "التقدم بطلب أو إعادة جدولة الإجازة" + }, "myQRCode": {"en": "My QR Code", "ar": " كود QR "}, "patientIDMobilenational": { "en": "Patient ID, National ID, Mobile Number", @@ -603,32 +865,68 @@ const Map> localizedValues = { "try-saying": {"en": "Try saying something", "ar": "حاول قول شيء ما"}, "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, - "didntCatch": {"en": "Didn't catch that. Try Speaking again", "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى"}, + "didntCatch": { + "en": "Didn't catch that. Try Speaking again", + "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" + }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, - "pleaseEnterProcedure": {"en": "Please Enter Procedure", "ar": "الرجاء إدخال الإجراء "}, - "fillTheMandatoryProcedureDetails": {"en": "Fill The Mandatory Procedure Details", "ar": "املأ تفاصيل الإجراء"}, - "atLeastThreeCharacters": {"en": "At least three Characters", "ar": "ثلاثة أحرف على الأقل "}, - "searchProcedureHere": {"en": "Search Procedure here...", "ar": "إجراء البحث هنا ... "}, - "noInsuranceApprovalFound": {"en": "No Insurance Approval Found", "ar": "لم يتم العثور على موافقة التأمين"}, + "pleaseEnterProcedure": { + "en": "Please Enter Procedure", + "ar": "الرجاء إدخال الإجراء " + }, + "fillTheMandatoryProcedureDetails": { + "en": "Fill The Mandatory Procedure Details", + "ar": "املأ تفاصيل الإجراء" + }, + "atLeastThreeCharacters": { + "en": "At least three Characters", + "ar": "ثلاثة أحرف على الأقل " + }, + "searchProcedureHere": { + "en": "Search Procedure here...", + "ar": "إجراء البحث هنا ... " + }, + "noInsuranceApprovalFound": { + "en": "No Insurance Approval Found", + "ar": "لم يتم العثور على موافقة التأمين" + }, "procedure": {"en": "Procedure", "ar": "اجراء"}, "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, "processed": {"en": "processed", "ar": "معالجتها"}, "direction": {"en": "Direction", "ar": "توجيه"}, "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, - "medicationHasBeenAdded": {"en": "Medication has been added", "ar": "تمت إضافة الدواء"}, - "newPrescriptionOrder": {"en": "New Prescription Order", "ar": "طلب وصفة طبية جديد "}, - "pleaseFillAllFields": {"en": "Please Fill All Fields", "ar": "الرجاء أملأ جميع الحقول"}, + "medicationHasBeenAdded": { + "en": "Medication has been added", + "ar": "تمت إضافة الدواء" + }, + "newPrescriptionOrder": { + "en": "New Prescription Order", + "ar": "طلب وصفة طبية جديد " + }, + "pleaseFillAllFields": { + "en": "Please Fill All Fields", + "ar": "الرجاء أملأ جميع الحقول" + }, "narcoticMedicineCanOnlyBePrescribedFromVida": { "en": "Narcotic medicine can only be prescribed from VIDA", "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " }, - "only5DigitsAllowedForStrength": {"en": "Only 5 Digits allowed for strength", "ar": "يسمح فقط بـ 5 أرقام للقوة"}, + "only5DigitsAllowedForStrength": { + "en": "Only 5 Digits allowed for strength", + "ar": "يسمح فقط بـ 5 أرقام للقوة" + }, "unit": {"en": "Unit", "ar": "وحدة"}, "boxQuantity": {"en": "Box Quantity", "ar": "كمية العبوة "}, "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, - "applyForRadiologyOrder": {"en": "Apply for Radiology Order", "ar": "التقدم بطلب للحصول على طلب الأشعة "}, - "applyForNewLabOrder": {"en": "Apply for New Lab Order", "ar": "تقدم بطلب جديد للمختبر الأشعة"}, + "applyForRadiologyOrder": { + "en": "Apply for Radiology Order", + "ar": "التقدم بطلب للحصول على طلب الأشعة " + }, + "applyForNewLabOrder": { + "en": "Apply for New Lab Order", + "ar": "تقدم بطلب جديد للمختبر الأشعة" + }, "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب مختبر"}, "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشعة"}, "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب أشعة جديد"}, @@ -640,14 +938,23 @@ const Map> localizedValues = { "en": "Apply for New Prescriptions Order", "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " }, - "noPrescriptionsFound": {"en": "No Prescriptions Found", "ar": "لم يتم العثور على وصفات طبية"}, - "noMedicalFileFound": {"en": "No Medical File Found", "ar": "لم يتم العثور على ملف طبي"}, + "noPrescriptionsFound": { + "en": "No Prescriptions Found", + "ar": "لم يتم العثور على وصفات طبية" + }, + "noMedicalFileFound": { + "en": "No Medical File Found", + "ar": "لم يتم العثور على ملف طبي" + }, "insurance22": {"en": "Insurance", "ar": "موافقات"}, "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف طلب جديد"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, + "addNewProgressNote": { + "en": "Add a New Progress Note", + "ar": "أضف ملاحظة جديدة" + }, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغي"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, @@ -666,7 +973,10 @@ const Map> localizedValues = { "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يتم الرد بعد"}, "clearText": {"en": "Clear Text", "ar": "نص واضح"}, "medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"}, - "medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"}, + "medicalReportVerify": { + "en": "Verify Medical Report", + "ar": "تحقق من التقرير الطبي" + }, "comments": {"en": "Comments", "ar": "ملاحظات"}, "initiateCall": {"en": "Initiate Call ", "ar": "بدء الاتصال"}, "transferTo": {"en": "Transfer To ", "ar": "حول إلى"}, @@ -677,10 +987,22 @@ const Map> localizedValues = { "consultation": {"en": "Consultation", "ar": "استشارة"}, "resume": {"en": "Resume", "ar": "استأنف"}, "theCall": {"en": "The Call", "ar": "الاتصال"}, - "createNewMedicalReport": {"en": "Create New Medical Report", "ar": "إنشاء تقرير طبي جديد"}, - "historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ"}, - "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المختبرات والبيانات الفيزيائية"}, - "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, + "createNewMedicalReport": { + "en": "Create New Medical Report", + "ar": "إنشاء تقرير طبي جديد" + }, + "historyPhysicalFinding": { + "en": "History and Physical Finding", + "ar": "التاريخ" + }, + "laboratoryPhysicalData": { + "en": "Laboratory and Physical Data", + "ar": "المختبرات والبيانات الفيزيائية" + }, + "impressionRecommendation": { + "en": "Impression and Recommendation", + "ar": "الانطباع والتوصية" + }, "onHold": {"en": "On Hold", "ar": "قيد الانتظار"}, "verified": {"en": "Verified", "ar": "تم التحقق"}, "endCall": {"en": "End Call", "ar": "انهاء"}, @@ -693,27 +1015,37 @@ const Map> localizedValues = { "edit": {"en": "Edit", "ar": "تعديل"}, "summeryReply": {"en": "Summary Reply", "ar": "ملخص الرد"}, "finish": {"en": "Finish", "ar": "انهاء"}, - "severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"}, + "severityValidationError": { + "en": "Please add allergy severity", + "ar": "الرجاء إضافة شدة الحساسية" + }, "inProgress": {"en": "inProgress", "ar": "تحت المعالجه"}, "Completed": {"en": "Completed", "ar": "مكتمل"}, "Locked": {"en": "Locked", "ar": "مقفل"}, - "textCopiedSuccessfully": {"en": "Text copied successfully", "ar": "تم نسخ النص بنجاح"}, + "textCopiedSuccessfully": { + "en": "Text copied successfully", + "ar": "تم نسخ النص بنجاح" + }, "roomNo": {"en": "Room No", "ar": "رقم الغرفة"}, "replayCallStatus": {"en": "Called", "ar": "تم الاتصال"}, "patientArrived": {"en": "Patient Arrived", "ar": "وصل المريض"}, - "calledAndNoResponse": {"en": "Called And No Response", "ar": "تم الاتصال ولا يوجد رد"}, + "calledAndNoResponse": { + "en": "Called And No Response", + "ar": "تم الاتصال ولا يوجد رد" + }, "underProcess": {"en": "Under Process", "ar": "تحت التجهيز"}, "textResponse": {"en": "Text Response", "ar": "استجابة النص"}, "notReplied": {"en": "Not Replied", "ar": "لم يتم يرد"}, - "requestType":{ - "en":"Request Type", - "ar":"نوع الطلب"}, + "requestType": {"en": "Request Type", "ar": "نوع الطلب"}, "special": {"en": "Special", "ar": "خاص"}, - "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , + "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"}, "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, "reports": {"en": "Reports", "ar": "تقارير "}, "operation": {"en": "Operation", "ar": " العملية"}, - "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, + "registerNewPatient": { + "en": "Register\nNew Patient", + "ar": "تسجيل\n مريض جديد" + }, "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, "occupation": {"en": "Occupation", "ar": "مهنة"}, "healthID": {"en": "Health ID", "ar": "معرف الصحة"}, @@ -722,23 +1054,51 @@ const Map> localizedValues = { "nursing": {"en": "Nursing", "ar": "تمريض"}, "diabetic": {"en": "Diabetic", "ar": "مرض السكري"}, "chart": {"en": "Chart", "ar": "جدول"}, - "operationTimeStart": {"en": "Operation Time Start :", "ar": "بدء وقت العملية:"}, + "operationTimeStart": { + "en": "Operation Time Start :", + "ar": "بدء وقت العملية:" + }, "operationDate": {"en": "operation Date :", "ar": "تاريخ العملية:"}, "reservation": {"en": "Reservation Number :", "ar": " رقم الحجز :"}, "anesthetist": {"en": "Anesthetist", "ar": "طبيب تخدير "}, - "bloodTransfusedDetail": {"en": "blood Transfused Detail", "ar": "تفاصيل نقل الدم "}, + "bloodTransfusedDetail": { + "en": "blood Transfused Detail", + "ar": "تفاصيل نقل الدم " + }, "circulatingNurse": {"en": "circulating Nurse", "ar": "ممرضة عمومية"}, "scrubNurse": {"en": "Scrub Nurse", "ar": "ممرضة تدليك"}, "otherSpecimen": {"en": "Other Specimen", "ar": "عينة أخرى"}, - "microbiologySpecimen": {"en": "Microbiology Specimen", "ar": "عينة علم الأحياء الدقيقة"}, + "microbiologySpecimen": { + "en": "Microbiology Specimen", + "ar": "عينة علم الأحياء الدقيقة" + }, "histopathSpecimen": {"en": "Histopath Specimen", "ar": "عينة الأنسجة"}, "bloodLossDetail": {"en": "Blood Loss Detail", "ar": "تفاصيل فقدان الدم"}, - "complicationDetails1": {"en": "Complication Details", "ar": "تفاصيل المضاعفات"}, - "postOperationInstruction": {"en": "Post Operation Instruction", "ar": "تعليمات ما بعد العملية"}, + "complicationDetails1": { + "en": "Complication Details", + "ar": "تفاصيل المضاعفات" + }, + "postOperationInstruction": { + "en": "Post Operation Instruction", + "ar": "تعليمات ما بعد العملية" + }, "surgeryProcedure": {"en": "Surgery Procedures", "ar": "إجراءات الجراحة"}, "finding": {"en": "Finding", "ar": "العثور على"}, - "preOperationDiagnosis": {"en": "Pre OperationOperation Diagnosis", "ar": "التشخيص قبل العملية"}, - "postOperationDiagnosis": {"en": "Post Operation Diagnosis", "ar": "تشخيص ما بعد العملية"}, + "preOperationDiagnosis": { + "en": "Pre OperationOperation Diagnosis", + "ar": "التشخيص قبل العملية" + }, + "postOperationDiagnosis": { + "en": "Post Operation Diagnosis", + "ar": "تشخيص ما بعد العملية" + }, "surgeon": {"en": "surgeon", "ar": "دكتور جراح"}, "assistant": {"en": "assistant", "ar": "مساعد"}, + "investigation": {"en": "investigation", "ar": "التحقيقات"}, + "conditionOnDischarge": { + "en": "Condition On Discharge", + "ar": "الحالة عند الاخراج" + }, + "planedProcedure": {"en": "Planed Procedure", "ar": "الإجراء المخطط"}, + "moreDetails": {"en": "More Details", "ar": "المزيد من التفاصيل"}, }; diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index c1e72f96..7754447a 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -115,7 +115,7 @@ class _DischargeSummaryWidgetState extends State { SizedBox( height: 15.0, ), - AppText("More Details"), + AppText(TranslationBase.of(context).moreDetails), SizedBox( height: 15.0, ), @@ -130,7 +130,9 @@ class _DischargeSummaryWidgetState extends State { color: Color(0xFF575757)), children: [ new TextSpan( - text: "Past History" + ": ", + text: TranslationBase.of(context) + .pastMedicalHistory + + ": ", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -167,7 +169,9 @@ class _DischargeSummaryWidgetState extends State { color: Color(0xFF575757)), children: [ new TextSpan( - text: "Investigations" + ": ", + text: TranslationBase.of(context) + .investigation + + ": ", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -205,7 +209,9 @@ class _DischargeSummaryWidgetState extends State { color: Color(0xFF575757)), children: [ new TextSpan( - text: "Condition On Discharge" + ": ", + text: TranslationBase.of(context) + .investigation + + ": ", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -242,7 +248,9 @@ class _DischargeSummaryWidgetState extends State { color: Color(0xFF575757)), children: [ new TextSpan( - text: "Planed Procedure" + ": ", + text: TranslationBase.of(context) + .planedProcedure + + ": ", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 31935fcf..0878994a 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -98,7 +98,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 0, - "Pending", + TranslationBase.of(context).pending, ), tabWidget( screenSize, diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 8634e76e..57013e25 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.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'; @@ -78,14 +79,14 @@ class _ActivationPageState extends State { Expanded( child: InkWell( onTap: () async { - // setState(() { - // isSendOtp = true; - // }); + await sendActivationCode(1); + setState(() { + isSendOtp = true; + }); // // await widget.model // .sendActivationCodeByOTPNotificationType( // otpType: 1); - await sendActivationCode(1); }, child: Container( height: @@ -127,7 +128,8 @@ class _ActivationPageState extends State { ), Center( child: AppText( - "Verify through SMS", + TranslationBase.of(context) + .verifySMS, fontSize: 14, color: Color(0xFF2E303A), fontWeight: FontWeight.bold, @@ -142,6 +144,9 @@ class _ActivationPageState extends State { child: InkWell( onTap: () async { await sendActivationCode(2); + setState(() { + isSendOtp = true; + }); }, child: Container( height: @@ -183,7 +188,8 @@ class _ActivationPageState extends State { ), Center( child: AppText( - "Verify through WhatsApp", + TranslationBase.of(context) + .verifyWhatsApp, fontSize: 14, color: Color(0xFF2E303A), fontWeight: FontWeight.bold, @@ -209,7 +215,7 @@ class _ActivationPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Please enter the verification code sent to 02221552", + TranslationBase.of(context).verificationMessage, fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.w800, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index d6410f5e..7e3ab871 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -13,11 +13,13 @@ class TranslationBase { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => + localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; - String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get areYouSureYouWantTo => + localizedValues['areYouSureYouWantTo'][locale.languageCode]; String get language => localizedValues['language'][locale.languageCode]; @@ -35,35 +37,46 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => + localizedValues['replySuccessfully'][locale.languageCode]; - String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String get messagesScreenToolbarTitle => + localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; + String get errorNoSchedule => + localizedValues['errorNoSchedule'][locale.languageCode]; String get verify => localizedValues['verify'][locale.languageCode]; - String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; + String get referralDoctor => + localizedValues['referralDoctor'][locale.languageCode]; - String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; + String get referringClinic => + localizedValues['referringClinic'][locale.languageCode]; String get frequency => localizedValues['frequency'][locale.languageCode]; String get priority => localizedValues['priority'][locale.languageCode]; - String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; + String get maxResponseTime => + localizedValues['maxResponseTime'][locale.languageCode]; - String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String get clinicDetailsandRemarks => + localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; + String get answerSuggestions => + localizedValues['answerSuggestions'][locale.languageCode]; String get outPatients => localizedValues['outPatients'][locale.languageCode]; - String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; + String get searchPatient => + localizedValues['searchPatient'][locale.languageCode]; + String get searchPatientDashBoard => + localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientName => + localizedValues['searchPatient-name'][locale.languageCode]; String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; @@ -71,9 +84,11 @@ class TranslationBase { String get patients => localizedValues['patients'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; - String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; + String get todayStatistics => + localizedValues['todayStatistics'][locale.languageCode]; - String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; + String get familyMedicine => + localizedValues['familyMedicine'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; @@ -91,26 +106,36 @@ class TranslationBase { String get inPatient => localizedValues['inPatient'][locale.languageCode]; String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get myInPatientTitle => + localizedValues['myInPatientTitle'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; - String get patientServices => localizedValues['patientServices'][locale.languageCode]; + String get patientServices => + localizedValues['patientServices'][locale.languageCode]; - String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; + String get searchMedicine => + localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicineDashboard => + localizedValues['searchMedicineDashboard'][locale.languageCode]; - String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferralPatient => + localizedValues['myReferralPatient'][locale.languageCode]; - String get referPatient => localizedValues['referPatient'][locale.languageCode]; + String get referPatient => + localizedValues['referPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; - String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; - String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; + String get myReferredPatient => + localizedValues['myReferredPatient'][locale.languageCode]; + String get referredPatient => + localizedValues['referredPatient'][locale.languageCode]; String get referredOn => localizedValues['referredOn'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; @@ -127,19 +152,23 @@ class TranslationBase { String get search => localizedValues['search'][locale.languageCode]; - String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get onlyArrivedPatient => + localizedValues['onlyArrivedPatient'][locale.languageCode]; - String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get searchMedicineNameHere => + localizedValues['searchMedicineNameHere'][locale.languageCode]; String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String get itemsInSearch => localizedValues['itemsInSearch'][locale.languageCode]; + String get itemsInSearch => + localizedValues['itemsInSearch'][locale.languageCode]; String get qr => localizedValues['qr'][locale.languageCode]; String get reader => localizedValues['reader'][locale.languageCode]; - String get startScanning => localizedValues['startScanning'][locale.languageCode]; + String get startScanning => + localizedValues['startScanning'][locale.languageCode]; String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; @@ -151,17 +180,21 @@ class TranslationBase { String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; + String get clinicSelect => + localizedValues['clinicSelect'][locale.languageCode]; - String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get doctorSelect => + localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; - String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; + String get errorMessage => + localizedValues['errorMessage'][locale.languageCode]; - String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; + String get patientProfile => + localizedValues['patientProfile'][locale.languageCode]; String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; @@ -177,15 +210,18 @@ class TranslationBase { String get medicines => localizedValues['medicines'][locale.languageCode]; - String get prescription => localizedValues['prescription'][locale.languageCode]; + String get prescription => + localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get insuranceApprovals => + localizedValues['insuranceApprovals'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; - String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => + localizedValues['bodyMeasurements'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -193,26 +229,33 @@ class TranslationBase { String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => + localizedValues['bloodPressure'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; - String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; + String get errorNoVitalSign => + localizedValues['errorNoVitalSign'][locale.languageCode]; String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; + String get errorNoLabOrders => + localizedValues['errorNoLabOrders'][locale.languageCode]; - String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; + String get answerThePatient => + localizedValues['answerThePatient'][locale.languageCode]; - String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get pleaseEnterAnswer => + localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => localizedValues['progressNote'][locale.languageCode]; - String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get progressNote => + localizedValues['progressNote'][locale.languageCode]; + String get operationReports => + localizedValues['operationReports'][locale.languageCode]; String get reports => localizedValues['reports'][locale.languageCode]; String get operation => localizedValues['operation'][locale.languageCode]; @@ -222,12 +265,14 @@ class TranslationBase { String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; + String get errorNoProgressNote => + localizedValues['errorNoProgressNote'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String get generalResult => localizedValues['generalResult'][locale.languageCode]; + String get generalResult => + localizedValues['generalResult'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; @@ -237,23 +282,30 @@ class TranslationBase { String get enterId => localizedValues['enterId'][locale.languageCode]; - String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get pleaseEnterYourID => + localizedValues['pleaseEnterYourID'][locale.languageCode]; - String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; + String get enterPassword => + localizedValues['enterPassword'][locale.languageCode]; - String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get pleaseEnterPassword => + localizedValues['pleaseEnterPassword'][locale.languageCode]; - String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; + String get selectYourProject => + localizedValues['selectYourProject'][locale.languageCode]; - String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get pleaseEnterYourProject => + localizedValues['pleaseEnterYourProject'][locale.languageCode]; String get login => localizedValues['login'][locale.languageCode]; - String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get drSulaimanAlHabib => + localizedValues['drSulaimanAlHabib'][locale.languageCode]; String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; + String get welcomeBackTo => + localizedValues['welcomeBackTo'][locale.languageCode]; String get home => localizedValues['home'][locale.languageCode]; @@ -269,37 +321,46 @@ class TranslationBase { String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; + String get pleaseChoose => + localizedValues['pleaseChoose'][locale.languageCode]; String get choose => localizedValues['choose'][locale.languageCode]; - String get verification => localizedValues['verification'][locale.languageCode]; + String get verification => + localizedValues['verification'][locale.languageCode]; String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; + String get yourAccount => + localizedValues['yourAccount!'][locale.languageCode]; String get verify1 => localizedValues['verify1'][locale.languageCode]; - String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; + String get youWillReceiveA => + localizedValues['youWillReceiveA'][locale.languageCode]; String get loginCode => localizedValues['loginCode'][locale.languageCode]; String get smsBy => localizedValues['smsBy'][locale.languageCode]; - String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String get pleaseEnterTheCode => + localizedValues['pleaseEnterTheCode'][locale.languageCode]; - String get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient'][locale.languageCode]; + String get youDontHaveAnyPatient => + localizedValues['youDontHaveAnyPatient'][locale.languageCode]; - String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String get youDoNotHaveAnyItem => + localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; String get age => localizedValues['age'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; String get occupation => localizedValues['occupation'][locale.languageCode]; String get healthID => localizedValues['healthID'][locale.languageCode]; - String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; - String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; + String get identityNumber => + localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => + localizedValues['maritalStatus'][locale.languageCode]; String get today => localizedValues['today'][locale.languageCode]; @@ -311,15 +372,18 @@ class TranslationBase { String get yesterday => localizedValues['yesterday'][locale.languageCode]; - String get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String get errorNoInsuranceApprovals => + localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; - String get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String get searchInsuranceApprovals => + localizedValues['searchInsuranceApprovals'][locale.languageCode]; String get status => localizedValues['status'][locale.languageCode]; String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String get producerName => localizedValues['producerName'][locale.languageCode]; + String get producerName => + localizedValues['producerName'][locale.languageCode]; String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; @@ -337,11 +401,14 @@ class TranslationBase { String get send => localizedValues['send'][locale.languageCode]; - String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; + String get referralFrequency => + localizedValues['referralFrequency'][locale.languageCode]; - String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; + String get selectReferralFrequency => + localizedValues['selectReferralFrequency'][locale.languageCode]; - String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String get clinicalDetailsAndRemarks => + localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode]; @@ -351,30 +418,39 @@ class TranslationBase { String get outPatient => localizedValues['outPatients'][locale.languageCode]; - String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; - String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; + String get myOutPatient => + localizedValues['myOutPatient'][locale.languageCode]; + String get myOutPatient_2lines => + localizedValues['myOutPatient_2lines'][locale.languageCode]; String get logout => localizedValues['logout'][locale.languageCode]; - String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; + String get pharmaciesList => + localizedValues['pharmaciesList'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode]; - String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; + String get youCanFindItIn => + localizedValues['youCanFindItIn'][locale.languageCode]; - String get radiologyReport => localizedValues['radiologyReport'][locale.languageCode]; + String get radiologyReport => + localizedValues['radiologyReport'][locale.languageCode]; String get orders => localizedValues['orders'][locale.languageCode]; String get list => localizedValues['list'][locale.languageCode]; - String get searchOrders => localizedValues['searchOrders'][locale.languageCode]; + String get searchOrders => + localizedValues['searchOrders'][locale.languageCode]; - String get prescriptionDetails => localizedValues['prescriptionDetails'][locale.languageCode]; + String get prescriptionDetails => + localizedValues['prescriptionDetails'][locale.languageCode]; - String get prescriptionInfo => localizedValues['prescriptionInfo'][locale.languageCode]; + String get prescriptionInfo => + localizedValues['prescriptionInfo'][locale.languageCode]; - String get errorNoOrders => localizedValues['errorNoOrders'][locale.languageCode]; + String get errorNoOrders => + localizedValues['errorNoOrders'][locale.languageCode]; String get livecare => localizedValues['livecare'][locale.languageCode]; @@ -388,17 +464,20 @@ class TranslationBase { String get done => localizedValues['done'][locale.languageCode]; - String get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String get searchMedicineImageCaption => + localizedValues['searchMedicineImageCaption'][locale.languageCode]; String get type => localizedValues['type'][locale.languageCode]; String get resumecall => localizedValues['resumecall'][locale.languageCode]; - String get endcallwithcharge => localizedValues['endcallwithcharge'][locale.languageCode]; + String get endcallwithcharge => + localizedValues['endcallwithcharge'][locale.languageCode]; String get endcall => localizedValues['endcall'][locale.languageCode]; - String get transfertoadmin => localizedValues['transfertoadmin'][locale.languageCode]; + String get transfertoadmin => + localizedValues['transfertoadmin'][locale.languageCode]; String get fromDate => localizedValues['fromDate'][locale.languageCode]; @@ -408,15 +487,19 @@ class TranslationBase { String get toTime => localizedValues['toTime'][locale.languageCode]; - String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String get searchPatientImageCaptionTitle => + localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; - String get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String get searchPatientImageCaptionBody => + localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode]; - String get typeMedicineName => localizedValues['typeMedicineName'][locale.languageCode]; + String get typeMedicineName => + localizedValues['typeMedicineName'][locale.languageCode]; - String get moreThan3Letter => localizedValues['moreThan3Letter'][locale.languageCode]; + String get moreThan3Letter => + localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; @@ -424,7 +507,8 @@ class TranslationBase { String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; - String get patientSick => localizedValues['patient-sick'][locale.languageCode]; + String get patientSick => + localizedValues['patient-sick'][locale.languageCode]; String get leave => localizedValues['leave'][locale.languageCode]; @@ -434,11 +518,14 @@ class TranslationBase { String get clinicName => localizedValues['clinicname'][locale.languageCode]; - String get sickLeaveDate => localizedValues['sick-leave-date'][locale.languageCode]; + String get sickLeaveDate => + localizedValues['sick-leave-date'][locale.languageCode]; - String get sickLeaveDays => localizedValues['sick-leave-days'][locale.languageCode]; + String get sickLeaveDays => + localizedValues['sick-leave-days'][locale.languageCode]; - String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; + String get admissionDetail => + localizedValues['admissionDetail'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode]; @@ -454,56 +541,72 @@ class TranslationBase { String get bed => localizedValues['bed'][locale.languageCode]; - String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String get previousSickLeaveIssue => + localizedValues['prevoius-sickleave-issed'][locale.languageCode]; - String get noSickLeaveApplied => localizedValues['no-sickleve-applied'][locale.languageCode]; + String get noSickLeaveApplied => + localizedValues['no-sickleve-applied'][locale.languageCode]; String get applyNow => localizedValues['applynow'][locale.languageCode]; - String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; + String get addSickLeave => + localizedValues['add-sickleave'][locale.languageCode]; String get add => localizedValues['add'][locale.languageCode]; - String get addSickLeaverequest => localizedValues['addSickLeaveRequest'][locale.languageCode]; - String get extendSickLeaverequest => localizedValues['extendSickLeaveRequest'][locale.languageCode]; + String get addSickLeaverequest => + localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get extendSickLeaverequest => + localizedValues['extendSickLeaveRequest'][locale.languageCode]; String get approved => localizedValues['approved'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode]; String get pending => localizedValues['pending'][locale.languageCode]; - String get leaveStartDate => localizedValues['leave-start-date'][locale.languageCode]; + String get leaveStartDate => + localizedValues['leave-start-date'][locale.languageCode]; - String get daysSickleave => localizedValues['days-sick-leave'][locale.languageCode]; + String get daysSickleave => + localizedValues['days-sick-leave'][locale.languageCode]; String get extend => localizedValues['extend'][locale.languageCode]; - String get extendSickLeave => localizedValues['extend-sickleave'][locale.languageCode]; + String get extendSickLeave => + localizedValues['extend-sickleave'][locale.languageCode]; - String get targetPatient => localizedValues['patient-target'][locale.languageCode]; + String get targetPatient => + localizedValues['patient-target'][locale.languageCode]; - String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; + String get noPrescription => + localizedValues['no-priscription-listed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; String get finish => localizedValues['finish'][locale.languageCode]; String get previous => localizedValues['previous'][locale.languageCode]; - String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get emptyMessage => + localizedValues['empty-message'][locale.languageCode]; - String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; + String get healthRecordInformation => + localizedValues['healthRecordInformation'][locale.languageCode]; - String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; + String get chiefComplaintLength => + localizedValues['chiefComplaintLength'][locale.languageCode]; String get referTo => localizedValues['referTo'][locale.languageCode]; - String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get referredFrom => + localizedValues['referredFrom'][locale.languageCode]; String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; - String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; + String get chooseAppointment => + localizedValues['chooseAppointment'][locale.languageCode]; - String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; + String get appointmentNo => + localizedValues['appointmentNo'][locale.languageCode]; String get refer => localizedValues['refer'][locale.languageCode]; @@ -515,19 +618,24 @@ class TranslationBase { String get dr => localizedValues['dr'][locale.languageCode]; - String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; + String get previewHealth => + localizedValues['previewHealth'][locale.languageCode]; - String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; + String get summaryReport => + localizedValues['summaryReport'][locale.languageCode]; String get accept => localizedValues['accept'][locale.languageCode]; String get reject => localizedValues['reject'][locale.languageCode]; - String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String get noAppointmentsErrorMsg => + localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; - String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; + String get referralPatient => + localizedValues['referralPatient'][locale.languageCode]; - String get noPrescriptionListed => localizedValues['noPrescriptionListed'][locale.languageCode]; + String get noPrescriptionListed => + localizedValues['noPrescriptionListed'][locale.languageCode]; String get addNow => localizedValues['addNow'][locale.languageCode]; @@ -543,16 +651,20 @@ class TranslationBase { String get instruction => localizedValues['instruction'][locale.languageCode]; - String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; + String get rescheduleLeaves => + localizedValues['reschedule-leave'][locale.languageCode]; - String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get applyOrRescheduleLeave => + localizedValues['applyOrRescheduleLeave'][locale.languageCode]; String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; - String get addMedication => localizedValues['addMedication'][locale.languageCode]; + String get addMedication => + localizedValues['addMedication'][locale.languageCode]; String get route => localizedValues['route'][locale.languageCode]; - String get noReScheduleLeave => localizedValues['no-reschedule-leave'][locale.languageCode]; + String get noReScheduleLeave => + localizedValues['no-reschedule-leave'][locale.languageCode]; String get weight => localizedValues['weight'][locale.languageCode]; @@ -562,7 +674,8 @@ class TranslationBase { String get cm => localizedValues['cm'][locale.languageCode]; - String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode]; + String get idealBodyWeight => + localizedValues['idealBodyWeight'][locale.languageCode]; String get waistSize => localizedValues['waistSize'][locale.languageCode]; @@ -570,16 +683,22 @@ class TranslationBase { String get headCircum => localizedValues['headCircum'][locale.languageCode]; - String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; + String get leanBodyWeight => + localizedValues['leanBodyWeight'][locale.languageCode]; - String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; + String get bodyMassIndex => + localizedValues['bodyMassIndex'][locale.languageCode]; - String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get yourBodyMassIndex => + localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => + localizedValues['bmiUnderWeight'][locale.languageCode]; String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiOverWeight => + localizedValues['bmiOverWeight'][locale.languageCode]; String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => localizedValues['bmiObeseExtreme'][locale.languageCode]; + String get bmiObeseExtreme => + localizedValues['bmiObeseExtreme'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode]; @@ -589,35 +708,45 @@ class TranslationBase { String get respBeats => localizedValues['respBeats'][locale.languageCode]; - String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode]; + String get patternOfRespiration => + localizedValues['patternOfRespiration'][locale.languageCode]; - String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String get bloodPressureDiastoleAndSystole => + localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; - String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode]; + String get cuffLocation => + localizedValues['cuffLocation'][locale.languageCode]; String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; - String get patientPosition => localizedValues['patientPosition'][locale.languageCode]; + String get patientPosition => + localizedValues['patientPosition'][locale.languageCode]; String get fio2 => localizedValues['fio2'][locale.languageCode]; String get sao2 => localizedValues['sao2'][locale.languageCode]; - String get painManagement => localizedValues['painManagement'][locale.languageCode]; + String get painManagement => + localizedValues['painManagement'][locale.languageCode]; String get holiday => localizedValues['holiday'][locale.languageCode]; String get to => localizedValues['to'][locale.languageCode]; - String get coveringDoctor => localizedValues['coveringDoctor'][locale.languageCode]; + String get coveringDoctor => + localizedValues['coveringDoctor'][locale.languageCode]; - String get requestLeave => localizedValues['requestLeave'][locale.languageCode]; + String get requestLeave => + localizedValues['requestLeave'][locale.languageCode]; - String get pleaseEnterDate => localizedValues['pleaseEnterDate'][locale.languageCode]; + String get pleaseEnterDate => + localizedValues['pleaseEnterDate'][locale.languageCode]; - String get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String get pleaseEnterNoOfDays => + localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; - String get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String get pleaseEnterRemarks => + localizedValues['pleaseEnterRemarks'][locale.languageCode]; String get update => localizedValues['update'][locale.languageCode]; @@ -625,68 +754,92 @@ class TranslationBase { String get request => localizedValues['request'][locale.languageCode]; - String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; + String get admissionRequest => + localizedValues['admissionRequest'][locale.languageCode]; - String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; + String get patientDetails => + localizedValues['patientDetails'][locale.languageCode]; - String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String get specialityAndDoctorDetail => + localizedValues['specialityAndDoctorDetail'][locale.languageCode]; - String get referringDate => localizedValues['referringDate'][locale.languageCode]; + String get referringDate => + localizedValues['referringDate'][locale.languageCode]; - String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; + String get referringDoctor => + localizedValues['referringDoctor'][locale.languageCode]; - String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; + String get otherInformation => + localizedValues['otherInformation'][locale.languageCode]; - String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; + String get expectedDays => + localizedValues['expectedDays'][locale.languageCode]; - String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; + String get expectedAdmissionDate => + localizedValues['expectedAdmissionDate'][locale.languageCode]; - String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; - String get isSickLeaveRequired => localizedValues['isSickLeaveRequired'][locale.languageCode]; + String get emergencyAdmission => + localizedValues['emergencyAdmission'][locale.languageCode]; + String get isSickLeaveRequired => + localizedValues['isSickLeaveRequired'][locale.languageCode]; - String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; + String get patientPregnant => + localizedValues['patientPregnant'][locale.languageCode]; - String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; + String get treatmentLine => + localizedValues['treatmentLine'][locale.languageCode]; String get ward => localizedValues['ward'][locale.languageCode]; - String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String get preAnesthesiaReferred => + localizedValues['preAnesthesiaReferred'][locale.languageCode]; - String get admissionType => localizedValues['admissionType'][locale.languageCode]; + String get admissionType => + localizedValues['admissionType'][locale.languageCode]; String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; String get allergies => localizedValues['allergies'][locale.languageCode]; - String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; + String get preOperativeOrders => + localizedValues['preOperativeOrders'][locale.languageCode]; - String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; + String get elementForImprovement => + localizedValues['elementForImprovement'][locale.languageCode]; - String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; + String get dischargeDate => + localizedValues['dischargeDate'][locale.languageCode]; String get dietType => localizedValues['dietType'][locale.languageCode]; - String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; + String get dietTypeRemarks => + localizedValues['dietTypeRemarks'][locale.languageCode]; String get save => localizedValues['save'][locale.languageCode]; - String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get postPlansEstimatedCost => + localizedValues['postPlansEstimatedCost'][locale.languageCode]; String get postPlans => localizedValues['postPlans'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode]; - String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; + String get emergencyCase => + localizedValues['emergencyCase'][locale.languageCode]; - String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; + String get durationOfIllness => + localizedValues['durationOfIllness'][locale.languageCode]; - String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String get chiefComplaintsAndSymptoms => + localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; String get patientFeelsPainInHisBackAndCough => localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; - String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; + String get additionalTextComplaints => + localizedValues['additionalTextComplaints'][locale.languageCode]; - String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; + String get otherConditions => + localizedValues['otherConditions'][locale.languageCode]; String get other => localizedValues['other'][locale.languageCode]; @@ -696,9 +849,11 @@ class TranslationBase { String get where => localizedValues['where'][locale.languageCode]; - String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String get specifyPossibleLineManagement => + localizedValues['specifyPossibleLineManagement'][locale.languageCode]; - String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; + String get significantSigns => + localizedValues['significantSigns'][locale.languageCode]; String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; @@ -712,41 +867,55 @@ class TranslationBase { String get procedures => localizedValues['procedures'][locale.languageCode]; - String get chiefComplaints => localizedValues['chiefComplaints'][locale.languageCode]; + String get chiefComplaints => + localizedValues['chiefComplaints'][locale.languageCode]; String get histories => localizedValues['histories'][locale.languageCode]; - String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; + String get allergiesSoap => + localizedValues['allergiesSoap'][locale.languageCode]; - String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; + String get addChiefComplaints => + localizedValues['addChiefComplaints'][locale.languageCode]; - String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; + String get historyOfPresentIllness => + localizedValues['historyOfPresentIllness'][locale.languageCode]; String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; String get addHistory => localizedValues['addHistory'][locale.languageCode]; - String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; + String get searchHistory => + localizedValues['searchHistory'][locale.languageCode]; - String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; + String get addSelectedHistories => + localizedValues['addSelectedHistories'][locale.languageCode]; - String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; + String get addAllergies => + localizedValues['addAllergies'][locale.languageCode]; String get itemExist => localizedValues['itemExist'][locale.languageCode]; - String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; + String get selectAllergy => + localizedValues['selectAllergy'][locale.languageCode]; - String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; + String get selectSeverity => + localizedValues['selectSeverity'][locale.languageCode]; - String get leaveCreated => localizedValues['leaveCreated'][locale.languageCode]; + String get leaveCreated => + localizedValues['leaveCreated'][locale.languageCode]; - String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String get vitalSignEmptyMsg => + localizedValues['vitalSignEmptyMsg'][locale.languageCode]; - String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; + String get referralEmptyMsg => + localizedValues['referralEmptyMsg'][locale.languageCode]; - String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; + String get referralSuccessMsg => + localizedValues['referralSuccessMsg'][locale.languageCode]; - String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get diagnoseType => + localizedValues['diagnoseType'][locale.languageCode]; String get condition => localizedValues['condition'][locale.languageCode]; @@ -760,52 +929,72 @@ class TranslationBase { String get covered => localizedValues['covered'][locale.languageCode]; - String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; + String get approvalRequired => + localizedValues['approvalRequired'][locale.languageCode]; - String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get uncoveredByDoctor => + localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get chiefComplaintEmptyMsg => + localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String get moreVerification => localizedValues['more-verify'][locale.languageCode]; + String get moreVerification => + localizedValues['more-verify'][locale.languageCode]; - String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; + String get welcomeBack => + localizedValues['welcome-back'][locale.languageCode]; - String get accountInfo => localizedValues['account-info'][locale.languageCode]; + String get accountInfo => + localizedValues['account-info'][locale.languageCode]; - String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; + String get useAnotherAccount => + localizedValues['another-acc'][locale.languageCode]; - String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; + String get verifyLoginWith => + localizedValues['verify-login-with'][locale.languageCode]; String get register => localizedValues['register-user'][locale.languageCode]; - String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFingerprint => + localizedValues['verify-with-fingerprint'][locale.languageCode]; - String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifyFaceID => + localizedValues['verify-with-faceid'][locale.languageCode]; - String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifySMS => + localizedValues['verify-with-sms'][locale.languageCode]; String get verifyWith => localizedValues['verify-with'][locale.languageCode]; - String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get verifyWhatsApp => + localizedValues['verify-with-whatsapp'][locale.languageCode]; String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; + String get lastLoginWith => + localizedValues['last-login-with'][locale.languageCode]; - String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; + String get verifyFingerprint2 => + localizedValues['verify-fingerprint'][locale.languageCode]; - String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; + String get verificationMessage => + localizedValues['verification_message'][locale.languageCode]; - String get validationMessage => localizedValues['validation_message'][locale.languageCode]; + String get validationMessage => + localizedValues['validation_message'][locale.languageCode]; - String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get addAssessment => + localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; - String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; + String get physicalSystemExamination => + localizedValues['physicalSystemExamination'][locale.languageCode]; - String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; + String get searchExamination => + localizedValues['searchExamination'][locale.languageCode]; - String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get addExamination => + localizedValues['addExamination'][locale.languageCode]; String get doc => localizedValues['doc'][locale.languageCode]; @@ -816,11 +1005,14 @@ class TranslationBase { String get abnormal => localizedValues['abnormal'][locale.languageCode]; - String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get patientNoDetailErrMsg => + localizedValues['patientNoDetailErrMsg'][locale.languageCode]; - String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get systolicLng => + localizedValues['systolic-lng'][locale.languageCode]; - String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get diastolicLng => + localizedValues['diastolic-lng'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; @@ -828,62 +1020,80 @@ class TranslationBase { String get bpm => localizedValues['bpm'][locale.languageCode]; - String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; + String get respirationSigns => + localizedValues['respiration-signs'][locale.languageCode]; String get sysDias => localizedValues['sys-dias'][locale.languageCode]; String get body => localizedValues['body'][locale.languageCode]; - String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; + String get respirationRate => + localizedValues['respirationRate'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; - String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; + String get medicalReport => + localizedValues['medicalReport'][locale.languageCode]; String get visitDate => localizedValues['visitDate'][locale.languageCode]; String get test => localizedValues['test'][locale.languageCode]; - String get addMoreProcedure => localizedValues['addMoreProcedure'][locale.languageCode]; + String get addMoreProcedure => + localizedValues['addMoreProcedure'][locale.languageCode]; String get regular => localizedValues['regular'][locale.languageCode]; - String get searchProcedures => localizedValues['searchProcedures'][locale.languageCode]; + String get searchProcedures => + localizedValues['searchProcedures'][locale.languageCode]; - String get procedureCategorise => localizedValues['procedureCategorise'][locale.languageCode]; + String get procedureCategorise => + localizedValues['procedureCategorise'][locale.languageCode]; - String get selectProcedures => localizedValues['selectProcedures'][locale.languageCode]; + String get selectProcedures => + localizedValues['selectProcedures'][locale.languageCode]; - String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; - String get addProcedures => localizedValues['addProcedures'][locale.languageCode]; + String get addSelectedProcedures => + localizedValues['addSelectedProcedures'][locale.languageCode]; + String get addProcedures => + localizedValues['addProcedures'][locale.languageCode]; - String get updateProcedure => localizedValues['updateProcedure'][locale.languageCode]; + String get updateProcedure => + localizedValues['updateProcedure'][locale.languageCode]; - String get orderProcedure => localizedValues['orderProcedure'][locale.languageCode]; + String get orderProcedure => + localizedValues['orderProcedure'][locale.languageCode]; String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; String get dType => localizedValues['dType'][locale.languageCode]; - String get addAssessmentDetails => localizedValues['addAssessmentDetails'][locale.languageCode]; + String get addAssessmentDetails => + localizedValues['addAssessmentDetails'][locale.languageCode]; - String get progressNoteSOAP => localizedValues['progressNoteSOAP'][locale.languageCode]; + String get progressNoteSOAP => + localizedValues['progressNoteSOAP'][locale.languageCode]; - String get addProgressNote => localizedValues['addProgressNote'][locale.languageCode]; + String get addProgressNote => + localizedValues['addProgressNote'][locale.languageCode]; String get createdBy => localizedValues['createdBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode]; - String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; + String get currentMedications => + localizedValues['currentMedications'][locale.languageCode]; String get noItem => localizedValues['noItem'][locale.languageCode]; - String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String get postUcafSuccessMsg => + localizedValues['postUcafSuccessMsg'][locale.languageCode]; - String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String get vitalSignDetailEmpty => + localizedValues['vitalSignDetailEmpty'][locale.languageCode]; - String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String get onlyOfftimeHoliday => + localizedValues['onlyOfftimeHoliday'][locale.languageCode]; String get active => localizedValues['active'][locale.languageCode]; @@ -891,18 +1101,24 @@ class TranslationBase { String get loading => localizedValues['loading'][locale.languageCode]; - String get assessmentErrorMsg => localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get assessmentErrorMsg => + localizedValues['assessmentErrorMsg'][locale.languageCode]; - String get examinationErrorMsg => localizedValues['examinationErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => + localizedValues['examinationErrorMsg'][locale.languageCode]; - String get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg'][locale.languageCode]; + String get progressNoteErrorMsg => + localizedValues['progressNoteErrorMsg'][locale.languageCode]; - String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get chiefComplaintErrorMsg => + localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; String get ICDName => localizedValues['ICDName'][locale.languageCode]; - String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; + String get referralStatus => + localizedValues['referralStatus'][locale.languageCode]; - String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + String get referralRemark => + localizedValues['referralRemark'][locale.languageCode]; String get offTime => localizedValues['offTime'][locale.languageCode]; String get icd => localizedValues['icd'][locale.languageCode]; @@ -911,43 +1127,73 @@ class TranslationBase { String get min => localizedValues['min'][locale.languageCode]; String get months => localizedValues['months'][locale.languageCode]; String get years => localizedValues['years'][locale.languageCode]; - String get referralStatusHold => localizedValues['referralStatusHold'][locale.languageCode]; - String get referralStatusActive => localizedValues['referralStatusActive'][locale.languageCode]; - String get referralStatusCancelled => localizedValues['referralStatusCancelled'][locale.languageCode]; - String get referralStatusCompleted => localizedValues['referralStatusCompleted'][locale.languageCode]; - String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; - String get clinicSearch => localizedValues['clinicSearch'][locale.languageCode]; - String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; - - String get patientName => localizedValues['patient-name'][locale.languageCode]; - - String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => localizedValues['complications'][locale.languageCode]; + String get referralStatusHold => + localizedValues['referralStatusHold'][locale.languageCode]; + String get referralStatusActive => + localizedValues['referralStatusActive'][locale.languageCode]; + String get referralStatusCancelled => + localizedValues['referralStatusCancelled'][locale.languageCode]; + String get referralStatusCompleted => + localizedValues['referralStatusCompleted'][locale.languageCode]; + String get referralStatusNotSeen => + localizedValues['referralStatusNotSeen'][locale.languageCode]; + String get clinicSearch => + localizedValues['clinicSearch'][locale.languageCode]; + String get doctorSearch => + localizedValues['doctorSearch'][locale.languageCode]; + String get referralResponse => + localizedValues['referralResponse'][locale.languageCode]; + String get estimatedCost => + localizedValues['estimatedCost'][locale.languageCode]; + String get diagnosisDetail => + localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => + localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => + localizedValues['referralSuccessMsgReject'][locale.languageCode]; + + String get patientName => + localizedValues['patient-name'][locale.languageCode]; + + String get appointmentNumber => + localizedValues['appointmentNumber'][locale.languageCode]; + String get sickLeaveComments => + localizedValues['sickLeaveComments'][locale.languageCode]; + String get pastMedicalHistory => + localizedValues['pastMedicalHistory'][locale.languageCode]; + String get pastSurgicalHistory => + localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get complications => + localizedValues['complications'][locale.languageCode]; String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get roomCategory => + localizedValues['roomCategory'][locale.languageCode]; + String get otherDepartmentsInterventions => + localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get otherProcedure => + localizedValues['otherProcedure'][locale.languageCode]; + String get admissionRequestSuccessMsg => + localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; - String get sickleaveonhold => localizedValues['sickleaveonhold'][locale.languageCode]; + String get doctorResponse => + localizedValues['doctorResponse'][locale.languageCode]; + String get sickleaveonhold => + localizedValues['sickleaveonhold'][locale.languageCode]; String get noClinic => localizedValues['no-clinic'][locale.languageCode]; - String get otherStatistic => localizedValues['otherStatistic'][locale.languageCode]; - - String get patientsreferral => localizedValues['ptientsreferral'][locale.languageCode]; - String get myPatientsReferral => localizedValues['myPatientsReferral'][locale.languageCode]; - String get arrivalpatient => localizedValues['arrivalpatient'][locale.languageCode]; - String get searchmedicinepatient => localizedValues['searchmedicinepatient'][locale.languageCode]; - String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; + String get otherStatistic => + localizedValues['otherStatistic'][locale.languageCode]; + + String get patientsreferral => + localizedValues['ptientsreferral'][locale.languageCode]; + String get myPatientsReferral => + localizedValues['myPatientsReferral'][locale.languageCode]; + String get arrivalpatient => + localizedValues['arrivalpatient'][locale.languageCode]; + String get searchmedicinepatient => + localizedValues['searchmedicinepatient'][locale.languageCode]; + String get appointmentDate => + localizedValues['appointmentDate'][locale.languageCode]; String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; @@ -956,9 +1202,12 @@ class TranslationBase { String get billNo => localizedValues['BillNo'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; @@ -967,30 +1216,40 @@ class TranslationBase { String get leaves => localizedValues['leaves'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; - String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get prescriptions => + localizedValues['prescriptions'][locale.languageCode]; String get notes => localizedValues['notes'][locale.languageCode]; String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - String get searchWithOther => localizedValues['searchWithOther'][locale.languageCode]; - String get hideOtherCriteria => localizedValues['hideOtherCriteria'][locale.languageCode]; - String get applyForReschedule => localizedValues['applyForReschedule'][locale.languageCode]; + String get searchWithOther => + localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => + localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => + localizedValues['applyForReschedule'][locale.languageCode]; String get startDate => localizedValues['startDate'][locale.languageCode]; String get endDate => localizedValues['endDate'][locale.languageCode]; - String get addReschedule => localizedValues['add-reschedule'][locale.languageCode]; - String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; + String get addReschedule => + localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => + localizedValues['update-reschedule'][locale.languageCode]; String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; String get accepted => localizedValues['accepted'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; + String get typeHereToReply => + localizedValues['typeHereToReply'][locale.languageCode]; String get searchHere => localizedValues['searchHere'][locale.languageCode]; String get remove => localizedValues['remove'][locale.languageCode]; String get inProgress => localizedValues['inProgress'][locale.languageCode]; @@ -998,64 +1257,93 @@ class TranslationBase { String get locked => localizedValues['Locked'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => localizedValues['fieldRequired'][locale.languageCode]; + String get fieldRequired => + localizedValues['fieldRequired'][locale.languageCode]; String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; - String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; + String get changeOfSchedule => + localizedValues['changeOfSchedule'][locale.languageCode]; String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; - String get enterCredentials => localizedValues['enter_credentials'][locale.languageCode]; - String get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational'][locale.languageCode]; + String get enterCredentials => + localizedValues['enter_credentials'][locale.languageCode]; + String get patpatientIDMobilenationalientID => + localizedValues['patientIDMobilenational'][locale.languageCode]; String get updateNow => localizedValues['updateNow'][locale.languageCode]; - String get updateTheApp => localizedValues['updateTheApp'][locale.languageCode]; - String get admissionDate => localizedValues['admission-date'][locale.languageCode]; + String get updateTheApp => + localizedValues['updateTheApp'][locale.languageCode]; + String get admissionDate => + localizedValues['admission-date'][locale.languageCode]; String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; - String get replayBefore => localizedValues['replayBefore'][locale.languageCode]; + String get replayBefore => + localizedValues['replayBefore'][locale.languageCode]; String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; + String get acknowledged => + localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; - String get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get pleaseEnterProcedure => + localizedValues["pleaseEnterProcedure"][locale.languageCode]; String get fillTheMandatoryProcedureDetails => localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; - String get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"][locale.languageCode]; - String get searchProcedureHere => localizedValues["searchProcedureHere"][locale.languageCode]; - String get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get atLeastThreeCharacters => + localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => + localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => + localizedValues["noInsuranceApprovalFound"][locale.languageCode]; String get procedure => localizedValues["procedure"][locale.languageCode]; String get stopDate => localizedValues["stopDate"][locale.languageCode]; String get processed => localizedValues["processed"][locale.languageCode]; String get direction => localizedValues["direction"][locale.languageCode]; String get refill => localizedValues["refill"][locale.languageCode]; - String get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"][locale.languageCode]; - String get newPrescriptionOrder => localizedValues["newPrescriptionOrder"][locale.languageCode]; - String get pleaseFillAllFields => localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get medicationHasBeenAdded => + localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => + localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => + localizedValues["pleaseFillAllFields"][locale.languageCode]; String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"][locale.languageCode]; - String get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] + [locale.languageCode]; + String get only5DigitsAllowedForStrength => + localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; String get unit => localizedValues["unit"][locale.languageCode]; String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; - String get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"][locale.languageCode]; - String get applyForNewLabOrder => localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get applyForRadiologyOrder => + localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => + localizedValues["applyForNewLabOrder"][locale.languageCode]; String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; - String get addRadiologyOrder => localizedValues["addRadiologyOrder"][locale.languageCode]; - String get newRadiologyOrder => localizedValues["newRadiologyOrder"][locale.languageCode]; + String get addRadiologyOrder => + localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => + localizedValues["newRadiologyOrder"][locale.languageCode]; String get orderDate => localizedValues["orderDate"][locale.languageCode]; String get examType => localizedValues["examType"][locale.languageCode]; String get health => localizedValues["health"][locale.languageCode]; String get summary => localizedValues["summary"][locale.languageCode]; - String get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; - String get noPrescriptionsFound => localizedValues["noPrescriptionsFound"][locale.languageCode]; - String get noMedicalFileFound => localizedValues["noMedicalFileFound"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => + localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => + localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => + localizedValues["noMedicalFileFound"][locale.languageCode]; String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; String get discharged => localizedValues["discharged"][locale.languageCode]; - String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; - String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; + String get addNewOrderSheet => + localizedValues["addNewOrderSheet"][locale.languageCode]; + String get addNewProgressNote => + localizedValues["addNewProgressNote"][locale.languageCode]; String get notePending => localizedValues["notePending"][locale.languageCode]; - String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; - String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; + String get noteCanceled => + localizedValues["noteCanceled"][locale.languageCode]; + String get noteVerified => + localizedValues["noteVerified"][locale.languageCode]; String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; @@ -1069,70 +1357,117 @@ class TranslationBase { String get report => localizedValues["report"][locale.languageCode]; String get discharge => localizedValues["discharge"][locale.languageCode]; String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get notRepliedYet => + localizedValues["notRepliedYet"][locale.languageCode]; String get clearText => localizedValues["clearText"][locale.languageCode]; - String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; - String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; + String get medicalReportAdd => + localizedValues['medicalReportAdd'][locale.languageCode]; + String get medicalReportVerify => + localizedValues['medicalReportVerify'][locale.languageCode]; String get comments => localizedValues['comments'][locale.languageCode]; - String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; + String get initiateCall => + localizedValues['initiateCall'][locale.languageCode]; String get endCall => localizedValues['endCall'][locale.languageCode]; String get transferTo => localizedValues['transferTo'][locale.languageCode]; String get admin => localizedValues['admin'][locale.languageCode]; - String get instructions => localizedValues['instructions'][locale.languageCode]; + String get instructions => + localizedValues['instructions'][locale.languageCode]; String get sendLC => localizedValues['sendLC'][locale.languageCode]; String get endLC => localizedValues['endLC'][locale.languageCode]; - String get consultation => localizedValues['consultation'][locale.languageCode]; + String get consultation => + localizedValues['consultation'][locale.languageCode]; String get resume => localizedValues['resume'][locale.languageCode]; String get theCall => localizedValues['theCall'][locale.languageCode]; - String get createNewMedicalReport => localizedValues['createNewMedicalReport'][locale.languageCode]; - String get historyPhysicalFinding => localizedValues['historyPhysicalFinding'][locale.languageCode]; - String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData'][locale.languageCode]; - String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode]; + String get createNewMedicalReport => + localizedValues['createNewMedicalReport'][locale.languageCode]; + String get historyPhysicalFinding => + localizedValues['historyPhysicalFinding'][locale.languageCode]; + String get laboratoryPhysicalData => + localizedValues['laboratoryPhysicalData'][locale.languageCode]; + 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 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]; - String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; - String get addPrescription => localizedValues['addPrescription'][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]; - String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; - String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; + String get summeryReply => + localizedValues['summeryReply'][locale.languageCode]; + String get severityValidationError => + localizedValues['severityValidationError'][locale.languageCode]; + String get textCopiedSuccessfully => + localizedValues['textCopiedSuccessfully'][locale.languageCode]; String get roomNo => localizedValues['roomNo'][locale.languageCode]; String get seeMore => localizedValues['seeMore'][locale.languageCode]; - String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; - String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; - String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; - String get underProcess => localizedValues['underProcess'][locale.languageCode]; - String get textResponse => localizedValues['textResponse'][locale.languageCode]; + String get replayCallStatus => + localizedValues['replayCallStatus'][locale.languageCode]; + String get patientArrived => + localizedValues['patientArrived'][locale.languageCode]; + String get calledAndNoResponse => + localizedValues['calledAndNoResponse'][locale.languageCode]; + String get underProcess => + localizedValues['underProcess'][locale.languageCode]; + String get textResponse => + localizedValues['textResponse'][locale.languageCode]; String get special => localizedValues['special'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode]; String get allClinic => localizedValues['allClinic'][locale.languageCode]; String get notReplied => localizedValues['notReplied'][locale.languageCode]; - String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; - String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; - String get operationTimeStart => localizedValues['operationTimeStart'][locale.languageCode]; - String get operationDate => localizedValues['operationDate'][locale.languageCode]; - String get reservation => localizedValues['reservation'][locale.languageCode]; - String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; - String get bloodTransfusedDetail => localizedValues['bloodTransfusedDetail'][locale.languageCode]; - String get circulatingNurse => localizedValues['circulatingNurse'][locale.languageCode]; - String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; - String get otherSpecimen => localizedValues['otherSpecimen'][locale.languageCode]; - String get microbiologySpecimen => localizedValues['microbiologySpecimen'][locale.languageCode]; - String get histopathSpecimen => localizedValues['histopathSpecimen'][locale.languageCode]; - String get bloodLossDetail => localizedValues['bloodLossDetail'][locale.languageCode]; - String get complicationDetails1 => localizedValues['complicationDetails1'][locale.languageCode]; - String get postOperationInstruction => localizedValues['postOperationInstruction'][locale.languageCode]; - String get surgeryProcedure => localizedValues['surgeryProcedure'][locale.languageCode]; - String get finding => localizedValues['finding'][locale.languageCode]; - String get preOperationDiagnosis => localizedValues['preOperationDiagnosis'][locale.languageCode]; - String get postOperationDiagnosis => localizedValues['postOperationDiagnosis'][locale.languageCode]; - String get surgeon => localizedValues['surgeon'][locale.languageCode]; - String get assistant => localizedValues['assistant'][locale.languageCode]; + String get registerNewPatient => + localizedValues['registerNewPatient'][locale.languageCode]; + String get registeraPatient => + localizedValues['registeraPatient'][locale.languageCode]; + String get operationTimeStart => + localizedValues['operationTimeStart'][locale.languageCode]; + String get operationDate => + localizedValues['operationDate'][locale.languageCode]; + String get reservation => localizedValues['reservation'][locale.languageCode]; + String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; + String get bloodTransfusedDetail => + localizedValues['bloodTransfusedDetail'][locale.languageCode]; + String get circulatingNurse => + localizedValues['circulatingNurse'][locale.languageCode]; + String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; + String get otherSpecimen => + localizedValues['otherSpecimen'][locale.languageCode]; + String get microbiologySpecimen => + localizedValues['microbiologySpecimen'][locale.languageCode]; + String get histopathSpecimen => + localizedValues['histopathSpecimen'][locale.languageCode]; + String get bloodLossDetail => + localizedValues['bloodLossDetail'][locale.languageCode]; + String get complicationDetails1 => + localizedValues['complicationDetails1'][locale.languageCode]; + String get postOperationInstruction => + localizedValues['postOperationInstruction'][locale.languageCode]; + String get surgeryProcedure => + localizedValues['surgeryProcedure'][locale.languageCode]; + String get finding => localizedValues['finding'][locale.languageCode]; + String get preOperationDiagnosis => + localizedValues['preOperationDiagnosis'][locale.languageCode]; + String get postOperationDiagnosis => + localizedValues['postOperationDiagnosis'][locale.languageCode]; + String get surgeon => localizedValues['surgeon'][locale.languageCode]; + String get assistant => localizedValues['assistant'][locale.languageCode]; + String get diabetic => localizedValues['diabetic'][locale.languageCode]; + String get chart => localizedValues['chart'][locale.languageCode]; + String get investigation => + localizedValues['investigation'][locale.languageCode]; + String get conditionOnDischarge => + localizedValues['conditionOnDischarge'][locale.languageCode]; + String get planedProcedure => + localizedValues['planedProcedure'][locale.languageCode]; + String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From e2cde9a39ff40ef0057f27968dc5e930908a3e9f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Nov 2021 17:13:29 +0200 Subject: [PATCH 150/199] translation and ui fixes --- lib/config/localized_values.dart | 616 ++++++++++--- lib/util/translations_delegate_base.dart | 1034 ++++++++++++++-------- 2 files changed, 1177 insertions(+), 473 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 95ff6e69..189eb976 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,7 +1,10 @@ const Map> localizedValues = { "dashboardScreenToolbarTitle": {"ar": "الرئيسة", "en": "Home"}, "settings": {"en": "Settings", "ar": "الاعدادات"}, - "areYouSureYouWantTo": {"en": "Are you sure you want to", "ar": "هل انت متاكد من انك تريد أن"}, + "areYouSureYouWantTo": { + "en": "Are you sure you want to", + "ar": "هل انت متاكد من انك تريد أن" + }, "language": {"en": "App Language", "ar": "لغة التطبيق"}, "lanEnglish": {"en": "English", "ar": "English"}, "lanArabic": {"en": "العربية", "ar": "العربية"}, @@ -12,18 +15,27 @@ const Map> localizedValues = { "mobileNo": {"en": "Mobile No", "ar": "رقم الجوال"}, "messagesScreenToolbarTitle": {"en": "Messages", "ar": "الرسائل"}, "mySchedule": {"en": "Schedule", "ar": "جدولي"}, - "errorNoSchedule": {"en": "You don't have any Schedule", "ar": "ليس لديك أي جدول"}, + "errorNoSchedule": { + "en": "You don't have any Schedule", + "ar": "ليس لديك أي جدول" + }, "verify": {"en": "VERIFY", "ar": "تحقق"}, "referralDoctor": {"en": "Referral Doctor", "ar": "الطبيب المُحول إليه"}, "referringClinic": {"en": "Referring Clinic", "ar": "العيادة المُحول إليها"}, "frequency": {"en": "Frequency", "ar": "تكرر"}, "priority": {"en": "Priority", "ar": "الأولوية"}, "maxResponseTime": {"en": "Max Response Time", "ar": "الوقت الأقصى للرد"}, - "clinicDetailsandRemarks": {"en": "Clinic Details and Remarks", "ar": "ملاحضات وتفاصيل العيادة"}, + "clinicDetailsandRemarks": { + "en": "Clinic Details and Remarks", + "ar": "ملاحضات وتفاصيل العيادة" + }, "answerSuggestions": {"en": "Answer/Suggestions", "ar": "الرد / الاقتراحات"}, "outPatients": {"en": "Out Patient", "ar": "العيادات الخارجية"}, "myOutPatient": {"en": "My OutPatients", "ar": "مرضى العيادات الخارجية"}, - "myOutPatient_2lines": {"en": "My\nOutPatients", "ar": "مريض\nالعيادات الخارجية"}, + "myOutPatient_2lines": { + "en": "My\nOutPatients", + "ar": "مريض\nالعيادات الخارجية" + }, "searchPatient": {"en": "Search Patients", "ar": "البحث عن مريض"}, "searchPatientDashBoard": {"en": "Search\nPatients", "ar": "البحث\nعن مريض"}, "searchAbout": {"en": "Search", "ar": "البحث عن"}, @@ -47,7 +59,10 @@ const Map> localizedValues = { "inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, "operations": {"en": "Operations", "ar": "عمليات"}, "patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"}, - "searchMedicineDashboard": {"en": "Search\nMedicines", "ar": "بحث\nعن الدواء"}, + "searchMedicineDashboard": { + "en": "Search\nMedicines", + "ar": "بحث\nعن الدواء" + }, "searchMedicine": {"en": "Search Medicines", "ar": "بحث عن الدواء"}, "myReferralPatient": {"en": "My Referral Patient", "ar": "مرضى الاحالة"}, "referPatient": {"en": "Referral Patient", "ar": "إحالة مريض"}, @@ -63,14 +78,20 @@ const Map> localizedValues = { "patientFile": {"en": "Patient File", "ar": "ملف المريض"}, "familyMedicine": {"en": "Family Medicine Clinic", "ar": "عيادة طب الأسرة"}, "search": {"en": "Search", "ar": "بحث "}, - "onlyArrivedPatient": {"en": "Only Arrived Patient", "ar": "المريض الذي حضر للموعد"}, + "onlyArrivedPatient": { + "en": "Only Arrived Patient", + "ar": "المريض الذي حضر للموعد" + }, "searchMedicineNameHere": {"en": "Search Medicine ", "ar": "ابحث هنا"}, "youCanFind": {"en": "You Can Find ", "ar": "تستطيع ان تجد "}, "itemsInSearch": {"en": "items in search", "ar": "عناصر في البحث"}, "qr": {"en": "QR", "ar": "QR"}, "reader": {"en": "Reader", "ar": "قارىء رمز ال"}, "startScanning": {"en": "Start Scanning", "ar": "بدء المسح"}, - "scanQrCode": {"en": "scan Qr code to retrieve patient profile", "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض"}, + "scanQrCode": { + "en": "scan Qr code to retrieve patient profile", + "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض" + }, "scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"}, "profile": {"en": "Profile", "ar": "ملفي الشخصي"}, "gender": {"en": "Gender", "ar": "الجنس"}, @@ -95,9 +116,15 @@ const Map> localizedValues = { "bloodPressure": {"en": "Blood Pressure", "ar": "ضغط الدم"}, "oxygenation": {"en": "Oxygenation", "ar": "الأوكسجين"}, "painScale": {"en": "Pain Scale", "ar": "مقياس الألم"}, - "errorNoVitalSign": {"en": "You don't have any Vital Sign", "ar": "ليس لديك اي مؤشرات حيوية"}, + "errorNoVitalSign": { + "en": "You don't have any Vital Sign", + "ar": "ليس لديك اي مؤشرات حيوية" + }, "labOrders": {"en": "Lab Orders", "ar": "طلبات المختبر"}, - "errorNoLabOrders": {"en": "You don\"t have any lab orders", "ar": "ليس لديك اي طلبات للمختبر"}, + "errorNoLabOrders": { + "en": "You don\"t have any lab orders", + "ar": "ليس لديك اي طلبات للمختبر" + }, "answerThePatient": {"en": "answer the patient", "ar": "الرد على المريض "}, "pleaseEnterAnswer": {"en": "please enter answer", "ar": "الرجاء ادخال الرد"}, "replay": {"en": "Reply", "ar": "تاكيد"}, @@ -105,18 +132,30 @@ const Map> localizedValues = { "progress": {"en": "Progress", "ar": "التقدم"}, "note": {"en": "Note", "ar": "ملاحظة"}, "searchNote": {"en": "Search Note", "ar": "بحث عن ملاحظة"}, - "errorNoProgressNote": {"en": "You don\"t have any Progress Note", "ar": "ليس لديك اي ملاحظة تقدم"}, + "errorNoProgressNote": { + "en": "You don\"t have any Progress Note", + "ar": "ليس لديك اي ملاحظة تقدم" + }, "invoiceNo:": {"en": "Invoice No :", "ar": "رقم الفاتورة"}, "generalResult": {"en": "General Result ", "ar": "النتيجة العامة"}, "description": {"en": "Description", "ar": "الوصف"}, "value": {"en": "Value", "ar": "القيمة"}, "range": {"en": "Range", "ar": "النطاق"}, "enterId": {"en": "User ID", "ar": "معرف المستخدم"}, - "pleaseEnterYourID": {"en": "Please enter your ID", "ar": "الرجاء ادخال الهوية"}, + "pleaseEnterYourID": { + "en": "Please enter your ID", + "ar": "الرجاء ادخال الهوية" + }, "enterPassword": {"en": "Password", "ar": "كلمه السر"}, - "pleaseEnterPassword": {"en": "Please Enter Password", "ar": "الرجاء ادخال الرقم السري"}, + "pleaseEnterPassword": { + "en": "Please Enter Password", + "ar": "الرجاء ادخال الرقم السري" + }, "selectYourProject": {"en": "Branch", "ar": "فرع"}, - "pleaseEnterYourProject": {"en": "Please Enter Your Project", "ar": "الرجاء ادخال مستشفى"}, + "pleaseEnterYourProject": { + "en": "Please Enter Your Project", + "ar": "الرجاء ادخال مستشفى" + }, "login": {"en": "Login", "ar": "تسجيل دخول"}, "drSulaimanAlHabib": {"en": "Dr Sulaiman Al Habib", "ar": "د.سليمان الحبيب"}, "welcomeTo": {"en": "Welcome to", "ar": "مرحبا بك"}, @@ -143,7 +182,10 @@ const Map> localizedValues = { "youWillReceiveA": {"en": "You will receive a", "ar": "سوف تتلقى "}, "loginCode": {"en": "Login Code", "ar": "رمز تسجيل دخول"}, "smsBy": {"en": "By SMS", "ar": "عن طريق رسالة قصيرة"}, - "pleaseEnterTheCode": {"en": "Please enter the code", "ar": "الرجاء ادخال الرمز"}, + "pleaseEnterTheCode": { + "en": "Please enter the code", + "ar": "الرجاء ادخال الرمز" + }, "youDontHaveAnyPatient": { "en": "No data found for the selected search criteria", "ar": "لا توجد بيانات لمعايير البحث المختارة" @@ -155,8 +197,14 @@ const Map> localizedValues = { "tomorrow": {"en": "Tomorrow", "ar": "الغد"}, "nextWeek": {"en": "Next Week", "ar": "الاسبوع القادم"}, "all": {"en": "All", "ar": "الجميع"}, - "errorNoInsuranceApprovals": {"en": "You don\"t have any Insurance Approvals", "ar": "ليس لديك اي موفقات تأمين"}, - "searchInsuranceApprovals": {"en": "Search InsuranceApprovals", "ar": "بحث عن موافقات التأمين"}, + "errorNoInsuranceApprovals": { + "en": "You don\"t have any Insurance Approvals", + "ar": "ليس لديك اي موفقات تأمين" + }, + "searchInsuranceApprovals": { + "en": "Search InsuranceApprovals", + "ar": "بحث عن موافقات التأمين" + }, "status": {"en": "STATUS", "ar": "الحالة"}, "expiryDate": {"en": "EXPIRY DATE", "ar": "تاريخ الانتهاء"}, "producerName": {"en": "PRODUCER NAME", "ar": "اسم المنتج"}, @@ -169,10 +217,19 @@ const Map> localizedValues = { "routine": {"en": "Routine", "ar": "روتيني"}, "send": {"en": "Send", "ar": "ارسال"}, "referralFrequency": {"en": "Referral Frequency:", "ar": "تواتر الحالة:"}, - "selectReferralFrequency": {"en": "Select Referral Frequency:", "ar": "اختار تواتر الحالة:"}, - "clinicalDetailsAndRemarks": {"en": "Clinical Details and Remarks", "ar": "التفاصيل السرسرية والملاحظات"}, + "selectReferralFrequency": { + "en": "Select Referral Frequency:", + "ar": "اختار تواتر الحالة:" + }, + "clinicalDetailsAndRemarks": { + "en": "Clinical Details and Remarks", + "ar": "التفاصيل السرسرية والملاحظات" + }, "remarks": {"en": "Remarks", "ar": "ملاحظات"}, - "pleaseFill": {"en": "Please fill all fields..!", "ar": "الرجاء ملأ جميع الحقول..!"}, + "pleaseFill": { + "en": "Please fill all fields..!", + "ar": "الرجاء ملأ جميع الحقول..!" + }, "replay2": {"en": "Reply", "ar": "رد الطبيب"}, "logout": {"en": "Logout", "ar": "تسجيل خروج"}, "pharmaciesList": {"en": "Pharmacies List", "ar": "قائمة الصيدليات"}, @@ -184,7 +241,10 @@ const Map> localizedValues = { "searchOrders": {"en": "Search Orders", "ar": " بحث عن الطلبات"}, "prescriptionDetails": {"en": "Prescription Details", "ar": "تفاصبل الوصفة"}, "prescriptionInfo": {"en": "Prescription Info", "ar": "معلومات الوصفة"}, - "errorNoOrders": {"en": "You don\"t have any Orders", "ar": "لا يوجد لديك اي طلبات"}, + "errorNoOrders": { + "en": "You don\"t have any Orders", + "ar": "لا يوجد لديك اي طلبات" + }, "livecare": {"en": "Live Care", "ar": "Live Care"}, "beingBad": {"en": "being bad", "ar": "سيء"}, "beingGreat": {"en": "being great", "ar": "رائع"}, @@ -195,14 +255,26 @@ const Map> localizedValues = { "endcallwithcharge": {"en": "End with charge", "ar": "انهاء مع خصم المبلغ"}, "endcall": {"en": "End Call", "ar": "إنهاء المكالمة"}, "transfertoadmin": {"en": "Transfer to admin", "ar": "تحويل للمشرف"}, - "searchMedicineImageCaption": {"en": "Type the medicine name to search", "ar": " اكتب اسم الدواء للبحث"}, + "searchMedicineImageCaption": { + "en": "Type the medicine name to search", + "ar": " اكتب اسم الدواء للبحث" + }, "type": {"en": "Type", "ar": "اكتب"}, "fromDate": {"en": "From Date", "ar": "من تاريخ"}, "toDate": {"en": "To Date", "ar": "الى تاريخ"}, - "searchPatientImageCaptionTitle": {"en": "SEARCH PATIENT", "ar": "البحث عن المريض"}, - "searchPatientImageCaptionBody": {"en": "Add Details Of Patient To search", "ar": " أضف تفاصيل المريض للبحث"}, + "searchPatientImageCaptionTitle": { + "en": "SEARCH PATIENT", + "ar": "البحث عن المريض" + }, + "searchPatientImageCaptionBody": { + "en": "Add Details Of Patient To search", + "ar": " أضف تفاصيل المريض للبحث" + }, "welcome": {"en": "Welcome", "ar": "أهلا بك"}, - "youDoNotHaveAnyItem": {"en": "You don\"t have any Items", "ar": "لا يوجد اي نتائج"}, + "youDoNotHaveAnyItem": { + "en": "You don\"t have any Items", + "ar": "لا يوجد اي نتائج" + }, "typeMedicineName": {"en": "Type Medicine Name", "ar": "اكتب اسم الدواء"}, "moreThan3Letter": { "en": "Medicine Name Should Be More Than 3 letter", @@ -229,14 +301,20 @@ const Map> localizedValues = { "bed": {"en": "BED:", "ar": "السرير"}, "next": {"en": "Next", "ar": "التالي"}, "previous": {"en": "Previous", "ar": "السابق"}, - "healthRecordInformation": {"en": "HEALTH RECORD INFORMATION", "ar": "معلومات السجل الصحي"}, + "healthRecordInformation": { + "en": "HEALTH RECORD INFORMATION", + "ar": "معلومات السجل الصحي" + }, "prevoius-sickleave-issed": { "en": "Total previous sick leave issued by the doctor", "ar": "مجموع الإجازات المرضية السابقة التي أصدرها الطبيب" }, "clinicSelect": {"en": "Select Clinic", "ar": "اختر عيادة"}, "doctorSelect": {"en": "Select Doctor", "ar": "اختر طبيب"}, - "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"}, + "empty-message": { + "en": "Please enter this field", + "ar": "يرجى ادخال هذا الحقل" + }, "no-sickleve-applied": { "en": "No sick leave available, apply Now", "ar": "لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن" @@ -251,13 +329,19 @@ const Map> localizedValues = { "leave-start-date": {"en": "Leave start date", "ar": "تاريخ بدء المغادرة"}, "days-sick-leave": {"en": "Leave Days: ", "ar": "أيام الإجازة "}, "extend": {"en": "Extend", "ar": "تمديد"}, - "extend-sickleave": {"en": "Extend Sick Leave", "ar": "قم بتمديد الإجازة المرضية"}, + "extend-sickleave": { + "en": "Extend Sick Leave", + "ar": "قم بتمديد الإجازة المرضية" + }, "chiefComplaintLength": { "en": "Chief Complaint length should be greater than 25", "ar": "يجب أن يكون طول شكوى الرئيسية أكبر من 25" }, "patient-target": {"en": "Target Patient", "ar": "المريض المستدف"}, - "no-priscription-listed": {"en": "No Prescription Listed", "ar": "لا يوجد وصفة طبية مدرجة"}, + "no-priscription-listed": { + "en": "No Prescription Listed", + "ar": "لا يوجد وصفة طبية مدرجة" + }, "referTo": {"en": "Refer To", "ar": "محال إلى"}, "referredFrom": {"en": "From : ", "ar": " : من"}, "branch": {"en": "Branch", "ar": "الفرع"}, @@ -272,9 +356,15 @@ const Map> localizedValues = { "summaryReport": {"en": "Summary", "ar": "ملخص"}, "accept": {"en": "ACCEPT", "ar": "قبول"}, "reject": {"en": "REJECT", "ar": "رفض"}, - "noAppointmentsErrorMsg": {"en": "There is no appointments for at this date", "ar": "لا توجد مواعيد في هذا التاريخ"}, + "noAppointmentsErrorMsg": { + "en": "There is no appointments for at this date", + "ar": "لا توجد مواعيد في هذا التاريخ" + }, "referralPatient": {"en": "Referral Patient", "ar": "المريض المحال "}, - "noPrescriptionListed": {"en": "NO PRESCRIPTION LISTED", "ar": "لأيوجد وصفة طبية"}, + "noPrescriptionListed": { + "en": "NO PRESCRIPTION LISTED", + "ar": "لأيوجد وصفة طبية" + }, "addNow": {"en": "ADD Now", "ar": "اضف الآن"}, "orderType": {"en": "Order Type", "ar": "نوع الطلب"}, "strength": {"en": "Strength", "ar": "شديد"}, @@ -284,8 +374,14 @@ const Map> localizedValues = { "instruction": {"en": "Instructions", "ar": "إرشادات"}, "addMedication": {"en": "Add Medication", "ar": "اضف دواء"}, "route": {"en": "Route", "ar": "طريقة الاستخدام"}, - "reschedule-leave": {"en": "Reschedule and leaves", "ar": "إعادة الجدولة والمغادرة"}, - "no-reschedule-leave": {"en": "No Reschedule and leaves", "ar": "لايوجد طلبات اعادة جدولة او مغادرة"}, + "reschedule-leave": { + "en": "Reschedule and leaves", + "ar": "إعادة الجدولة والمغادرة" + }, + "no-reschedule-leave": { + "en": "No Reschedule and leaves", + "ar": "لايوجد طلبات اعادة جدولة او مغادرة" + }, "weight": {"en": "Weight", "ar": "الوزن"}, "kg": {"en": "kg", "ar": "كغ"}, "height": {"en": "Height", "ar": "الطول"}, @@ -307,7 +403,10 @@ const Map> localizedValues = { "rhythm": {"en": "Rhythm", "ar": "الإيقاع"}, "respBeats": {"en": "RESP (beats/minute)", "ar": " (دقة/دقيقة)التنفس"}, "patternOfRespiration": {"en": "Pattern Of Respiration", "ar": "نمط التنفس"}, - "bloodPressureDiastoleAndSystole": {"en": "Blood Pressure (Sys, Dias)", "ar": "ضغط الدم (الانقباض, الإنبساط)"}, + "bloodPressureDiastoleAndSystole": { + "en": "Blood Pressure (Sys, Dias)", + "ar": "ضغط الدم (الانقباض, الإنبساط)" + }, "cuffLocation": {"en": "Cuff Location", "ar": "موقع الكف"}, "cuffSize": {"en": "Cuff Size", "ar": "حجم الكف"}, "patientPosition": {"en": "Patient Position", "ar": "موقع المريض"}, @@ -318,41 +417,80 @@ const Map> localizedValues = { "to": {"en": "To", "ar": "إلى"}, "coveringDoctor": {"en": "Covering Doctor: ", "ar": " :تغطية دكتور"}, "requestLeave": {"en": "Request Leave", "ar": "طلب إجازة"}, - "pleaseEnterDate": {"en": "Please enter leave start date", "ar": "الرجاء إدخال تاريخ بدء الإجازة"}, - "pleaseEnterNoOfDays": {"en": "Please enter sick leave days", "ar": "الرجاء إدخال أيام الإجازة المرضية"}, - "pleaseEnterRemarks": {"en": "Please enter remarks", "ar": "الرجاء إدخال الملاحظات"}, + "pleaseEnterDate": { + "en": "Please enter leave start date", + "ar": "الرجاء إدخال تاريخ بدء الإجازة" + }, + "pleaseEnterNoOfDays": { + "en": "Please enter sick leave days", + "ar": "الرجاء إدخال أيام الإجازة المرضية" + }, + "pleaseEnterRemarks": { + "en": "Please enter remarks", + "ar": "الرجاء إدخال الملاحظات" + }, "update": {"en": "Update", "ar": "تحديث"}, "admission": {"en": "Admission", "ar": "تنويم"}, "request": {"en": "Request", "ar": "طلب"}, "admissionRequest": {"en": "Admission Request", "ar": "طلب تنويم"}, "patientDetails": {"en": "Patient Details", "ar": "تفاصيل المريض"}, - "specialityAndDoctorDetail": {"en": "SPECIALITY AND DOCTOR DETAILS", "ar": "تفاصيل التخصص والطبيب"}, + "specialityAndDoctorDetail": { + "en": "SPECIALITY AND DOCTOR DETAILS", + "ar": "تفاصيل التخصص والطبيب" + }, "referringDate": {"en": "Referring Date", "ar": "تاريخ الإحالة"}, "referringDoctor": {"en": "Referring Doctor", "ar": "دكتور الإحالة"}, "otherInformation": {"en": "Other Information", "ar": "معلومات أخرى"}, "expectedDays": {"en": "Expected Days", "ar": "الأيام المتوقعة"}, - "expectedAdmissionDate": {"en": "Expected Admission Date", "ar": "تاريخ التنويم المتوقع"}, + "expectedAdmissionDate": { + "en": "Expected Admission Date", + "ar": "تاريخ التنويم المتوقع" + }, "admissionDate": {"en": "Admission Date", "ar": "تاريخ التنويم"}, - "isSickLeaveRequired": {"en": "Is Sick Leave Required", "ar": "هل الإجازة المرضية مطلوبة"}, + "isSickLeaveRequired": { + "en": "Is Sick Leave Required", + "ar": "هل الإجازة المرضية مطلوبة" + }, "patientPregnant": {"en": "Patient Pregnant", "ar": "المريض حامل"}, - "treatmentLine": {"en": "Main line of treatment", "ar": "الخط الرئيسي للعلاج"}, + "treatmentLine": { + "en": "Main line of treatment", + "ar": "الخط الرئيسي للعلاج" + }, "ward": {"en": "Ward", "ar": "جناح"}, - "preAnesthesiaReferred": {"en": "PRE ANESTHESIA REFERRED", "ar": "الاحالة قبل التخدير"}, + "preAnesthesiaReferred": { + "en": "PRE ANESTHESIA REFERRED", + "ar": "الاحالة قبل التخدير" + }, "admissionType": {"en": "Admission Type", "ar": "نوع التنويم"}, "diagnosis": {"en": "Diagnosis", "ar": "التشخيص"}, "allergies": {"en": "Allergies", "ar": "الحساسية"}, - "preOperativeOrders": {"en": "Pre Operative Orders", "ar": "أوامر ما قبل العملية"}, - "elementForImprovement": {"en": "Element For Improvement", "ar": "عنصر للتحسين"}, + "preOperativeOrders": { + "en": "Pre Operative Orders", + "ar": "أوامر ما قبل العملية" + }, + "elementForImprovement": { + "en": "Element For Improvement", + "ar": "عنصر للتحسين" + }, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ الخروج"}, "dietType": {"en": "Diet Type", "ar": "نوع النظام الغذائي"}, - "dietTypeRemarks": {"en": "Remarks on diet type", "ar": "ملاحظات على نوع النظام الغذائي"}, + "dietTypeRemarks": { + "en": "Remarks on diet type", + "ar": "ملاحظات على نوع النظام الغذائي" + }, "save": {"en": "SAVE", "ar": "حفظ"}, - "postPlansEstimatedCost": {"en": "POST PLANS & ESTIMATED COST", "ar": "خطط ما بعد العملية والتكلفة المقدرة"}, + "postPlansEstimatedCost": { + "en": "POST PLANS & ESTIMATED COST", + "ar": "خطط ما بعد العملية والتكلفة المقدرة" + }, "postPlans": {"en": "POST PLANS", "ar": "ما بعد العملية"}, "ucaf": {"en": "UCAF", "ar": "UCAF"}, "emergencyCase": {"en": "Emergency Case", "ar": "حالة طارئة"}, "durationOfIllness": {"en": "duration Of Illness", "ar": "مدة المرض"}, - "chiefComplaintsAndSymptoms": {"en": "CHIEF COMPLAINTS", "ar": "الشكوى الرئيسية"}, + "chiefComplaintsAndSymptoms": { + "en": "CHIEF COMPLAINTS", + "ar": "الشكوى الرئيسية" + }, "patientFeelsPainInHisBackAndCough": { "en": "Patient Feels pain in his back and cough", "ar": "يشعر المريض بألم في ظهره ويسعل" @@ -366,7 +504,10 @@ const Map> localizedValues = { "how": {"en": "How", "ar": "كيف"}, "when": {"en": "When", "ar": "متى"}, "where": {"en": "Where", "ar": "أين"}, - "specifyPossibleLineManagement": {"en": "Specify possible line of management", "ar": "حدد خط الإدارة المحتمل"}, + "specifyPossibleLineManagement": { + "en": "Specify possible line of management", + "ar": "حدد خط الإدارة المحتمل" + }, "significantSigns": {"en": "SIGNIFICANT SIGNS", "ar": "علامات مهمة"}, "backAbdomen": {"en": "Back : Abdomen", "ar": "الظهر: البطن"}, "reasons": {"en": "Reasons", "ar": "الأسباب"}, @@ -376,11 +517,20 @@ const Map> localizedValues = { "addChiefComplaints": {"en": "Add Chief Complaints", "ar": " اضافه الشكاوى"}, "histories": {"en": "Histories", "ar": "التاريخ المرضي"}, "allergiesSoap": {"en": "Allergies", "ar": "الحساسية"}, - "historyOfPresentIllness": {"en": "History of Present Illness", "ar": "تاريخ المرض الحالي"}, - "requiredMsg": {"en": "Please add required field correctly", "ar": "الرجاء إضافة الحقل المطلوب بشكل صحيح"}, + "historyOfPresentIllness": { + "en": "History of Present Illness", + "ar": "تاريخ المرض الحالي" + }, + "requiredMsg": { + "en": "Please add required field correctly", + "ar": "الرجاء إضافة الحقل المطلوب بشكل صحيح" + }, "addHistory": {"en": "Add History", "ar": "اضافه تاريخ مرضي"}, "searchHistory": {"en": "Search History", "ar": " البحث"}, - "addSelectedHistories": {"en": "Add Selected Histories", "ar": " اضافه تاريخ مرضي"}, + "addSelectedHistories": { + "en": "Add Selected Histories", + "ar": " اضافه تاريخ مرضي" + }, "addAllergies": {"en": "Add Allergies", "ar": "أضف الحساسية"}, "itemExist": {"en": "This item already exist", "ar": "هذا العنصر موجود"}, "selectAllergy": {"en": "Select Allergy", "ar": "أختر الحساسية"}, @@ -388,9 +538,18 @@ const Map> localizedValues = { "leaveCreated": {"en": "Leave has been created", "ar": "تم إنشاء الإجازة"}, "medications": {"en": "Medications", "ar": "الأدوية"}, "procedures": {"en": "Procedures", "ar": "الإجراءات"}, - "vitalSignEmptyMsg": {"en": "There is no vital signs for this patient", "ar": "لا توجد علامات حيوية لهذا المريض"}, - "referralEmptyMsg": {"en": "There is no referral data", "ar": "لا توجد بيانات إحالة"}, - "referralSuccessMsg": {"en": "You make referral successfully", "ar": "تمت الاحالة بنجاح"}, + "vitalSignEmptyMsg": { + "en": "There is no vital signs for this patient", + "ar": "لا توجد علامات حيوية لهذا المريض" + }, + "referralEmptyMsg": { + "en": "There is no referral data", + "ar": "لا توجد بيانات إحالة" + }, + "referralSuccessMsg": { + "en": "You make referral successfully", + "ar": "تمت الاحالة بنجاح" + }, "fromTime": {"en": "From Time", "ar": "من وقت"}, "toTime": {"en": "To Time", "ar": "الى وقت"}, "diagnoseType": {"en": "Diagnose Type", "ar": "نوع التشخيص"}, @@ -401,9 +560,18 @@ const Map> localizedValues = { "codeNo": {"en": "Code #", "ar": "# الرمز"}, "covered": {"en": "Covered", "ar": "مغطى"}, "approvalRequired": {"en": "Approval Required", "ar": "الموافقة مطلوبة"}, - "uncoveredByDoctor": {"en": "Uncovered By Doctor", "ar": "غير مغطى من قبل الدكتور"}, - "chiefComplaintEmptyMsg": {"en": "There is no Chief Complaint", "ar": "ليس هناك شكوى رئيسية"}, - "more-verify": {"en": "More Verification Options", "ar": "المزيد من خيارات التحقق"}, + "uncoveredByDoctor": { + "en": "Uncovered By Doctor", + "ar": "غير مغطى من قبل الدكتور" + }, + "chiefComplaintEmptyMsg": { + "en": "There is no Chief Complaint", + "ar": "ليس هناك شكوى رئيسية" + }, + "more-verify": { + "en": "More Verification Options", + "ar": "المزيد من خيارات التحقق" + }, "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بك!"}, "account-info": { "en": "Would you like to login with current username?", @@ -420,24 +588,37 @@ const Map> localizedValues = { "verify-with-sms": {"en": " SMS", "ar": "الرسائل القصيرة"}, "verify-with-whatsapp": {"en": "WhatsApp", "ar": " الواتس اب"}, "verify-with": {"en": "Verify through ", "ar": " الواتس اب"}, - "last-login": {"en": "Last login details:", "ar": "تفاصيل تسجيل الدخول الأخير:"}, + "last-login": { + "en": "Last login details:", + "ar": "تفاصيل تسجيل الدخول الأخير:" + }, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { - "en": "To activate the fingerprint login service, please verify data by using one of the following options.", + "en": + "To activate the fingerprint login service, please verify data by using one of the following options.", "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية" }, "verification_message": { "en": "Please enter the Verification Code sent to", "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" }, - "validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"}, + "validation_message": { + "en": "The verification code expires in", + "ar": "تنتهي صلاحية رمز التحقق خلال" + }, "addAssessment": {"en": "Add Assessment", "ar": "أضف التقييم"}, "assessment": {"en": "Assessment", "ar": " التقييم"}, - "physicalSystemExamination": {"en": "Physical System / Examination", "ar": "الفحص البدني / النظام"}, + "physicalSystemExamination": { + "en": "Physical System / Examination", + "ar": "الفحص البدني / النظام" + }, "searchExamination": {"en": "Search Examination", "ar": "بحث عن فحص"}, "addExamination": {"en": "Add Examination", "ar": "اضافة فحص"}, "doc": {"en": "Doc : ", "ar": " د : "}, - "patientNoDetailErrMsg": {"en": "There is no detail for this patient", "ar": "لا توجد تفاصيل لهذا المريض"}, + "patientNoDetailErrMsg": { + "en": "There is no detail for this patient", + "ar": "لا توجد تفاصيل لهذا المريض" + }, "allergicTO": {"en": "ALLERGIC TO ", "ar": "حساس من"}, "normal": {"en": "Normal", "ar": "عادي"}, "abnormal": {"en": "Abnormal", "ar": " غير عادي"}, @@ -456,25 +637,46 @@ const Map> localizedValues = { "visitDate": {"en": "Visit Date", "ar": "تاريخ الزيارة"}, "test": {"en": "Procedures/Test", "ar": "اجراءات/تحاليل"}, "regular": {"en": "Regular", "ar": "اعتيادي"}, - "addMoreProcedure": {"en": "Add More Procedures", "ar": "اضف المزيد من اجراءات"}, + "addMoreProcedure": { + "en": "Add More Procedures", + "ar": "اضف المزيد من اجراءات" + }, "searchProcedures": {"en": "Search Procedures", "ar": "البحث في اجراءات"}, "selectProcedures": {"en": "Select procedure", "ar": "اختر الاجراء"}, - "procedureCategorise": {"en": "Select Procedure Category", "ar": "اختر نوع الاجراء "}, - "addSelectedProcedures": {"en": "add Selected Procedures", "ar": "اضافة الاجراءات المختارة "}, + "procedureCategorise": { + "en": "Select Procedure Category", + "ar": "اختر نوع الاجراء " + }, + "addSelectedProcedures": { + "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": "Name or ICD"}, "dType": {"en": "Type", "ar": "النوع"}, - "addAssessmentDetails": {"en": "Add Assessment Details", "ar": "أضف تفاصيل التقييم"}, + "addAssessmentDetails": { + "en": "Add Assessment Details", + "ar": "أضف تفاصيل التقييم" + }, "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, "editedBy": {"en": "Edited By :", "ar": "عدلت من : "}, "currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"}, - "noItem": {"en": "No items exists in this list", "ar": "لا توجد عناصر في هذه القائمة"}, - "postUcafSuccessMsg": {"en": "UCAF request send successfully", "ar": "تم ارسال طلب UCAF بنجاح"}, - "vitalSignDetailEmpty": {"en": "There is no data for this vital sign", "ar": "لا توجد بيانات لهذه العلامة الحيوية"}, + "noItem": { + "en": "No items exists in this list", + "ar": "لا توجد عناصر في هذه القائمة" + }, + "postUcafSuccessMsg": { + "en": "UCAF request send successfully", + "ar": "تم ارسال طلب UCAF بنجاح" + }, + "vitalSignDetailEmpty": { + "en": "There is no data for this vital sign", + "ar": "لا توجد بيانات لهذه العلامة الحيوية" + }, "onlyOfftimeHoliday": { "en": "You can only apply holiday or offtime from mobile app", "ar": "يمكنك تقديم عطلة أو إجازة فقط" @@ -490,7 +692,10 @@ const Map> localizedValues = { "en": "You have to add at least one examination.", "ar": "يجب عليك إضافة فحص واحد على الأقل." }, - "progressNoteErrorMsg": {"en": "You have to add progress Note.", "ar": "يجب عليك إضافة ملاحظة التقدم."}, + "progressNoteErrorMsg": { + "en": "You have to add progress Note.", + "ar": "يجب عليك إضافة ملاحظة التقدم." + }, "chiefComplaintErrorMsg": { "en": "You have to add chief complaint fields correctly .", "ar": "يجب عليك إضافة الشكوى الرئيسية بشكل صحيح" @@ -514,20 +719,41 @@ const Map> localizedValues = { "referralStatusNotSeen": {"en": "NotSeen", "ar": "لم يحضر"}, "clinicSearch": {"en": "Search Clinic", "ar": "بحث عن عيادة"}, "doctorSearch": {"en": "Search Doctor", "ar": "بحث عن طبيب"}, - "referralResponse": {"en": "Referral Response : ", "ar": " : استجابة الإحالة"}, + "referralResponse": { + "en": "Referral Response : ", + "ar": " : استجابة الإحالة" + }, "estimatedCost": {"en": "Estimated Cost", "ar": "التكلفة المتوقعة"}, "diagnosisDetail": {"en": "Diagnosis Details", "ar": "تفاصيل التشخيص"}, - "referralSuccessMsgAccept": {"en": "Referral Accepted Successfully", "ar": "تم قبول الإحالة بنجاح"}, - "referralSuccessMsgReject": {"en": "Referral Rejected Successfully", "ar": "تم رفض الإحالة بنجاح"}, - "sickLeaveComments": {"en": "Sick leave comments", "ar": "ملاحظات الإجازة المرضية"}, + "referralSuccessMsgAccept": { + "en": "Referral Accepted Successfully", + "ar": "تم قبول الإحالة بنجاح" + }, + "referralSuccessMsgReject": { + "en": "Referral Rejected Successfully", + "ar": "تم رفض الإحالة بنجاح" + }, + "sickLeaveComments": { + "en": "Sick leave comments", + "ar": "ملاحظات الإجازة المرضية" + }, "pastMedicalHistory": {"en": "Past medical history", "ar": "التاريخ الطبي"}, - "pastSurgicalHistory": {"en": "Past surgical history", "ar": "التاريخ الجراحي"}, + "pastSurgicalHistory": { + "en": "Past surgical history", + "ar": "التاريخ الجراحي" + }, "complications": {"en": "Complications", "ar": "المضاعفات"}, "floor": {"en": "Floor", "ar": "الطابق"}, "roomCategory": {"en": "Room category", "ar": "فئة الغرفة"}, - "otherDepartmentsInterventions": {"en": "Other departments interventions", "ar": "ملاحظات الأقسام الأخرى"}, + "otherDepartmentsInterventions": { + "en": "Other departments interventions", + "ar": "ملاحظات الأقسام الأخرى" + }, "otherProcedure": {"en": "Other procedure", "ar": "إجراء آخر"}, - "admissionRequestSuccessMsg": {"en": "Admission Request Created Successfully", "ar": "تم إنشاء طلب التنويم بنجاح"}, + "admissionRequestSuccessMsg": { + "en": "Admission Request Created Successfully", + "ar": "تم إنشاء طلب التنويم بنجاح" + }, "orderNo": {"en": "Order No : ", "ar": "رقم الطلب"}, "infoStatus": {"en": "Info Status", "ar": "حالة المعلومات"}, "doctorResponse": {"en": "Doctor Response", "ar": "استجابة الطبيب"}, @@ -540,7 +766,10 @@ const Map> localizedValues = { "ptientsreferral": {"en": "Patients Referrals", "ar": "إحالات المريض"}, "myPatientsReferral": {"en": "Patient's\nReferrals", "ar": "إحالات\nالمريض"}, "arrivalpatient": {"en": "Arrival Patients", "ar": "المرضى الواصلون"}, - "searchmedicinepatient": {"en": "Search patient or Medicines", "ar": "ابحث عن المريض أو الأدوية"}, + "searchmedicinepatient": { + "en": "Search patient or Medicines", + "ar": "ابحث عن المريض أو الأدوية" + }, "appointmentDate": {"en": "Appointment Date", "ar": "تاريخ الموعد"}, "arrived_p": {"en": "Arrived", "ar": "وصل"}, "details": {"en": "Details", "ar": "التفاصيل"}, @@ -548,16 +777,28 @@ const Map> localizedValues = { "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, - "sendSuc": {"en": "A copy has been sent to the email", "ar": "تم إرسال نسخة إلى البريد الإلكتروني"}, + "sendSuc": { + "en": "A copy has been sent to the email", + "ar": "تم إرسال نسخة إلى البريد الإلكتروني" + }, "SpecialResult": {"en": "Special Result", "ar": "نتيجة خاصة"}, - "noDataAvailable": {"en": "No data available", "ar": " لا يوجد بيانات متاحة "}, + "noDataAvailable": { + "en": "No data available", + "ar": " لا يوجد بيانات متاحة " + }, "show-more-btn": {"en": "Flowchart", "ar": "النتائج التراكمية"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, "fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "}, - "searchPatient-name": {"en": "Search Name, Medical File, Phone Number", "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف"}, + "searchPatient-name": { + "en": "Search Name, Medical File, Phone Number", + "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف" + }, "reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"}, "leaves": {"en": "Leaves", "ar": "يغادر"}, - "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, + "totalApproval": { + "en": "Total approval unused", + "ar": "اجمالي الموافقات الغير مستخدمة" + }, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, @@ -566,16 +807,31 @@ const Map> localizedValues = { "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, - "searchWithOther": {"en": "Search With Other Criteria", "ar": "المزيد من خيارات البحث"}, - "hideOtherCriteria": {"en": "Hide Other Criteria", "ar": "إخفاء الخيارات الأخرى"}, - "applyForReschedule": {"en": "Apply for leave or reschedule", "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة"}, + "searchWithOther": { + "en": "Search With Other Criteria", + "ar": "المزيد من خيارات البحث" + }, + "hideOtherCriteria": { + "en": "Hide Other Criteria", + "ar": "إخفاء الخيارات الأخرى" + }, + "applyForReschedule": { + "en": "Apply for leave or reschedule", + "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة" + }, "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"}, - "addSickLeaveRequest": {"en": "Add Sick Leave Request", "ar": "إضافة طلب إجازة مرضية"}, - "extendSickLeaveRequest": {"en": "Extend Sick Leave Request", "ar": "تمديد طلب الإجازة المرضية"}, + "addSickLeaveRequest": { + "en": "Add Sick Leave Request", + "ar": "إضافة طلب إجازة مرضية" + }, + "extendSickLeaveRequest": { + "en": "Extend Sick Leave Request", + "ar": "تمديد طلب الإجازة المرضية" + }, "accepted": {"en": "Accepted", "ar": "موافق"}, "cancelled": {"en": "Cancelled", "ar": "ألغي"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, @@ -585,10 +841,16 @@ const Map> localizedValues = { "remove": {"en": "Remove", "ar": "حذف"}, "changeOfSchedule": {"en": "Change of Schedule", "ar": "تغيير الجدول"}, "newSchedule": {"en": "New Schedule", "ar": "جدول جديد"}, - "enter_credentials": {"en": "Enter the user credentials below", "ar": "أدخل بيانات المستخدم أدناه"}, + "enter_credentials": { + "en": "Enter the user credentials below", + "ar": "أدخل بيانات المستخدم أدناه" + }, "step": {"en": "Step", "ar": "خطوة"}, "fieldRequired": {"en": "This field is required", "ar": "هذه الخانة مطلوبه"}, - "applyOrRescheduleLeave": {"en": "Apply Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة"}, + "applyOrRescheduleLeave": { + "en": "Apply Reschedule Leave", + "ar": "التقدم بطلب أو إعادة جدولة الإجازة" + }, "myQRCode": {"en": "My QR Code", "ar": " كود QR "}, "patientIDMobilenational": { "en": "Patient ID, National ID, Mobile Number", @@ -603,32 +865,68 @@ const Map> localizedValues = { "try-saying": {"en": "Try saying something", "ar": "حاول قول شيء ما"}, "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, - "didntCatch": {"en": "Didn't catch that. Try Speaking again", "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى"}, + "didntCatch": { + "en": "Didn't catch that. Try Speaking again", + "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" + }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, - "pleaseEnterProcedure": {"en": "Please Enter Procedure", "ar": "الرجاء إدخال الإجراء "}, - "fillTheMandatoryProcedureDetails": {"en": "Fill The Mandatory Procedure Details", "ar": "املأ تفاصيل الإجراء"}, - "atLeastThreeCharacters": {"en": "At least three Characters", "ar": "ثلاثة أحرف على الأقل "}, - "searchProcedureHere": {"en": "Search Procedure here...", "ar": "إجراء البحث هنا ... "}, - "noInsuranceApprovalFound": {"en": "No Insurance Approval Found", "ar": "لم يتم العثور على موافقة التأمين"}, + "pleaseEnterProcedure": { + "en": "Please Enter Procedure", + "ar": "الرجاء إدخال الإجراء " + }, + "fillTheMandatoryProcedureDetails": { + "en": "Fill The Mandatory Procedure Details", + "ar": "املأ تفاصيل الإجراء" + }, + "atLeastThreeCharacters": { + "en": "At least three Characters", + "ar": "ثلاثة أحرف على الأقل " + }, + "searchProcedureHere": { + "en": "Search Procedure here...", + "ar": "إجراء البحث هنا ... " + }, + "noInsuranceApprovalFound": { + "en": "No Insurance Approval Found", + "ar": "لم يتم العثور على موافقة التأمين" + }, "procedure": {"en": "Procedure", "ar": "اجراء"}, "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, "processed": {"en": "processed", "ar": "معالجتها"}, "direction": {"en": "Direction", "ar": "توجيه"}, "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, - "medicationHasBeenAdded": {"en": "Medication has been added", "ar": "تمت إضافة الدواء"}, - "newPrescriptionOrder": {"en": "New Prescription Order", "ar": "طلب وصفة طبية جديد "}, - "pleaseFillAllFields": {"en": "Please Fill All Fields", "ar": "الرجاء أملأ جميع الحقول"}, + "medicationHasBeenAdded": { + "en": "Medication has been added", + "ar": "تمت إضافة الدواء" + }, + "newPrescriptionOrder": { + "en": "New Prescription Order", + "ar": "طلب وصفة طبية جديد " + }, + "pleaseFillAllFields": { + "en": "Please Fill All Fields", + "ar": "الرجاء أملأ جميع الحقول" + }, "narcoticMedicineCanOnlyBePrescribedFromVida": { "en": "Narcotic medicine can only be prescribed from VIDA", "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " }, - "only5DigitsAllowedForStrength": {"en": "Only 5 Digits allowed for strength", "ar": "يسمح فقط بـ 5 أرقام للقوة"}, + "only5DigitsAllowedForStrength": { + "en": "Only 5 Digits allowed for strength", + "ar": "يسمح فقط بـ 5 أرقام للقوة" + }, "unit": {"en": "Unit", "ar": "وحدة"}, "boxQuantity": {"en": "Box Quantity", "ar": "كمية العبوة "}, "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, - "applyForRadiologyOrder": {"en": "Apply for Radiology Order", "ar": "التقدم بطلب للحصول على طلب الأشعة "}, - "applyForNewLabOrder": {"en": "Apply for New Lab Order", "ar": "تقدم بطلب جديد للمختبر الأشعة"}, + "applyForRadiologyOrder": { + "en": "Apply for Radiology Order", + "ar": "التقدم بطلب للحصول على طلب الأشعة " + }, + "applyForNewLabOrder": { + "en": "Apply for New Lab Order", + "ar": "تقدم بطلب جديد للمختبر الأشعة" + }, "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب مختبر"}, "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشعة"}, "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب أشعة جديد"}, @@ -640,14 +938,23 @@ const Map> localizedValues = { "en": "Apply for New Prescriptions Order", "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " }, - "noPrescriptionsFound": {"en": "No Prescriptions Found", "ar": "لم يتم العثور على وصفات طبية"}, - "noMedicalFileFound": {"en": "No Medical File Found", "ar": "لم يتم العثور على ملف طبي"}, + "noPrescriptionsFound": { + "en": "No Prescriptions Found", + "ar": "لم يتم العثور على وصفات طبية" + }, + "noMedicalFileFound": { + "en": "No Medical File Found", + "ar": "لم يتم العثور على ملف طبي" + }, "insurance22": {"en": "Insurance", "ar": "موافقات"}, "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف طلب جديد"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, + "addNewProgressNote": { + "en": "Add a New Progress Note", + "ar": "أضف ملاحظة جديدة" + }, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغي"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, @@ -666,7 +973,10 @@ const Map> localizedValues = { "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يتم الرد بعد"}, "clearText": {"en": "Clear Text", "ar": "نص واضح"}, "medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"}, - "medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"}, + "medicalReportVerify": { + "en": "Verify Medical Report", + "ar": "تحقق من التقرير الطبي" + }, "comments": {"en": "Comments", "ar": "ملاحظات"}, "initiateCall": {"en": "Initiate Call ", "ar": "بدء الاتصال"}, "transferTo": {"en": "Transfer To ", "ar": "حول إلى"}, @@ -677,10 +987,22 @@ const Map> localizedValues = { "consultation": {"en": "Consultation", "ar": "استشارة"}, "resume": {"en": "Resume", "ar": "استأنف"}, "theCall": {"en": "The Call", "ar": "الاتصال"}, - "createNewMedicalReport": {"en": "Create New Medical Report", "ar": "إنشاء تقرير طبي جديد"}, - "historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ"}, - "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المختبرات والبيانات الفيزيائية"}, - "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, + "createNewMedicalReport": { + "en": "Create New Medical Report", + "ar": "إنشاء تقرير طبي جديد" + }, + "historyPhysicalFinding": { + "en": "History and Physical Finding", + "ar": "التاريخ" + }, + "laboratoryPhysicalData": { + "en": "Laboratory and Physical Data", + "ar": "المختبرات والبيانات الفيزيائية" + }, + "impressionRecommendation": { + "en": "Impression and Recommendation", + "ar": "الانطباع والتوصية" + }, "onHold": {"en": "On Hold", "ar": "قيد الانتظار"}, "verified": {"en": "Verified", "ar": "تم التحقق"}, "endCall": {"en": "End Call", "ar": "انهاء"}, @@ -693,27 +1015,37 @@ const Map> localizedValues = { "edit": {"en": "Edit", "ar": "تعديل"}, "summeryReply": {"en": "Summary Reply", "ar": "ملخص الرد"}, "finish": {"en": "Finish", "ar": "انهاء"}, - "severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"}, + "severityValidationError": { + "en": "Please add allergy severity", + "ar": "الرجاء إضافة شدة الحساسية" + }, "inProgress": {"en": "inProgress", "ar": "تحت المعالجه"}, "Completed": {"en": "Completed", "ar": "مكتمل"}, "Locked": {"en": "Locked", "ar": "مقفل"}, - "textCopiedSuccessfully": {"en": "Text copied successfully", "ar": "تم نسخ النص بنجاح"}, + "textCopiedSuccessfully": { + "en": "Text copied successfully", + "ar": "تم نسخ النص بنجاح" + }, "roomNo": {"en": "Room No", "ar": "رقم الغرفة"}, "replayCallStatus": {"en": "Called", "ar": "تم الاتصال"}, "patientArrived": {"en": "Patient Arrived", "ar": "وصل المريض"}, - "calledAndNoResponse": {"en": "Called And No Response", "ar": "تم الاتصال ولا يوجد رد"}, + "calledAndNoResponse": { + "en": "Called And No Response", + "ar": "تم الاتصال ولا يوجد رد" + }, "underProcess": {"en": "Under Process", "ar": "تحت التجهيز"}, "textResponse": {"en": "Text Response", "ar": "استجابة النص"}, "notReplied": {"en": "Not Replied", "ar": "لم يتم يرد"}, - "requestType":{ - "en":"Request Type", - "ar":"نوع الطلب"}, + "requestType": {"en": "Request Type", "ar": "نوع الطلب"}, "special": {"en": "Special", "ar": "خاص"}, - "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , + "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"}, "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, "reports": {"en": "Reports", "ar": "تقارير "}, "operation": {"en": "Operation", "ar": " العملية"}, - "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, + "registerNewPatient": { + "en": "Register\nNew Patient", + "ar": "تسجيل\n مريض جديد" + }, "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, "occupation": {"en": "Occupation", "ar": "مهنة"}, "healthID": {"en": "Health ID", "ar": "معرف الصحة"}, @@ -722,26 +1054,50 @@ const Map> localizedValues = { "nursing": {"en": "Nursing", "ar": "تمريض"}, "diabetic": {"en": "Diabetic", "ar": "مرض السكري"}, "chart": {"en": "Chart", "ar": "جدول"}, - "operationTimeStart": {"en": "Operation Time Start :", "ar": "بدء وقت العملية:"}, + "operationTimeStart": { + "en": "Operation Time Start :", + "ar": "بدء وقت العملية:" + }, "operationDate": {"en": "operation Date :", "ar": "تاريخ العملية:"}, "reservation": {"en": "Reservation Number :", "ar": " رقم الحجز :"}, "anesthetist": {"en": "Anesthetist", "ar": "طبيب تخدير "}, - "bloodTransfusedDetail": {"en": "blood Transfused Detail", "ar": "تفاصيل نقل الدم "}, + "bloodTransfusedDetail": { + "en": "blood Transfused Detail", + "ar": "تفاصيل نقل الدم " + }, "circulatingNurse": {"en": "circulating Nurse", "ar": "ممرضة عمومية"}, "scrubNurse": {"en": "Scrub Nurse", "ar": "ممرضة تدليك"}, "otherSpecimen": {"en": "Other Specimen", "ar": "عينة أخرى"}, - "microbiologySpecimen": {"en": "Microbiology Specimen", "ar": "عينة علم الأحياء الدقيقة"}, + "microbiologySpecimen": { + "en": "Microbiology Specimen", + "ar": "عينة علم الأحياء الدقيقة" + }, "histopathSpecimen": {"en": "Histopath Specimen", "ar": "عينة الأنسجة"}, "bloodLossDetail": {"en": "Blood Loss Detail", "ar": "تفاصيل فقدان الدم"}, - "complicationDetails1": {"en": "Complication Details", "ar": "تفاصيل المضاعفات"}, - "postOperationInstruction": {"en": "Post Operation Instruction", "ar": "تعليمات ما بعد العملية"}, + "complicationDetails1": { + "en": "Complication Details", + "ar": "تفاصيل المضاعفات" + }, + "postOperationInstruction": { + "en": "Post Operation Instruction", + "ar": "تعليمات ما بعد العملية" + }, "surgeryProcedure": {"en": "Surgery Procedures", "ar": "إجراءات الجراحة"}, "finding": {"en": "Finding", "ar": "العثور على"}, - "preOperationDiagnosis": {"en": "Pre OperationOperation Diagnosis", "ar": "التشخيص قبل العملية"}, - "postOperationDiagnosis": {"en": "Post Operation Diagnosis", "ar": "تشخيص ما بعد العملية"}, + "preOperationDiagnosis": { + "en": "Pre OperationOperation Diagnosis", + "ar": "التشخيص قبل العملية" + }, + "postOperationDiagnosis": { + "en": "Post Operation Diagnosis", + "ar": "تشخيص ما بعد العملية" + }, "surgeon": {"en": "surgeon", "ar": "دكتور جراح"}, "assistant": {"en": "assistant", "ar": "مساعد"}, - "askForIdentification": {"en": "Please enter a mobile number or Identification number", "ar": "الرجاء إدخال رقم الهاتف المحمول أو رقم التعريف"}, + "askForIdentification": { + "en": "Please enter a mobile number or Identification number", + "ar": "الرجاء إدخال رقم الهاتف المحمول أو رقم التعريف" + }, "iDNumber": {"en": "ID Number", "ar": "رقم معرف"}, "calender": {"en": "Calender", "ar": "التقويم"}, "gregorian": {"en": "Gregorian", "ar": "ميلادي"}, @@ -750,6 +1106,16 @@ const Map> localizedValues = { "activation": {"en": "Activation", "ar": "تفعيل"}, "confirmation": {"en": "Confirmation", "ar": "تفعيل"}, "firstNameInAr": {"en": "First Name In Arabic", "ar": "الاسم الاول بالعربية"}, - "middleNameInAr": {"en": "Middle Name In Arabic", "ar": "الاسم الأوسط بالعربية"}, + "middleNameInAr": { + "en": "Middle Name In Arabic", + "ar": "الاسم الأوسط بالعربية" + }, "lastNameInAr": {"en": "Last Name In Arabic", "ar": "الاسم الأخير بالعربية"}, + "investigation": {"en": "investigation", "ar": "التحقيقات"}, + "conditionOnDischarge": { + "en": "Condition On Discharge", + "ar": "الحالة عند الاخراج" + }, + "planedProcedure": {"en": "Planed Procedure", "ar": "الإجراء المخطط"}, + "moreDetails": {"en": "More Details", "ar": "المزيد من التفاصيل"}, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 407bb198..1e4674a2 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -13,11 +13,13 @@ class TranslationBase { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => + localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; - String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get areYouSureYouWantTo => + localizedValues['areYouSureYouWantTo'][locale.languageCode]; String get language => localizedValues['language'][locale.languageCode]; @@ -35,35 +37,46 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => + localizedValues['replySuccessfully'][locale.languageCode]; - String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String get messagesScreenToolbarTitle => + localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; + String get errorNoSchedule => + localizedValues['errorNoSchedule'][locale.languageCode]; String get verify => localizedValues['verify'][locale.languageCode]; - String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; + String get referralDoctor => + localizedValues['referralDoctor'][locale.languageCode]; - String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; + String get referringClinic => + localizedValues['referringClinic'][locale.languageCode]; String get frequency => localizedValues['frequency'][locale.languageCode]; String get priority => localizedValues['priority'][locale.languageCode]; - String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; + String get maxResponseTime => + localizedValues['maxResponseTime'][locale.languageCode]; - String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String get clinicDetailsandRemarks => + localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; + String get answerSuggestions => + localizedValues['answerSuggestions'][locale.languageCode]; String get outPatients => localizedValues['outPatients'][locale.languageCode]; - String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; + String get searchPatient => + localizedValues['searchPatient'][locale.languageCode]; + String get searchPatientDashBoard => + localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientName => + localizedValues['searchPatient-name'][locale.languageCode]; String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; @@ -71,9 +84,11 @@ class TranslationBase { String get patients => localizedValues['patients'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; - String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; + String get todayStatistics => + localizedValues['todayStatistics'][locale.languageCode]; - String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; + String get familyMedicine => + localizedValues['familyMedicine'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; @@ -91,36 +106,49 @@ class TranslationBase { String get inPatient => localizedValues['inPatient'][locale.languageCode]; String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + String get myInPatientTitle => + localizedValues['myInPatientTitle'][locale.languageCode]; + String get inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; - String get patientServices => localizedValues['patientServices'][locale.languageCode]; + String get patientServices => + localizedValues['patientServices'][locale.languageCode]; - String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; + String get searchMedicine => + localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicineDashboard => + localizedValues['searchMedicineDashboard'][locale.languageCode]; - String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferralPatient => + localizedValues['myReferralPatient'][locale.languageCode]; - String get referPatient => localizedValues['referPatient'][locale.languageCode]; + String get referPatient => + localizedValues['referPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; - String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; - String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; + String get myReferredPatient => + localizedValues['myReferredPatient'][locale.languageCode]; + String get referredPatient => + localizedValues['referredPatient'][locale.languageCode]; String get referredOn => localizedValues['referredOn'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; - String get firstNameInAr => localizedValues['firstNameInAr'][locale.languageCode]; + String get firstNameInAr => + localizedValues['firstNameInAr'][locale.languageCode]; String get middleName => localizedValues['middleName'][locale.languageCode]; - String get middleNameInAr => localizedValues['middleNameInAr'][locale.languageCode]; + String get middleNameInAr => + localizedValues['middleNameInAr'][locale.languageCode]; String get lastName => localizedValues['lastName'][locale.languageCode]; - String get lastNameInAr => localizedValues['lastNameInAr'][locale.languageCode]; + String get lastNameInAr => + localizedValues['lastNameInAr'][locale.languageCode]; String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; @@ -130,19 +158,23 @@ class TranslationBase { String get search => localizedValues['search'][locale.languageCode]; - String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get onlyArrivedPatient => + localizedValues['onlyArrivedPatient'][locale.languageCode]; - String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get searchMedicineNameHere => + localizedValues['searchMedicineNameHere'][locale.languageCode]; String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String get itemsInSearch => localizedValues['itemsInSearch'][locale.languageCode]; + String get itemsInSearch => + localizedValues['itemsInSearch'][locale.languageCode]; String get qr => localizedValues['qr'][locale.languageCode]; String get reader => localizedValues['reader'][locale.languageCode]; - String get startScanning => localizedValues['startScanning'][locale.languageCode]; + String get startScanning => + localizedValues['startScanning'][locale.languageCode]; String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; @@ -154,17 +186,21 @@ class TranslationBase { String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; + String get clinicSelect => + localizedValues['clinicSelect'][locale.languageCode]; - String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get doctorSelect => + localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; - String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; + String get errorMessage => + localizedValues['errorMessage'][locale.languageCode]; - String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; + String get patientProfile => + localizedValues['patientProfile'][locale.languageCode]; String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; @@ -180,15 +216,18 @@ class TranslationBase { String get medicines => localizedValues['medicines'][locale.languageCode]; - String get prescription => localizedValues['prescription'][locale.languageCode]; + String get prescription => + localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get insuranceApprovals => + localizedValues['insuranceApprovals'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; - String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => + localizedValues['bodyMeasurements'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -196,26 +235,33 @@ class TranslationBase { String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => + localizedValues['bloodPressure'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; - String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; + String get errorNoVitalSign => + localizedValues['errorNoVitalSign'][locale.languageCode]; String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; + String get errorNoLabOrders => + localizedValues['errorNoLabOrders'][locale.languageCode]; - String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; + String get answerThePatient => + localizedValues['answerThePatient'][locale.languageCode]; - String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get pleaseEnterAnswer => + localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => localizedValues['progressNote'][locale.languageCode]; - String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get progressNote => + localizedValues['progressNote'][locale.languageCode]; + String get operationReports => + localizedValues['operationReports'][locale.languageCode]; String get reports => localizedValues['reports'][locale.languageCode]; String get operation => localizedValues['operation'][locale.languageCode]; @@ -225,12 +271,14 @@ class TranslationBase { String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; + String get errorNoProgressNote => + localizedValues['errorNoProgressNote'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String get generalResult => localizedValues['generalResult'][locale.languageCode]; + String get generalResult => + localizedValues['generalResult'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; @@ -240,23 +288,30 @@ class TranslationBase { String get enterId => localizedValues['enterId'][locale.languageCode]; - String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get pleaseEnterYourID => + localizedValues['pleaseEnterYourID'][locale.languageCode]; - String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; + String get enterPassword => + localizedValues['enterPassword'][locale.languageCode]; - String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get pleaseEnterPassword => + localizedValues['pleaseEnterPassword'][locale.languageCode]; - String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; + String get selectYourProject => + localizedValues['selectYourProject'][locale.languageCode]; - String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get pleaseEnterYourProject => + localizedValues['pleaseEnterYourProject'][locale.languageCode]; String get login => localizedValues['login'][locale.languageCode]; - String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get drSulaimanAlHabib => + localizedValues['drSulaimanAlHabib'][locale.languageCode]; String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; + String get welcomeBackTo => + localizedValues['welcomeBackTo'][locale.languageCode]; String get home => localizedValues['home'][locale.languageCode]; @@ -272,37 +327,46 @@ class TranslationBase { String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; + String get pleaseChoose => + localizedValues['pleaseChoose'][locale.languageCode]; String get choose => localizedValues['choose'][locale.languageCode]; - String get verification => localizedValues['verification'][locale.languageCode]; + String get verification => + localizedValues['verification'][locale.languageCode]; String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; + String get yourAccount => + localizedValues['yourAccount!'][locale.languageCode]; String get verify1 => localizedValues['verify1'][locale.languageCode]; - String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; + String get youWillReceiveA => + localizedValues['youWillReceiveA'][locale.languageCode]; String get loginCode => localizedValues['loginCode'][locale.languageCode]; String get smsBy => localizedValues['smsBy'][locale.languageCode]; - String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String get pleaseEnterTheCode => + localizedValues['pleaseEnterTheCode'][locale.languageCode]; - String get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient'][locale.languageCode]; + String get youDontHaveAnyPatient => + localizedValues['youDontHaveAnyPatient'][locale.languageCode]; - String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String get youDoNotHaveAnyItem => + localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; String get age => localizedValues['age'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; String get occupation => localizedValues['occupation'][locale.languageCode]; String get healthID => localizedValues['healthID'][locale.languageCode]; - String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; - String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; + String get identityNumber => + localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => + localizedValues['maritalStatus'][locale.languageCode]; String get today => localizedValues['today'][locale.languageCode]; @@ -314,15 +378,18 @@ class TranslationBase { String get yesterday => localizedValues['yesterday'][locale.languageCode]; - String get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String get errorNoInsuranceApprovals => + localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; - String get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String get searchInsuranceApprovals => + localizedValues['searchInsuranceApprovals'][locale.languageCode]; String get status => localizedValues['status'][locale.languageCode]; String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String get producerName => localizedValues['producerName'][locale.languageCode]; + String get producerName => + localizedValues['producerName'][locale.languageCode]; String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; @@ -340,11 +407,14 @@ class TranslationBase { String get send => localizedValues['send'][locale.languageCode]; - String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; + String get referralFrequency => + localizedValues['referralFrequency'][locale.languageCode]; - String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; + String get selectReferralFrequency => + localizedValues['selectReferralFrequency'][locale.languageCode]; - String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String get clinicalDetailsAndRemarks => + localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode]; @@ -354,30 +424,39 @@ class TranslationBase { String get outPatient => localizedValues['outPatients'][locale.languageCode]; - String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; - String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; + String get myOutPatient => + localizedValues['myOutPatient'][locale.languageCode]; + String get myOutPatient_2lines => + localizedValues['myOutPatient_2lines'][locale.languageCode]; String get logout => localizedValues['logout'][locale.languageCode]; - String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; + String get pharmaciesList => + localizedValues['pharmaciesList'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode]; - String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; + String get youCanFindItIn => + localizedValues['youCanFindItIn'][locale.languageCode]; - String get radiologyReport => localizedValues['radiologyReport'][locale.languageCode]; + String get radiologyReport => + localizedValues['radiologyReport'][locale.languageCode]; String get orders => localizedValues['orders'][locale.languageCode]; String get list => localizedValues['list'][locale.languageCode]; - String get searchOrders => localizedValues['searchOrders'][locale.languageCode]; + String get searchOrders => + localizedValues['searchOrders'][locale.languageCode]; - String get prescriptionDetails => localizedValues['prescriptionDetails'][locale.languageCode]; + String get prescriptionDetails => + localizedValues['prescriptionDetails'][locale.languageCode]; - String get prescriptionInfo => localizedValues['prescriptionInfo'][locale.languageCode]; + String get prescriptionInfo => + localizedValues['prescriptionInfo'][locale.languageCode]; - String get errorNoOrders => localizedValues['errorNoOrders'][locale.languageCode]; + String get errorNoOrders => + localizedValues['errorNoOrders'][locale.languageCode]; String get livecare => localizedValues['livecare'][locale.languageCode]; @@ -391,17 +470,20 @@ class TranslationBase { String get done => localizedValues['done'][locale.languageCode]; - String get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String get searchMedicineImageCaption => + localizedValues['searchMedicineImageCaption'][locale.languageCode]; String get type => localizedValues['type'][locale.languageCode]; String get resumecall => localizedValues['resumecall'][locale.languageCode]; - String get endcallwithcharge => localizedValues['endcallwithcharge'][locale.languageCode]; + String get endcallwithcharge => + localizedValues['endcallwithcharge'][locale.languageCode]; String get endcall => localizedValues['endcall'][locale.languageCode]; - String get transfertoadmin => localizedValues['transfertoadmin'][locale.languageCode]; + String get transfertoadmin => + localizedValues['transfertoadmin'][locale.languageCode]; String get fromDate => localizedValues['fromDate'][locale.languageCode]; @@ -411,15 +493,19 @@ class TranslationBase { String get toTime => localizedValues['toTime'][locale.languageCode]; - String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; + String get searchPatientImageCaptionTitle => + localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; - String get searchPatientImageCaptionBody => localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; + String get searchPatientImageCaptionBody => + localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode]; - String get typeMedicineName => localizedValues['typeMedicineName'][locale.languageCode]; + String get typeMedicineName => + localizedValues['typeMedicineName'][locale.languageCode]; - String get moreThan3Letter => localizedValues['moreThan3Letter'][locale.languageCode]; + String get moreThan3Letter => + localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; @@ -427,7 +513,8 @@ class TranslationBase { String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; - String get patientSick => localizedValues['patient-sick'][locale.languageCode]; + String get patientSick => + localizedValues['patient-sick'][locale.languageCode]; String get leave => localizedValues['leave'][locale.languageCode]; @@ -437,11 +524,14 @@ class TranslationBase { String get clinicName => localizedValues['clinicname'][locale.languageCode]; - String get sickLeaveDate => localizedValues['sick-leave-date'][locale.languageCode]; + String get sickLeaveDate => + localizedValues['sick-leave-date'][locale.languageCode]; - String get sickLeaveDays => localizedValues['sick-leave-days'][locale.languageCode]; + String get sickLeaveDays => + localizedValues['sick-leave-days'][locale.languageCode]; - String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; + String get admissionDetail => + localizedValues['admissionDetail'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode]; @@ -457,56 +547,72 @@ class TranslationBase { String get bed => localizedValues['bed'][locale.languageCode]; - String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String get previousSickLeaveIssue => + localizedValues['prevoius-sickleave-issed'][locale.languageCode]; - String get noSickLeaveApplied => localizedValues['no-sickleve-applied'][locale.languageCode]; + String get noSickLeaveApplied => + localizedValues['no-sickleve-applied'][locale.languageCode]; String get applyNow => localizedValues['applynow'][locale.languageCode]; - String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; + String get addSickLeave => + localizedValues['add-sickleave'][locale.languageCode]; String get add => localizedValues['add'][locale.languageCode]; - String get addSickLeaverequest => localizedValues['addSickLeaveRequest'][locale.languageCode]; - String get extendSickLeaverequest => localizedValues['extendSickLeaveRequest'][locale.languageCode]; + String get addSickLeaverequest => + localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get extendSickLeaverequest => + localizedValues['extendSickLeaveRequest'][locale.languageCode]; String get approved => localizedValues['approved'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode]; String get pending => localizedValues['pending'][locale.languageCode]; - String get leaveStartDate => localizedValues['leave-start-date'][locale.languageCode]; + String get leaveStartDate => + localizedValues['leave-start-date'][locale.languageCode]; - String get daysSickleave => localizedValues['days-sick-leave'][locale.languageCode]; + String get daysSickleave => + localizedValues['days-sick-leave'][locale.languageCode]; String get extend => localizedValues['extend'][locale.languageCode]; - String get extendSickLeave => localizedValues['extend-sickleave'][locale.languageCode]; + String get extendSickLeave => + localizedValues['extend-sickleave'][locale.languageCode]; - String get targetPatient => localizedValues['patient-target'][locale.languageCode]; + String get targetPatient => + localizedValues['patient-target'][locale.languageCode]; - String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; + String get noPrescription => + localizedValues['no-priscription-listed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; String get finish => localizedValues['finish'][locale.languageCode]; String get previous => localizedValues['previous'][locale.languageCode]; - String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get emptyMessage => + localizedValues['empty-message'][locale.languageCode]; - String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; + String get healthRecordInformation => + localizedValues['healthRecordInformation'][locale.languageCode]; - String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; + String get chiefComplaintLength => + localizedValues['chiefComplaintLength'][locale.languageCode]; String get referTo => localizedValues['referTo'][locale.languageCode]; - String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get referredFrom => + localizedValues['referredFrom'][locale.languageCode]; String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; - String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; + String get chooseAppointment => + localizedValues['chooseAppointment'][locale.languageCode]; - String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; + String get appointmentNo => + localizedValues['appointmentNo'][locale.languageCode]; String get refer => localizedValues['refer'][locale.languageCode]; @@ -518,19 +624,24 @@ class TranslationBase { String get dr => localizedValues['dr'][locale.languageCode]; - String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; + String get previewHealth => + localizedValues['previewHealth'][locale.languageCode]; - String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; + String get summaryReport => + localizedValues['summaryReport'][locale.languageCode]; String get accept => localizedValues['accept'][locale.languageCode]; String get reject => localizedValues['reject'][locale.languageCode]; - String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String get noAppointmentsErrorMsg => + localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; - String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; + String get referralPatient => + localizedValues['referralPatient'][locale.languageCode]; - String get noPrescriptionListed => localizedValues['noPrescriptionListed'][locale.languageCode]; + String get noPrescriptionListed => + localizedValues['noPrescriptionListed'][locale.languageCode]; String get addNow => localizedValues['addNow'][locale.languageCode]; @@ -546,16 +657,20 @@ class TranslationBase { String get instruction => localizedValues['instruction'][locale.languageCode]; - String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; + String get rescheduleLeaves => + localizedValues['reschedule-leave'][locale.languageCode]; - String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get applyOrRescheduleLeave => + localizedValues['applyOrRescheduleLeave'][locale.languageCode]; String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; - String get addMedication => localizedValues['addMedication'][locale.languageCode]; + String get addMedication => + localizedValues['addMedication'][locale.languageCode]; String get route => localizedValues['route'][locale.languageCode]; - String get noReScheduleLeave => localizedValues['no-reschedule-leave'][locale.languageCode]; + String get noReScheduleLeave => + localizedValues['no-reschedule-leave'][locale.languageCode]; String get weight => localizedValues['weight'][locale.languageCode]; @@ -565,7 +680,8 @@ class TranslationBase { String get cm => localizedValues['cm'][locale.languageCode]; - String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode]; + String get idealBodyWeight => + localizedValues['idealBodyWeight'][locale.languageCode]; String get waistSize => localizedValues['waistSize'][locale.languageCode]; @@ -573,16 +689,22 @@ class TranslationBase { String get headCircum => localizedValues['headCircum'][locale.languageCode]; - String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; + String get leanBodyWeight => + localizedValues['leanBodyWeight'][locale.languageCode]; - String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; + String get bodyMassIndex => + localizedValues['bodyMassIndex'][locale.languageCode]; - String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; - String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get yourBodyMassIndex => + localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => + localizedValues['bmiUnderWeight'][locale.languageCode]; String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; - String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiOverWeight => + localizedValues['bmiOverWeight'][locale.languageCode]; String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; - String get bmiObeseExtreme => localizedValues['bmiObeseExtreme'][locale.languageCode]; + String get bmiObeseExtreme => + localizedValues['bmiObeseExtreme'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode]; @@ -592,35 +714,45 @@ class TranslationBase { String get respBeats => localizedValues['respBeats'][locale.languageCode]; - String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode]; + String get patternOfRespiration => + localizedValues['patternOfRespiration'][locale.languageCode]; - String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String get bloodPressureDiastoleAndSystole => + localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; - String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode]; + String get cuffLocation => + localizedValues['cuffLocation'][locale.languageCode]; String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; - String get patientPosition => localizedValues['patientPosition'][locale.languageCode]; + String get patientPosition => + localizedValues['patientPosition'][locale.languageCode]; String get fio2 => localizedValues['fio2'][locale.languageCode]; String get sao2 => localizedValues['sao2'][locale.languageCode]; - String get painManagement => localizedValues['painManagement'][locale.languageCode]; + String get painManagement => + localizedValues['painManagement'][locale.languageCode]; String get holiday => localizedValues['holiday'][locale.languageCode]; String get to => localizedValues['to'][locale.languageCode]; - String get coveringDoctor => localizedValues['coveringDoctor'][locale.languageCode]; + String get coveringDoctor => + localizedValues['coveringDoctor'][locale.languageCode]; - String get requestLeave => localizedValues['requestLeave'][locale.languageCode]; + String get requestLeave => + localizedValues['requestLeave'][locale.languageCode]; - String get pleaseEnterDate => localizedValues['pleaseEnterDate'][locale.languageCode]; + String get pleaseEnterDate => + localizedValues['pleaseEnterDate'][locale.languageCode]; - String get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String get pleaseEnterNoOfDays => + localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; - String get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String get pleaseEnterRemarks => + localizedValues['pleaseEnterRemarks'][locale.languageCode]; String get update => localizedValues['update'][locale.languageCode]; @@ -628,68 +760,92 @@ class TranslationBase { String get request => localizedValues['request'][locale.languageCode]; - String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; + String get admissionRequest => + localizedValues['admissionRequest'][locale.languageCode]; - String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; + String get patientDetails => + localizedValues['patientDetails'][locale.languageCode]; - String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String get specialityAndDoctorDetail => + localizedValues['specialityAndDoctorDetail'][locale.languageCode]; - String get referringDate => localizedValues['referringDate'][locale.languageCode]; + String get referringDate => + localizedValues['referringDate'][locale.languageCode]; - String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; + String get referringDoctor => + localizedValues['referringDoctor'][locale.languageCode]; - String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; + String get otherInformation => + localizedValues['otherInformation'][locale.languageCode]; - String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; + String get expectedDays => + localizedValues['expectedDays'][locale.languageCode]; - String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; + String get expectedAdmissionDate => + localizedValues['expectedAdmissionDate'][locale.languageCode]; - String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; - String get isSickLeaveRequired => localizedValues['isSickLeaveRequired'][locale.languageCode]; + String get emergencyAdmission => + localizedValues['emergencyAdmission'][locale.languageCode]; + String get isSickLeaveRequired => + localizedValues['isSickLeaveRequired'][locale.languageCode]; - String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; + String get patientPregnant => + localizedValues['patientPregnant'][locale.languageCode]; - String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; + String get treatmentLine => + localizedValues['treatmentLine'][locale.languageCode]; String get ward => localizedValues['ward'][locale.languageCode]; - String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String get preAnesthesiaReferred => + localizedValues['preAnesthesiaReferred'][locale.languageCode]; - String get admissionType => localizedValues['admissionType'][locale.languageCode]; + String get admissionType => + localizedValues['admissionType'][locale.languageCode]; String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; String get allergies => localizedValues['allergies'][locale.languageCode]; - String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; + String get preOperativeOrders => + localizedValues['preOperativeOrders'][locale.languageCode]; - String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; + String get elementForImprovement => + localizedValues['elementForImprovement'][locale.languageCode]; - String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; + String get dischargeDate => + localizedValues['dischargeDate'][locale.languageCode]; String get dietType => localizedValues['dietType'][locale.languageCode]; - String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; + String get dietTypeRemarks => + localizedValues['dietTypeRemarks'][locale.languageCode]; String get save => localizedValues['save'][locale.languageCode]; - String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get postPlansEstimatedCost => + localizedValues['postPlansEstimatedCost'][locale.languageCode]; String get postPlans => localizedValues['postPlans'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode]; - String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; + String get emergencyCase => + localizedValues['emergencyCase'][locale.languageCode]; - String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; + String get durationOfIllness => + localizedValues['durationOfIllness'][locale.languageCode]; - String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String get chiefComplaintsAndSymptoms => + localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; String get patientFeelsPainInHisBackAndCough => localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; - String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; + String get additionalTextComplaints => + localizedValues['additionalTextComplaints'][locale.languageCode]; - String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; + String get otherConditions => + localizedValues['otherConditions'][locale.languageCode]; String get other => localizedValues['other'][locale.languageCode]; @@ -699,9 +855,11 @@ class TranslationBase { String get where => localizedValues['where'][locale.languageCode]; - String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String get specifyPossibleLineManagement => + localizedValues['specifyPossibleLineManagement'][locale.languageCode]; - String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; + String get significantSigns => + localizedValues['significantSigns'][locale.languageCode]; String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; @@ -715,41 +873,55 @@ class TranslationBase { String get procedures => localizedValues['procedures'][locale.languageCode]; - String get chiefComplaints => localizedValues['chiefComplaints'][locale.languageCode]; + String get chiefComplaints => + localizedValues['chiefComplaints'][locale.languageCode]; String get histories => localizedValues['histories'][locale.languageCode]; - String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; + String get allergiesSoap => + localizedValues['allergiesSoap'][locale.languageCode]; - String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; + String get addChiefComplaints => + localizedValues['addChiefComplaints'][locale.languageCode]; - String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; + String get historyOfPresentIllness => + localizedValues['historyOfPresentIllness'][locale.languageCode]; String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; String get addHistory => localizedValues['addHistory'][locale.languageCode]; - String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; + String get searchHistory => + localizedValues['searchHistory'][locale.languageCode]; - String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; + String get addSelectedHistories => + localizedValues['addSelectedHistories'][locale.languageCode]; - String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; + String get addAllergies => + localizedValues['addAllergies'][locale.languageCode]; String get itemExist => localizedValues['itemExist'][locale.languageCode]; - String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; + String get selectAllergy => + localizedValues['selectAllergy'][locale.languageCode]; - String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; + String get selectSeverity => + localizedValues['selectSeverity'][locale.languageCode]; - String get leaveCreated => localizedValues['leaveCreated'][locale.languageCode]; + String get leaveCreated => + localizedValues['leaveCreated'][locale.languageCode]; - String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String get vitalSignEmptyMsg => + localizedValues['vitalSignEmptyMsg'][locale.languageCode]; - String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; + String get referralEmptyMsg => + localizedValues['referralEmptyMsg'][locale.languageCode]; - String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; + String get referralSuccessMsg => + localizedValues['referralSuccessMsg'][locale.languageCode]; - String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get diagnoseType => + localizedValues['diagnoseType'][locale.languageCode]; String get condition => localizedValues['condition'][locale.languageCode]; @@ -763,52 +935,72 @@ class TranslationBase { String get covered => localizedValues['covered'][locale.languageCode]; - String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; + String get approvalRequired => + localizedValues['approvalRequired'][locale.languageCode]; - String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get uncoveredByDoctor => + localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get chiefComplaintEmptyMsg => + localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String get moreVerification => localizedValues['more-verify'][locale.languageCode]; + String get moreVerification => + localizedValues['more-verify'][locale.languageCode]; - String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; + String get welcomeBack => + localizedValues['welcome-back'][locale.languageCode]; - String get accountInfo => localizedValues['account-info'][locale.languageCode]; + String get accountInfo => + localizedValues['account-info'][locale.languageCode]; - String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; + String get useAnotherAccount => + localizedValues['another-acc'][locale.languageCode]; - String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; + String get verifyLoginWith => + localizedValues['verify-login-with'][locale.languageCode]; String get register => localizedValues['register-user'][locale.languageCode]; - String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFingerprint => + localizedValues['verify-with-fingerprint'][locale.languageCode]; - String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifyFaceID => + localizedValues['verify-with-faceid'][locale.languageCode]; - String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifySMS => + localizedValues['verify-with-sms'][locale.languageCode]; String get verifyWith => localizedValues['verify-with'][locale.languageCode]; - String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get verifyWhatsApp => + localizedValues['verify-with-whatsapp'][locale.languageCode]; String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; + String get lastLoginWith => + localizedValues['last-login-with'][locale.languageCode]; - String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; + String get verifyFingerprint2 => + localizedValues['verify-fingerprint'][locale.languageCode]; - String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; + String get verificationMessage => + localizedValues['verification_message'][locale.languageCode]; - String get validationMessage => localizedValues['validation_message'][locale.languageCode]; + String get validationMessage => + localizedValues['validation_message'][locale.languageCode]; - String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get addAssessment => + localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; - String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; + String get physicalSystemExamination => + localizedValues['physicalSystemExamination'][locale.languageCode]; - String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; + String get searchExamination => + localizedValues['searchExamination'][locale.languageCode]; - String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get addExamination => + localizedValues['addExamination'][locale.languageCode]; String get doc => localizedValues['doc'][locale.languageCode]; @@ -819,11 +1011,14 @@ class TranslationBase { String get abnormal => localizedValues['abnormal'][locale.languageCode]; - String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get patientNoDetailErrMsg => + localizedValues['patientNoDetailErrMsg'][locale.languageCode]; - String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get systolicLng => + localizedValues['systolic-lng'][locale.languageCode]; - String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get diastolicLng => + localizedValues['diastolic-lng'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; @@ -831,62 +1026,80 @@ class TranslationBase { String get bpm => localizedValues['bpm'][locale.languageCode]; - String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; + String get respirationSigns => + localizedValues['respiration-signs'][locale.languageCode]; String get sysDias => localizedValues['sys-dias'][locale.languageCode]; String get body => localizedValues['body'][locale.languageCode]; - String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; + String get respirationRate => + localizedValues['respirationRate'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; - String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; + String get medicalReport => + localizedValues['medicalReport'][locale.languageCode]; String get visitDate => localizedValues['visitDate'][locale.languageCode]; String get test => localizedValues['test'][locale.languageCode]; - String get addMoreProcedure => localizedValues['addMoreProcedure'][locale.languageCode]; + String get addMoreProcedure => + localizedValues['addMoreProcedure'][locale.languageCode]; String get regular => localizedValues['regular'][locale.languageCode]; - String get searchProcedures => localizedValues['searchProcedures'][locale.languageCode]; + String get searchProcedures => + localizedValues['searchProcedures'][locale.languageCode]; - String get procedureCategorise => localizedValues['procedureCategorise'][locale.languageCode]; + String get procedureCategorise => + localizedValues['procedureCategorise'][locale.languageCode]; - String get selectProcedures => localizedValues['selectProcedures'][locale.languageCode]; + String get selectProcedures => + localizedValues['selectProcedures'][locale.languageCode]; - String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; - String get addProcedures => localizedValues['addProcedures'][locale.languageCode]; + String get addSelectedProcedures => + localizedValues['addSelectedProcedures'][locale.languageCode]; + String get addProcedures => + localizedValues['addProcedures'][locale.languageCode]; - String get updateProcedure => localizedValues['updateProcedure'][locale.languageCode]; + String get updateProcedure => + localizedValues['updateProcedure'][locale.languageCode]; - String get orderProcedure => localizedValues['orderProcedure'][locale.languageCode]; + String get orderProcedure => + localizedValues['orderProcedure'][locale.languageCode]; String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; String get dType => localizedValues['dType'][locale.languageCode]; - String get addAssessmentDetails => localizedValues['addAssessmentDetails'][locale.languageCode]; + String get addAssessmentDetails => + localizedValues['addAssessmentDetails'][locale.languageCode]; - String get progressNoteSOAP => localizedValues['progressNoteSOAP'][locale.languageCode]; + String get progressNoteSOAP => + localizedValues['progressNoteSOAP'][locale.languageCode]; - String get addProgressNote => localizedValues['addProgressNote'][locale.languageCode]; + String get addProgressNote => + localizedValues['addProgressNote'][locale.languageCode]; String get createdBy => localizedValues['createdBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode]; - String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; + String get currentMedications => + localizedValues['currentMedications'][locale.languageCode]; String get noItem => localizedValues['noItem'][locale.languageCode]; - String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String get postUcafSuccessMsg => + localizedValues['postUcafSuccessMsg'][locale.languageCode]; - String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String get vitalSignDetailEmpty => + localizedValues['vitalSignDetailEmpty'][locale.languageCode]; - String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String get onlyOfftimeHoliday => + localizedValues['onlyOfftimeHoliday'][locale.languageCode]; String get active => localizedValues['active'][locale.languageCode]; @@ -894,18 +1107,24 @@ class TranslationBase { String get loading => localizedValues['loading'][locale.languageCode]; - String get assessmentErrorMsg => localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get assessmentErrorMsg => + localizedValues['assessmentErrorMsg'][locale.languageCode]; - String get examinationErrorMsg => localizedValues['examinationErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => + localizedValues['examinationErrorMsg'][locale.languageCode]; - String get progressNoteErrorMsg => localizedValues['progressNoteErrorMsg'][locale.languageCode]; + String get progressNoteErrorMsg => + localizedValues['progressNoteErrorMsg'][locale.languageCode]; - String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get chiefComplaintErrorMsg => + localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; String get ICDName => localizedValues['ICDName'][locale.languageCode]; - String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; + String get referralStatus => + localizedValues['referralStatus'][locale.languageCode]; - String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + String get referralRemark => + localizedValues['referralRemark'][locale.languageCode]; String get offTime => localizedValues['offTime'][locale.languageCode]; String get icd => localizedValues['icd'][locale.languageCode]; @@ -914,43 +1133,73 @@ class TranslationBase { String get min => localizedValues['min'][locale.languageCode]; String get months => localizedValues['months'][locale.languageCode]; String get years => localizedValues['years'][locale.languageCode]; - String get referralStatusHold => localizedValues['referralStatusHold'][locale.languageCode]; - String get referralStatusActive => localizedValues['referralStatusActive'][locale.languageCode]; - String get referralStatusCancelled => localizedValues['referralStatusCancelled'][locale.languageCode]; - String get referralStatusCompleted => localizedValues['referralStatusCompleted'][locale.languageCode]; - String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; - String get clinicSearch => localizedValues['clinicSearch'][locale.languageCode]; - String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; - - String get patientName => localizedValues['patient-name'][locale.languageCode]; - - String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => localizedValues['complications'][locale.languageCode]; + String get referralStatusHold => + localizedValues['referralStatusHold'][locale.languageCode]; + String get referralStatusActive => + localizedValues['referralStatusActive'][locale.languageCode]; + String get referralStatusCancelled => + localizedValues['referralStatusCancelled'][locale.languageCode]; + String get referralStatusCompleted => + localizedValues['referralStatusCompleted'][locale.languageCode]; + String get referralStatusNotSeen => + localizedValues['referralStatusNotSeen'][locale.languageCode]; + String get clinicSearch => + localizedValues['clinicSearch'][locale.languageCode]; + String get doctorSearch => + localizedValues['doctorSearch'][locale.languageCode]; + String get referralResponse => + localizedValues['referralResponse'][locale.languageCode]; + String get estimatedCost => + localizedValues['estimatedCost'][locale.languageCode]; + String get diagnosisDetail => + localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => + localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => + localizedValues['referralSuccessMsgReject'][locale.languageCode]; + + String get patientName => + localizedValues['patient-name'][locale.languageCode]; + + String get appointmentNumber => + localizedValues['appointmentNumber'][locale.languageCode]; + String get sickLeaveComments => + localizedValues['sickLeaveComments'][locale.languageCode]; + String get pastMedicalHistory => + localizedValues['pastMedicalHistory'][locale.languageCode]; + String get pastSurgicalHistory => + localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get complications => + localizedValues['complications'][locale.languageCode]; String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get roomCategory => + localizedValues['roomCategory'][locale.languageCode]; + String get otherDepartmentsInterventions => + localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get otherProcedure => + localizedValues['otherProcedure'][locale.languageCode]; + String get admissionRequestSuccessMsg => + localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; - String get sickleaveonhold => localizedValues['sickleaveonhold'][locale.languageCode]; + String get doctorResponse => + localizedValues['doctorResponse'][locale.languageCode]; + String get sickleaveonhold => + localizedValues['sickleaveonhold'][locale.languageCode]; String get noClinic => localizedValues['no-clinic'][locale.languageCode]; - String get otherStatistic => localizedValues['otherStatistic'][locale.languageCode]; - - String get patientsreferral => localizedValues['ptientsreferral'][locale.languageCode]; - String get myPatientsReferral => localizedValues['myPatientsReferral'][locale.languageCode]; - String get arrivalpatient => localizedValues['arrivalpatient'][locale.languageCode]; - String get searchmedicinepatient => localizedValues['searchmedicinepatient'][locale.languageCode]; - String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; + String get otherStatistic => + localizedValues['otherStatistic'][locale.languageCode]; + + String get patientsreferral => + localizedValues['ptientsreferral'][locale.languageCode]; + String get myPatientsReferral => + localizedValues['myPatientsReferral'][locale.languageCode]; + String get arrivalpatient => + localizedValues['arrivalpatient'][locale.languageCode]; + String get searchmedicinepatient => + localizedValues['searchmedicinepatient'][locale.languageCode]; + String get appointmentDate => + localizedValues['appointmentDate'][locale.languageCode]; String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; @@ -959,9 +1208,12 @@ class TranslationBase { String get billNo => localizedValues['BillNo'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; @@ -970,30 +1222,40 @@ class TranslationBase { String get leaves => localizedValues['leaves'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; - String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get prescriptions => + localizedValues['prescriptions'][locale.languageCode]; String get notes => localizedValues['notes'][locale.languageCode]; String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - String get searchWithOther => localizedValues['searchWithOther'][locale.languageCode]; - String get hideOtherCriteria => localizedValues['hideOtherCriteria'][locale.languageCode]; - String get applyForReschedule => localizedValues['applyForReschedule'][locale.languageCode]; + String get searchWithOther => + localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => + localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => + localizedValues['applyForReschedule'][locale.languageCode]; String get startDate => localizedValues['startDate'][locale.languageCode]; String get endDate => localizedValues['endDate'][locale.languageCode]; - String get addReschedule => localizedValues['add-reschedule'][locale.languageCode]; - String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; + String get addReschedule => + localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => + localizedValues['update-reschedule'][locale.languageCode]; String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; String get accepted => localizedValues['accepted'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode]; - String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; + String get typeHereToReply => + localizedValues['typeHereToReply'][locale.languageCode]; String get searchHere => localizedValues['searchHere'][locale.languageCode]; String get remove => localizedValues['remove'][locale.languageCode]; String get inProgress => localizedValues['inProgress'][locale.languageCode]; @@ -1001,64 +1263,93 @@ class TranslationBase { String get locked => localizedValues['Locked'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => localizedValues['fieldRequired'][locale.languageCode]; + String get fieldRequired => + localizedValues['fieldRequired'][locale.languageCode]; String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; - String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; + String get changeOfSchedule => + localizedValues['changeOfSchedule'][locale.languageCode]; String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; - String get enterCredentials => localizedValues['enter_credentials'][locale.languageCode]; - String get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational'][locale.languageCode]; + String get enterCredentials => + localizedValues['enter_credentials'][locale.languageCode]; + String get patpatientIDMobilenationalientID => + localizedValues['patientIDMobilenational'][locale.languageCode]; String get updateNow => localizedValues['updateNow'][locale.languageCode]; - String get updateTheApp => localizedValues['updateTheApp'][locale.languageCode]; - String get admissionDate => localizedValues['admission-date'][locale.languageCode]; + String get updateTheApp => + localizedValues['updateTheApp'][locale.languageCode]; + String get admissionDate => + localizedValues['admission-date'][locale.languageCode]; String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; - String get replayBefore => localizedValues['replayBefore'][locale.languageCode]; + String get replayBefore => + localizedValues['replayBefore'][locale.languageCode]; String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; + String get acknowledged => + localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; - String get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get pleaseEnterProcedure => + localizedValues["pleaseEnterProcedure"][locale.languageCode]; String get fillTheMandatoryProcedureDetails => localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; - String get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"][locale.languageCode]; - String get searchProcedureHere => localizedValues["searchProcedureHere"][locale.languageCode]; - String get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get atLeastThreeCharacters => + localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => + localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => + localizedValues["noInsuranceApprovalFound"][locale.languageCode]; String get procedure => localizedValues["procedure"][locale.languageCode]; String get stopDate => localizedValues["stopDate"][locale.languageCode]; String get processed => localizedValues["processed"][locale.languageCode]; String get direction => localizedValues["direction"][locale.languageCode]; String get refill => localizedValues["refill"][locale.languageCode]; - String get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"][locale.languageCode]; - String get newPrescriptionOrder => localizedValues["newPrescriptionOrder"][locale.languageCode]; - String get pleaseFillAllFields => localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get medicationHasBeenAdded => + localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => + localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => + localizedValues["pleaseFillAllFields"][locale.languageCode]; String get narcoticMedicineCanOnlyBePrescribedFromVida => - localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"][locale.languageCode]; - String get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] + [locale.languageCode]; + String get only5DigitsAllowedForStrength => + localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; String get unit => localizedValues["unit"][locale.languageCode]; String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; - String get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"][locale.languageCode]; - String get applyForNewLabOrder => localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get applyForRadiologyOrder => + localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => + localizedValues["applyForNewLabOrder"][locale.languageCode]; String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; - String get addRadiologyOrder => localizedValues["addRadiologyOrder"][locale.languageCode]; - String get newRadiologyOrder => localizedValues["newRadiologyOrder"][locale.languageCode]; + String get addRadiologyOrder => + localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => + localizedValues["newRadiologyOrder"][locale.languageCode]; String get orderDate => localizedValues["orderDate"][locale.languageCode]; String get examType => localizedValues["examType"][locale.languageCode]; String get health => localizedValues["health"][locale.languageCode]; String get summary => localizedValues["summary"][locale.languageCode]; - String get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; - String get noPrescriptionsFound => localizedValues["noPrescriptionsFound"][locale.languageCode]; - String get noMedicalFileFound => localizedValues["noMedicalFileFound"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => + localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => + localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => + localizedValues["noMedicalFileFound"][locale.languageCode]; String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; String get discharged => localizedValues["discharged"][locale.languageCode]; - String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; - String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; + String get addNewOrderSheet => + localizedValues["addNewOrderSheet"][locale.languageCode]; + String get addNewProgressNote => + localizedValues["addNewProgressNote"][locale.languageCode]; String get notePending => localizedValues["notePending"][locale.languageCode]; - String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; - String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; + String get noteCanceled => + localizedValues["noteCanceled"][locale.languageCode]; + String get noteVerified => + localizedValues["noteVerified"][locale.languageCode]; String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; @@ -1072,80 +1363,127 @@ class TranslationBase { String get report => localizedValues["report"][locale.languageCode]; String get discharge => localizedValues["discharge"][locale.languageCode]; String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get notRepliedYet => + localizedValues["notRepliedYet"][locale.languageCode]; String get clearText => localizedValues["clearText"][locale.languageCode]; - String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; - String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; + String get medicalReportAdd => + localizedValues['medicalReportAdd'][locale.languageCode]; + String get medicalReportVerify => + localizedValues['medicalReportVerify'][locale.languageCode]; String get comments => localizedValues['comments'][locale.languageCode]; - String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; + String get initiateCall => + localizedValues['initiateCall'][locale.languageCode]; String get endCall => localizedValues['endCall'][locale.languageCode]; String get transferTo => localizedValues['transferTo'][locale.languageCode]; String get admin => localizedValues['admin'][locale.languageCode]; - String get instructions => localizedValues['instructions'][locale.languageCode]; + String get instructions => + localizedValues['instructions'][locale.languageCode]; String get sendLC => localizedValues['sendLC'][locale.languageCode]; String get endLC => localizedValues['endLC'][locale.languageCode]; - String get consultation => localizedValues['consultation'][locale.languageCode]; + String get consultation => + localizedValues['consultation'][locale.languageCode]; String get resume => localizedValues['resume'][locale.languageCode]; String get theCall => localizedValues['theCall'][locale.languageCode]; - String get createNewMedicalReport => localizedValues['createNewMedicalReport'][locale.languageCode]; - String get historyPhysicalFinding => localizedValues['historyPhysicalFinding'][locale.languageCode]; - String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData'][locale.languageCode]; - String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode]; + String get createNewMedicalReport => + localizedValues['createNewMedicalReport'][locale.languageCode]; + String get historyPhysicalFinding => + localizedValues['historyPhysicalFinding'][locale.languageCode]; + String get laboratoryPhysicalData => + localizedValues['laboratoryPhysicalData'][locale.languageCode]; + 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 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]; - String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; - String get addPrescription => localizedValues['addPrescription'][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]; - String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; - String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; + String get summeryReply => + localizedValues['summeryReply'][locale.languageCode]; + String get severityValidationError => + localizedValues['severityValidationError'][locale.languageCode]; + String get textCopiedSuccessfully => + localizedValues['textCopiedSuccessfully'][locale.languageCode]; String get roomNo => localizedValues['roomNo'][locale.languageCode]; String get seeMore => localizedValues['seeMore'][locale.languageCode]; - String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; - String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; - String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; - String get underProcess => localizedValues['underProcess'][locale.languageCode]; - String get textResponse => localizedValues['textResponse'][locale.languageCode]; + String get replayCallStatus => + localizedValues['replayCallStatus'][locale.languageCode]; + String get patientArrived => + localizedValues['patientArrived'][locale.languageCode]; + String get calledAndNoResponse => + localizedValues['calledAndNoResponse'][locale.languageCode]; + String get underProcess => + localizedValues['underProcess'][locale.languageCode]; + String get textResponse => + localizedValues['textResponse'][locale.languageCode]; String get special => localizedValues['special'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode]; String get allClinic => localizedValues['allClinic'][locale.languageCode]; String get notReplied => localizedValues['notReplied'][locale.languageCode]; - String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; - String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; - String get operationTimeStart => localizedValues['operationTimeStart'][locale.languageCode]; - String get operationDate => localizedValues['operationDate'][locale.languageCode]; - String get reservation => localizedValues['reservation'][locale.languageCode]; - String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; - String get bloodTransfusedDetail => localizedValues['bloodTransfusedDetail'][locale.languageCode]; - String get circulatingNurse => localizedValues['circulatingNurse'][locale.languageCode]; - String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; - String get otherSpecimen => localizedValues['otherSpecimen'][locale.languageCode]; - String get microbiologySpecimen => localizedValues['microbiologySpecimen'][locale.languageCode]; - String get histopathSpecimen => localizedValues['histopathSpecimen'][locale.languageCode]; - String get bloodLossDetail => localizedValues['bloodLossDetail'][locale.languageCode]; - String get complicationDetails1 => localizedValues['complicationDetails1'][locale.languageCode]; - String get postOperationInstruction => localizedValues['postOperationInstruction'][locale.languageCode]; - String get surgeryProcedure => localizedValues['surgeryProcedure'][locale.languageCode]; - String get finding => localizedValues['finding'][locale.languageCode]; - String get preOperationDiagnosis => localizedValues['preOperationDiagnosis'][locale.languageCode]; - String get postOperationDiagnosis => localizedValues['postOperationDiagnosis'][locale.languageCode]; - String get surgeon => localizedValues['surgeon'][locale.languageCode]; - String get assistant => localizedValues['assistant'][locale.languageCode]; - String get askForIdentification => localizedValues['askForIdentification'][locale.languageCode]; - String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; - String get calender => localizedValues['calender'][locale.languageCode]; - String get gregorian => localizedValues['gregorian'][locale.languageCode]; - String get hijri => localizedValues['hijri'][locale.languageCode]; - String get birthdate => localizedValues['birthdate'][locale.languageCode]; - String get activation => localizedValues['activation'][locale.languageCode]; - String get confirmation => localizedValues['confirmation'][locale.languageCode]; - String get diabetic => localizedValues['diabetic'][locale.languageCode]; - String get chart => localizedValues['chart'][locale.languageCode]; + String get registerNewPatient => + localizedValues['registerNewPatient'][locale.languageCode]; + String get registeraPatient => + localizedValues['registeraPatient'][locale.languageCode]; + String get operationTimeStart => + localizedValues['operationTimeStart'][locale.languageCode]; + String get operationDate => + localizedValues['operationDate'][locale.languageCode]; + String get reservation => localizedValues['reservation'][locale.languageCode]; + String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; + String get bloodTransfusedDetail => + localizedValues['bloodTransfusedDetail'][locale.languageCode]; + String get circulatingNurse => + localizedValues['circulatingNurse'][locale.languageCode]; + String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; + String get otherSpecimen => + localizedValues['otherSpecimen'][locale.languageCode]; + String get microbiologySpecimen => + localizedValues['microbiologySpecimen'][locale.languageCode]; + String get histopathSpecimen => + localizedValues['histopathSpecimen'][locale.languageCode]; + String get bloodLossDetail => + localizedValues['bloodLossDetail'][locale.languageCode]; + String get complicationDetails1 => + localizedValues['complicationDetails1'][locale.languageCode]; + String get postOperationInstruction => + localizedValues['postOperationInstruction'][locale.languageCode]; + String get surgeryProcedure => + localizedValues['surgeryProcedure'][locale.languageCode]; + String get finding => localizedValues['finding'][locale.languageCode]; + String get preOperationDiagnosis => + localizedValues['preOperationDiagnosis'][locale.languageCode]; + String get postOperationDiagnosis => + localizedValues['postOperationDiagnosis'][locale.languageCode]; + String get surgeon => localizedValues['surgeon'][locale.languageCode]; + String get assistant => localizedValues['assistant'][locale.languageCode]; + String get askForIdentification => + localizedValues['askForIdentification'][locale.languageCode]; + String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; + String get calender => localizedValues['calender'][locale.languageCode]; + String get gregorian => localizedValues['gregorian'][locale.languageCode]; + String get hijri => localizedValues['hijri'][locale.languageCode]; + String get birthdate => localizedValues['birthdate'][locale.languageCode]; + String get activation => localizedValues['activation'][locale.languageCode]; + String get confirmation => + localizedValues['confirmation'][locale.languageCode]; + String get diabetic => localizedValues['diabetic'][locale.languageCode]; + String get chart => localizedValues['chart'][locale.languageCode]; + String get investigation => + localizedValues['investigation'][locale.languageCode]; + String get conditionOnDischarge => + localizedValues['conditionOnDischarge'][locale.languageCode]; + String get planedProcedure => + localizedValues['planedProcedure'][locale.languageCode]; + String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 72df25d94979868c59e2b728c73fc7da45616fe9 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 28 Nov 2021 09:46:02 +0200 Subject: [PATCH 151/199] fix issue --- .../patients/register_patient/RegisterSearchPatientPage.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 0d2e398c..6b10bfd1 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -44,7 +44,7 @@ class _RegisterSearchPatientPageState extends State { List countryList; - dynamic country; + dynamic country ; bool isSubmitted = false; @@ -109,6 +109,8 @@ class _RegisterSearchPatientPageState extends State { countryList.add(iraqCountry); countryList.add(liberiaCountry); countryList.add(senegalCountry); + country = countryList[0]; + _phoneCode.text = countryList[0]['id'].toString(); } @override From 118d367b4ccfa651e9d26d13391604a707e33d1c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 28 Nov 2021 09:49:54 +0200 Subject: [PATCH 152/199] ui fix discharged patient card --- .../profile/discharge_summary/all_discharge_summary.dart | 8 ++++---- .../discharge_summary/discharge_Summary_widget.dart | 2 +- .../discharge_summary/pending_discharge_summary.dart | 9 ++++----- lib/util/translations_delegate_base.dart | 1 + 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 6a8633da..532d5e46 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -36,13 +36,13 @@ class _AllDischargeSummaryState extends State { body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable), - ) + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable), + ) : Column( children: [ Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.all(12.0), child: Column( children: [ Row( diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index 7754447a..e88c242f 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -115,7 +115,7 @@ class _DischargeSummaryWidgetState extends State { SizedBox( height: 15.0, ), - AppText(TranslationBase.of(context).moreDetails), + //AppText(TranslationBase.of(context).moreDetails), SizedBox( height: 15.0, ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 99176624..0313371b 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -37,14 +37,13 @@ class _PendingDischargeSummaryState extends State { isShowAppBar: false, body: model.pendingDischargeSummaryList.isEmpty ? Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .noDataAvailable), - ) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable), + ) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Padding( - padding: const EdgeInsets.all(8.0), + padding: EdgeInsets.all(12.0), child: Column( children: [ Row( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1e4674a2..0c25bca7e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1477,6 +1477,7 @@ class TranslationBase { localizedValues['confirmation'][locale.languageCode]; String get diabetic => localizedValues['diabetic'][locale.languageCode]; String get chart => localizedValues['chart'][locale.languageCode]; + String get investigation => localizedValues['investigation'][locale.languageCode]; String get conditionOnDischarge => From bd7e68390081e80d5629f12c014f83e69226694c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 6 Dec 2021 12:36:15 +0200 Subject: [PATCH 153/199] textfiled design --- lib/config/size_config.dart | 8 +- lib/screens/auth/login_screen.dart | 244 ++++++++---------- .../text_fields/app-textfield-custom.dart | 7 +- 3 files changed, 116 insertions(+), 143 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index abb3ddd6..21859d3b 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -12,9 +12,8 @@ class SizeConfig { static double textMultiplier; static double imageSizeMultiplier; static double heightMultiplier; - static double widthMultiplier; - static bool isPortrait = true; + static double widthMultiplier; static bool isMobilePortrait = false; static bool isMobile = false; static bool isHeightShort = false; @@ -61,7 +60,7 @@ class SizeConfig { } _blockWidth = screenWidth / 100; _blockHeight = screenHeight / 100; - + textMultiplier = _blockHeight; imageSizeMultiplier = _blockWidth; heightMultiplier = _blockHeight; @@ -75,8 +74,6 @@ class SizeConfig { print('widthMultiplier $widthMultiplier'); print('isPortrait $isPortrait'); print('isMobilePortrait $isMobilePortrait'); - - } static getTextMultiplierBasedOnWidth({double width}) { @@ -102,5 +99,4 @@ class SizeConfig { } return heightMultiplier; } - } diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 9563b29c..f562077b 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -16,7 +16,6 @@ import 'package:provider/provider.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; - class LoginScreen extends StatefulWidget { @override _LoginScreenState createState() => _LoginScreenState(); @@ -55,151 +54,127 @@ class _LoginScreenState extends State { children: [ //TODO Use App Text rather than text Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - SizedBox( - height: 30, - ), - ], + SizedBox( + height: 30, ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, children: [ + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ SizedBox( height: 10, ), Text( - TranslationBase - .of(context) - .welcomeTo, + TranslationBase.of(context).welcomeTo, style: TextStyle( fontSize: 16, - fontWeight: FontWeight - .w600, + fontWeight: FontWeight.w600, fontFamily: 'Poppins'), ), Text( - TranslationBase - .of(context) + TranslationBase.of(context) .drSulaimanAlHabib, style: TextStyle( - color:Color(0xFF2B353E), - fontWeight: FontWeight - .bold, - fontSize: SizeConfig - .isMobile + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.isMobile ? 24 - : SizeConfig - .realScreenWidth * - 0.029, + : SizeConfig.realScreenWidth * + 0.029, fontFamily: 'Poppins'), ), - Text( "Doctor App", style: TextStyle( - fontSize: - SizeConfig.isMobile + fontSize: SizeConfig.isMobile ? 16 - : SizeConfig - .realScreenWidth * - 0.030, - fontWeight: FontWeight - .w600, + : SizeConfig.realScreenWidth * + 0.030, + fontWeight: FontWeight.w600, color: Color(0xFFD02127)), ), ]), - ], - )), + ], + )), SizedBox( height: 40, ), Form( key: loginFormKey, child: Column( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - width: SizeConfig - .realScreenWidth * 0.90, - height: SizeConfig - .realScreenHeight * 0.65, - 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).selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: (){ - Helpers - .showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, - - - ), - buildSizedBox() - ]), + width: SizeConfig.realScreenWidth * 0.90, + height: SizeConfig.realScreenHeight * 0.65, + 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) + .selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: () { + Helpers.showCupertinoPicker( + context, + projectsList, + 'facilityName', + onSelectProject, + authenticationViewModel); + }, + ), + buildSizedBox() + ]), ), ], ), @@ -210,7 +185,6 @@ class _LoginScreenState extends State { ]), ), bottomSheet: Container( - height: 90, width: double.infinity, child: Center( @@ -220,26 +194,23 @@ class _LoginScreenState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ AppButton( - title: TranslationBase - .of(context) - .login, + 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: 25, + ) ], ), ), - ),), + ), + ), ); } @@ -249,7 +220,9 @@ class _LoginScreenState extends State { ); } - login(context,) async { + login( + context, + ) async { if (loginFormKey.currentState.validate()) { loginFormKey.currentState.save(); GifLoaderDialogUtils.showMyDialog(context); @@ -259,7 +232,7 @@ class _LoginScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - authenticationViewModel.setUnverified(true,isFromLogin: true); + authenticationViewModel.setUnverified(true, isFromLogin: true); // Navigator.of(context).pushReplacement( // MaterialPageRoute( // builder: (BuildContext context) => @@ -275,22 +248,25 @@ class _LoginScreenState extends State { 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; }); } diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 086375bb..98207888 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -130,10 +130,11 @@ class _AppTextFieldCustomState extends State { // marginTop: widget.hasHintmargin ? 0 : 30, color: Color(0xFF2E303A), fontSize: widget.isPrscription == false - ? SizeConfig.getHeightMultiplier() * - (SizeConfig.isWidthLarge ? 1.1 : 1.3) + ? 11.0 + // SizeConfig.getHeightMultiplier() * + // (SizeConfig.isWidthLarge ? 1.1 : 1.3) : 0, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w500, ), widget.dropDownText == null ? Container( From 3bfee08b9d182804e3f1b89f4863f6111b65c18f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 6 Dec 2021 16:50:59 +0200 Subject: [PATCH 154/199] textfiled and app button design change --- lib/main.dart | 5 +++-- lib/screens/auth/login_screen.dart | 2 +- .../prescription_in_patinets_widget.dart | 2 +- .../shared/buttons/app_buttons_widget.dart | 22 +++++++++++++------ .../text_fields/app-textfield-custom.dart | 19 +++++++++++----- .../shared/text_fields/text_fields_utils.dart | 17 +++++++------- 6 files changed, 42 insertions(+), 25 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 450c046f..37f3d3d0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -36,7 +36,8 @@ class MyApp extends StatelessWidget { SizeConfig().init(constraints, orientation); return MultiProvider( providers: [ - ChangeNotifierProvider(create: (context) => AuthenticationViewModel()), + ChangeNotifierProvider( + create: (context) => AuthenticationViewModel()), ChangeNotifierProvider( create: (context) => ProjectViewModel(), ), @@ -67,7 +68,7 @@ class MyApp extends StatelessWidget { theme: ThemeData( primarySwatch: Colors.grey, primaryColor: Colors.grey, - buttonColor: HexColor('#B8382C'), + buttonColor: HexColor('#D02127'), fontFamily: 'Poppins', dividerColor: Colors.grey[350], backgroundColor: Color.fromRGBO(255, 255, 255, 1), diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index f562077b..083c2ab3 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -196,7 +196,7 @@ class _LoginScreenState extends State { AppButton( title: TranslationBase.of(context).login, color: Color(0xFFD02127), - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, disabled: authenticationViewModel.userInfo.userID == null || authenticationViewModel.userInfo.password == null, onPressed: () { diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 9d22962a..0d622420 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -29,7 +29,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { padding: EdgeInsets.all(40), decoration: BoxDecoration( border: - Border.all(color: HexColor('#B8382C'), width: 4), + Border.all(color: HexColor('#D02127'), width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index acbd27fe..0a225dde 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -54,10 +56,13 @@ class _AppButtonState extends State { // height: MediaQuery.of(context).size.height * 0.075, height: widget.height, child: IgnorePointer( - ignoring: widget.loading ||widget.disabled, + ignoring: widget.loading || widget.disabled, child: RawMaterialButton( fillColor: widget.disabled - ? Colors.grey : widget.color != null ? widget.color : HexColor("#B8382C"), + ? Colors.grey + : widget.color != null + ? widget.color + : HexColor("#D02127"), splashColor: widget.color, child: Padding( padding: (widget.hPadding > 0 || widget.vPadding > 0) @@ -103,18 +108,21 @@ class _AppButtonState extends State { widget.title, color: widget.fontColor, fontSize: SizeConfig.textMultiplier * widget.fontSize, - fontWeight: widget.fontWeight, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ), ), ], ), ), - onPressed: widget.disabled ? (){} : widget.onPressed, + onPressed: widget.disabled ? () {} : widget.onPressed, shape: RoundedRectangleBorder( side: BorderSide( - color: - widget.hasBorder ? widget.borderColor : widget.disabled - ? Colors.grey : widget.color ?? Color(0xFFB8382C), + color: widget.hasBorder + ? widget.borderColor + : widget.disabled + ? Colors.grey + : widget.color ?? Color(0xFFB8382C), width: 0.8, ), borderRadius: BorderRadius.all(Radius.circular(widget.radius))), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 98207888..2a77eb2d 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -102,7 +102,8 @@ class _AppTextFieldCustomState extends State { Color(0Xffffffff), widget.validationError == null ? Color(0xFFEFEFEF) - : Colors.red.shade700) + : Colors.red.shade700, + ) : null, padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), @@ -116,8 +117,8 @@ class _AppTextFieldCustomState extends State { padding: widget.dropDownText == null ? widget.isSearchTextField ? EdgeInsets.only(top: 10) - : EdgeInsets.symmetric(vertical: 0) - : EdgeInsets.symmetric(vertical: 0), // 8.0 + : EdgeInsets.only(top: 7.5) + : EdgeInsets.only(top: 0), // 8.0 child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, @@ -135,6 +136,8 @@ class _AppTextFieldCustomState extends State { // (SizeConfig.isWidthLarge ? 1.1 : 1.3) : 0, fontWeight: FontWeight.w500, + letterSpacing: -0.44, + fontFamily: 'Poppins', ), widget.dropDownText == null ? Container( @@ -147,14 +150,17 @@ class _AppTextFieldCustomState extends State { ? TextAlign.right : TextAlign.left, focusNode: _focusNode, - textAlignVertical: TextAlignVertical.center, + textAlignVertical: TextAlignVertical.top, decoration: TextFieldsUtils .textFieldSelectorDecoration( widget.hintText, null, true), style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: + 14.0, //SizeConfig.textMultiplier * 1.7, fontFamily: 'Poppins', color: Color(0xFF575757), + fontWeight: FontWeight.w400, + letterSpacing: -0.56, ), controller: widget.controller, keyboardType: widget.inputType ?? @@ -203,7 +209,8 @@ class _AppTextFieldCustomState extends State { Icons.keyboard_arrow_down, color: widget.dropDownColor != null ? widget.dropDownColor - : Colors.black, + : Color(0xff2E303A), + size: 12.0, ), ) : Container(), diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 1f1ff2bb..8ca24a68 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; -class TextFieldsUtils{ - +class TextFieldsUtils { static BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor, - {double borderWidth = -1, double borderRadius = 12}) { + {double borderWidth = -1, double borderRadius = 10.0}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -46,13 +45,15 @@ class TextFieldsUtils{ borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderRadius: BorderRadius.circular(8), ),*/ - hintText: selectedText != null ? selectedText : hintText??"", - suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), - + hintText: selectedText != null ? selectedText : hintText ?? "", + suffixIcon: Icon( + suffixIcon ?? null, + color: Colors.grey.shade600, + ), hintStyle: TextStyle( - fontSize: 14, + fontSize: 11, color: Colors.grey.shade600, ), ); } -} \ No newline at end of file +} From 3d379b3b843fc4f61c2097e3228c2a99060e8f6e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 6 Dec 2021 16:52:34 +0200 Subject: [PATCH 155/199] change the green color --- ios/Runner.xcodeproj/project.pbxproj | 6 +-- lib/config/config.dart | 1 + .../doctor_replay/doctor_repaly_chat.dart | 5 ++- .../doctor_replay/doctor_reply_widget.dart | 4 +- lib/screens/live_care/end_call_screen.dart | 4 +- .../live_care/live_care_patient_screen.dart | 2 +- lib/screens/live_care/video_call.dart | 3 +- .../add_patient_sick_leave_screen.dart | 2 +- .../ReferralDischargedPatientDetails.dart | 3 +- .../profile/UCAF/UCAF-detail-screen.dart | 3 +- .../medical_report/MedicalReportPage.dart | 5 ++- .../notes/note/progress_note_screen.dart | 7 ++-- .../operation_report/operation_report.dart | 3 +- .../patient_profile_screen.dart | 3 +- .../referral/AddReplayOnReferralPatient.dart | 2 +- .../ReplySummeryOnReferralPatient.dart | 3 +- .../referral/my-referral-detail-screen.dart | 3 +- .../referral_patient_detail_in-paint.dart | 3 +- .../referred_patient_detail_in-paint.dart | 3 +- .../objective/examination_item_card.dart | 3 +- .../objective/update_objective_page.dart | 3 +- .../add-rescheduleleave.dart | 7 ++-- lib/util/dr_app_toast_msg.dart | 3 +- lib/util/helpers.dart | 2 +- lib/widgets/doctor/my_schedule_widget.dart | 5 ++- .../patient-referral-item-widget.dart | 9 +++-- .../patients/patient_card/PatientCard.dart | 37 ++++++++++++++----- .../profile/patient-profile-app-bar.dart | 3 +- ...ent-profile-header-new-design-app-bar.dart | 4 +- lib/widgets/shared/card_with_bg_widget.dart | 25 +++++++++---- 30 files changed, 106 insertions(+), 60 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 66be39bf..77994274 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -400,7 +400,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -485,7 +485,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -534,7 +534,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/config/config.dart b/lib/config/config.dart index 0511f1cd..4c5374ae 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -456,4 +456,5 @@ const TIMER_MIN = 10; class AppGlobal { static var CONTEX; static Color appPrimaryColor = Color(0xFFB9382C); + static Color appGreenColor = Color(0xFF359846); } diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index 52331e8e..cda899f1 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -1,3 +1,4 @@ +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/doctor_replay_view_model.dart'; @@ -370,7 +371,7 @@ class _DoctorReplayChatState extends State { child: Center( child: AppButton( fontWeight: FontWeight.w700, - color: Colors.green[600], + color: AppGlobal.appGreenColor, title: "Update Your Answer", //TranslationBase.of(context).close, onPressed: () { setState(() { @@ -400,7 +401,7 @@ class _DoctorReplayChatState extends State { fontSize: 13.5, suffixIcon: FontAwesomeIcons.arrowRight, - suffixIconColor: Colors.green, + suffixIconColor: AppGlobal.appGreenColor, onSuffixTap: ()async { if(msgController.text.isEmpty){ diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index 69bb9ab2..ecd0f93d 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -37,7 +37,7 @@ class _DoctorReplyWidgetState extends State { ? IN_PROGRESS_COLOR : widget.reply.infoStatus == 3 ? Color(0xFFD02127) - : Colors.green[600], + : AppGlobal.appGreenColor, hasBorder: false, widget: Container( child: InkWell( @@ -77,7 +77,7 @@ class _DoctorReplyWidgetState extends State { ? IN_PROGRESS_COLOR : widget.reply.infoStatus == 3 ? Color(0xFFD02127) - : Colors.green[600], + : AppGlobal.appGreenColor, fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 1.8 * SizeConfig.textMultiplier)), diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 62b97f2d..060b3844 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -63,7 +63,7 @@ class _EndCallScreenState extends State { PatientProfileCardModel(TranslationBase.of(context).resume, TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', isInPatient: isInpatient, - color: Colors.green[800], + color: AppGlobal.appGreenColor, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); await liveCareModel @@ -347,7 +347,7 @@ class _EndCallScreenState extends State { }, title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, - color: Colors.green[600], + color: AppGlobal.appGreenColor, ), AppButton( onPressed: () { diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index a9c7b38f..d3217a95 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -159,7 +159,7 @@ class _LiveCarePatientScreenState extends State { )), // AppButton( // fontWeight: FontWeight.w700, - // color:Colors.green[600], + // color:AppGlobal.appGreenColor[600], // title: TranslationBase.of(context).initiateCall, // disabled: model.state == ViewState.BusyLocal, // onPressed: () async { diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index e024624a..2d3f1d15 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; @@ -242,7 +243,7 @@ class _VideoCallPageState extends State { onPressed: () => {resumeCall()}, child: Text(TranslationBase.of(context).resumecall), - color: Colors.green[900], + color: AppGlobal.appGreenColor, textColor: Colors.white, ), ), diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 8c9f0f1d..439c9e26 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -295,7 +295,7 @@ class _AddPatientSickLeaveScreenState extends State { child: AppButton( title: TranslationBase.of(context) .addSickLeaverequest, - color: Colors.green, + color: AppGlobal.appGreenColor, onPressed: () async { submitForm(model); }), diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index f78752ec..a52df188 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; @@ -122,7 +123,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { color: referredPatient.referralStatus == 1 ? Color(0xffc4aa54) : referredPatient.referralStatus == 46 - ? Colors.green[700] + ? AppGlobal.appGreenColor : Colors.red[700], ), AppText( diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 9268b031..901dcfe1 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -522,7 +523,7 @@ class ProceduresWidget extends StatelessWidget { AppText( "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: procedure.isCovered ? Colors.green : Colors.red, + color: procedure.isCovered ? AppGlobal.appGreenColor : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index a25d03b4..bb03a9bc 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -1,3 +1,4 @@ +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/service/AnalyticsService.dart'; @@ -135,7 +136,7 @@ class _MedicalReportPageState extends State { margin: EdgeInsets.symmetric(horizontal: 8), child: CardWithBgWidget( hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700], + bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : AppGlobal.appGreenColor, widget: Column( children: [ Row( @@ -150,7 +151,7 @@ class _MedicalReportPageState extends State { : TranslationBase.of(context).verified, color: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) - : Colors.green[700], + : AppGlobal.appGreenColor, fontSize: 1.4 * SizeConfig.textMultiplier, bold: true, ), diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 52a1b0e0..f47c99ae 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -1,3 +1,4 @@ +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/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; @@ -147,7 +148,7 @@ class _ProgressNoteState extends State { : model.patientProgressNoteList[index] .status == 2 - ? Colors.green[600] + ? AppGlobal.appGreenColor : Color(0xFFCC9B14), widget: Column( children: [ @@ -196,7 +197,7 @@ class _ProgressNoteState extends State { TranslationBase.of(context) .noteVerified, fontWeight: FontWeight.bold, - color: Colors.green[600], + color: AppGlobal.appGreenColor, fontSize: 12, ), if (model.patientProgressNoteList[index].status != 2 && @@ -318,7 +319,7 @@ class _ProgressNoteState extends State { }, child: Container( decoration: BoxDecoration( - color: Colors.green[600], + color: AppGlobal.appGreenColor, borderRadius: BorderRadius.circular( 10), diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 6d912c3f..4d566e6c 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.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/service/AnalyticsService.dart'; @@ -320,7 +321,7 @@ class _ProgressNoteState extends State { }, child: Container( decoration: BoxDecoration( - color: Colors.green[600], + color: AppGlobal.appGreenColor, borderRadius: BorderRadius.circular(10), ), 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 0c66b493..16a4f23c 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,5 +1,6 @@ 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/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; @@ -334,7 +335,7 @@ class _PatientProfileScreenState extends State fontWeight: FontWeight.w700, color: isCallFinished ? Colors.red[600] - : Colors.green[600], + : AppGlobal.appGreenColor, title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall, diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 251a91fa..15d176d0 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -198,7 +198,7 @@ class _AddReplayOnReferralPatientState extends State }, title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, - color: Colors.green[600], + color: AppGlobal.appGreenColor, ), ), ], diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 2a48e079..72bd6825 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; 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'; @@ -105,7 +106,7 @@ class _ReplySummeryOnReferralPatientState onPressed: () {}, title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, - color: Colors.green[600], + color: AppGlobal.appGreenColor, ), ), ], diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 8bf89d87..218c568d 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -1,3 +1,4 @@ +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'; @@ -105,7 +106,7 @@ class MyReferralDetailScreen extends StatelessWidget { color: referralPatient.referralStatus == 1 ? Color(0xffc4aa54) : referralPatient.referralStatus == 46 || referralPatient.referralStatus == 2 - ? Colors.green[700] + ? AppGlobal.appGreenColor : Colors.red[700], ), AppText( 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 cfc26eee..d88d5a95 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 @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; 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/service/AnalyticsService.dart'; @@ -146,7 +147,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { color: referredPatient.referralStatus == 1 ? Color(0xffc4aa54) : referredPatient.referralStatus == 46 || referredPatient.referralStatus == 2 - ? Colors.green[700] + ? AppGlobal.appGreenColor : Colors.red[700], ), AppText( 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 f6d3b8d7..21634d0f 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 @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -157,7 +158,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: referredPatient.referralStatus == 1 ? Color(0xffc4aa54) : referredPatient.referralStatus == 46 - ? Colors.green[700] + ? AppGlobal.appGreenColor : Colors.red[700], ), AppText( diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 9dd00302..89691cf2 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,3 +1,4 @@ +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/models/SOAP/selected_items/my_selected_examination.dart'; @@ -59,7 +60,7 @@ class ExaminationItemCard extends StatelessWidget { ? examination.isAbnormal ? Colors.red.shade800 : Colors.grey.shade800 - : Colors.green.shade800, + : AppGlobal.appGreenColor, fontSize: SizeConfig.textMultiplier * 1.8, ), if (!examination.notExamined) diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 9712eafd..c4964975 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.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/master_lookup_key.dart'; @@ -167,7 +168,7 @@ class _UpdateObjectivePageState extends State "Verified", fontWeight: FontWeight.w600, fontFamily: 'Poppins', - color: Colors.green, + color: AppGlobal.appGreenColor, ), ], ), diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index f6e1b8d7..db8a0140 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -62,7 +63,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 - ? Colors.green + ? AppGlobal.appGreenColor : Colors.red, width: 5.0, ))), @@ -89,7 +90,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 - ? Colors.green + ? AppGlobal.appGreenColor : Colors.red, fontSize: 14, ), @@ -174,7 +175,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { (item.status == 2) ? IconButton( icon: Image.asset('assets/images/edit.png'), - // color: Colors.green, //Colors.black, + // color: AppGlobal.appGreenColor, //Colors.black, onPressed: () => {openLeave(context, true, extendedData: item)}, ) : SizedBox(), diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index 1f2ebe8f..76950ae5 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/material.dart'; import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; @@ -13,7 +14,7 @@ class DrAppToastMsg { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_SHORT, - backgroundColor: Colors.green, + backgroundColor: AppGlobal.appGreenColor, icon: ICON.SUCCESS, fontSize: 16, imageSize: 35, diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 169ad81c..368a4c94 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -49,7 +49,7 @@ class Helpers { onPressed: okFunction, title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, - color: Colors.green[600], + color: AppGlobal.appGreenColor, ), AppButton( onPressed: () { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 54df8cd9..5c21f9ad 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -1,3 +1,4 @@ +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/models/doctor/list_doctor_working_hours_table_model.dart'; @@ -52,7 +53,7 @@ class MyScheduleWidget extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.55, child: CardWithBgWidget( bgColor: AppDateUtils.isToday(workingHoursTable.date) - ? Colors.green[500] + ? AppGlobal.appGreenColor : Colors.transparent, // hasBorder: false, widget: Container( @@ -64,7 +65,7 @@ class MyScheduleWidget extends StatelessWidget { "Today", fontSize: 1.8 * SizeConfig.textMultiplier, fontFamily: 'Poppins', - color: Colors.green[500], + color: AppGlobal.appGreenColor, // fontSize: 18 ), SizedBox( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index ff1cb256..3d49c1e1 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,3 +1,4 @@ +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'; @@ -61,9 +62,9 @@ class PatientReferralItemWidget extends StatelessWidget { bgColor: referralStatusCode == 1 ? Color(0xffc4aa54) : referralStatusCode == 2 - ? Colors.green[700] + ? AppGlobal.appGreenColor : referralStatusCode == 46 - ? Colors.green[900] + ? AppGlobal.appGreenColor : referralStatusCode == 4 ? Colors.red[700] : Colors.red[900], @@ -85,9 +86,9 @@ class PatientReferralItemWidget extends StatelessWidget { color: referralStatusCode == 1 ? Color(0xffc4aa54) : referralStatusCode == 2 - ? Colors.green[700] + ? AppGlobal.appGreenColor : referralStatusCode == 46 - ? Colors.green[900] + ? AppGlobal.appGreenColor : referralStatusCode == 4 ? Colors.red[700] : Colors.red[900], diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index ea3a0940..5354bb5e 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -1,4 +1,6 @@ +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'; @@ -10,6 +12,8 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import '../../../util/extenstions.dart'; import 'ShowTimer.dart'; @@ -38,6 +42,7 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); String nationalityName = patientInfo.nationalityName != null ? patientInfo.nationalityName.trim() : patientInfo.nationality != null @@ -50,10 +55,19 @@ class PatientCard extends StatelessWidget { return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), - padding: EdgeInsets.only(left: 0, right: 5, bottom: 0, top: 0), + padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.white, + shape: BoxShape.rectangle, + boxShadow: [ + BoxShadow( + color: Color(0x0000000D), + spreadRadius: 10, + blurRadius: 2.7, + offset: Offset(0, -3 ), // changes position of shadow + ), + ], ), child: CardWithBgWidget( padding: 0, @@ -63,18 +77,21 @@ class PatientCard extends StatelessWidget { bgColor: isFromLiveCare ? Colors.white : (isMyPatient && !isFromSearch) - ? Colors.green[500] + ? AppGlobal.appGreenColor : patientInfo.patientStatusType == 43 - ? Colors.green[500] + ? AppGlobal.appGreenColor : isMyPatient - ? Colors.green[500] + ? AppGlobal.appGreenColor : isInpatient ? Colors.white : !isFromSearch ? Colors.red[800] : Colors.white, widget: Container( - color: Colors.white, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( child: Column( @@ -94,7 +111,7 @@ class PatientCard extends StatelessWidget { AppText( TranslationBase.of(context) .arrivedP, - color: Colors.green, + color: AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, @@ -117,7 +134,7 @@ class PatientCard extends StatelessWidget { ? 'Confirmed' : 'Booked', color: patientInfo.status == 2 - ? Colors.green + ? AppGlobal.appGreenColor : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -154,7 +171,7 @@ class PatientCard extends StatelessWidget { ? 'Confirmed' : 'Booked', color: patientInfo.status == 2 - ? Colors.green + ? AppGlobal.appGreenColor : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -196,7 +213,7 @@ class PatientCard extends StatelessWidget { color: patientInfo.status == 2 ? Colors.grey - : Colors.green, + : AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -249,7 +266,7 @@ class PatientCard extends StatelessWidget { ), AppText( 'My Patient', - color: Colors.green, + color: AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 174da04d..1bd9c50d 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -1,3 +1,4 @@ +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'; @@ -157,7 +158,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { patient.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, - color: Colors.green, + color: AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: SizeConfig 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 f0678e22..46b8ed7f 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 @@ -162,7 +162,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget patient.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, - color: Colors.green, + color: AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -356,7 +356,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget return BoxDecoration( border: Border( top: BorderSide( - color: Colors.green, + color: AppGlobal.appGreenColor, width: 5, ), ), diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index c8e187a1..e36b84a4 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -2,7 +2,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - class CardWithBgWidget extends StatelessWidget { final Widget widget; final Color bgColor; @@ -12,7 +11,12 @@ class CardWithBgWidget extends StatelessWidget { final double marginSymmetric; CardWithBgWidget( - {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); + {@required this.widget, + this.bgColor, + this.hasBorder = true, + this.padding = 15.0, + this.marginLeft = 10.0, + this.marginSymmetric = 10.0}); @override Widget build(BuildContext context) { @@ -27,6 +31,7 @@ class CardWithBgWidget extends StatelessWidget { border: Border.all( color: hasBorder ? Color(0xFF707070) : Colors.transparent, width: hasBorder ? 0.30 : 0), + ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -34,12 +39,14 @@ class CardWithBgWidget extends StatelessWidget { children: [ if (projectProvider.isArabic) Positioned( - child: Container( + child: Container( decoration: BoxDecoration( color: bgColor ?? Color(0xFF58434F), borderRadius: BorderRadius.only( topRight: Radius.circular(10), - bottomRight: Radius.circular(10),),), + bottomRight: Radius.circular(10), + ), + ), width: 10, ), bottom: 1, @@ -50,10 +57,12 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor ?? Color(0xFF58434F), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10),),), + color: bgColor ?? Color(0xFF58434F), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10), + ), + ), width: 7, ), bottom: 1, From 52bd1511e83205a5048c15acfe1fcbee70a6afb4 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 6 Dec 2021 17:33:21 +0200 Subject: [PATCH 156/199] fix patient card --- .../patients/In_patient/in_patient_list_page.dart | 1 + lib/util/helpers.dart | 15 +++++++++++++++ .../patients/patient_card/PatientCard.dart | 14 +------------- lib/widgets/shared/card_with_bg_widget.dart | 4 ++-- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index 6e9ad14f..7498257d 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -53,6 +53,7 @@ class _InPatientListPageState extends State { return AppScaffold( baseViewModel: widget.patientSearchViewModel, isShowAppBar: false, + backgroundColor: Color(0xFFF8F8F8), body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 368a4c94..17e75ba9 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -188,6 +188,21 @@ class Helpers { static clearSharedPref() async { await sharedPref.clear(); } + static getCardBoxDecoration(){ + return BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + shape: BoxShape.rectangle, + boxShadow: [ + BoxShadow( + color: Color(0xFF0000000D), + spreadRadius: 10, + blurRadius: 27, + offset: Offset(0, -3), // changes position of shadow + ), + ], + ); + } navigateToUpdatePage(String message, String androidLink, iosLink) { locator().pushAndRemoveUntil( diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 5354bb5e..f8af64c2 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -56,19 +56,7 @@ class PatientCard extends StatelessWidget { width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle, - boxShadow: [ - BoxShadow( - color: Color(0x0000000D), - spreadRadius: 10, - blurRadius: 2.7, - offset: Offset(0, -3 ), // changes position of shadow - ), - ], - ), + decoration:Helpers.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, marginLeft: (!isMyPatient && isInpatient) ? 0 : 10, diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index e36b84a4..8dd7ba65 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -47,7 +47,7 @@ class CardWithBgWidget extends StatelessWidget { bottomRight: Radius.circular(10), ), ), - width: 10, + width: 6, ), bottom: 1, top: 1, @@ -63,7 +63,7 @@ class CardWithBgWidget extends StatelessWidget { bottomLeft: Radius.circular(10), ), ), - width: 7, + width: 5, ), bottom: 1, top: 1, From 98f6d63fcdf4fc8f69fa921e824f448cd4a2db7a Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 10:00:23 +0200 Subject: [PATCH 157/199] add simibold --- assets/fonts/Poppins/Poppins-SemiBold.ttf | Bin 0 -> 279164 bytes .../patients/patient_card/PatientCard.dart | 187 ++- lib/widgets/shared/user-guid/CusomRow.dart | 7 +- pubspec.lock | 1249 ----------------- pubspec.yaml | 2 + 5 files changed, 89 insertions(+), 1356 deletions(-) create mode 100644 assets/fonts/Poppins/Poppins-SemiBold.ttf delete mode 100644 pubspec.lock diff --git a/assets/fonts/Poppins/Poppins-SemiBold.ttf b/assets/fonts/Poppins/Poppins-SemiBold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..8987d800613f02363aa9fe6b59596642e25bca7d GIT binary patch literal 279164 zcmd3P2Ygh;7WbLCTe9iNrjY>I&87g^gpdvdSW+RO*Mv~g=sh64ND&YTRuCJaVttkc z1r|?0)|2rT5ef(ac*o{O%JEzw#T7diE7_Ss%!1OuGryW~y+igTSca!$=6EmjPHw8wOUx)sk zc%DB4H-a+_@8Y@%*U2;HE?)NY=+8P6$pE6TtLDsatT$OlU5Q6gxZX9le%S)!^x&ar zzXk1W^XlhL{r;jiza@hK;~Mubn7?STcN1k}{A7N0>zE(K-KHPOv) z-W@X~tmsDy(mux>dgTg{sh2Xg^?gsW);yr+f#0XHl@aDX9-t(o)o)47ys~F~|m4O-3NF6(v!XUW&<-Eif9;YWsJgxvh%I z;4$UH#f22|o78bI)XESW5vYQ8f@P4%_lhIGI7)EjG{!ME9BH{3Uf#(VrLo(Xp zzPt!H@q2h*T#3>KnrtB(o|S_ZW^D+WWgwuQ%;GERDdT8{m_jpU2#t_K$*ySsAZ?R7 zsh`|VX)+u516S3i9DR4PEv_}pH;n@6V~P?_srR$xyTJEHtaCc`0PU+4-I?|sKsx}g=e1zEw*#z0oDSYr z(Bpgg4u$&Hf!Crv0FP<7?&MnwUJo63EwE8oz7Zg8s zEO~!`M}hmegkaBy{oz*yXC0qh3!1FXZn#VGGb8A!Qu3hM7; zuh~%EhI_A}ya8nu4b=vq{v{wp!Q+gJwioqHD9dQHyc=aEuBUrXVLq#5Eo5Z6_mmGH zaXkY7mjaFe{tm#LJzW9GqPzD&v?~{}-Z7v?dQYzx8Vz%v|j<2@;J1dL1fXT z(h2xaErC8>9&@KVInj-&A-N5%L@)$+Q&naH~ifhO<)+a2t zv^f+lPf`~V=Y5ssq&x+EkwQZh^rCoq6*=h|@XG?oXn7VSy(dghvsU)z(9OJNt-rKi z+w=13HuO0M@1CDmzXGo+oE5KTpr`7;N4n)$Pr_Z2_B?Qu~1gL%C@ zEmz-@drZsj04IQH*#R#_OWZq)mfz$0e6&1>{;+oh)BGsKFde1o3|^q$DS08* z^I4RkfaTs(rUw8I0XBM187HH}zA`REnF|?EgZdipDRUJ{ZuuU9>I5dqdHFu=k|#b(D}nfKQDW3-GD2H_F~9pF{ZyN{nTA1aJ|qK}+L6)ExlG z5fl0`3Dn<1c`?fQfL~F^+zjAp!<_)UYlIv!3;~=1fG&ok0N`#I?)|~=Daw<8UjVJ% zlZFFmUj!%vcrpHkC|B#(X3)^|9qNk!nP~ra0BCFY5O6u}6{CC~oUV`!-yx$#V zE#OAfZwFv4j3!)T-Hk5q7v|0=3xG3lVq6t%aVA4FW@=$g5tGA zTrc*X3V0ahQ@95@Xg{M20AP<9pGUb3&)?%ppLc;6W>1E7uC zU!V#0)G5G#y~Zb1&X|TL%;O_X%JS#%11|i08*pGLE=scn$C_U(GXuf{$o{{eUs0J@m=qI?GTvrvBvWq*`+pzMkJ zZ=zg>61-r{LHWD)3BzcV%q#Z;w=1xg;D6IJ(5eDuzV|cm;x|V0Z+yc0xe>H5c17FU zQEI>yV;i?(eYvlbIv9obQ&Sr5V|?R7fF}T$ugQRRFQMMW`?-=|jQ@QAE++tf1B3&I z>(S;N8f`od8=#oF8E4XH!+yZ)xEDeB#=)rnfci~%UWDi6sE@}x%rjU^Q=?uQB2fZY z(@MQG{2TQ}zIr^`Gk@`VjYByLkN`-*ecS`jeqjdAM!ahT9Sj=)_o6M+>T;9*sAS|iND zDiTDZaENr#OB9IyVvrarYQ&Hq;(*c9!02sYBrHZtn8j-8Vac-;St=}5z^K|%2aJMjR$H8{v(2V3>g~hm;d3yG z07jkKFlzE)1OtmS@6X;(y-#|Ncn^CIc^~mU;N9=N*L#omZ{9n+w|Vz^_jq@Euk~*B zN>78Q##8O7Y@Kns+v&8^si#v;C!cnlwx710PCVV^bj<1K(@`f^om_fy@ySIen@`R^ zIql@+lVeYOcjB89AD=jRV%v!|Csv+VeEg>4yN~ZYzT^0n$1gkHa(vzKsmF&MuX^vZ z_f7?VYr0>pr6SV*H-CZ|6K$0bpTX_$Vjc|ffdQorum*rw6zxHTh@(wSDA9wkqW(O} z7(fE*ucO4C6N#vEoGuA~y$4T$L=QkZ>K~#+{7m#h{RGN}`Y@FIjOSd9vItOy`XrPU0IZ3ajgV=TNLVBQN{ri{p0k_PD@?m-E9GKhOoHUXxhejicFF&)G{l+WuR_Jb9l&_Uc!^qT+x zSMdOakpQ61r8r1o+9#+Ubd%HOrm@v!H8xw7J7i>)+cbJYwL3S#-L0l>nr-XYYPU?O ze>eaU<;F%wLxSDzrW!YuI7;`UqmsJf47YH)ZFSQ!+|p@lvbm3pa2rx5?C&N5OUfF{ zM%7l^9rlE+)i(Et5!H6Lt0uwbF63HaO^t1z-l)FG-3_;VS2lMRKhNTpM@CfJfW+2% zn>%nsbsg^5_*o#=^0}5@mrz$zQ*BdXm- zN3q-FCp$mf?6e_C=b~-4~=MB!Ns(n42{{!yWD1C%B9Oow&*j;K*ePaO5%-IC7Z=9J%ZU9JzElZAEGe zWH>>Z@H$%w)~AlwvmT|}$^4e-bZ4ZyGq96-f{81@ZRg!ej`~6ei?Kg#0anUzXSFSl zh;jGqvCk-?%c>!UcoBNFr_8yJvz@j)g>MepiL!HdGz7(Y(c}9R^8lnWQE7ii;l6AU zjTz-){y_M=uhfCD>kBj7dCtt(q6~NbUo{02Hlld}mV{zbY?-zS-n<~?;H_IL92F22 z)e!3ti`dcmLPSSl{6a{X7;F&yr<%AeCFxVQW;$%PqOItw_nF7GOuY}c0ezyC&0WX) z-8HiMereNe3HQrXExx9hWnciLDaONyj&kfitmfHU3Hx58>%v}^)HONWT1kBq#E>kh zPe8q{279;TJM};bg4t1CUzp&)2<4a;3N;G)JI^3MgoUL60syo(f}tSVJ79ty>+y1m zLIQuGX;{jg84DcIhiPEL=*CnZ4ID)vO<#4}9e@pPvz0q4craeAB1JNufRCayraIGB z1l`CO`);DMGbA^q;A$`)wP{~{q0VKlI)`s%fMbTcpAUl)|I*a4dhR$y|5EmMI&7It zwQ>mNqMFQonIZ}sa6sE_tmc{9uD08%wg1(#+6;8M3)B5i&g!(->F%Ar6+FbuvK8C% zoPn_{neI%CU!usx4CtpWGnWIqA`_cL$FUSb12VjgQ~mS(YgVi{A7lJ4+{bid`BLO4 zOt80GZ+ndo$1)~{pQz+p2QS{BDZORpxa3zaAml2zfgBZprY=KY4BWi+?p${23Lm9gArAS&ay4Ohl<8?IDy8?MxFn-Wwea2u}FavQEprgNR{qPC{<_(CH)eO9;Cti_6$3UQ-w4-Myc-2SHwtZ{8v&0K#Q>L> zIRLyH>jEqUd`1+9I6@r!;<)FCI>iE(1As?7+QxrNl<*+nH-yxN0d@fJewRwXWq^MY zbJL3Y4*$TM0C_z`{}$`p)|S_pWSC=J|{ z279#IaKKkY-3Ji$NCCiq?t%8{7%P1{;0q!r`gLv~$_N4=29WVIQD#pcfDS#=h_Y~< z^%_yHIsp9HY(P#7QEqp@O@Pxxd5DSRU4b;I7l;ZF*C@CUfcY0dG3JO~fP+LMONd655sgj)yg@YP8?fmQMB^~e@wX9GUrbc<8qtJ!0O&IT@797Z zCZ-cj!aOJ4OEh^90Bc+qLR4=CY$R$J2zY>~5%g^Y-c8d1M~J2Zr)gOGX?Sn?0-_ms zXU2m>Gsh6k!urg5nrJp?J0~3QGSS?@MDr#BfW!Q|h!$X83x@)Z5;cPsiyk9djCjWd zpwR_C6D>JFwDffx&jXJYi2%@I#iv9oD*&LyD)8j0l|-x2?;6m34RBivIRl|B#VI-S7H1eRRG|-^H!p(HKJXh=dP_p*YpIS{k7=# z+LJ`rflk+fzSplOx&iHOXa;;hv>SVO_iscu;`xnew+G|gjPdtk-h00xx()NX4P)E} z8r-%M@CniFSpd-YcFg4tjB^Lp=nl;JPSEGh{X}<3z$Bu(G0r{D65WfoZs4@9JK$@g z`>{?BY#=(&AAsivfzv~G5IyoR(W9{d(Ec#$k2Me-i2-1o#~X?Mu^7;b1U&HFlfd<< z$wW^F0l){(YzF*D^z2-sqgdNxxc^)~0M`HcQlb|Ku$SmXT)(u0=;cTN_~8}s@~bO} zUIQ+#J%{ks9EK-o^OueoXXU24D>U z0CWZxH<)3@8Br z_n%)SI-LZ#1n>*dFW{M9b`$-Y02l{&g6Ma&`~4~8H%LGMw9q=7-?&K77+7560A3Qv z4it#N3N0V-3H0NgB#dT2HQ-SIGAK>m08N0q5Q3f$_z*gJ2MJ3h;3b58Q3kFe5fTYl zMj|v1@D_=1WLbs(Od{eVgn(hbSt|f1Va7d8BDx%*>;3?Yft*wkX9qk$qSIQ0g>gTj z2(X7l=McbaP=h}qy!|dh!;=7iCt=%7!rlY$J;K6E5$YCz&q*XdL?WdpiPTKM^(4}6 zAkl3RiS7jmgLekpf>8KDgo*DUkuekD@E{UBV*#I$$ij6N=F=+x@H&Z{T_kd+AdEZ~ zq4E_7l>_I(Y`|M2`lJI+ljwT|iJ}}5{V-nt?f}elz;qHW&}1Om7axN)2%43GHf7O( z-$+!9LU6Vl2iS zKNMkW;87DrVnQuK@}P6=&m<;ZjSx28pNz4mAR~4PY^l08Nz{XO4T}Nal4!!*rmiP3 zZ9hWXz+*c4o$)1!nMV-j{u_ze!${0Qe{&N6&mhFzLSlY6i3Pn$EQ}%1tRcLQc`j~5 z$a^`7C0MJadr2(AJXZ80u@bnh-hi+_`dfRH#D$pu`VUELG?Tb!42ey^VasO-h3`ZN z9Ba3I4#MBFNL+R=Lf;Udpe@)_=uSi_?4v8BuuN#5$9^Aj_I}&>%5Mq82Y0tMK zjQk^sd!9phcrXb!cw@ht#DSYgJh*_w!>uG9?L^`*c2$x33}b9`N|!3lbk<4NhSE zli-7opCNGywEYZyef}tkFF@;mf<9k?f3fGq*T0bXb|i^^-$&xR3rKtqJbnUC{k)mP zFW~K8K!e}FAHN?U;Q@boPLc3_OHxFU#Mz_NT1XnZk~E<-*CO4ziljx7MBcOv>Pa#f z5E4oqoJ{UOO%)I0Si8Gi}M&gp1$_bKb>qvH6PqO<_lIiHzIfi5ga;!7aPfy^Ll?8Z>WUu>3W^X2$GmK>J zAd;|wWIp;X#QS~zMzZe{B>SOV|4}3dWRP?jNe-M%ve-eg6G)Z~Cs~292gL$D zC0PmltGWQZB!>dWVPi=Se}v>n)JIPvIkuSOIN)84ekM#JS&MrUkCB`_k>r$@NY+=9 zZ1{m>E|QCCNG|@3#9j!kFjnzKyvr9ByW6`5K2T0xxy4-_n=uznoCb>VJVt zgNsQ%w2|b){YgI33vi0$-!ayq$4EXpm*n9Fl8+4}c_e}4;{xys$tTeE$-X3?T8(2g zjPnfUeiU>)hI`LBNj^W41l7 zGU};;q^0d8t$P>J(&v%pe2}!vF{JhEM;bz$S~mL2MIG{8%O6Er!35F@50cg!&nY5}f(uPbTZRiQohS!od;&swS z6_GaPLej<+k~aPw(yG58ZGt4NHlDPJM@XC0O4^jWNvp$n4d}D+BxzGqNSo#%Z3dAx z6L`%UK-%mA(&ly|Z64m8hd$=tOWMMVNyGOW+LGy{E$dI(@>Qg*#Pe0NNLz!pYeA27 zjihb3hqO(%khWzVXa+F{fm zGm~~ikoI^t(*7}sv?pAoJ$WH%PhpNveMH*RSgWUBCheIL0C0ac4S@cR#sRhgFpp#F zNqf!$z}U|NzvnLiVC)wr0*;aPB53;}_~WGrz#71pq`i!Fd>Q+h;NQq0_+~>RGxcz# zku(TwHBnDkoEoFhv?y(e!2qY+Y%rUQXr@J&OwsAq2z!J8d?TVgH;dck^48~MUh8K0 zXln^Ng|jCzKQD6duhV^P3{Flq)3*F!tb#f-V6<(Tb&_d=G3cuwPwtb7Ci&>@UhtsDW51WKf3`aDuY zf}|xh0A`1U8p6ZOnlKrp1pf8GA}}zeibwYz#t#krBRs;SuI8>B3>oiFTMB1q$+V3LJnOvjTyeTKP4OHP<*cIvxaE^8o%! z+L-hpV2$Sp?un=OuD%ujR_|SX6aIOQ?*%JRk@rrSt3^=~rBMczxLi@fprv+|MnjL3 z#1MltrUy%`2`Fa7ZUGr+5*dw#T721*UWG+OeuNOoVn}2}LS#gg$sC`ag1^y@ywudZ zoS4|W)U?#R-28&PoamUCSVwAVT69coOiEO2p2?b<7M-6jbC);unYMDLscc&E__Ymv z>K7TW)Ka=mOC9OCcKGl&h9q};Zp89{kt5BsCJYIAEFmgu=Ja;u>ACq;g zf5N@No;7{C+-vShMoRYnB;P?|g$9lbBP%6{_$qe*_^vyc&?3#2Ml2^>0OXaJOorM3 zVK6wD54GALW1yyKPAplKJLo@up{IHw6jssoo z-e2Th*e3B{r`uhDMq!e1f{d~fxd)hU3d}o`CTEbzsF{pVP@3W%$N{4f-(;DwFiuDU z-~Q4Yn-=^SiRLE3aJ9vUSUrtu5LH&oR#>o};xP3q%?c?z+wAj!VT1@wog5pMzDotl?m@ z;GjV02?LfQln2ol6%M^VcYzNp5?ql?1&octKX{ER5N#qTB94h7%muOLSaVveqrjY2 zkX8_zCVI!s%igddZ+7gAnArvE*X7KQl^<=ZsqNWwQq9(_6Q=acm{_w7_>8Bia;$8G z6mVkeL*yIAnv4?I!0o4cNH0+X=U=Tr5CthQYc_XE7ts#LE(lf#EIIbjrbCA|iCfk_ z_So7ZN6@L=TTPEcV+B)^3vngz8EN%Ul0uI6i9#ucTO*>v4d%G?f}9w$$>hk(&d>WbPW9*?SVwF zy25$gd^*$`!TgZ#Q<2a0EXm9)>8Wc*yp`gu5{I<=F<2~gEp9Y3*=O=Jd@L9X5s)H6 zFZO(Qz%b*tUD(ihnAQjhlLi`ag1&^&xTOZfw)Jgbh<|L_c>eNAT~)gA>@cH5$bBR47mUWsD;)T^Q_5sH1UHOijEFFRJ~#W^8~lWH2Nfc*@b3@;R;4)X%g6 zHvVpO#ltjcdknc0g6_Lem-xuY?j~lNy#882eqOF4$pmQxQwLHh)L^zpXU5OTA8zf{ zkd-gCh|TY=N{&n#kUSWl>IF`Zos=~^p*(+2Zk)dz!~1(WmowH z%VzPX9>3V{>zbE z>E~dELmxAlAkTdm`WOp%v4#tZwAvk!k?|1$=FaJnie9ikKs9WGw49h2mf;Spcy=C3 zcC(}JMQ^Pr?!N586Wg^da=@&Ds*zo~Y|pLBGF&WI&7C{iH9pkPecPnw=6SvP_MVlq zXiE32d^>hR7IOS6TI&kLrjsWA;}dMLnn@BYW+MqWtKbwf>tiD`Ni2xa;jyFb zu?t}UlFjYj_PvOi#cFJCg=j2FEdgdDyideKpt3}SX3ewbiJS=7gVAE=vyXXh5#_g3 zSBn6V<$2k2diy-_x~Fi(b}#^xh8!l}gXOy9fC2j0&)iOs*E662rNj9H6oms#A=VW!_Lcw*?0DuB$*wx z;xW(T(Ur5NbjrTytIfe%Ed%Ek^~sl z*!RX-m;jgu_B5NT`j%yuOw}8M>HoYn zObgX3?+$bb{eiu!_usBltd!Lf&^e(~Y*b`eNI(}$7b|!%CY{)j0Q+g+y8Qf{?3gH% zBPlg6+zwJWQpMq-h2`b*`!6jm74Z|Zn^s-eeAQ}Unz=Y=y;Y=ExE7a}iX(HDrgmHN z;ig9pi$x2^AgD$-c#uKzbuv-m0hr~m33Qf^4}nD7zD=ZgZ5bHHy(mFf0wqY zOMLDRda9umjh%|mnX-SH<$eM@w9kHOd;!UIgjH%auMVrm)us zQK&N!yA-KnC5W_iU})c_qW)9*d#=CmUuzpLxa!o7{sm29XwjU3#WO`=e*UDw!hxd~ zEgn55H~XR)D_71KI5`eljc~*x2gonmSP6n26VtC(scm`dN+ zK339TeoEF6f7Y5=$=A?;bu@@Z{|oIq{UcV2R8lO-WQ8pOlY%W)@KZR~AmUyuT2Rz~ zPXD$2d&i8-oW5>j^QDVsU$$_uaecTrS~j40V40_+VR3?O$;pimdo~_eHeoWR53xXB z%06nTeF~EuxlC5uO4mVYTCG-HJL@iYl=PK{;A#8+6W7AT=vm?^RCmyEgST1)sg9#4 z)#bn)BlHRkE`-0dDHv6m{FyWaW>TazLM^q=VA0weOhW4B%hhd$lXzAQ>lxn8fEq;` z#Rsw!ssRQRJE`YdvysXu60wf70ysGD?R)p#eWK~ai4(wVG2J6~$OJI9nYu$NNVwus zn*=egtWio8=R`c%P=_sM1T2>J*5lGHZdkMC+tsVFs1tz9CkmMqSCT<=G}+nKRrV$< zkw`Xf3kuS5V$BoYeb@c&yBmQKqg0FUmb=UEfKURxtNWoog$U7RG#C&ogBk=)>!GOC zLSY;Fh^p&cW?>fY(C+FL#5aI5B^Zq$qZb|6F;EWC@^z)4r`A4ro?MHY+FO_^2f?TcDAd!1FFAI=xd z=5A)c$N3kp^gQboI2EudH8M7yuluvwVpoS|^#s2sCtDrKjzENR3UVWpbFvLkh`fdQ z4{J!X*`$-fkwno^F|lU+`U7@;K|bh`ey`|u;DiW!Xi3Q+W5wEO>yjS)YD0LGse5+A z(|5h$`SP77I)CjsE^aKFKP51zeBP7~?h-+lfAhk%Zxr`gb@Q(`Tz0{hoJ(e3ebDpm zGj}~B=SyKcI$=U(Wz7T-5hu9t+7E%}0@+y#6b4ucSVQC zH3=j4uM37o6M_}W;B-{6Q|5~%g@$%Xh>Ho04vk9cZZj*brAvPn{|>t~8gznLr|E^G zN+ir)xutCMs#%^lTGsX~DCoI%d(Yl|dbY?%W{kL?TVUhBQB&ox13kxOdAjCI$i-ew z_Wmkgl}`evELf;QV#;g^X|RT23h54xGUWXVE-AuckAxJDc~V-q~~El%-3jEXcYubzk$!RFX0QKn{oEs- zCl8}f!M%$Qv5Y~~69NF5pJS2Cq&1+p5o561q1!>Yd$!YSk7i2}mRf}P(DUo(p9_;` zt~@m7!8wo5;lpy(_iq@*LP}0TmP?Hd3uSYFKXi`>-CFP=lH!gy_*rcEq2Guq;r4v+ z;fL}Obm(~l-7)n)0QF;;9}sX9IM9^f3b-SXZjdLiE8DGssTP~nX@bgttsj|WHYapg z1ndz9B(lk5YrhQlGzNbz)d=E@xWk@r~*^A;-DP<_%DKA2%!?)@L*Q}+LsLvwOV2#D9qlMD~_LFLD|YU>ru_Y zNGMT`Hl(0yc6ktVg~$*?wkF32HykY=GS( zDj8Frw~E9^B2vgb=J0&2Ie4PI-O}>=L!MVe&j(vE+h;|g=Vs4dd`+h_#zW}N*fwkC zYDg9Ky5Zd`ijwr$c!Vs@lM-(c87=yrSc)krrnw-4k@Y1D+e|qsHk@4b-Kfk;R@?hODQE=>- z=O_+x6}E#wiy%a+9WEOdngl!;>{K-p)?2ZW!(op|GIEFt;>H1_;YUOned0k{6Q-9f zZV_Vn2G3=S^9l>|7K_RDG|!jvk>z_63MLn*nQWG)F_TaT{JyTjkU(YJ^_SgyEHt7(4tcI5Ij77!RvM(|ju7ZAF9;|AyFrEuYfdIJFz^XK=P)#xLPAZnQ8is#hq!Q5~Il!URe zgn?|y^GTY)ErYjIZoBR4J@^p&UeBmOm6e0I+;}O69WZ_QAi6X$T2MsTfxrwMp9#pB z$P}ppa&`?{8geGYyW_FPc6xFC-};)&P%;v+G3^_46U^NNThz&2C1%-fFGuobR{J6c z@&W&GXI8EH>SKF0U$W=vots*2yhurj&pe$_eu~KAmq0KZ2yQ~pL9B@(2Vv{LDnZv0 z>X=d0B@onPWTe{GLbE#3VD4x+u?2F|yYJq3*`^!cd+)}}HbWxb;<@G2DKSY*I)!W& zkP)dC=sJM9xZ(p4bjHT=iC8QL`i;~*al0c=A*+ckEnn^4anFcwv-VWEQ+f|%eKr>hVWDzZ(ck_fjPlkG)7JcyJPJKL2 zL-%^R&Y2@VLi!PHMkIJWBEe?r27X3AdL#$BXRLn!sUc^u9qYt$s0pz7x1~!F9A5PM z8jddBWUTYZtV6(N5s@7C zO##)w8RF+#_Fnq!=5KBn^F5c#=+=Lt^=$7bdC<#Y?!Sn`$6^P~mR0v&bP?VPlq2a| z&55^6_rqq$!v2bl4m>3vXoihbTc0hVj@~WHoe~{_-8U{b3Vz0%=DF`Wx_W&h18> zIJzvD1pe247Mkwrr7{1A-^VW*KYqyzeLuPCs+0X&T8`}+H-6W6(J=YO-}X$M1mxK^ zJS}^JY|%7D_vDhnpXW2rRjk5qo+r5ex*5lqT$aByRNdEv-)KDXzdXORGoY5K+*STYiSrZL6H%va=zsFZ$VZY->E(689Pwv zxc{VKPXaMoay56sXeEtF(v-4VDo zq;f&kfDj2gnQVleO4$5i|nlUaX>ZD#x-w0{{A4 zuuQ*0l)#4-x?7g1Ts~3bbCvW%EYKFV0@gVWwi)}#(V#AiGA`fFTRLUgw&LcJ7Ws+i z``Xp>J&%a&fn{X_JudYqF^*SOLeaVDj zOJn2Z_X;21VvGVM0;%jl<(9Rb)F1&^sMSdIduY56U@%Z0=7dfgpYO*0U_0-vAcu_> zcyE7y?5Cd&9R}rV{^j}H^Yv%?fbds8!F00pi3ej&DSoFl!Nr#8{Z!ts)O~L3 zC#`(62`XtHLeL~~B*lbOA@C8WG*NAU8M+<2fb*i*9YlwTln55FT9cD3aN@1eDw3iO zN80mBJDwTPn9ybFfX3y_IXd_B7+u>ZKeuSrf-?-%#z;MUgscTV5rj~M&en=+;axH^ zK8^)0?b%f!(jJ9&?1}-;;?^GE))YwBIt;>I;UHbQvd{06_Z&d>Th9q97|`(nD@%3} z!a{@aOTA>a8W9gp*0W7w;9haGCrPXtJ7(#qQ789)zxUQ3=8wN|+_*jC(ga<9y_a?a zhbj;2d)>ak`kbrp86UVPeq9f~M%2?_=!Tp&Vte47o2QGAs^G1XcmD`^k|8#wgW!ZO0CM2AFa=l>uh; z`Ij80?5Zi>6Iw&}J)J9#tuS0>8qv*JJb6;_+Nai-E(;i$mcQEGr=~1o@JHaB_{E zXBAeq3{segsd-B0=BU_URE$U}sTn)5Z{LqU+R~D@Y_ifkEc3@;FN-qIO9RWx z2cmm3xNrozH|d@)>p<{v zseVBUUiIVF&OMcnZN6*gl)9aFZJ##nswPHEEcR?e&$Z%K4=AV*Goa`5xTmRq?VcJQ zxPSMoY1{ATzv%Seo=^>4t?>3XVI6~ zJBvJzE?z83*qfW-O%q48$H_rRud;Uv4?~_YJUTo%%QH-jU}ac%LVeS0_ym$_<>6 zv^x38KH)K&8oMt`oEatAwwUSNLO*G+(kRXqjj{bXdw3*-Kvc z?v4QB?z0hBGNr?-I^x)tz!W)ke3rp8FySw!9_HoyrjVEV6!6}@F2b3g?~GWtU12W1 zYlr%f5@W8Zc*wb^+v&J;iW{Jodbu)*lbOa#WTwDmA>{TzEltE$71{_yXhM)xf@4Ai zQ^G_T2llMleAtx3`v*pxBmd=$dAZ4ksfm}XvMEvAFwma(C`#_5?QJl3~EPQYMxGyPnd-#&@U3&8NqnxrWA6G}apkzO!Blki4 zIDsl%6){%i)Px4{K}IEq=#fc^d?om`_#rX`3vr?e6A+R|jOUrvAcm|B6%^koIw~YM z0O>7A{zdE!`7&n?YV^$Hb_vO1Q2&aG{{v@)%@>);0Djh(3Ia zESbAtaC&X2IlOK_!R!lG)y*iJIj}A~pspB8QAE4NPqG?EIEmE9RS+A4;B2S~pSlDF zfTiGI%F5_)DFz|@j$8|Hprk2a4rR}$BB&Uh5W|NI6vgSCrld5acc$iYh9^QE$oVw+ zQg6lkiM{*u&s^Z_-=}w?txq3U#+(dSpFYo&=fIK{2bX2wX-o_rrmx88)7KRhIoYGWcG2l3Ay z5zLwQ(PpzcA=6Vs)3AB<$ekQV;j! z^NwToXM~EGID1rpB!cR3s^bs4A)QnkiZRvcixqa31|joP3;z?>itVjmdz#TtvNu&a z!caT01#%=JY<~+lZI4lqz+8OnJywJ5LiOl zTj}i4uqa1+^MZ3;Ku{jrtm7N(l13&VsBKr-U4oB6qocY?PR(hHZs&0dXRe-9P5zZ^ zz0_1Oq~C)R77Shf)Ur!W<*3)pAF}+(<({7!`W7|xl@TKb+MR>OyQUWA?U+7k46ZUN z#=GY9%H27Ak|!r`SYF;R%s)`h5f$=VsIM@})%Q^d2nkP-O?#DAY()(>#`6uraX)B1 zyyhU>4n zGHPJY{QRE%;#SHhpY=R-^r-0jZ1(M*&+fcabh_Qschu?^R}HVoD_c>{nNywdv#)o_ zr!cOSa$UX71iwt+D{LtPXZh&1eLA1wStHpJ^!Yj1N9pAEbJ~YDEqQr^^YZpKUY9&) zj^lc9ckYzDyvcd7*H7zL=-Ja7ANx@TEfa6z|DeLCYa9y{7l(V*Qjb+jjih=k^-u)t z)q#bc^JCOAe^%CRsHxfDd0Q1C?LPeff={u7pqg2ykvRpHc>g}dwll#zomH_6z_R`yodjP4SM`Q3?gOz z1eaboCd1(ytHc0&A`xJ!hX7NV6zNrg!eUV|48?s)=IU9zoTL3;zSvVqi8F&4(0PCX zpV6E%DhQ^A!W+;-kzKlUN$%oEiin7IAS4_S1UVY14n%FKia%|pa4UjD`Y|H1?)^y} z&ZA=B(W9Qnj(#BGZ@ty?>8*Qi89FAnpn2x(#Oms*q~zoz@%yuiOLsAQf=$JuVU2@B z9@@WOtk~%2?*PREp~7=-GqNW84TTIM--DI zneeLQxI>3L@(?~`&LkrAo-;XAtLoOH-~JtrNDW)=fIC!706g(qrr#PExTW#kSK2gZ&X*1cO~ zOj2(DvXQxo=@>OaOoX^TN?ln8Ft1grYgyL4ye=>X6~#V_tZ6N*8eQb7-aJmsHg$`P>lEFkQ^s)PRJnD4%UKwy#rAd< z_RmX=wnvqe+7*LzJi94~HV2+MB_CMUJQL43xKaxbCz9|jWB`sIfHxL{JwpzfE60;9 zhHfxrA|l~_@`(qh6R`W4#z7MOtW>A_6RZcXxRwZ*e@~$ha ztjfP)LD%?Bi3R5D{8{}*1@#DA12m(+9}meRkg-TwQPLPv*!PKtN)$OGd^xlbF|_wy zFnj1I&mQbv)>n5beTA%MHoOo=7Ah50Mdj4yZI`}59DT$&ciXn@lRGFUXVA*|^WF0n zh~o|Ud5w9)8*goBxD|5;ahHkrd`cnJnUYOIqN1>|C@MAz>G!%O=C27%0j2<5V}-IatB7XIGv~k`P@g{`RTkd@O$He! z);yk`KIiad*R~!OYd3k;`RID$+G__49N6cS=SI$#!5&WWdgbF-q9~ZpU1^MKq%L8C zgayR5FiR^@!@C_ecN3dOH32Fw4f%!!LXMg`8t>EzKc&^RQ`at?6XN+BSicks2EV|K zIadm4Il`giFCXhDk49|rY~Ez;y?0Cpu_R|8#mC1V2I_$Tc9fD(b{v0Y(JQV{mQyzP zc0EL3faW_DDeoY*LNKoo%nK6=z=SN}G5{a?1_cB*C{Y%Q`M?VF%d)D7Fc}n-90c9d zQU3i&N1>r`OU@OHZJpJ)92psji5XcLSv@nI>D{}frKTi1k`nEScE9M1Z2Kza4@IXq zXW@JOfiN9C0n9M_@TJ$b9uZqNd6t}4x_Z*i<_$^J-hMJwMXD3%2HjIeaK!*=1~?f7KUB+6k8T_J0yT0x4R;OEM-CLaQHq>wb1)K0 zEykv^C>`X>V}{p6_{2UM22OZbNKkxmd|O^~2x6b@@|p{hbeji;s><{|8@v9Am60jt zK~dAVG!2ewL-crtbAvN|0|wVuWu3w_lH%D4(s2zCCP-}<@Qr7o2)D+U(-RkqPhsHT zwV@VxHfpIpKQ_i!o{gGIxv^KOzinv!)9=~B#cjjwl{VZ;T?2L8uno-tCNtak_}$6> z8N+-ZX1YSn&pjK%?1tjvhJllMbm`KgOB;so445%sz>Mjgot-;#em~YpTZsIgFc@M3 zUHv0e3%iF3dI1C@O|yfGSZRdxeLGM~3@w0X7Ph(?qNBC^PU+cPmY-9xdP)Q!yM#v@f6y1Fo6S-elIK+ zBvRTK`VIdf&>|30t-%j)5jZAE*Payz{(|M=U)J=3VBnh{+#nOqw()JU^M=u{4YlX4u6!`UH}9COmh2BnEL+w_KVr% z_m8(59YkW^JQhI-P|XXsJ_m9md74RWO%Zgc-sC zimUM~(gvQJ#os9|8o%Ta65KZFAoU6R8S*Ckc3@kqt1Y`<^jD(67xnU!Vqkj#Avpnu zJZizsWOH><3r>S@vn`Vv%ZuNGiRRClIQvb5-xGK0{uZ^CtzFp_0cHQYZm>?AY8rRy zR8EUlhPCncjgrYyABvL{73SgyZ{(FPM zOY?q@{<1Wd&HPItI0|Mzn;l~uE9hsN>Qg@m5^K0MisOeWleYs+)c}F*sOfBxt?lUe z`v*QUa8B$2m2w)(34zFV#y1X+_zEZYk8A)0p{3=%3Q^r@S_nX(5HP~;73}j0p)?{i zq0)%ZjH1Y&SFc?Fg$T9yaJ%$+O;4{^9LDUAua6XuN#-%#JLBB0wmik);9zSoRw70v zx`N*#+nhB$*ItC5n$bSnUh$zPxPW^m}HS%nZ2tE%-oN=Ok>oU@3A+_lqZx0F zjJM+$rjxZ(WOAe<0PeA15rKm=M}gAzu?0Cs_FZBjGWpxeG!Y|rR=;@lvMGi2O*Jp= zTt20s-gDWMrD-A~w{pso6whn9a(IL1&10qg<~E8R$4ZNqubw`tkEl%b6s(>xvbX0T ze!fTlR6y-lD~n*CMu5Do$F){s{foMM7W1S%Uu`n*7h`v1KS?>RIK;NG|I(|QJ zW*ipG7)NbS8g#yK&iieG6`Qi{`-Gd2o8R#h1$kIk`s&jMs1)9gIL7vE$Nyp^UCFeK zCGN!rJa@Dw{aa8UZym;CW=1esXJ(w~HlA;C$Oz{j6Tq)1bRc5KL##6hT+xno&qZWO zd*+2e#|B!Aqs@73-z}t_YWs3QzQDervZmx9 zSnm9Z52oq!aX4Iv9({-6IGqpzxk3)sbn4s66#lkJeQ3ZZ10B9@+Pd`2*G;e6)3(V& zmn^>(A2$_Z7jp8uTYimG(RB~n!a@<7@muKleHNUn3O+g4R9xAY*~-ye-bwoTz@N3k z>01K-ii@us{PrEfo@iP3-jd-pl>`1!vv5YWJteECM@((M&@R0ZkjQBL zMutycI&(+Q+;rqvs3iF&_31$n7zw9v`2QA?(HvpJ_YbgOeEI~_KHo{04!Y76*cs<_b`hv@#Q7WhOqi88 zkPe3FrT;*nigIB?u+rr$1nda2IS^VmFfcg~T<276Rq_s}*!_9)8dsvg0kKW}f*}9m z+u3?L-85dt!r4RijezN1V$?}EPEPCQ=M zVP5Ue{yhcfpPc4W#v4zr*frqHT>$y7btBV9CISeH~DKhyx{^H4d5#@XYUkvf88nhrRazkE^=YhR;4{y6VhmG}5SR zM$M|0G?Hvf*2qP+iY<3rmTXy;yCqwe<$@b-*nn+HfZPxgAO#X~lN(BGE};ZM2ni`S zAzYFWZZ2uQUkK?TAqg7&@7nvEnKL7eY(xI%=6jwm0bF#-KD(~#@wiR25p$B1RgQ1Lw!&iTK zB{7Ks=a-jFD=93<&%=3#a~xF7{1itbp)oFOhMkNxew)m_2+*C5wum3z)yO0OeChtiDRGor(1?0Z0TBJO)1hz^&4 zAw`!s%qx0N=|XUD{4rC8T$d+F8e$^?3+LHS|I8l-<0)1y)Z`!brhweV zhb8b4%a#rWtUOYdZu;jLG$%*#V}6|j2kM=ZjhtOz`{E4g#2G@9GFK{=z9yz4=;o2L z3^1A50=AXK0*fv(lMTvXI@|7A@8tGgmG(Nk0B>Rzpy3EkO_DZ8FB3Lk7L#bB%g!SG z-pI5#a*}!CeB_oV(&98>B@M}s*?G_N!%Kkrll9@WNb6qUZj_)J1>c3(=`r9tZt{(N zp7;tl*P+$na5|C_NrBl-oOtrVWQ`4}W_^AAa*ZzSOE_QI zQORH7h6w<3$t4xPe9sNLLMj^JDG}*t^5x4>8ENuU0^$^1Mv0t+sVomzLlEcxUyTzG zOhofoGPaE927XxsVMO+x@Y8anCq=u;v83Re5iCB@H-p4>1thi!5ygB4AgaO!*KkuM zZVHr!5!YycF7g$)8lXZB)eO$b&hR9=lMxM$^yenST^&)AiN!_va^Kg_EzOTR7d5>= zK%#jc^5b%(+eIJc6Ci1X!^U+rRq&N$)d-^($e-FVSGtntwB=4ja&-?A`D|EZ8k!qQ zmb7B&L?=r|Z`cvj;ZM4~J9<`(>d#C?nkO~ObL5-UlLdeRey5%rI5d!tglG-=U^Ofb zV%QoDU8o-jLGe(o3!NZDA1xGq3?*_Bqa<}63w~atyomp@f@8=2KmyH`!4#@ufSM9g z2D*I*oDw_E+#G3jAekWHoHRh)Dj+O|!HuaJN}iH=p#T@S7 zN~9bpCMN85a%_)3zth3LgKey3_F>t35l#xWTe z5g)r&W4(xE$lu}J6fx+5o-a%b6;{cnMQK7k1CyzM=ZQzANCLnVgcI-!1}2UMlIIDN z;E9x0N_bJ3tVq>ViL4WBR9&;5(3zzZTEADnzGRVosGg_*_F*3(|BxT6(n6ZXXtpf# zG(-fIAz6fj2a-F;zhvHjzkIn^%SPl@<=7LUoJ0W5JRMqSa@;gA9XbaK7FJhi&k6-A z$Pyz?hOi-HU8ZFpX9RL4J_A3*Za~_4ls%2L_WshR-@;BHk~B3SZP7(1s*7kt%_W*N z1Px4E1NzKlDmLMKNexG^^*;c)-R@8W*clUWGDYoQ_KQC>P&5+baFm63O%$HfQLdbz=R`7vo(-N15rkL| zDETV*%nAMkfR6-h$q1#pkm{ttjQMmZ3Bo_kD50&wjcoxYf*P9<$OUO1Ylt@W$uH?f z&W8kp6Xq42K4$0v!%3j?hqicGMep?J>D}yDa}-90B!b}53DBG%hTX?|FHKqyn5Rjh8i zk|nJkFaD=>uad~4H+ckfdVu2Qa1@u%Fp_!F;`5O}XD`9nfN=A237ds*i2ypeJEFCv zX0ncBe^J}iE_6#mN=NdaLMmZH;g}h|R#avv$hKQe(O{^-M5)BlY>YzOB z?>=1DF}FPUTP}85o0IMdKJenE>z6kATirL1?CJa#+q5{gi+OQA`OvtVaGn#8aXJu} z%*=|_B7@+`ilC782h6t-kr=XyKb`z3$<(mSJ43ds{;L4X>osJZNAihboq^y@ON61MDzlr7w z_2Io}c?QwXcnv7yKduvt{F8O#t#{seS7bjfUbSV#iYGv!zG5_K8_2zX=tfszDA8Zd`8==@^tMmv@i12sv$LRyB}7#yD5X(l_^}52k1LMV zkkjC=Mk$+UB|7%wQG4_3>X~6hIw3+Pzg2%=K|_-hbLoGH`9_<;y%-7NRUW5tuqsIU z=GppOyB~pB%CN%;L2Bx-4nsoWaK_anFUl4yi@Y$D{x#|4-2oKW@uVYl#VJ8)4CkL6 zxsMq_Y%H|xid4POu6yrHNcz#1yJX4vV3!)s`cT{0BkTBnd$_H$Ggz(dwirp!aEEYA zCrO}ea~sA?HjDy)R56e(W9}w&oHH#<-S{?GJ3u!iqT-69j?hMRPLV46>eokWh%wcW=D2qXtJP$R}CR@@{!J{XX2JNH5O1C$%G7pkiAIqBBZ*C&6jFdLL4XqS_}Mg*q2vx zJ&*NrS0bd01j8(yrStF93^V9Dhv@Ob===;>WV8Rq?hr#xHW}GsbD>a8gZ^1qV*I#1 z!1W%pKup*JWWX3AKtW|h9S;QtC@plUte_}R%xfuc z%29w&ei|nz8-=x8$dRsaOg~XhNv)}oMF8K9&ya`C==C4%OILfcyVnX0$eWt{sPuXF z-!vV_8Ow7^`NsFb&8KVt1eZf}_!n`Qhp74Ibw|0}2^)xZyMNMX zE55>AA9E4JjJ9ruk++IUHgYL`N7iGT>f#x}q&Gt30*E*!DsrkMQoEp| zl4}cajSE|^WV4moItzSxxg^ey!cR^IrTRxYe3F)b!l!gtu3yg8oW7tzS3n`G+^^ga zcK!-Ne~&)7;yX#hW9&wPr3q;nuaZ#00(u6efnuZ!kmS2|#zTyPPIfP0 zLZpp`JujI-(G?|PwZoa5Awo+&Nk?+~1??zq_sAE=OyV5oZ@`g}j3Z;iMez#paakZU z3b02_3Wva~`c4R9ktC;D;4pMu_@^i_M?jU+5pEa>n@wn#Cgh-NV84)@C6fW|Ea1qE z;t;a4{9KiOppc;&CwT+8WT?tysM4sadb==7QGXjIDJ9)#VKz#7`W&~gZq%}!)I2Ay z2n%IdWMNC95=tz32P&Zmf=LIqDN&QeC7l%Nw>-g;%Fbm1MTV3cxAKi9W1rxpQv^fk zsL_s;qg|u>AuUD@>J$^GGv!mT!^AmInu?@ziEFPbeBuo6C%PIajbhR0OQ8hs(^d)s z5pT#s$=4-)Rj1`kUz4k~6lOSm4X_9p;4)N5CuCQC}kC41@@HgS!z?}bgK!cRChZI7h{Rr|9 zwoB|FP_vm(DTd%4UM(gc3?eER!?OTkh6p0kWlSuy)No1VA&JEm4|L<|#f!rPC1@Bc zy99KIabu#CO|o=C9FtT*o@!N-v5ZhJ3I0ShTRjo;LzhMToJWO7Nt&npUg=rra~ozM ziTY51BM3}F)JJ!o@g6y(%{=rc&{KthZ0?u9lC_N zjx(Yt7RCWF$l9piroV~-v_cRk;wo%g6W*j=C+f3;xWlC;qZwA_@Y3qIa7vp&W0|_o z!qj;do3&AF*E9xDM1nhM5|cJ!C?<5BZldz8`<<@qn@uA6tu6gD{#)lvaY;X`UVQF3c4ynjfRW5^_NoFW$M6B{@$!Sy3?cG(^h? ze*-Q0=h)-x19XC5ED$2WlhojG9Da*$6?|9Li7yrr<9r zIXj#tDi5g(lmJYXU;qg#Zhy3^1OxOB6q9gdU%kXPL>>J)TG%PD45F33L9`ReOxV&z zL8%n!#3l99#6pWcS!e?eeW|*JLg$n2hmjleluyxiW9m0LpThlyikTWJ8!lk=BXw%& zdN4Q^p6~b+A&;IZeI&%)qq8X=3k+3;;oza#ve_hj0J4I@U8;UhLFh{Ab^RrTkAyv_ zt9T;54W^x-^?~E3a{6qOa{6=&C_HXoQ@?h?*p2;b_?!9EycbiG*WFXck0YUou;>Pb zk@|7e+@!Mt>MNnyc`ru_bhC3zEl$+{m zY4E?6Da$C*9Z|z9_!)LAIx9Arhvfxt>~*yPw+J6RkEkh}9>Mn*-VRg+m`EDC!iAhO zhP4#+NxDa=l(FPwNfMtGqKsMKi$qh#xNoA@*q_UeMYF?>;60#V1ELl++Zn7j~rN-#STUjyIK7;Jc`hY`<)J;Bv@^Be$GV%4jL?m$^o+O<#tG)Z~m*c?YxukCYD#<6OWNhoBd%6rO`eQw20_n6oA*WZ593Z8MOR zjzwb>(rN{zFb@6A(|fM=Vooze3Iw4Pxljt=L~T2XN5JCuFpo%qC_;uW5!0(7^c<1> zZ)gxzH2p4sO0YY2`t- zJCq;I4#AiqbsOkF5bnX+xyB8}{I9we1vg?uJqnfw3no;OLYOZ2ew_DOsl{CB$&2Fi zh3zs;f|x7+e7K`liwUu1glsJ4zBo()HP@7k+pwn%zH`(a(U;QX57kx1M2o&Y<{Pj$ zGO5mEZVqYxxq0#5P`$@^oJ&q9jG*RaRJ})?2{d5{<_p_k(s39&8#WK%_=##DsnUmF z646MA4$2Gp)**KtWo@8;36n@TuBt`k3tdPjTJ>jt)w3 z;9_*>1-&68#@?)1L80*vnLpYRxR);hE-)nK0H<`MB6I8?vk2;iu@YT=^8%SHla9cf zS_lGm6T1_3lM$8^v~MAzfdSyz+noOry%wPGV>dzGK8=gOaO=#i>l`M*KpRp^v^>sj zv!8`}1!oYi`-u%94*`$CO9ZGI6lCU*$RJRc|D_6`Mfi-Vs(^k79??{VK>r{-BwmCD zn@W!4m2SJ_&Ckn)?+h;{oKePLPjW+{Y!shm-z^vWfVP1l=~ z^og!FDPYdKlauOn-AT5b+A;cp(DzG>djq7Ehw+QqpOfE*4h5~CqP%n(VnUd41(DrjLwx1$t=y9&sYW(Nee-I9zq7HF3xxG_uL2qkru-JqWun84Nw?9rB zY##RU|66vUBL5Wo&@a#lu{Wa4q6e6iKb|d9O=gD#nKx)F;5dUNN?Ak{Oo!S+9|fI^ z-M|^W5{aDW6$t%suRWCj9a6-uG*FA-h?c%XVj160xmd=+y zOqG0du}lx59+ywL!suc!jTh20Q$>L%+RTtKVU)`Ji@uO1lI z@AlJeHt2U>(|rigdh>F#$)BP9i~BV0Xa&m1nqMR|onQ3lhW7TlJA~f%Tu}flcW!r* zxl~<0w-)XQ7X#Z5j|=_`s$FwZXMzM(Ae=@1}`f+ zi|jW}X5+n}Raql1YqBb9I=G$b3a+UEg~+;V9}AhrLavIahE86VKmuw*QD2ol8|HDx zNP>&j{`w@sz(pbPFGPcb%0%rik>>O|tU;I58z z=q`~n(Y&Xyb+?TV%SUlYWJxG(k3Zv-pnVsnrC|e~J5py}F{TS8^GB+`nN3L6axkuy)B4`+8^a>*xL@-Q%5n@rXkRlyT5Ql>YOY^*bwH}u$+YnOH zxbebURF>Y==;$Ts_i4%coiamew z`i79024@&`3gFPliNUY3nL!`^{pu)%vIm3NgM;j+gXe^|My0o&g11HyvngK3nfozb zrM0g`%VSk!%+4)z5`LQ)MG>*S-`-HvdYVN^X}19@pM1BCWa9ktFnwz<|~S zd~Uc28GLC(wlU%YWG}>Qrq(&k!JBzntvD(28MlS%PErvM8g~&Nf{ML1?jk_+9tIxa zBHhschD?pn*sEzGYQF&WprF)LFTL8~hxxA7)chK~Ff;=$s8;FtQ{%~O7OJVINf(7} zgHkBSKVzuNCvw?Q@fzv47=DTl6>=|_xG0F?X+_s{Kc+YmkSpmuT!#oBuV&-Cf_q*`&fXyFS%mr62tbr@0u=jT7SRz92-4v` zQCKL+Zu27?xIV(2y_m8hfq@VL|D<Mp+0527sL7L%`iZ#F#ih>pj3v~$VR1RW~3PDcgBaWR6S(c@+ zwMD(;X{=5-htne=sz^wh`W_{V2zbSKgbOH>k$#OgQXEl4mxz#xl1myWroC~(t2n(k zgldb?L+ps|1ssIRoK%qcD(?oW6yruQcoRRAM>VlB5~r2eoo-Rznew!zs_(3Wh^O#p zKcxcXv9Pt^snB@kW7&{TYlc?~H4y6dXfzwJH}-^X3=&RAks=|wDuj+lUoka09(^_K z4}^|WQfpNDIIp=EiHvhM&#F#J)zi~~{{PR{6E(IqUk|8-+$4PpwcBkHbQv&+zz>vu zaF3Y08ly?aw9L9dv*P>+-TcZIeXLZgbA_t!Ek~*}0s5xLkZ@O}D)F-#!~$eh!z=PC zI002$>!HYhADvzTx5wG^k1XUzPg{@d21;w^rLXZpBlu83jF38suFrW%5lns7rllz8 zIQP6|gVHVBt|=GBOdK91j2RL|OvWWBLCQ}_{00R`zu@FdDvd$AjT-{9j}64oB%^Zj4ZkE zp!fpsrjexw%SuN^2HIoKKvQa|mO3{&ud;GprLv%MZdKJ> z^rlZbE`1hVLF^%#D1a=%kjD&+oXD7gc7rLcv`%ewt@`U{i)R!S%_tWC{ZvtLLvhjn z!JmqY@qpFXPIk$^mdaW2#S#|Jip_Z0 zI=7nXgw(!+EZ&szG8Fa6&Cbe0_EZXC9tkFr;1M&80^VenaeNA>u&9;@>(@(I5k%KTrUGB7hLH_yZ*ljG+lrS*3yT7ES zx}^I+Nk>_kZ_VK56}6qv(2o@aP6B2Ps(5!>{0UE7H7L$V6 zXNKWzCOSA}Qmm5_6Zx3gQT&*!P`+94=_h8e`jB`!a1tq(ajJ(!KO*@b(GK#EXG^>t z$QYiw0kOU&&=`8ad-xJe-R?jdHjwF+h>N0HWPuoHR9{Hq^A=lMT{(q)?|mnl%xGAO7x zYc_$HNk5H?@l!B0=>a&(O^V3|3>#X7R_sJX>og6ZN-Z`SS)t9wXfXE0V@FNsmJ$*i zywX&P8TKJgarIW5Gp0Dy7FTbEQ8M+t;HzRbS5cV1xX@uQ@;admo193K8Kg=YWQ2Hl z0nd6D@eZ+H)dQ@iLRx08zmC!TbH-8g^aHT|8=7Sy5U-w4j`9PZ}^bLbfeZ zHLH#{aj6CBo;vi2+gs<&N7++!S|OK+M6dBp-j#}_WadAs#t)U64F~2nu!_3T#3PBr z1Is&a`sjg8rz+B0#=fY0`EOn8t;t(wEX*(LSih!eWn#m^ix-cy&o}P3o%`eUgL7Rc zM@L5zuiIQww5+(;vJ+V@<3Ey|@}tUM5xnwB%K}|kN|f+Jg$Znyc-tn-29Vhqrj*rc z?|`5jlux=7aCq^x#nTQ_OxOeH11UU;=cFTsgxd2?d!mU74tTZI<@efCs$o;n;jDQ5 zO#H4UrCNS;>+XYfB|rZ0sS|G=WhdG7BTYw|M^a!u4e#5c9A-uJ!@&<6-nw=4%pSI7 zl(|-K+PvxjonC1A(-`S=sS(pzYq;8AwW&n1jcTgCiMA=5C_f$1uow-}TB5uz6-w=a z1)-MM04>_Eup(Q8-D_f#3Z+6&W-^fwDY}juqcOWKuTbo#sW>s*QH^9@Zke~bqQoDV zpVibBqs9H@JFK3}#-nK2R=7$JDR0BFYGOws4A3^6^+*P&LrRW!ByWmkMA}(W66^qB zjyfkZN85D|#4LGTn$5OE%#nGzA*DHz zEG5M!Cvnw^*v?8fqgh0dMm1@z#SewJ>KiXXlArd7|Zwew7}wPeNgmtaM2an*J0au%3ze* z*uMm9jVvjdTvyWnpp#YYvykh0g|3$%*wrH;5nSCpx*@tf$^7Wj&9$qUA6M~Mnkh@J zd4R9f+`yXm{>bRrlj4k?J%yM(ZBpA@)GmxUgIw=t2GNI@lBI2>j<#VQ*tN;}|f7-C2}qFUJo#bOvB^#)<7QN~e<0%;ts0_XHNl5N5;6}SzV z`9%A1ae+P9S;7d_3N$Fe;QY$3jC}IC)+I9s8%|cgbYTBCs)GfFw6WA(&CR=K%fsj9 z+_3q;LD!IN)<~eWG58<%wBGRI4XwA0j{Tx}aQ1AFwtxkUDPQAONeQ<56@jH*7H278 zHeCm$Na3wwp+230h)s2Rz zay&jq;eaS?>U@#e1B-jM0^iD+f?%!sQRLbfcrsJI$)o&q@MPKQIAiAZE05fkSzYI~ z1>gMjsSQ~(cYL-q_)zN(7O3y>*Y?))G5bP2n?3j3vD;bvw3a4c@aCIZ8ZV93-QxY1 z5nGnu-|P2tgGW-l_{cP=SFHIw^1%pARMA72U*WG2=wSdsZ7{?MF^qW;G!R^rb3z;> zm}cTb?PNlF^XqF;NG!dcyhxAIG<4>^u?X4M{lpNQ^;V3~o>H zp!aQnU^&u6eJ>mv5X1d2W}zUaV)tNc!3mPTH*~h?`05+#rj-{CvA+i2Et*wYQ9C10 zHGds%=p!BLSJk#VOs?gNZKJ^xEY8;2xT|DI@nUN8_;2O!qRl=ytP6pl!5xG!8ci5k zK}#`V;>!jjeK5r4ySez*H7@9KzXW;%WFP11ECC+Fk zM9Dz>QIL5&@~__cXiZ&>|Mi2f++?`Hva`2tO+!;j2BAuK%I&ku%4V10BM4Ub%#!|{ z8#c5Sddx0w^EALpPn0&7md;jZ2*XEsi2DL^1F$7vM!=XzO~8!khZ%?hM~%dc=X1pA z%(DX?0VOVCmKWC6dkO9mOgO(C!=EvDwr0vOLCMIXom}=n41G}6@U(;1bEnVSY=}WuaeA2%QJ)NZULlaK{vx^wit{A zBPiI1h?j#2p(?f!xC#ln7`I?fVS@MR@1!ySlz&*6TIq25@_cqrL9&4OTm+C{1rwjl zFJ@7mF*J$jHyrRYq1;$qeZ8{c>D^B}@_f(qEwx1>%C50cDJ6hh$090~JKV zQxJa%q5czw#E!}@d_9JTL|u>AbF4*YRooEoDC%Qh;spp^k?Wm#n!M&nSf?1HYo4Upqh!{3XvN ziBGV^44jCL!0OO8T1P2>W_gT2J6HVzC(7|vtkKVQycl1?`GV`>GdBs+<(V07Y+LHNmM}tRL z^24&ZFvp<|-fr|+jcXE_~z`1wQ0yT-PQ zF*dB+G_WMoH*aLVFLTMj#^rzI?ah!sh4!Wr*^V4xfGD)W5SWt&h!(HmiE1$u9NpOa z(J*H&?f(qz;V~GF6%dXjVDA?ft=zo)Z0GSi{`S#Z_Xi)4pL>Hn#@fy;UOe~kxeLF# z+0p^fke0qr{&&3G43B@!C3iA_Edsa+6VArUW&jI^NkxmN$@5KL!wN|lO1*$LS?&v8 zM=?~Z9m~RLH<>&lXNZm^j%#R5%mZk{ezD}#68v-eqks75XkYME`Q_k`H|%AbySk2d zbp`gFzc4y*gJbFF=u*cG)Kl2>SEI2$4rVBT?F6)m9fb!G08VjbdWvZBDr_9!G~J95K3Y~>5h{fgp(@1nm;qOH1K2lEw6{Bb4!hSI@pS~%!XPRXMjg*>)~3e)tY5dg zzk5b=)2tDB^{2O=AG+z`kDm$NAYc3f`{J7Wmsb?enZK;Jr*q?u4>02`mR5D5NXjkv zFe;t|f;2@rWJEc5TsmZu@dFAIldA{9dCUc1pEJ`Sj44TX(#%eJ}giLl5zl zArJq4_mLyJfB%=i{ACXx>2dj6cw4GegVP77D+u%hWbCPD4QbRuR|O`mK-ZxYk6?k_ z?#&}~y#PB4;e%=fh~nZ@M~1CSKYH^=P8<)$%l|WU=2+{por8z}e(=;NMIf)6Gw(*c z2l*+APku|vm-d6;5BnKwfk5OE?52tY(+&27h3p9uzk!`W`7$O{$TgXG2$dgw)5Ns^ zoUeE>MlT=s2coO_Uc0cu2?FM+=pYqh2w{iQ;YL`JubqJD064 zoad8|7=}MLeA{8;vIn+N>nT>2g_nv+VR`3;c9r`t0 z8odbPlLxbs@O{$|yE21k5U*38t7hg0|`7_ejvw9q1rRt%BSL-vLe8Y3a`P>M|!cW_(#injpU zj&U{d{z$AHPnRSs+j4gOjXS0{4?MWeIK*;ico)x{Iqmd<+V+in;XJswf90+slVkY}J=<60 z7v*P8uh_M0T4`?w+sC(eNtuc9HcOdgV`9yMe1c;IovA>qLVvsv3Y=mga&@L9lZFiS zi($-XhIVha-AgDtS-*8PIAds^w6or-75@6A(|`4#D}DFVhfnNcRb%%lD~8zos>)T< zr~i)aPoC{vwQ1zJ9XHZC6HStzMU&#Obg{T$_EIDm%S$$*J(L3*xt$~=B%~yycq!=u z{*EW)*zx@Y))kMYc;we$?7lp@>+M7JExcd;+IrjY(_cE*Hv4(C8-9&MrZ0g1wy8Lkuq@-5&q z-~%u*!8-`K4DkIUyAb+}YWHdGqMwfA-BvA?POF2Hk6%HPl5Gbdd!(hY?1*30wglN9K-pCb%7$Ihim^q2Zr`yK&%) zMtd}3N4U`>53jbg04J`}J#^*{(c0h#*siKQm0e!uxI;8`edW*rH1*@7!3DgDKm7Q| z)fHplt>kmgjX8(Oh5|8Qjlo0Zd!{0rDB?{aK@F2pJyd6wGt2FA2ro4wv}Cd2)mP7! zflUAjzuv46X5 z;p+Y+f8dAM7%0C#$CkEJ04r4G4Pi;prG?QP5rv1(snP{*VnH}-W-(u?tpV;8GXIB+hF6&x>$G#5&pfwt771mf8!letOSMFK292jS=pFJ|PJvA5shH?4Uz~*6|e%4Tw3% zJ~a5YNM5H08AK-=zIpP*f7AtQ**9DFFIcd@l`q}f+s=RUT-z`{i+#Iwy3ud|(I^XeFH%?)9)TEFN=XV3&30vx} z6eGhCVz2qpn#!V6-`{pOmJC!kw<=G=xpVW_6@PO-g)Pp=D?!tH~DzIwcyO|SLMf2=XA__h$ark zY9Sink#eO=qSGOo1S8t84F{H5*~DtbIc32)#iR9LDEE@>A=s7VR=~m*bsMhc7L1U| z296K5arGu<0|sJ~`(wTaBb1&27$PG#BR4A(ZS^?8u)?u}vz+rPFbp_qU?SGn5NZQB zj*c9DJc2KxEF3x$Jk(j1%TCLEuME!{m>GOV-u<9k9E>vtdmH?__U;{cp>0daXz+y> zt2Wg0)8_&C1UiQAXc^#5BM}s!Gq7<|0x6t%RfE6fJN(ZC3!6!PsYdq7_oI`EK91B}@ZRug^o*6{G$IL#duX^Iy<~ck(d6dY zTe2&~OT0FOBx;KQ;nJsol)0s1)`D5jkNq?=$+yARxOwS|x65UY>P3r&s*j8^L#B6Y z;jZer^Ep=u&z+C{HcQBjAl|D6H}i>xp-v{!H(zlux!HU`aIBBKV0l=*T{)?|3*#BZ z%RqjEe*se;6bwq*vP10=%EH|+12}?hGy;Rc-vds-g8^u!(8=#aqhaHxx?Em=ZLV46 zKl@kidgQl{?7Cs>4Z|SbDgWHuchv7c+E?ZK+^2c0nBHDSjmO)$@FuKPAQ?b*)MRoy zr|wF~-3{}uiNsFdMBs^2dy{H~((BO<*UNkHzQMdrxhK}Yxt`Bed}>DfT&&!-gU3&R z_7iLlejDPtbFu9Mz{X$^TMfQF_&>6Q*aGIPvKmGarG+RAZZ$4Uf*B07F0It;uftIl z4t{)p&*<(~&nkzMqkXj%JIwu$ZXDUYud~F9*W4QXhO`ANvSgYQNie}!dosh(j^FIX zrY#e{o~N-$au+JRrLT`&ToYX|K|c=|(JHc209sxiN$FCyTmE>y6#9wsDonCKVF3kpn0V&MKsdaSJ zy1SECukpAu3s(;hZgiOMweGa_KhzIbIQV3+WBgfZDYkbM%{7Brh{ddcz^ib<1h}On zh0Y%ja=$mvn>Q_&5KV>q?sZ6V$JC$+O&BcwN-lg&O`v4`(W;`N>2p`rWF?hV`pbRA zE@f%++*{MUAeM^U3=oXsr0f8>Q}|~CmkzNrnvF>G018bD z%E&=#Y;JXOd4C5Tk!T}*(oDep4SeD zXYr75#Dc-1`2Sasy?`-5)bsruaEyLNDN#R!HE^m z`$yzoP+kq1XQvTxvd)6M{M1|{vPM`1jEy2 z^I$lHzg#}A|BmS?YLFYJ&*NA(yLpc|Ic|YI!BMk`XWofLtNG>XlEtyds~4%AWkqL+ zN-v_boOB@5_OM&+wS|0}2=`s^u(n~e@+JE^&-D3g%f-QbG?Xx=vE5 z;fX6eq-E#@g&F7!NK#~UtexxyJcZ`{zah{Q@o?FuOVD}WPlq*A%A}=B7In5QY@I(B z)oqCn2X4c(k|IjyfLvHwiWBwmX0s+IEn(O){6K&+&AHhEtbk`d8LylS)QH?1r$#P? z8DA*ypj7s&8D;C<*!1wrAJ~z%I^d;gGIM6j*5z`lbMx@N{<6B7-s%ID zU6mEZy}Nd-s$FIW>0ByW)KV#R1v;muwb(#wkr3&(#q~{Kx0IKa z6zdo+6u$%YnvPG=S=1dd7%r)*<9j8hi&u4lufTWth46(9_&SG<^)f^13-n$k?*;pL zLVQABEc#15j<_fa3{lNB55Rks6c}0KHe4+g=08OT5KwbPLQHU$=mzpEKBV$ua-|`G zeiZANF&5<2sbI!r1Q|qP;037!nJKSDa0LZKHL45+{$f&P9HB3tK$&?X{EhOko;Wl1 zQuu?q6~PuLpupq=z5wXJHmeO(d3E!|rp0|(Z+=d8h&n)Vfr$1^pbltw%%l_o#=`BK z$Rrp$7jCOt4WSC&3=X$gK~xCpXsat6tTd~y%0MB zd%Ng@$>XqNi$xF6PWiZ^MKnsK?!YQtOoIq?ve9OgL3@abX{cWnKUrvl_REOy2FJs% zBD|q})f8clABovHb+BXXm*VRvOqpnK!snYSH;Xeprx{lGG-iqOBT2WaL{{Q`$iT>e zX^{yK&fJcppTe}0U1rr^#;-_-dXWB#ZV+lHyRTV_w zaJs@RK*plg3f7Nmgo>{sX2`tIqY}_P382}j-2=xZloxfyX9ZfW_AwLsMzqXIx;!wN zJagxO>Dx4GW_?|S&x1^A|=bkf$|ona{bdAXCgFeErdLNO&-X-X-G9phl6TF z+FR&nrs$ukahgzC03@G{BK=-*2M5g_T*G*BRM!QS+`Oa7A$JUG z;W_|ukHMcSlU@uYO+&mrp2=o!0#HqIf(Z7W2AmYR;sCtORP=Ti#QuN`0SJOY3l~qX ze}N$(wX0I~4p20%dcRArT=yvE5mlUC-B_fPzsmUm^VKzdG zs*K_-1!Ome^XpXf1Ic*k=UOZmR|=LBAv@LXx;ojgV2Q~xzi7HMC2QfTa-X@SEn&Ny znc2K;{m8Pmwb{1DoDCh>?wYhT!wO@dsd$#HYc#9Y*VSuUXWsZwPe)EU??a#bB>J#H z`k#QaiW#jXZY+XiECQ6QS13V|`mx%Cau77pA<@9+IkqfqqKD=f5IzFCs9u(0=t6%I zU8F|4Gqgmm;?}?nZDJ$)QNJ?8y?klJcrE%D>ZrBVmE}lp_9D?SlkyyG2%ky~tU=^C zn)M(OZBRh03H{Y_A1CxQ(y6ekbx*Z#{EHMx8or z`nXoM^J}4>8Au_pB9yuW$6X+_xI@9e?B=s)|1R!S@AktSULt=VZ-QhgU@H}z#l|EM zN(v~Xt50#{Cg)1|iAqYgQaxL#t&sh4#@H`d)x7GAWTP=Tqgwlo{Qa>~dAX;!rEytf zONqx*!hb`W9|icZ9QmujSRl=UKNCdOkKIU>Rl&w*hmHtJixHS(zjepowQY5;tLn;Vt=kc3*mvm2`qswW=>cC$ z!d^6{eEeNGTmB`OY7buoZVAvxtOyXVO-69xfpM#-FIGDkF1$P)!F7nIg}W7tfyf$H zyeVQVIJ^5AUV^C~hYGor`wpZmv(zEHa5HCjhpDtYOu!)wvv<}F-#;{`O@1y`E?^ByQa^Yv7=^hUrAM69_C>chGCEV9sDi< z-ZkR15|lFWAM{N+KGO{X1NaL#2-!x=G6!S@IeeHAaN`zvME7I$Cy@OE&MYYjiYjJo zG|-h6LSO8PlOjn}57FylAN<;vf}dcmpIEa7!ZB6B?*!kuWfyxT*l_3;3|2eZwOIa< zlp%5D0K|*iF-*wNqQq*lx_05ICNnYa!akx(DEeuI0rF@>WN@jy zJ?u-t=UnYO`qHa!cSO8OA2t_5U z1;x~$cAu1B$+BiaZ5S(z*Af8wq+mq=MkgnnPL^a;QvvCbJ=3_SwRQLG1M}uFPjB_6 zBgaSXJjzVlN8?U9S>b}fXzM)o?BIdI;$uHP^TlV_-aRWw|EUDu6eqs|lM!190tKXT zjtxc484^2~1EExa>ELa68BX?}2LEt3%Lsl(er4O(o$>~J%FOZK$!+rQ(J@dQA{;o+ z&56<4SK>VoW~54Vyerb>P5^UIq2**}Rf||wgLnlTqD#>*IkGp|VYK}~OX93ejkEh^ z2S0NB*Vhm1yYup0v+FmpMU8_kbGEaFy1I1@4K2&}jxHapt-fK~;ltZn)~8{olosFv zo8>n{gNFSF)0=V%F=&cRgN6x<2r~5PhHW!We_*zNPj7LRg4PJbg_0jZ`kpV8a)u=|r9u=tP<*Eh`xzv*g4O0BvVc zYEQ_mNU(Rr)O=c~dmM+G-^cTa4c9h7#pyjiFtBv8XT@FlV>O(eFMDkf@spAquUtuL zsP`j7x3U7=TVCL!dgz*1l-)s)D{YPxlMtKL71W~i+1ghSj$+$J)JP7yz*Yl*oKizd z?pI@E2+96(+#{tarC7>Z2%Lwnu|Y6t5rP^hD(VJ#BdxOXvcZn)PvH6!N)_e?;?EH2 zp)#dZ{#20@q=i^P+mjh;_~90FQGHRpyWVYfn~Tya=jW~K%j?^ayJ17#!plm38~W5aWC#JIZTTsCdrK5?6}aJ`$SIPNCZ#{!nxHw`_?}jC@EH=TyIaNbQ2i7eNLbkH@odF!Ymn3gjs9 z3-l=Qej!L1dYv;|4i%q+L(X4~k5Tn0)wgLfmD<~w^pEW(CRKxaRIfM?A@ySA!pt4P z1VK2DdWmaSqrebF5}_4FYV!52BG6*Zes@s~8~nyM63-{T^itw^IVWx~eyl=%Ieswi zkC>6#Lq(X@Vz!KspUS%*y+ZV9;ACbqp06k<-i(>;lsLnIzlm2FbQPg^ZxM9r@h%ke z#rw>1{WsJ%(mNC7X@l{>195ocAMqb{6TO>WzDfErJHlSW!J#c>0CgG@MW|Z(R5lAM z-M@6{{-s}Dx^LOC{a9V4I7N?2_wzHyO)DGx9l8}!DPC6&JPa@~s3SBvL4z71BOVbQ z>EEcFTTwB$l07PZ{h|1!qM~A6c`>J6h+a*gp1SCl9LSvg4ZbpFD)Yt^+b~0$q@M`bzMW8 zAua{sW2y(6pHfYj1DTEb-xshNCgW%7kMfn5_v|^=-F<$|n&1b9hmUr5pX**T_BOlm zrr-f(&z|qoAJ6~n?iDNlWhMUkwe}kuReF|3?v_8ea^(kCVX~D=2a!_$Di#j5Y!EAm z_Js*9$WP+*fQ|)D4<};c^)>(2bE>=h6f64t=RZ%&1UD!0n_-n2F~=smo1Z=P-uj{% z_odUly{Fe46gTH$u2#!WVfv&KArUIZn5qoLwsq%34L&-T-GpzVcH`2H@plXhp^Kb@ zhWn+@UMyl3?juscD+mEWUI`YDYysA^4M715BH8^3EG~|#6?r>I4U5~3yj~Vt3kDv4 zV+No-+-oxeHNnlGBT%W%tG&BB;H{`Y@hg8tEtKBMNa`)0DR|o(y6!n6uHa92UBJcPtX~hppX46@ z8$R?azzs)MGZCZL-@3y0(+j}?l;BArt`@j}$W%Ba+U+r!e&b_lIm1_8UTkE9fQ! z3lR^ws=JUbbu~AbOor9!%M7L^Fex2sAA!%~B_^wgtGTEjOvuVWU-?xgCpeuv3CW)) zFWJ0#XY!Hjebp;Zvfba^{oyTf!Edwr;Me6`d2Rc~{x#)Q^_#YAAKq~)r*UKZM%Z*? zOMVutuLlBIcvWHolqad8iYrCfckv2U6jBJTr9B#eG~8jTKPAi9#)#;O6^zpKT6&6e`{Q*tHJ+;GgeMOb0@oo|~SN3CR%JjKij|l*ZB$ zXz6-ss6bT2B&L5wVN@7!in>zS=;))5Ug*XDXj%F*wmu=2WNO>ch7Ch)gRJ4Y?vCcX zBG#a;K4O1Ewji|mIr!!WL{QuOOfDdGHTI4RDw>$V`V}X}mh#IG7K$?gz(JzC(P~f> z8cDS z_b%vJ_kqPL#%^bZE_qOqpACNO%{Tw>2iEuFA1_=Nlmpo1$J_9|w| zJG0sAXM$gT?lIPIDQIcidTJlL@R?cjg59@VVspOt+}YWmn};+- zUOBuLgY3kL+!{zkGCrta$m&Mugq9!~A;?DO?Icu#w-b;gA!K00i`*W#QR)Sd&;T7f zMBH>>Ed`PR#b%_X;ti;9?KK1bNkwB3u7I5Z!Yc>TO;%GB*WGvM6T4?s*hdOV zYN`&LyLjRwRmII+)x}L+mSaqMs^G@B_T;B-d-4}-VPo^?zqB02N1y_LdmEm zf;9=452b=6)`q_Wx=7Z-S~Qz$K9{9KM^lQ@t&x7ynk-yM>KKRZB84nwKm>wrD!2^rOzrkL{1LLLYKqXc( zc6W4nJ9yn_rh-$9oEdVBF?J@$2^w*=l%ge#<27}|QI=JfX zx8zccvbouByO%b&nY;ODY;uIR9033ES}J)}CU1>+s4K=c?UA)*Orjx<6R&vrC{ z`^C84jovC?i8lrRaM7^s?;pY?)zaUkm)Siy!X|SD>_lyMsHXeNs_9VMFHLJ?{(tX7s>z!F9wdu^GU}$M!!q)_T69_=Tg&;dgu9DWA9RCumug^tk*L zxDR#=mRDL5Sd;`=$ov!(;eaP(P};#>#VLy=h}=?>RY9_vVKx5^c(j-;2B|AE!-;(1 z+?)(#nWDUx$LYbtk}+Z9(B~3|M~h5g(ThNv+Xy8ijxy#6NY0!pZ|m(}ux@!^TL*q! zzodC*@X=W%+2wUUAKQ@S^Ua*$tY^Vh|I*#PmNERYZaur)h)jfLFa47}4@cw6sK(Q# zJb(m4;o;I;z$SsF^B@{6Jw@(f66`f(EJ_XrVlwu9$k^wb6`avj45zN%Sy#vEoN@Ld z(;C~r%9QwI7m^UI1Ih#YtKWUHXVLyNk20TEy~&e4B$vr8aEo$C2TH~siLRpfB*WH- zg}g~3duz2N0XsJ`a&5?RHCuZjwQ064u_vqb261p>E6TCwkQr$OI)lSHi6teXWzK3k zB5QDbqNfmdK>^5!KYyouSFO*mIp=o%>!zIBqW&zmwB+SHP5=H%`wb?{sI*$XOWuR+ zWJC~DkU$SX-7UPIwvx+>A;)RDk-z{fBXZ+pc-pj(G6Kc8*fN4^mAzA6D$>UzJZ1vb zTwX+t@=$jOCoCC3_3)VQ`a(Z*1y8hfx3xXGG58ic*0#1y&N#OB=&Dsm_a0ld3VThb z?_QO|SeeAW@zRRwc=RNtt5= z@a^3B&{I!7i6?uce%URr$HivJa*^^@Wt0FZGP|*)&FtLB-o4}F!64hPckk#Z_A_jE zWm2}hP430@qMTxpR4LU<&A{NhfGhVgByUo*WGy-_4fuhZR!XXexp7{@h8BDpoC_{T ziVN{KRhPgaIg=eu%JsF{ERa4;mOzHKbE;heB&$F$j!)=GPm(F`oy>3Y*mm$`xSHO> z6t|?j|JOjtTYF0fB;~c=STMmLy9O?6eHp z5QXobpQ?KLs1U+=oZ7D@_0Q42(*8*os=ufRk$N^D!=g_80b}Wf>FI^nd(w;2VD{4Q z)6 zcyLc?As(2%jz4aQE=q6Xzt1X8!^MgGKF=2ZR~P8gv=53)aTET*=3@)KA>BIupK!bZ zA-OR-oOCb}4vFQ-E4{c>&qDiKY(BbLIo+2y;0x>49Y!N<0`x2mft}>D)S_69Q_7IG z3JyvM_FkcOQch*VwBKSUL4b|Y>>3#U(CI9+bb8GDsI9&BTe^J;4O z$<+(1s~2LaQ{xL!Q%-^T3-vuwE{+PopxKfUfW(ZYG-|Dp6k%fyRK z=EZ<5oheo)xH@E>let@l6Ar$(6=O;zKusuyfGv;LwS(bnFz}B6H&58>LZ+=Y`W_94 zh=|@q-y5h7-)7)EA(9TGS5A7n8vF@3#Ij6>7_*BoWA3Pne#k>=Kjj9){ZsW`IK__E zoVlim92)G8b@Hy?44nwR+Gn>^t(`u6wBVs_i|5w29R9*c?I(X;xwK}Ezfq)N_SNJ& zW|cJ*2Y-C5V*M@MKF8|j>f( zL|Czbsd7cU7u8s>$s}XastymTUFt5S`VEnn@}k&Uf5V+1BnQei$ScCP>$%(9NGlYo zX9Ao;+7W4k?KyDfjv3q5PV01?I$_*ZQN5r(lMRoZ7aw_B#REIC(hjic$NU4egF=`~ zQb-ldg8=mLKwK)FldvbbfGlT_!49(myaP;OLlA=D8?8t`1vwA7&B)2sr2ToAzEoUn zrDXdnU5$^+&B@Gw#x^CV>P1dKi6m!K8`Ns3hxqeCvY?*|ex&j%yHD#iL6zsmhIE>s zb(5-r%HzL4sxc{IP?9~YW>StP5qTLo>J}?1x)6)mVgUOVUnrvn!$5>80>+-ycVMna z5@|Z(FqIU0s(A0r#3d0n9ZKvuCGTcbpo?n04gEBS$x8req#p zb>z0(UVreH%IKknb@lb@8suS;_zc|CTKDv>U0>Q|Xr2!dP`PEqH#+)GT}b!yNiYyd zPII{c+%nK=jzA`f)z z3gCpaJ=J6wfH%Uq4@1iYuY@!SC1E}kvKqJ7qofA^E4Bt)S6Op;d2?CtrR$HK#R{HO z<}>*B^0MZ#vfynma2f#t93p61Y%}teGiLVd=cxkr{se)B}hL=49PR{ z#%tY9#6WB;9{GW>9`+REJzI|ku0MWi=N zbmXFs0!=t)NZJ#)E+&BylK@gWC}}l7lL5OT1Qjr$9SurEa zMZ1q=Jrm1HJrKUi_hAmHBE#W11ek@h;Yi@DjtBx+nw*NQDt#&|bP}HJCB=pjYv1z& zI)zVpI3(UVxTx>$Lu~J+2yIW^?*m*X7O@klB2bD9P7t`@g43}IkZ6Oh!wm*Qx*;7( zo;cc7p(!XhiPaXFj05r4F_--2PjoV#=<@4^q69pt+sD5pe-Xo8F0}<(?c~t5!yH15 zSqU8t#GQH?ErGh~I-J5*TQ|;JbU5%*bx#vf5>;KZAXiN@5we+>&zx2fOJWm0XFn3^ zne5!x(kIu~eC5B{vs^iIr=w_6ZB20)b;vLA*_$EF4FqsjDi$lv8MWROATO(o{TYtC zNfCv&%%DewCv%2}&JqGu`81&UoQl=v=D2>C0!SXZhs>pZQqBD06H!{4=;Tj9G;^;` zL=!{&U*m51Ufwv5G#l|LZD|RO3YyUPXT3fF2yk1EAVYb;D@Ds_oze6(BAeC8bGgMj zBiBF`O_X!b?!P{B(W*_6nwr0Sfqg$(Rg&BN^GGZO zn%#cvf7SBFRXVXwA=Eht zbr|e<(65F@4U8GGzEsf!{DRe1BfG}FD_1_zy6kQ))(K^czl_eAcOxlvVj0(=isnTq z2xUrx0(UC`S|~%42L2wny^tl-c(hQiG_yV&U4phsv;^qa(6z*Sywb&-u}rd@`NH(! zrcUAHlALn&sZX5$331Z&;^(u=N+1!z0MK*B{vbp=aWk_2uI_HcYOio3pa!eWs@tis^T1D_ zXm&{7lboQ~`kqegKa**E9>?wzsq;DZt*>IBJEd;<4BX>F5R{&OgheBNGHphDuxn83mof74PD*EG~ON;&H-O&AJvRq{7Q#GDze}J5vleG0Z3*q zYtiI57u|@^vu{Sxya)F!)wDY0<*FKI>9pl50-Ksr^1Q19+cl|9uJP0%-^W)@GOWU? zKso2}!wAFTp)e&vSlSwrIt>OwzYNKSBp0_&5SkQ=C#=bts=6`qePavcCxWUV=X@d1 ziG}p;h^EE)2`r*+J*c)($ zlV8QYb@IfY&g_zR1kW8lz&>~IoPKGJyoirs9QMC-+5ywtNO%Dk1iW(?b}~$AZffey zA)MD3L@p$wT0$i3Qh=7}r8u{a-97)FU)}TJUw@c=X4S!x-&%s-T6L`W52VETl{065 zcIM1T%aV+T(xAeb^;z;U7fJ2%TTtP2OS#ex(Z#56&bLRx*?|j?z#i;R&^;n|#sY0; zoboyl!X+suJ0l%$K)H7k&9rgh6U+mSo%DkQ{WwLJ# zN2+9gLP%uNyy=kt6P-#DnULiHItTMdt!1KE6bOxzI_Ce!+jqdnb(Q(vd#CrRX34Vp zNLH6-MqRqQK!jz_-no8inWG7=-x(Cm&L4;*|ej?2v zQBfp_VT}iHMva*P?ShFdXdpa#@Y#%-?IDYmD_bkMdyv$D$t3uZyjdZeTBrS zmtBaV!}nA+0EQ9LngWzNKv=_YL%e#BE|We`QX6E0dFkBXEJ;ex3J8n*PxK$}?>`>C z|NdW~6aDnxOB;cu>F+<>7rE=~&(5Cx={czsaUSAWlrkB|;s^P{mGgoyl=6^1M@MS} zp=imFyi>}-P{k5s(Ba&@Y7N;!#>lbiF?=1dNOpnD`WrADY@A53P*V+NfSrkODPl@E zG>oQ?6`5odZXwRZKh!2tDN1|5m-u6cLZbK*=TKx)^Z}_0Qe?-Pm&jm^hHphjmmoKw zg@fYYSDJt;&F6PBx~lv%1A%%OWwS_6(GZZjA`gjs#dANsG%1Zn9y(dkV*a%>CH{HG z^%su4dN}gcJ4^GQX72s8^a1=@u7Jg+l?y1VOd1NCERKP(No|lhgkZg9p?QE>S+RM) zFM}u(yGs?l>LSnm3s`0k%!gbd7c8X2iRj}DQGQAtv$c*}!r$e;qQR`+C>^A#0EiEE7 z|Ba(YWE>Q9kIYYv$eg8l=@EZUKGUoeiC6yXC4nw=&ihJf-y)%uLLP-c#buIfGiU-` zGoq(}a*YGgL+%bD9Wi1@kDJ~g9~ilGzq`m&L@;s!l7;z!21bg(W?xaS6R#f|7(;6_WEN8*#Q6h8usnC zxa~`X1G2Rc;=dFSV6wd^?pI8j6I8GW)-d9Ut&kPMc1Xw-84L{d2Qv6XbIrA@kOjhNe{1IVa0kiv%piJ4(2P+F zC724RZqu=(kG2zcEF1-G3$jDSXkfurilxDbVWBjxdjlTnrRip|P<(%6aOWp$&mL>v z5$XuR_L@3a{_)A+C9$%!xoJEEYjoy&GY51J;xQ;!vs}10MYaaFZ;EVRr6gM1!xuz!E@3^eyZ)O90LGHHHKN^Ltt}8DyC)8Kja~B_@S_ z!Z#1O0Zse2!_#NgE&JunP0>(!zR)Z;z!}g4%Yl~x7K@NeT2Dr=heNO=7C0w|fE}om zfpe89C`ADMsQPqCVf4sy^$C9pm>!WLlRp^{?o0M4amdQjEyNnE1ow|AHx1FTE^0uFpo{KC-3+ssaZEqBi0_ zJ;LJ$aXGO{UX@HXTVBflteZ;tcU(!h&>VsTeBFds)rEot@hvPt5-lz5+s|ztIV81~ zER$ZI`nSC!8=6{JAX8jNsWZH!ldz9)J%CKZzx3cVBCm_;kp zMw(fiiX0Vh7hCSSW=K40IlsIJk(bC_`GK8-*H{E``Y$u@n|WT4p$bsU1ACOH00^@%SO^vgawNr<7cTdEyy;%*`pH_+q~b&bOcEC~Vq84K&%hkPk_0-$ z$1e}o4)0TYf2Or}Ak&}R`}5Hk*N1Hh2cu<PKJ-vyPE;^A*4_238F8 zMp$B#VHcpn(Y+#{k`);g(w9UdF&fSKEgWQmKH#jyHM}$x3Jt7FOFR&QwLJaQgJMQ) zioU1+_-(N)BxY!DKX$DCnKeI6$Blv*rAvg73oI7d$s~hiIG{RdFI{{Vz``IxIuUpx z#Ape`VWm5K2%#9Fyhq>xd8I=O_$uowP=fX|xj87&0@*kyVyH6|Lw8_{>HNVTjR7mf zRIO7#{=k;Xk(&~lr*_r!j=)BpzWb9u+!@}oY4-N1Q|zvBw^Cho&AW z2ex-W+h8G>g=)6p-06@e&|wX*K)4U!x2ao7FCU~)NFz)UNN1tLAnIh*p%Spvm+yzP zBM+;Jx(2L4nBqccL`B8Mfi{vGvbKazoF9?4oDTgy*1H8ayS|431=?6u2aob3#`-bVG%CVMYL3w^fTrQA8Z+DKmBULB?>N?*c0U z^gj?~BnoPhoX)$Vj0x?*mjqD~rMv6L?_b?;^?{`Ru7CIa&27f9_r>e`z@sCGF)y}S?ytC_Fx)0(Z%itb;mFF_8 z253<)mRkbFpYji2gQ&+V1&bOfJwun6!)bAhyG19txlSE9L61~|_>|yZq|I2@Ki>D1YOHi0oVf7bJ7zxW@NQmTJmfobMhsW2uin*FIBi$~YTbO2b=j~b3r}TdHwh>ha&^9_yk|AaT zYUS9K1h|ULY=Ie}!c|BR;1Ym*9NNr=Fo-QG594UB8wHiILri&lC~8#ZP`3`8O;tfD zXEOx62wpH{KiDTHF5La#j|Xl^z_GBNu;-`OvsXL)$^Wy`qCvDo+rrK~A`t*IS3u(- zugk7OBnHKUWD~p&$^`BOYJ-xUY~|N!M(LYdv8&L7aV~b8Q!H-xbV50%rr#d z>D3AUUai7jkbxBq2cQ!T2kE`^sQD%DhMLl9L$TR%O%(33z#&)y3VwRh(HxQ5(J}`^ z!CY!ck+plyj2tLYEIlqmQpRojZb|G=>*qN;ybIEE zNEs92j@kKCav43`iWQ18jVjh;^Xkl zibts_=PR$^$HFt;WSwt|gd?A|AzN%AxgkHi6z3R6gmR5$i=Lan79Fr4c&iZ#TjH{b zT088k%v+xOyRdc&;6Qu*CA9Vo844&M)2Q%lN@hXYgrwU4nY{47@2#7>bS43AgXXu_ zFm?KwUz?YY*}ndy7Io7_6c15Zz{NH;5td?lTVY|-ARZbfJp z+I6Q^x5BTav$UKBU}NE#&O3t7u6!9zsH(YB%nsMjjvb{nDO9vKWzdQ9AZ7^iYm^Sm zJG@Qqg*$HBj7|z_?_BXi)Gasiqx0XGXf#j#g!<>=S=Y?G&RXYIh^AyGrv?uN7YqWK z($^vNJz_)JL(d9H$k*WCd-r*6f;PS7Wf#1z*f~&q9u~M6k3&Qt2oOP zmpMyb5PS}*R3+$JqT4lb;qtAo41KPOcjoP!zUz6k>IEK%os@^Z_P-;0ik{we{nxHJ z7ctTP~p58ni700zi?&0UQDJYedjU8v<5nTC;ICCVU$pS0Y(W9s>Ud6*Y*) zFI%>(WLb$Hrq-OTfTORN)D8IVV@fyRH*Y)Hy<^Ah4T1fU??1S~bbd0fDe%mztSK-- zj`D;XWK=?%49jveGxVrlhZxaSLsde^N8|lTrJ2kI6N#1{?kK3HqW7SxyGytb&i6%V zDArAwc9QH%B`Ae}6n2tF3{!Lze)PhTYc9^#Q~2^%4JV|t-%rt2xNqhYx?=z|6(EW9 zrfju{cGxp|yNVyHCFMg{KvE+X(O?sGb_4t&J94vjdP&qljX2O`$gI&@#H?7y2NFl_ zf=9}&3mSw#WEPsrks5NusUaC9i6~Dh!pjuo=P~pY*&UqJoZo!h!-UnrTqO;XO51q& z*y)R3x+ogt%W;UR%aPy5x(`468?kJtxB9@b$~4Xm0$OUp**3 z_jp2kV**qUC@pgtiEP#J*VURLTSs8eBP%!6fQ`r3ZE46xS_WpYR9gUF*fOLSj*Thlr>hJniJ zoPJKXrGj5nkw+1`P5Shjlj-r*Yjf2Xpjmu<3@&n!(v zXEER+CH`4M+b7R?caPnW+|%~GUpM%7>&|^6p|5Sl%%63uq_^Oz2ZRS@cQLr#9d?rm zRx_Y#^j=iLpN*3wq5mRlcr1V=l5?bU)0qRf0mI~9Vc;zO4IH+_FC(uU`yPk4)0tFC z;gl;Gwxl&96Rgp^8?4C9Yo0j>z)fH;5ATbLa?>+7Sur3R()Qm@oXdUv-u(}q-_Z8h z>XSo#N1r<~x@F|G>UA~YIy8iZzwiau>xTXJb@o-6TgS^sIyPK$&EIb>3y9e@wW~u} zZA~n{^Gk^mwUm}zBB1Z^k}RJNz70E~{Gw6LnGw#Y`sDm7q87H?PKcha=p~xi#`g7F zclYg@NbF?$$H?!Ft=FHrR@2S)J2Nx7Aw1ABp;-9tv*2!Kq!W~>KwDtw2(o>dodDfu zf+1tljiK_8D%q62@p`>DO1CCAe#tMYqk$-NP%VswjD#I)vgvHNvJ%FMHvFhy)Nr;Eink>*t*ZOjixjp5-io zji`4yOwh2>AS$E90f?gx%}Y^%Y&OB$MHCSkALv#(jVk7tdaXg7q!kt;^v#1D(NGq> zKpduv)sLm@@!i{cBk9c>yK@)P==%c)vL8Hq_JO7Htlhrp1!FnlI*Rj0v&4SUYRKx+rHo@32ZTqc=OD9EG|p*!%2>tQEFg7^!eR3J z0}DzaM?QqFmXr`wPn$^=+QiT-x#ZSpDp!+5b|8z4Xu7C(=y%MS&E-BtEFYaXhvKoN zoJ&>klu-Wbo?kYC8e|i zhzx4dS`_`zyuvJLt=Mavo4k-Jy|p*?9x0Pt)6c88tzT*!_A22cvX@+TpJ+2@h?31L zBC-S`6YqCvSop) z0CrRJv-!9pL5Jf_ltJaKtQMGEP@G7St+6e+|pq>sP6AqgWy ztRU~xT?LbkIJdqfTLYqn_;uNPlZzJw53$8+fcFD3Tisp+YmhMoI~>plSRBw7s0lHO z3999%h+C2x1~+YVEL^^Y4JAu)j#2b0z=~;p*vM)mt16Kb^7so2y@h@+DUT>p2STGl zc_;!Is#jt7R8D2mD|qqm_B^qyl@XEzO22kFbC-1ErL3OTOmLDMj8yhrBg$YU0XK=5 z*4r6qV5B70UmBL|I(_btm_4u-yd(r*T^b6FgwZ?%;`ELrV^RHx8(k*9S+C1dd=xr= zd9Zb`niT7&GQ?dh$RDN4;cUQ!9?z%m!RKVKxYS?Ne8(smVNfN`NDQ~|{ur?d%LkH5 z!kfnUuLnuS-(p``z3HM3&C;0Qm)v)STA^1 z(_&)&RzUzdB8rKK<4QTw_uA#+Bk%1?L6>qv_Z!Bg*CkS>T#CYX8ifxg0C>=SZ+-xe z!=&E{fTYvm_*&$Y^W`hmt@&s*$lsP!D5bk$&@MPQ)@luqW~t zRChou7$3`A=$`49Sb6-+cN9{V9O^`zN=D46JOqR%DkM=qo0cj;M&|e~$%r2^LPQfv z*i=jC!sP>CnPgIz`XSql(L6sSZcIWRrMo8wJWxLTM~qm^R@rawM-qYB-*ar$4yTkYqVlDUgz zdFzC6d4~iFcqbK|0HC3V_h?28+H6O+SX7?_90Bn$AY^0EkEJGgL307(!Y9ADARBc< z02aFtKq7|VIrqA0v+yA}{ z*qUJZmfXyZ!H&|LLnBQ<*ZiOVV$3k&j#naYzcXPfOdGtqnxHjRJ*6;+eR=K6*YItoQ5Dk&@s=7?<4emAN#FX?gWn##I~Ann z3)4B`u`mDTpT`p5G~%REto9X#s97cylJoDg;}z%~kgqoqlm<~$SWsi!ipJSci%KcD z#_%i1{E#7yuH7C~`Vz#3GnpV~&q6M#feoxKO~u))=|6Vo@IEfHqH3LE5J| zhs^M)oXa=da53}TRt~nAPJfAxLgWR8w@F8Uu|VjPyS;?CVaUCdh#RmTP{&Uy)!3%R z-k^pb=o^GAlv_$g->~3y0{Dg=ngeh~S2JYL4eQ6W_?r`?Xc-3QboTvc&)$=D=6MYU zC-Og>d*wa_hEoHOX*>|8el8%6%^>aMby2vRVx@HiGMx*MGs`d-vZUMMz&R|Ap&(Pp z+L{AkN~el#q0+g0Zh+3~w40yJ==6VNHjvJhU-7khRKe*~2#+Tqbr3;C8U|Ka6n2Az zjE#0Q4y==Mg_`+TAQKin80$o96o=r^uG72-9=1yJqIlj%E2L>}o`~eR@_Q!pIFuiP zx*_J8bfH$RN<%q#I$^X3Vg|S)x;tT&qM>63n*kOE60S8S$*wNs2p&b%f9+9~%I3NU z#17K&G4M|0d*UhEdq~;g*O4S=@#}iI20utvB$8tU#eudX7#>Qf)dFsEG5jFQg9a-E z3o@D~QGh*$$4MuWW+_zomye74mt51)12E3He>-cO{*<&@EL{ETV?Qn-p5Z~}mb^W~i1 z@=c@pnDpYOwD293H0S3E%~zhdgaH#6M2YY_Apu0n7As2J`MCj7$;y#Rghbzo?4E&# zZimoWfQw8TYyPZ7AF2J|LI0#iZ~aoebZiTYrm-3e>J1yku` znq{CBr%YIN@;FG@9K+OK0vay%Q*#a>!33EPI?fg*2xg39FeTat^c=bqLtnU@HQ{(< zurvwl1D+r8x{E7bH2TNal*hc*iyI8_$W{4B{zLxU^5Q|~~E0f#C^^rMihs5C#tFbM^P>xUzJ6sjMw`?bsBW|W=% z;(8A6d4F~F=GwZA=Vt`*24=echLQgGHLMgAMq!~4KqU2X$quCBd}vl=qO3kV0s^D? zO*)46V2laUS|a|rq51dkdGY9J&;UtOU%qtlkR17);YIz$!_PDNK*axu2Z-vUpObAY z`iB^nh6qRtzu5zkgV{I>R_Ff_%`6bWny>9ia|Z{B^f zdvxmoP9qc+DexDq>O{=%J?kwO_j6Fss?PT_xp`IL5^@8ZktCDvD$(l*GNxXH%n*P!0pIyA|x~uwLH5~hIEh`b4>&(0$y{xbj6$>Y2 zYY~9C#o+T%VLWBHb)XUUA+~2Z1bfwlc2ojxSLhG0XT)7>2;s2r;trno%N$}_$a#vQ z5K|a?N%)#5Q4uo{#9#mT$8p#i&Q^5uqwomD?_I}XH9-!md82+qQF&wJW$}>xCg!ug zAk9F|iMJ?^VEcK?@R~UG7Mh+J4Yo7v?7uD{LW0LT z_-qbxn`&&V3_?QzOwzD=0qz4gGEC6nV5ddmKFU=?b#6)Dg)&a@RUniZBT}JXVbM!B zp-%{q2Z(p3Bt|+R_KW{=xAhKvj2-EHkzdLRJJKyHf26ma_+lbM5;;h_qKKJVVYj?< zR?LiZ7R-!YvW&rJci0`<;;}Qea2=BHGtp=k<6fgQDDl{46ozNT&tx!4;RRr5mXKey z036Min2|j5V@5HgV`xp32@wSi9e)algZmF-ky%8mz~`YF z)A?Qw6(Pk?B9Xfb?XX1JIQ{p1_x$v(!KW@9JLF{iM0ohf$iJRD^P{e33kzUG4kJrkrC0qr+7w`*#Y0vJisrz~zzw_l^#gfo2mbcM;OE!G$KeaZ&M{2_I98y^|EZ!(7MKT(I2kHoA?Z*R zS;BB(5`>XuMe~IZC+9^2n!G4_wCsYhLp(UMrAJ{P#nPj5eqSz+e$@yknnLMN*(ryx ze5u{%S2Ct5_&#;UG*%U#GIJU+so0I=1nNT^wL#FTk7zP5C6rr==3o#pF0{i6O7-%0V1xiR-uPX@Rr6^H}ajrJUE!Ik5qi|F{w3r3+i{3O5Yq32&<;tyJw|dp!Kws~iE12=OT0s>k zR-`bn$qw}N1V7hPL@@VmmN)V{cJOQX@i$LN6$if5c;uzK)7z zsF~=kl|1_9Oh}|v2hs)psVnYNxK$LiY;@Trlh-EcJ?ISu`(JW;U`AO1B(xgG-F}A| z99ouPADVceK*s45hcPFIi_2{&n{nw)TLc#y?^@jWVY#%tTo6_ct>{NPL-gTYD*y=R}<)z8>Jt?ECAv3-PWDnplc zvhYy;hYpJt1Yl7pGj1~h<8KCKhS}_8P2f1ZpC+vWU|46|BG}m|`@Eyzf1yFCjvAEO z9VnifcLdy_rGfyY3`%p5#n0zF%e0-en{Ji~ry?raNWel++8w9S)O{=lH4w@^Ik2WK zY&bq~vHsw;o0@mGT_v8Y`{pr5(4}mc?wRQ?1<#91^Ftk-M^FxdT8^g%u6w4ssV(x_ zBYo#zCYG-0Uobs2E*c+`Cpz{t4wL;2_1=q}AXg)Zmg%xx}=7LF;0vD^&00iQ4UtBk;8I9ARq{V zU;ySN)isfUfoIEA*UsZrj{;FdVfg}x&Ls3Li!LA1yL5@9QvyF^?47)D;Rn}Eh5xoz@JgWog;+_9IvW&=%c@fo-~>b9Y?wsR z3Ie~Xs;W>Gi0x`?sNWSe7@-wNM-nuTak6NrKj=~fU_NmbAU5hk@Qbk_r2i;-+^oNK z=NKNeA(NujSP0^7tU@P`o$~g|vK%PkG$u$;l8_)5X;&A7zyj0pfpBuW=Go z3Zm~2UcR)dw5nn`Ij>X}LrYME1C%HPfe@jfXORM?3^PJ3Q4IcP&fLQh6jnySg5TvQ!{pK0TG1{9f3F7|S+tPOa35`-(SnPF1e+Ub(Tzr^^ zY|s%w4+9ClDycFe7EnKd3y)7I!H7>R^d0(y{(<|3{R5dmK1mUHxQMBf@-|?b5bVR~ zvFaT%!HkkdK=`ZHA5hIwb?WaDNvZNxA`Vjjo6+de>8_Y#7&NJbzKFoejG*?FID`3{ z%r%Azy=aI5{VbUzEALt-pafoT*@vG)#5v)G*h40dL>(3igN=IJ!mzy;HVA76?dw;` zrt^LI1mE;BW*=@;qPV3XTHZpJDkR5`h&-Jmgs%gL$A|Luha$nyE5}b?>+!b@c20F( zI89w^PF*Tm`ZTVW>96bWl%~Ghf8o`0Aneh19+W#9|0JHEUN*;$R<22#y7@56`D`}4 z7cxQ3@4`a6a74a7Sd*_axV*5NmylNu4t%p6ksQ#N`bf3fT(CQA$dcHQV@2;^w`aS< zf@{n=?BxZ=2%ioElgqShWu+jrwlp?WhAVMYs;gLo#3BKz0>`8nFAf+}Oj&APvSIea zQcNnd9#(X{>YE$hJIUYu#@qe=tAmYEm7(4{-bOnc&DY}O3Atvi zR&yv9&@XSk)HPZVvBkX68PjeoRGCnVWg0*t>3DNPeTm-a>duhtx@BmzVW+jSI7B0E zd8S0{P$C}Dj?NLHT^dIhX15h;#0D#kQDmW}Z`efjhq#V9I_l~Kp<|!}W^-M8U3*hw zI7qFB@q0kT6c<6S=EL;>@Jn4T@-70TQUUhmf{{YOYP2h@82%5p4A>5MCx}qUw0q)W z>u+yOcQ%|@)x9S3)CG&wbWPIw!TA_F5$^ey=9Ph4^r* zaq4(^VW=&|Dw6sg3)Gl<)}`}?5@TzBuiQ!ZVKK=pt`|iffKRKhsa&SlnXNc_2GIt( zbCXRErK5cAivJwiN5KFV|w+I`mr7sH!Ozz2lMk*(z zy~Xqc?WEzpLtxSoGgswq56R}Ub)kJpV*mB&4_AJ%vgtbwY`b201w}^#8|9Xk6=!1? zr6TU){)?@fR`xNCFk^g+ZV91IkcC09gvaT<9W9Lkz0sKo5`;W1?AdbShdv#V#gV3O z^0*|6*CDa9kS4;cvV$tl7d;GaP8R1+J_(BcZcjOZVE0M(ErO4Zln*Za?6b%nvrK>{ zGC0RY{ zp)9T^HKuAaL$n0k_}0X^##hdnR`VugHeJ*Hq$8=@dXGFZ8NSk0J$9_IS8DD%+TVY) zkL~k419$AnDI`6A@}=@3aR5fpCl`@@qf>k0&||P1YGrLc%O^%RCcUM}Q>H8d8T7xIFp{*v+C~FxV07fD4Nf0Sf5Q z9u@$~#O!u7Qg*Ye2+EWW9=Sa!EVg{|TGRXiYNQj=YlAxYH@sbw{*V7NaWP|O|IPR5 z(^hM)BHjD*OEw?9E&0X5fvhErAM_u35*X{l; zbBRcoZYl{Em7!L9=HF-DGElb~s!nPYzrYWjCs>=W6U<(i_Dcv{jF1A~wfH~4G=o}Y zpBdCI(`RJS5u6Q-JDiK3dnij;L>QAR&k@L-6${ZA-@+?k+V(#Xn-9?2h6P5=O9VzjGF^_QL|wS zdl*#QQ0G(o{1YY2;Si&fAj!C}Ihc``S5s5dSknmQQAe2w?j|uWi8!{HqZmcTaeY6l zqogFdidh5^T$cKORrt3GpS@X>8uvGyt^3wd=58B~oPOue?bmh4*R_e0HD9S2x+7O* z<+`c#_(7MsK29kdj=ZP6dXAjbT@|)vvT7;l``Qn zkr2gwgn$L9f7*dM996|1_lj-@ctP9}ghzGAo!lY!#5?4TsRoe~rX%Cpj!XpwHBt=4 z*{+ACu5YbxftrR_URj}Dw9F%=2JtLlOGn$I6fuxTI(v9ZEq{v{o5tG73m;@X?WE>w zV_vCZVoG1<%vR#l(}v3JN9tQS3$l2Wx4he7_os|OWz^Pgs;PeJ)_VuW(JGCFoK9ll zvxP!-|L&Lfloe;{bUZLQ5yF+-F6e~%Y=AR zd3g~!>y_7)gFUrqdC~IHlKi}-Ijrgda)@Tb@KmYlfoZ*zI#0c?6fadJ%QBptxLEhK zDR=guM$JV-a~10=3NGG&HY#K({<(MmmUgJN?<7Pj#QnFn`geT!(m?wQ%<}k81HC!#0ohYgnytLO-y#_-bPG{5ty;4Rv%Ec;af`!%_$k4jn&c6*ehz8tEXy`57gtqL zoQGl@bv1;+DKFDTdWa=2wsIVcm*T>hWATV+Z0(qH0qe&o$V_8v$;6G}7P5^G4- zTa(Z!UawehjlmLf(S4%9y$p=d5F}g;ek`Sz{lyXY7v)2v_CvZHNX6GXEt2SfN#LgZ zwi^{*ZUas>IxvITYuxAYy10)ckc$ItPjqFm#TBQyCxzVzP zJS@?;1+xf?nnZ5WxMzzSOa6LEb8~%tb7wQsLiJ7cP&8x2*}3kMGaJ{j3i`@;2?k1Gsq)z9wrsIj10bT2AuR-`CwWk4!P|;;)t| zHCAGLDnYhBv)8+1MNGEpjURjaP*k=8Ot!9kR7s0H+?gn1BWoIG5i!pWE@IPnsmZWE z&KzTsRwpzIod}_<6aRrrTBh7urD~@D*G|PtVZRP2ii7{1>!|p@%luDVQ^oyB)mI&Y z$!9t=s{neTv}mVHUf+0v1ag7~+>H1kN|LM9_A98e~kSDDQ}q0Ap_9(kO19wv`n zT`etZRu2t!4Rj$2)zaD0+0oY65Uj5Q2(_{zJwwrP3y??7M}absSl(|oT{oXx8q(3< zD&3@Hl2S=$WO6>~%<8PJ?#xP|2BR|i8kbQ@j$dW?7_?yyEU$uBf$B|{s$gb3$qjLB39V1=GD&UYq2gy=^HnSfE12gAoE&o;h! zhc@l2|H+0UWxqCES)-_@%IAW8KW~iuVDqWKTh{3dvB>VFflHIRczZjtSzed@!L-ea zCw;lEXU*WPk#BadUiOjf$oo|dMTtg~7{$xRZG_^A<}l1ieTM4v#_IZE?N4i~&5nDKC{lys%X@6=}V)r2Mgx#pCE1*=;J zadOiPZUmiE&mgzVGFWl3+;FjG9Ss4fXl^EpxVf#lje`2YxNF;}=QOyrzK^TfsbP+w4zeIzOPMe*q4jfGX!ypOXNp=3B2;x_7{ z{J!c6Tu6!OWQv{aFg+Fd0^=b4!BbB$9L!bVN7QV#&?}<%7wu5u?)_EU-5Oi;j8xl= zP^91I-|k6Qc0Dc5E9Sf2nR1SVU7vd*xoeg=;x~WJNgx9?Tn4(kI@%W?2bpTN;$6#u zst=6f5sU4xh@xT4XO#Pt1nF=@Asw^0lQlI(@WN}FYe0ckR9#dZ?}bxh zC+174iJe&z019vhG$%Zh1HFm=H2h@pLhIXi+RaTnl7bUBFWVcg&Z@UtZ;^Lye1vCj zKC$`osiHD0O0q+FM`x(QU9zk*E@$%#=*H7nkXq=)KH<20q)%?Glnh394~hwM5dba$ zuV0o~0?{)Oii6+YJ_XffNAl1-D^l$B(mj7|j*@%**+ zQy1mlH6Ix8fok8D+ij8&YsipASY`!TE7SrYC9OM;U8HQFJ91&NxNA(DEWTpK?G zW&;9Fs@;)t3{*v7aj_r}8BcL#F$hLV16q&~*$QzYpUPIy_{S`Ji7SFab|mqJ2Pe)o zyn0S+A4FqMm0t+TuQzB?BKHp7u_wVGh~~X6_w@}9UXFZIO@#oohZ;0Aa}bE8GbFSL zE2zYUVjsTR%H>P-dQ+EZ)u&UVPY&8k{M5z5pcF~3hQ()c1GHx)U=l1oqYe=%E6W8t z&4|^hh`rbyPrnn?4nv86RocP^b2Jn3$g_;4%?)YCdPFN5j;$ig0GZ0!1}BZf)rj9^ zY3w=1k>60!-d|Sb*ViC*{mzQM+YjBJQV6QQ+&FmTfu8#8$Ya#EzE7%*OI;6*o|~FYBrbKeckOd@ z_oqh&(BHoAus9Vvo_*+(ev zJ^|=V(TB1nhZ7lVV2NC!5e=(>=1dbEdXHlq=rgnAG>?OU$I9|(ICZSQ3Ggvj11X?F zX(&(9ubIuEcTW8k)6vtf;M0MH08jT<&PTAJ)rs@Lb#@soF7kAYKo>6drRCv8Pbhf3 z!mzS}>3%CqDW+Ob$S{OB95x!m{o(%Jp03We*5=0gy6P%pr4d~_2-%jO=k*rndnrlC zaLX)7D6%&8C`VT$IWc9g{^?>{eoM>ShDZp>8`MadoKH&7>f^HYbP5AfFX&quu(18uCyj*SfgozyR^ z6Go+#92)D|Tnw^SgJ|?F1LT;JcG^!+La9PFWS`rvv%$30fg^k@P4vQ0vv_d@uwtXF zS?QU6m%|94*GPs_qC`9Lwrm@LrBnBw(0aXb^9XQp)3yljW-=1SzJ$q8;hBa<@`51S z3kbp@9*t?Gh0G?nTndtaUfF?L+BuvdI-L;E35Xr7_vNJR82Wdg>gk`YsGc5i;2)E;PS=mu)}%yEzWbTVIJgFgHEb zkmJ{hx5zuBjgM_+XXjJHx1FLOz#>kMc=9Qo%U0_y$}2v+(=xDmeA90PozOJ%4gG)P zG&KobsM(0fuKpqzaVThY=Ag=z(vT#aK#*I3MX;iKBLGfj0Gt#h>2}#|bb*g>42njv zsaH5jW5;a60iad%quXU;_ZI4wfO#{CKA-#?(XhY-Kf~1*j`g( z4R8w3iL56ucew!5=GcTlq0?Ye$mXJG1y)ebRbqXpu3bl)TNu@f#WAoUD%U@bjh?>C z@>}219BZ1{U-ZGEe-OGpE+E!x4Sakjr8PwU#MLd>}qZnU&r>Ye+)#t zho^7<%*b6gnZXv~aag?Vl}&-jzur>6Yh7P;Ajh|{edB?#hbu&@Db4B4DbHS2T3xld zO3c4C@8~s_!OeTu|2KBEAG`XG*i}Ggu&-Z{y_G1!TL#cKHrAbmE0B1gX=B>}=yU09 zE@Udz4MuFtjM$j6!7#Gt*j@zX=NXUew6eq6exI@XkL@q0mS{&B;I+aHhW}KAY(4HO z9La=zp_|IdSP??hsf|V58we^)-8JgN9A*~Xk{HrVS}z?%nDyJ|q{tt_^&WLM)^r}i zUIag|Y-j6aICA`XY=zv=A@wGBRF3rQl9K2?+`B1%`6+C|qm?xcgO}O**GPFE;citw zOYct`^Wj!eAwnZ=sW-VY9#|oIhAN5sh@(o#f^Ot#4zij3B1)k29%&4? zA{YZ;+j9F{R@6Y*5Ikq-TELLWX684O+ySxxK%(qZDW;%E1mYBP&HyW-si~?;5SrSX z+FP2d8mk)XSlI(!huepUep9RTSREAg%m$dB_mK#p74e+te_jg3DgaEz{K*TE8&+22 ziML4G-BM%tME1Ye-C^L~@CUPqw^9ol7vffT=!^YD&Z#tU8x< zd?7Ppzgk;YucE58*1pz08GvfK+PKk2DSO&2v@h}HF?&9-RE2LHH8Dx;q{bJnsD*6# z7>484V7xb0!y-l=TUn8hef;jh@U^jRG~Myjx6di2ef8Mjn7^-Baz;*MKHvR>wyec# zo)~Qk(xzS$pU=?Nx2)_mui29o*wuOvy@cVOzGbSwt~Rr)Yl|evuAZPII0i&9qY|vU zba~P44FMIWGnw~grTKIYFM@Cx4(whASX(lTW5C#<1s6g*C>m+~&g*#T#lm@eI>TfhB#X{CDc1|06P7BgB36D915ToCwlE7`j zydHzuGbQLeCXddvkY|P~WVd-}8RnQ?-n_V(F{g#ii4&0Y#3qwvlsJ3+7NXu8mh0B6 z?(W{SaoyV0Th?r$OS`{U?r3dkCP*tFh8$vEkPk(~h^O+H=>|A5Y6PeWFwD1l{1<{~ zDA9a(GH!s+!=yZH{5Yq@KK{mSde-MY{M7Qu4Xer_?AzWrsEx^(`cA*SCnoH>()&up z-!w(WGoEo=$H_|9j$ONhdI=AcxLpjQs=SGo_EtrWQH?FZ3VNZ&{-CI_)@sR; z)+tK2{(3HSBW5t9>=^I=IlWS^@$)LY%qHDgnu*rRWEiHo3x4Mt%ua@4HUY>}@ zD?)>D94U(JpukuKO_pk($CU|DCnnAHLtg6K2?a_bD0^FPdOTWDV~X6r3OCWsiJKaY zwnBZ;j!GYz{z>M~2JhmR5vwygd7^A7T}ml7G#Y-r)Wy};%{S*wHunIJgk~M4N3oq1 z$i8=ALsyBP;2Y`>mq{jTi>ULWf0nPng05MVX-)pv!Se2;<5svtt5Y<2t)}q|(JSbD zUfmc$dC{y9n+;TAD~DYl6=w4ujg8_7nw!dhu%IAFSal?dX*Dorhs!v>}9#2#jLktnAC>hlT zLS4&(q!2!)362BA7bQxMPFy6U=*yUg)w{o%63U_%i6n6lG1ZvCN;oTLiWq* zFhC{~{_4^GRfz_#7m%?5qGQS@I$^P83HTd>O?|BZ|lX zf3pHPnUS`{??ObvJuJB0-XWA%ilTKCz-p`CN;ew`=@!9~sS_>xaIt0TJO>ssKQ1~AP1OIRxDlR;SDR@Iiz3 zA?ppyPYX9#{_vM|qm-K5i9{nyO&)v5Tix?SePl~&`L{a%l$UV3Hh(%(Z<-!DymEl|7;(UlHG{R`wls01aCCCOIde1JuyAKX_J zpgLF;lI+H=VkgLX?D|2$2xdd0oz$im;9;wS$|5Peh_Xnxjb|!-EK>>h%p#7c+!cbb zal_g*11tJ^J7MKCHq_QEFD)vdoRY7wu#gxlHE<*B0h#M;Gg$c!^5c{{$`AQyb*ZbZ zLO6ltjy1S3D1T&?Senm`qmyULuOjw|PoK*Ub!Ypt&u%_-dD+%rp^4hy+8$m>|c4dyfqxaJ3d!)|m ziw;N9Z|e&`e?V@w4P0Hso8$zyhC(-`q@tLaHtfYx=c637O_-7=TSS|y28qOwOEMq{ ziLQRwX$dyvDE{5^gipgnyzG7R$ zkzYxbXtjhzlXgx!qbt@pczU{1gLh%3SK`8rhQdeGg=_l4fwA!PzeJHP5H2eCED)$@ zpby==kM)RFcN4M&?M~cr5HI9`z_m3+4!98xI7)he__q*<1O1tu=+BIJmkwMK;|@+} z;$df*XlT%9mRS?5KBup~x4W~gg;(ehbP&H;kOoOBW(7J5a8N1Gq2tVsG|R5lx9hZW zrY+A&lDD^bq0Z>p)~0oeyk*yiimWk-6MNNaohujBbv)hFj{0uGk@1?HZ53SfM0;6R zTU7dPQwnxsGB{enjMiyG1Z%jA8LcaXmBK~&mZl);ONtzl-YpH5i%xMsFghhCt)o?N z8m&$w<55j7O6c5*c$NcRr2{L8KqCX;*|lmB$+GBD4h*1`mN2k#VCB#t;NzXGEuoHZ z2O(w30)@OaE0iNrmB_b8mlUUx3L3R5nnE{HLW|C?0hf`2v;Y=Qlhuk42y1uC_MGrq zWo7fA5P$t&{P1?}TGG6|dir)~#1EkTILWH`iR9!~b$KaYT2&ABG=1?vV_n`;w5aPh z87!6I&}gVTn%pwtswqfV-i^XN@?BU|TWpa@PUF`Xa65H<(-YTM#kncVoW>g9pt zrEjQPHp|jazr>iVxRY(5x}v2J@Kz)k56TBh(Z;niDA^1J7K2Xb!15dHHoF1M6VV;i zU_qD!O2G`JK!sK!AzYnSBYbER_>Nc`ce7a>L6(I4mbNxQXzOo-5k>%#n(9Dt{xba5 zQc?~SRE@TDX9BEI3w69{UF?Pjwu_~g;_i5sgivsDPXZ@*(>;T&`<2!7hZ~Eb8Wa&e z*;1S4)rr$Hn$~vzs|C&N?&J#yt#dX}a0Yn*!B{V9eRAxo)1Sv&&I z^*}qEl26d`wbw3U`JjE>F86k?x{7FAZi3UQS;gjNK_H#b+|%6CDHDLMvLaz6eT!L1 zy4tm-l4cpB;>nkDpnYH5a;oBas-<;VinY8lsu9djY~CfOT2p)XP|5|JF479+1_)&i zGCBar0ZtZ` znwn8+iUnu5dYcg-1rwljiR-P@hREs^V1jV~g}wNBP;IO{1zimeTn$udvZ!Z)Ym+Ak z6bw||7a;R<37Jo(a^e|^zX`Yvr=B5>w2RyLSjNb(0o(-Fwu~(ck7oID$dt?85vJ3# zE4%f?OU>PHhNp95M@L$(Ng3TU&`@2=4dBkh-2QEP?m*Y3fxBYIrXz;JqeG+FT-2pC zy^HPbQWtji?Ny9FWtY9P?Q*|5(>%L8?{vUgEpW5vn+khgBnVVOHpjllo%naX?@`lq z!^GLfYg@;bHH>KXAIF{c|Ld)tKMGGT)$IRQlNAp?AsQZYdYBY+h!!cx2_^00W96*vaH5!fU*RCAw>85x>WJ8sk2BX@Iq z`1p>#eM(-DgUnX10O+iU>*;Q|uMA}73x&1@Lq+-Z8|(Y?b7}wJm%+X0Y-aI+d@za- zPLj541EOa?lUnr*XT+cI2|4Z(Mt0ib%5U@@93<3Q7ZA#XeS z|FX?P<1M~H%#n%u%Nz`tau?Mjr~d;$ zf^Yv$cR8}atR6!cGV z`xdiQ;|gIdDQJoix@y6X)Qk=*%YA4w#4<1V#H0BHcQ1Xh9XGAZY;=MvU$^+?xmD4Y16!x1R%$U~4 zq(oFe1#9}#lS5ZsZN`%Ry2C=(8HQ>z3x4M3sv`;dMC-;4;p zZbTJ;Cbgj}C&O$gIg9}NB6{*n&Hc?`IUT?##*l_4;f1V~v&X|aB5R__o0XiYMGPCJCMKbJ zWC%etMp8yAvIMrDQ}s^iW?>Y9fTIAVmAo7x38B(Gnv%w0{S%WH+i%)(KD@lLO4gdbhHL`sC2I&A~yhF>S+YYuqwL&Wbi`U+aOgwWX_xi4w(CAgclm z=bh>zS@e?C0?Hu}x?A-)YF03mTg|(0doV#^Ou2R}5=+!Y7YU=#Z5_Qv7CsCe6d*KJ z0y=UMB}1VHXnP8lF#2+h*s$sW((Ez>}ArHhSH}VCkAfTBEJxU)` zUEF&{9sms~VkmMTN^L|Fbtgawa!261TAWji)vIP5*IXUEIQ=X(!XQ zUj(vI7W-u@*gEZ64b+OmWEaq$(tsok6cPGN8SQX$RYl~4B61QLHCIG#aJp0Zc@)&m ztIuO|*pUEV^dtnUZ08RGdN4f6yO;$fH0&wnp8$fP;49IFoYld>8Hm0Uh1`0<5zIsmmB8BUhIVq%A?~m#i+Cxd-cw(%OpJWNj|PA&>rx*Iewpxb0T- zaMa%(x1G|Hxy4(y8YacOroz?D&C74;4-W2R2j_#U$2J`Z7`+=>GTd={Y~8<6?eVz0 zd~`@W!nKBRFZO(;utmHe`w$NDtm~G{;K?*n9k`LetaPyY!M)}b?fV3e)8zD!ig1}t zdtl4B%udwfm|@eHjk|mz3Nv+*8zo|Xuft+M7aL(%ag&JkmeKf;B&<-oKu?TdzTXeGtXXi5pw~QXd8jFWDVi9Ee2#OKtm`pv^B@zLR3muty;BZ)s~GL zRt_VH{JVq-SM zZBW=KUQy~HSBOpz0w%s582pHzkj#PlAmLLmK&dHIh;h|1`7Ze(iwD0BAf#%Fy-lJ3=f zQos!H%CkM>B4!1;kiGQcCyYrtB8m^z_k@I;bp>Ee z9+Ywb#YcH}QXVGC5A>9zSOx{=bx%qsfkeNyb$nUd13Q_FACH&uyOL!5=5*tkZ-pa= z#5*-n#(M`FYlnAio?nZe+i^Bl_S?_(ss4{JOo;d;YL){3N`k6Kz7v*LR9mX%m<7C; zV7^BAg*AF%%0WWS>M0$+h+)huW%SsE0;S%`k|3*0W0rDO9W+}=Ws9m21^pim1V&ap9|CO!H zqRtGn!cLA2f$JIwnM($n0jY9`6f@H7Fw$_@0NX*7*B%$k_}CCT*Z6n*T53%i?lehG zM9&2iO(M)a2W$xiYn=4+&?b@|_6$rEJ)R`>LqM$;gu^ILm&5SOgY`Alcu~lDNiqD$ zZjdumb$Ya+36(vmt6x{ob56;|fVu@D{$%2s+xY&8i%rvaTJPcwl0WfGdZoiTZHeEN zgFG26J=-y+TmR%HwmYBRa{tXmPmf>!)qQqLk-H~;kIc1oo2skC%Cuu!%`3-uZ~S+@ zUHV(GU3sj#!BcVuKw-LKkVOLXZLBCk*FEf=&7jx>bx7$m_d}1r_AS*c;3m?T?jq>G1g?O+$ay3v4u5mR&tW-sT-XxgC3QeX^68#qtU!_PG8!PZc;Nqe^U`2~U~>YXY{vMb_*{Op1xCXtafl0aJ6Xik zSCadph#sLy2AolXiEw8WrLZDOVX;zh+3mw#mqVxVN4Z>g@LBXogEE))T}(s8VX}4_ z@^KeE4+2{3efX0sWD3U!E{Uw6*y~BLwp~F_u!j2(rP14MD9<-~ zL0N3XJrCarEi8BWMV|o{vQIajo`woE^r44c0$Smiv8VtryZKBAApTWTk%`lzoyus_ zqs;$ZJr+sS;QVuuNn?OX18@XT$A;No6y^AAwfH-xey~|5bB&;CBx^{siq3e88?n>D z!NHA#sB-`=6S4QEFia63TnIB%h)zW$Z=|AmF}|ieaWP_7*RDs1L#N_fG+JBtlJq*S zNZp_j#&dCMM|u>(xUsyx)MFDr_hn8*^>)V&U0f;Zfn$@O-#UwMN=|!8ZegCnJtUsw z<)^zg{)P)Hv^AL`6+(^h2v;m&GAm$=xCxY%V2&u{$gq~7n5+O;Xzh^()gD>oNMw|$ ze@A6aC94Py6ytfcrb*OIR>_@ML45MP7(L#^>t*0PPA5(utd7JVZ(VxL!Rj@IVjP{< z=eIo-cd8@(QCJXjN%SwUWvUV$k*%e;>9A~!$bd&)bShJFrZ2)umB*KWe|R(5upQJb8@__(-uC z^e>RFclTur`EQY5#Yvs6FV36$>XXb(i(8??G2{vLi+)G{U93e6577sUwnrD#sv=GU75{%rJx(35`cZ`GtN3kkK4RDn}vT zum#jtkKeXx!?=nszwNPOyKb(^>YV;;+`1VKa@6=uwG5*#jr@=snK*4$GtvJzQT%~ihf#{=IvflMZ-@3~W*4P874$3&3(A+` z$U)ll=BdREmRmrZO~^?2vC4QfWRa}S=ublz652G?Ps8lXBi_%7+6t=pDHjm*Vn!b* zuUYysb_*b4r71XL#XA(lN;K;!g8(h0$xps9)id54c_wb1^`%L5&0inb6K~>0zRoI{ zS%X0RYY;tRR%;YK%~#r)hO-zF;Z%xxR{y7bU{^js5}NG3DwjjD+JGW35#5zuXVPy0 zQ6da|lWv^3_r_tTXf(#$`)YLnk`TvePG; zEQKN(=zs`Sts{n6f_w`I%Fqvlq9oMM+l+NIV^JJf6bE`X0EP$lKtutw>)3!B#)Ps3 zB1T)xNHFs^HVQ&xOC#!DfyY1~mPptO@<4F3L|C$fW%InTHDw|gfIC91(|F!9B%&r( zT|tI<#;V5g_vnAlkj_V2n_jt<7WJg~-iBb)(XAfijg!?8Tc9Nb<3b^@GEkpTeqsK5DgaVI>;COyFXgh39yO7MBO5PC*zj5IKogt7<->`c;T4@qSec zW~`9_YF4Pz3+Y|vf{15 z$-dC-lGNG@n`aDCE8e3;-R>RT3UT$Y#PZ?Dy=%)$-j`Rzu5c{w9a@X$56H&v$LcOc z9Au5WvRE|fsR<$AMhFxk)}c2Us86A~W@dOE@yS%2OrfYCH?S-~0AwE!KA;JRv*Uox zB4Gl(H9QX1Xg3CGc0DlU*Gsx)*YBp`!O9 z>M@3%A=;r%6pmA$*D2KQp`;2Dp@)BJ)w4jH)nP$Y2N#S8Ys96{N&_nlv9Q_15hb@r z2%H7Zfx`-ual3XZVI{1&Kp-FoWJHS_kw$}Z^JErc#eBtXw^B66jvsJ`@k>VKZu~GJ znhE1Ks?{i8NAX(9d3kG)Px$2-ys1RGd;@PNa>+rC=k535v;gFl%gW!wz2j^Ek$h-QD1DcNh3(C zrLn{sxhty|H!r$5gS`gTIB`D^H*4Delc)V#KPZbVRadQ9y>f6xADsQR=B8kMRbzEy zWd)O^bZ-W4x6Ugt)i%TpbIX*dPKN3Pr_c}Dga$xHaB`r05Ys0*+8#pu#UO`@cc6ktsiZ^_GLn?T8+Xi9=dTu7-V?ErBS z#z$N-CNAE)`}?g8ubgjuRJ>Fd?CJ<^O}C!fTXW@AT^%=KJoj?ra2w*OYx}SLDD-C2 zcyRaHHBTK*inx%WT>^*ZYI#d}4mxf#iv`!K*`PO=p%qCH#$B?z5JF&KDQ%jJwa~5& zkWaxx%}3V;CDNmU#!=7=uNJ#%sgPF*qJ&t?gje;D72JB$<$;R0YU4ML&ppT zgaekDrt5Xk=+$&f!peqjAob; zCT9841>6B|-eI%=41@dtY%+2Nj263*6+G$wFKh1sUe{Hn4WD!FIk)$sYOD7yUG;ip z70Z%rNp7+%ce(c>x5zcFiQ~j1q>%!I1PBZPhB%>wggVqPKwyS2GZ2Q4HWT3c8HP*} z>H2@y-sjw=D_P2Xd3dmOt+Vghd#}A$d)K>I!IOm>WDahS84S8nv=I*RB~nj^*+1~!j>7ri|SFBS_fbOU=ATa&FC!A#+5 z7a|1>I8IVC*mxdGS%nx&@K*2YKYV?(a(i|DVR65^0vF*sy@dtxVbjKKr_1~{^VBni zZ8m9lRJ3LJJ)@P250!EK8$7|3FD}1F?+~}z3(^)PKqEgBw%@S!w;pF}zkrpQp_aE2 z)Zy(u$za0T8|_XTh+HL9l$#B9gBd^%i(oQX01>wd2D1�aY*)+EL+d(5-i&M=NaN zXx}4TZPrZHW(@q3o1MOps%28$oQz#{$!hdiHbY`I!cl0is{%US+uGG%IC*K^hD%2d z+%vxgT%Y;A^XIQRcC4B6DoVG0gDLwU!F8Zed7krt+WY{@8@y%{dgKyAv6ua97Hvi^ z>h*Pq2yFY13CsB{1p)>EN|R zm$n^0;oE0!Ivh~x)5dZOs*azzvR}h)X0%)`@4hjva)zil*2l2Sl>+P*R3cFL&wz*y z77eC2oD6lXB4Mk*opJKn()>Jvp3VS1rCDZY#mq8t#+a@07{{MZL}E}cVTze90IbdL zw(?7z;ZLh#K&TOL)NwL`Z>?1xW-~$8IAKL#Fz##|qRlDVZT5|PF9E(G+8lNn2|^oq z@rbK1&h(=77ENm|)6=l*In+%JnofC`PxpA_bkB#UyGXZ+A=jt=GXlVV+sRKQv4RFx zQ`n*IDY3s-2@l_7G7qz#kUUl3;Q}yKq4S8i8jI%wJmlYsflnqp=hfvBP?FciBmvkdw?x%BrY9JnM%U90^bFt_$ zCrR0T{K^N~ca9V-^If=8YTQ=U-xmD!w!>$t%P(ium3Un`Nb9?IaB;a&{>k0x$#;mA z&5LTc*Hs@ovt-e(4_zMUTaZxg&A2?SLf#EsSR<+gek5RS2f-HZ3S2AP<|+nD9323o zLAMzOmJu~t5~4<1aT&u7upthlQUNl?qDu9*;iOW91;cKb*<}MOE$%Zgl)_gyUIGMY z)nIJN%VozY4t7I5OScm`AUlu}#A@O9)ntsJYae4Q-4B^N5Gi*jRk{0XSy_qQD!%h& z<=ZV|^3YQpzVZB;hc42AoB7m6Wc4f6tu(kU0Mz1lzi(;Yhvc zz%mkj04xiK4y7#-3(J=Xs3ZcUNg~J?Y!E~Hh>KGdtB10)17=DS()QFC73IJM`D~52 zjtiw*xNknkRU*tQ-L+xx7WjLqVYT%<7U)#uB3;%FXMgj`eYJ0YTVEd?Jl|fFH~T78 zFS&O-I-vflavclQfCYN3?=$wnHNcRARUc-*6(A($E#X5X^KF95Xme4|Su{j88#jAJ zH=SPMvnKYhH5O4pyhPrBoTwl;MnDPTz*VN#i=&|oSNE)g=w=xt%FF|RlnS#OyBa$| zFVuv0C!JUA2ippnYd&w5%k9O{X4pEG{>moBmzB>?HpN5o^Rn{LK$3AUPg4rDjD}o< zOOTyqU@&Cm`rga$OWO3w!gJ@u>f+(_#1;M)Z-sm`a%)okCmSXwjZ<<`e<{ z?JDToSUxTqipn|*Oa|HQ$XODjHflS@gQrC2XCy;jx|<~S)?bt!YzQS7e;#mTU=vDl zB~pVN#4I^Xv{Wz|fk!scMQI>p7=n%t*l`g)E7pA^oa-PH1PM0vA;><6Td{9QQsVj9 z9;F1^3{N2zrs$RRG2hGWXrRGklalERfm7n`aakaXrzL>{%gbg+Ft$15dsOG;gLsk5 zW_Hy^Tpdaee3HN1?OE_dTJM(6RGvT9wh`26|L}Ovkk_J2enI!WC_DMg{@&u}_EldK zOA8ws#%jbvoyMZXlENs@gwm3!GHQ|#t6ByEPk;;0_VSfXHB_MVqlwtZ0OI z!FZ7b=@l-Nx_*Y}MBbH*55|DXlZj};jp?A90U1{sTqnlVW*ET$PLjKbmL}Gev*|Ls_YuArAR>lZXfxZuF1hcvIXZa{Q&BK9};6pQ* zz{3fPUeJR`7WW&-&y1Xl6i1f93uQtEqSgmYnLrt;q_Wn2ZbVYMpuz%oHgcrcxeTT% zS$sBz`!cHxTrzQW0Y6GK!M9?#E!Why6sF!0In#=|Z4HyhYhzgn|nLwL$MLaA_&u=0oD z(W!+t^LZGULbwYg##j<2#8h#^fEJ9aCR}kdqa3p<6Z5Ti$4Ho1T42iWGp!6*UD79RPJkKdgWE-{iu0kkWmH`7yiS)QbpZ z6t0xVj`p(omqR5k4fHzgMjZfhToRxFRY|a!V0T0#wOGQ3Y-;G zeRPs7HBica6NzDhKcKe)u0aR@9*X<>aEPKcbV4oJv9bFf*FcJ6)hlUXt6p0Z)sUb3 zKe`XcG32!nKzi%tIF>v4&ubKIU7Dy2ICf>q;;alT8*tBTbf^nN+=rSwjgZQW3pC4P zswG2Y=V6FdXsx0xnRps7&RS_+_?*^k@`qv9Tl0ZtUAn2eIh_DYgvdXGWaT4%uqLo7 z2iFGO6!3lC%S}PO*)bI8HZr-LGuN9U*0+&=7WQp4Q4yIt^X{Z9$8~2SCLHa*keIxR z_DfXwTq|@FUlDmQKGY#i$?OC(oExDy7db926C&#_q!=l*G)(ju za8uVis7aU=9t;b{5FJ$5k|tlM0|#uzk<@eq^v>)GT|5o-_s48IlS58XTGGnuwt@vmMjL|nOK)m`nW=40gOY};17ed>pTme}f?KH6gg0xz6hgKGixp0++_^KoK8u0Gh4W!I6Q1l+5puY== z8KJAEtB2@?+FHn81?0b}tcjC87v^WAv#lcC6x-$XHX9`(fF3IWTiHHI$EQPv*DsxEr%vsEif>X)BpL@N(uut)q+pg<$95`UZx_J{ z1~iUSL>oi|%OgHeJ7%d-1_zuF6pRQC8+zN}2$J_{)oo?Ci(%lMnA7QX*`r#M7z`oX zUPbmH)G*^nvR;~HBzZIy? zyc{03K*BC`P+7um_A@GGYS}w&_eC6OHP)s$3CR0}!0{QkKAjSJ00{k-@BYas5Bl*L z_r0`~L529{i_UPmNxbzlI4uTjf0gi!n`Fq4Z$pI_AeAwg4MsE4nL4{pu^$BA0(d$N zMiX*OW>iU-!@)|`a2a#JVs#?^M$FtAzy{hYdK|%IHK5Rj`*Qq?0AYIf8|+4WYRN$N>TP3#skvQ;J9AP8wr*XOm$GYDgNkBe zMq)Z+_P~o~UQQd`hhkpvj0)(ZlyMS{0*pzks-~)d3)rPPXb~Anxs= z0uoXpkhD51)NcdlNk%y#*t^JR7FcxyTCr<5CJu;NE!ZuJ#SZ4D+YFCGIiJzd;O&1k zFv5tUP23py_JB@dJIl+$fTrPFr#>vuTs@+1OKbyhh&bqyI@p4kPUO4a~X#ZTV%5u|ag z`c+%U1{dUX9`4FnFgUhlh0{D8SG9EW)lR<#R?oUI@iES+JdFhsg?w;UnTC5>Jv;rm773~GkrKvf6Qw%ex|Ag(r)lAQC*ak zk-l&N9VryxMw}@IxWGQlaH^t{kuXM-53*d<&7AG=)_Y^fk~F^yE)*giraaY$W0v<^ zRFaOv$XNaO%sFuU3M=gg#u(=$d`fv$~$%O;u z6igPUX)`fz znn|fpKa*lWqN&Gf+Cs26`5C1eQz{XZYCf-`hrdF}9-G93>ON-V>7k{?njg3d^v3byzieta@sISrQ{L8ttu2RmFhc$tUON+^$<2Wcg`x#T znK}d`(nT}awq?{jv$7@&=mhseYb!FS@F}!Lti)CmlYInNS>DGuilv8>!lb{VytFtc zD-%tBJ$?!@I4Rz$!y0oCLLJMtYS3R6F(+twrh*0o+?>HyxiV8=&|LPvcG}q7*wr;T zykq&Lp7Zy;^Z5Ht1V1MJ@_mor7pRgNTF*^=mC4zuj%!!Ft-hY?%Z55mUBCXvE2h4_ zuBA1trpne&iK#5pVwPTFlPwW`5U>{eY{+*xMMO?uvY4S&D+LKwhlF~30fAX?CIPQ& z0_`akyve`?Q+_~i7y+#mCalx>fZOQ%OfnvER~EM@WQI%ySpZYjMhOOGHI@shqym7p-`Pavf|GK$xeB)tf)A;1iTiXt{w*HZ%zLj1bHYP#rN52sS%WY@^e?9-Z#NMI{P|W8t!bS`?M7kts`A4k6@G2tVJE z$Z0^DFg&0c!nWw}Oiv15_dP+I-!{%@bwpHj9BSJZsByiR{gYADBFzrSx) zP4Jp@>HY`$o%Bn));LYJ6vwsR&~x9CK-2j62R$Z7it}2} z0GSxUA4?QkY7+kbW-fYg&`J|L9P9;VlbOix6j>*OIK6y&G0c7zomJodqq&d%}VYT4NEvZ^;aY&FQG0o5KV z%8M=V^z{{gqpsHetzE0uEURvLIcq`t=9LeR-T9Zs!c|K`OUv}?pXKMVq7{(dzi{W@TrZk&ZJHQPQv1O!5fq>D zo_=I9vCLp7hW&%(mCf*Epi}4$b+E?3>K$q_NuvOrsN`uBR;ZrkQEZXHWY`!r0)IBp zgpIMAjdt{Tj{RnwB%MT^r)PQ^S~rEDd6XS5E6L5tOh{PJ=gNmTU*;VuYPz$*LP1>UU~}-`=*s2*m(YLbuE_gjh2w72s`CfLSl1wAYGY zj*O=8EGiHQ;Yv?W&q;@anzqmd>RzZ=k2)<92o1!=Oj~x1BUnPG3h>~nni}2j!q~0* zjs-sn8s8)Guilt^>)8m*)_>k@?Bg81SdWwO=p2rTWp&%7DK}%5!J0Fz=RN7L9>=Twn9{jI;my`GOKk{JW zp5?=NojKAe(R!4YMwgJ0w(8)G31#^+yTqwFmErjFMU6jvwxl*IzoMu#S6wLMwwJev zi$@M^&LpB^iq`#EhG&3$Srq~55$pkD9jtmibd?^P%q?CLe4~u+^K>8x)@HNd5;E{0 zx1qnZw6v-e)e($qG~eUOp98jyYw9>V|F?LcHd4?}Fd?}2%;fK%je}-`N{*Fufp^=HK|uK7^(MR>2VJ8EsX zcaD$_0t*X;Y@sPok0=abegJ<(*}ja(40;Ix2SiaA6{O9B&MC=MwdKKo2#(maK25yR zPbK39?1yTPn8*^D5}3HZ%9*&&(MyUShIsm8NVwJ4WAxjHNHQ6-14ALC2pQPIQeh;p z+QmtwKv_rnP7k^pW;=;i^z?I@4GP}c2x5{jhjLL-YASGv2$!;^ky)u3sc@x;fC2B% z*x=k6>AX6H7_m%bw^4MZA~N+4aK^3R$7w?U^Q`!9(=)sve0wT#(Nzkq*PnVy4US}B z`Dt#&!n(jnE(&DPFdAVp_&l)EA!bGpL6JwT5<%H5HWMPSvHOylNi)nW&IFl$r8ZSgr?>gkBq=I=sd70*PAr_LWMU=%NENGmVJNT+ zjxF))AgP9Vp{k4dc#34gyj12UNE^~+vBH*@o0Yk6fhKG!9b>9S=0K!<1eOb(4o%q9 z5LT`HqYyDpVMylIMdM(I6DLyas=|yof4Fr^L0}#CMxC%eu(lXAX+|?Tb)g0gxgZ$? z!X^>PGFEy<`(&kk0+A$}weaY~`4KsCzjSNBf5d!iwtRt$&k)-6LF zW?l^BTpL)FPX>-P))eS;rcQLk1zw)&O2ONP;%~i~xpR6*B|5nRhrqh$`P^Qo1;;Ri z^Z|-s1U#MW4haORs|6v@8$kEB>bB~(`dS7NWo$jT7x}^vTr$*bq=w=edC-k&Q+R?- z##t6Yi`4r_Y4Yk&6yE6#-0Lya0ptG8b*r&qQ^TEA-#xA$)RyW7E!C^iWvwys#=5o1 zeyjOnWFhW-r*aBWYWJhZx-X5zTQzalJ?%9m&b;*YXeR1gKT}p>C96Q6vL&#wEK-J& zOcJqBLx}7)&^U;=&LX79DzBeGi2QzkqaWpK6d5Wl!FuJ-UW&-r$tXe{Z_zRZW`B;+gD@S(fmuYKsFRjr(D*LB=t!-GR={1Ote`9&A<>W}z+5~^ly05iuZ!5zY z-O^M3qXaqD7NA$sxIJcXZm2DkbtX3n6_t8Me&AtY42nfGI31GNZO3{=$eSlDZ!QaN z59^4R>(0+{onT9S@(lG)w)vs8f`ltq3!&p zbgwG%rC+KJ{J1XSX1u@mp6$BYP;qJ0u7>*1-`CyU8|J0%W_IL1qL0p>gjVeE4$eO3 zs3?yo`qw@TajrKB7KhFnlxTY@Xj3R4m^)(->%EZy!ag;N(6lswM@H z7tQiMh;vSR6|fhg5JsEU48uiCigkYgk$-z@3*-e30=nhEbj(G)PYNtA4!mGqge%i7 z^I#C_VnX%Di2G8m3ISiW!!^rPAx*{H3WFaF+*qK!R`>fq?mZv;gFo48v`L1l(elG* zb3V4mvS9p1$3XJL<$I4j*Oi)b)G#$EUCt^S-CKJ9KbI}9>Z)#Fp0~Iq+3PSnjUH!C zNnK&^7k5@|8OUC+4{($qR7n_P^VEE_84ErMOPFn$`@hH@%+X_5l60+mL_!9d7n5Eh_CIATLY z_6QId>a>CXE90g~-hjMr){CD-A4pp?sF$`J0!A}EYS;!wa_jl+;5Dvm~A zE|qdcve>Cv29f(9riLQ-9WXf@3hFIMdDzJWL0u|BMPn*z-^uw^Efx)ZM|Fb+wdj{0 zQ6%a_Do>=QM!O;;$ z^|*<=Xs;p=>lvX^TrO{>8D32;$u{YJN={Q`g~F)y1b`G;&Q@kVLhNlf{KEQj#j zIXPe|3p37UqBIPk%*cuuye7BtyzDsgSB5$Zmnw2IPJVqa=u-~dmEfp7%}m{z_lc+X zHTLIE73kKrZCUx)FuRjJz53|RtW0Lzo?KHlUSaGUimFefn8z)~zLpKI5>v|nA|o2a z&!&f-+ho-9_Geh+P(@V40o0XaA@{uBsni}7Lki|+tJ097A^Ab^-3@SD% zO*X9W9DEdele_Sv(!#*#zS_w>x(6dvGl)F5FUaobxQgv6?e~tiM%5iNiIML>@T*$* z2|{0rT?>6xp_mwrsnF2GhHI8?Q#D8o`UFyDR>J1PT~QPX;-qDQh)w|Yt@I=zwdVdP zLZRAIxVmK^k5Lmlx37h*lteeU+JiL9>(BJCpcyNZWa^Fw&GN(Qt)@CNGJ>Y6IG;C@ zMb30r0If>e(|`6pQ}-i1L&<0E5*L1H#j;!;JPVde%QDhd?+^Y>PmwbwKc6pbdg$z# z_O`v_C;pgSlbuV!vvK2=bzkb+bZ9d>7*q1oI2eS;K!v1Wpt315RY;m~iNQ*ZV(ViX zir=|{Kwd4LL%bZ4!UHI(YGOnQG13CJk4~ zSeZy%BTB%cFMrNo&7QL1DFJX{Sk-fQ6kv^rrw~$vYS*;Q%-;y<$f&9kgsSE$XnIyW z!`do#&}tF_D&m^Qox+=8aPKFq>N7IcZtU8+is1l=el-ZyC+{_1rbZaJB;z*^cEQW@^N4r zQiLp_Kd=NI2-4$-M)Okl;JDbMa-Fw%nasy59%C#k}UuWX} zrksNJB^=L{7eJ#WvvfXfeYy79F|TVfp-vuT8Y1j;yt?{#5lNCl?FpKwNm?KCV8lGp zB{B^hmub0aKtB-2B~2C9Z^Tq}#J!De4qdN2b{C#)%HAtKy|K4*Xp3#NHsO`QdTBtL za4`6%bAyJh%i~S@mY(QU{6ag`Khf#%w&RowZD8wN0O|mcY@3YKM~Z#yi1}EBF*OP3 z!)gb$JF=mA;FpXC5jsIJyac)tx`Xv1+O*=#kONB<$9(|zv4(J76QSM+)CAKiW(dJy zmK?)imYU-@WGqe_0*Bk+U^kY*ZiZJf`@7)WrL;CPZVncCC@Sz|sTAMLw&s+FdLluh zd}(5KExVoTe0s1Sl6IfAMVSg>cZ7k3H-d1De)rph>z}x*f5jG!?EAzcuJX>Y!;VpH z-7c~DZ`V0sybRH9sEH1nV;NYJ0REZZCX+v{H17Lw08HDT1{QsY z`4qS0FJj8+D1|K{HU_Xl8_+BUr4H=EW#!wdPo)-iMkp*+%vw^2tPYC$qZL=kr_v(- z6l2mHPH1FOTv1VT`HOq6Jh<(P$Fp{5T3FmL<(FQq+FLT16)NxDQ@-!`))nokrx&&F zJ$~Yk4~_>{qO7;5{`ChRR3k}Xt^xeFTxbwFg=YiiR<6TX0+)(5DnW*1ffBP4$|cm{ z$>Vg}O^8aGQTM{CG9uMjpjLgxK`IP+bDS=%t}(HIG*mSBBWj{^ zaa}Q`*`_sEG$)#Xo)2bZyR6~~{H zJT_Nibw;?chji=ru#eATozq||tPBh#A=sOZ%n)p3L~$Z-aB)^um7XpL>4oV?Y-6M} zp9hA2)cvi+c0;;3%I4>jmd_$3@#ftL_PUcxI|h(+>1nVYCG}3$|F!M-&r0IZU)QNQP(V^8iW+5786*t~z z;7(RvUS35WSPkI6xRSEmd2Yf5=K>d2Q!CUlUlI{lex-4SLhg2v)9DFY8RCDR+3;L~ z*lSAM)7C9rmM$K;wy0r&PbW?tkpGS{FwcI4=UjeyeuLg8W*MciRh`El++;}g`Q4fD zWu|UCw@OM3=UtfPuaK`;EBuvfD`%A?nS=^V44MiISI|`KBXh(@s+OwMfD6!40J|FY z1C32wSUPNOBpV)p{|tR@)O1sA?1M<~NM`g#yUo*qIzVfoLq*bya3s;a#0-U`C#9%n z_2Pdo^pF=ChA}v2dh$Seot?yhv*IioXnORUsT|x-nTmIMj|t~?P2;>;+Cc3lCYLE? zGjy0Z(@>?}xjt$&!8pfobW*Vq)LsJV^o0OO;Ml;#h7V-c8Ib;hrDq{aPfLG6vO=r_ z5%v$dkD!eZ#>sGJLaUHp8KP4mBQNf>*rm$@d+3Rs%ALyP+JqitF69?=i>JAi>MWxD zNitQZSO}m9=jLCyTmfV)Apk+eq^Eo$a&ai`)YC-ii-uIxS}}3Mgp8oCfSm+HipQaAwWp^ zY=iuIR9^^DJV$XL+)fWoJl49dcB)hsruBvB7^4g7^#7b(CH0OKj)%KK+?vvVpB-Ha zog4TvqdlAKQ1m-}9?9ZF*9S<@m|H}K5o|4+fn3pv2$8!eC~imU!)|vY7zD+=4sNKn z;)DSW&@i&zaqvBl1K5w%ExD}{)v-+*3WeXY-aV%`!bTLewSj+eaa(s6)Fs7gab4j! zBP+^6+d0?}MiLXs{)KAlA?(avtgZ7?J=OHET`Rbf!k#kK)_VnSls5k4VAO8;8y6a;%H)AiZTJM)+yZ5fEui1a($XIw2MNf5e zQ*yYlK6iU_8xL;lNp)5tw7o=h1k4?bb&%Nc_|CQhLGC2zvl-B4nBE?{gh~U&f^3CK zkmm&fAs|+^5jP_sBr{W7hmJgv8{0;s=oD1ay~kltI&49sWy{WK1L07il6a1;I znnK%>wk6$NO^sEp{#MK$2}+{*%}mG5<<27CJfZ*_X3*^08D@nN$wweVh;}rWbSSY% z0?0~s!GB$I2S2zJ+j>FT@RLIk+xkF2T$ZyyubV2>{d9M#)uxk!ZzPCcYS}C;*Gz^r zrw<(3*id)q$oRH^b~2YHc{)-n632tDF0^`m3#u39Y-xBU@7NCWlA+B*|E=zB8FrUi zVswfb0ds@sGUI-CYrETt<#f~TIs})+;i8Zb+hvfRtD6iuIuR@xUMDA+L?#n-oN@QK zi^kF^?t}lk!O&ol?KE7Qi1F+ZFGtZpw&QbnH*9zT*}Py|Xsu|h01C9)kLAD_2C`|! z?WWyB0Alvjiy#HgELl%A5n0SKD6v=12cL!Qz2x5DcSD#Dz_tY?3Bl6}{O$j$2>T+@qH{3yof#(4QW6o4NHXAY_QR0LZ4~-H(7My!6uu8;%wftEyAOQPqw&J+y z5gV}R38X*U(~%E45P}Et2^PieAH=?;5bZ6Y>kIRNug?G)F^l!}VXmB-9$*DWlq7@K z9*Ik2WeJ+*}9Ooowzt`^Y2SJu6n{b>vDD^1)9Xyzi85Xz77m z<@_#m`MtG1GEjMp@pP@|`{vE!Iszze+Q029o5W=+wvKMO8a&5imJ)3W=yu*joStn8 z1)VHaK&qi374^hSWk11EXFp+EcvK3UM519Qac7#$iV49?n3p;Uky(cwtuhhuhVLG= zBea|75X2r6EQ(37P>IUio`yBc9t6IBeotac7L=8h)t7-=rnDqKFDo-WjWD8QmhiqL zY*SdqN}myTJ8+~_rV7TYtHQXX1nFx;H2?6DuHg5kZ^*;L2uBk^#mB^A_!;4}$-X18 zo3UwmdKM$42>Tj*PwvE?6bgQEm@{!Z@9KdQVk;T)E1bE0_OEFy<+1`55wlv!I!a< z z9|Kw3uR6Pfzns47*M_Xhx$oBoPl#6|Zpr(5$JWGddS~VpcJ}N+Ld6bR2&n z9T3bAw<5ab0R;?9wGohTBSQj^9rgi$4=%ld#a8P4-b7qfFcOFgKa)t8aFE2eAL#0AsaR$; zpE#Y_-~Z`Vy5k9ESDK@$Q4~^w08FTPZ=t*qLXIyEV7&em1$-M({eyUkEmvn**{ z`%l_XoI!4ODO-pN;a>xe91oCNZuF`|<2BT>s#RBlK|y~?@{bVU=J;t`50s+U>xgC^ zt4B)`S@4I`LbV5I$PVl^RaDOBStQ%E$52vtWaeiQ=ar)r(&-Tx(uN5UB2}R>oRyab0f#7Whb!eKP+i5^w0Mvy8%nbrEJH;f^yBk5QzI^{NmbwDWqs{nx~WFBac4Mud#ASY%%&#H;((6iVfI~_xdg5#a#>i&FJf;rmex>hEuk1t!-9%}(8MVQcWu zY{@^YqXOCn;ok!m68$oWzKOgHRrJjy`W6vAe33VhAr2K|A)?t@t*?o%g-B^NNP;2X+CEIqO0){3^9APZ-e z;yj*Wln@3bGes|1P<$Xec#CVhXfUIC07}@^x*s$ z5SGPN4{{6>5#r2kK&r)v8V`Q_+=oJh0sK4bqh66$cVK_A1PaEW{#GOHMcFwlQlwpx z;(_FQv@}L2D#P&!*q4Zli=ho8c@9N?VzzQo3&Wh>4@Y3PdRJw>aN)6YX~9D}0}s9g zKYQ-X)u_nJS9f3iwsujS`2EQtE!+~^^bgD%_ak~vX^LDp2!ny8`5wtEmK5h?%O)Vy zS+W92AJnqYu>i3HD?R|^7zPSAOu}3v`u?JVEIQy2O;{In$V2yR2v*5>Y(fSFKuLA^ zdT7RMwBD%|{{s7>sl3l(J~mPGu@ghf$*h==KJ@2!qJBCV#llN_`t$0m?LK6SR< z-?w$vskYdXr+&TzNxH|I>P%w;8{*Fxbq6?g4@rMSqCXEOuTy;MCa7sG1Yn}vd%vJ} zf`4eIkN{4t1h8~C1+V1v0%?QGPD+r0;1(@#hvBY|d0Yyh6NV9YB6!+SzGUZTP^Dq_ z+2{Y=|lS0=GEd20Aq&&3u%2i&WmDHPbS^E0RSA%a?94s5m z3QD+QjF+{WM|$84zl->-vmS|3lx;OvH#XM(_P32vyS?# z`KZ9o2XG8m&-Jk*K$A06*(@XR=L7WuP5`>QN58>spC=O^{)&4M_5|Q~D%C(O3q8?g z8SyD{D~LQrexL@P$OkD$@D5Bf__;uO9mt&bvh!ra(Ur z{lA`97|4LK5am4!5%{Vw$cUQKJeRRFDPt0h@Ue?%Hba9dY;6nM%-D3IF-*(h4M;D12 z)&6AB={0?uR`1W(yH{Kq-L*0+KWjl{+5Y84#al+lLLq7$iKPC1h-90v7>$`hqD^Au z>`#P|Rt2ea0tm?jF#010Yn4t8G{Qaz+As-pQUU=Ih>olvBLjdESzoW)W<)knKZ-=5 zUY{Jk!YFKt*iY=U2ryYB^ts0fpe;ZSV#WdJJ>v|3+f^HZSAWbn038I#W9%EaD1pH; z)<|5*qGOg}OkROMNv9*5s2|GM={REGF-6$Fe22mCGu0Es!Wnt)))HFd|5Q|K2MNQ`gOB z$_}hM)7)|?zNDt<&+Yv9#|Vc!b!IbnnWSeJ3>ly}fPy|Z%wWiCd*e#&*vQ5iQOQh- z^rgQ$HcCf~*<;XW4;* zPW;EmMFg1Qp*uY&yENKOz|{icg!C6eqlBM#qVfXTd(>@{6eULD$vmP*!LDmG4f6qD z4$SF!F7WE}FcdHXyakk1VE~-8+rIz_e5>{X(+6N0a~Q*LgKeg1&>8{XLDOJW{;}^d z$6@H~0N*k5Fq#He(IW9*2cd|$4*^S`@nIzQp)4~T<%l>%BY`{y@>tZih(SE+AW%fQ zR6#)>AOUcSU^;{lkqkVlrWm)2nhdQ!0CdtHov4%X6pYBgrP*f*tY;E#fMEO?fJT0(OH7zZ5x13+)s^^!Rofi1Y$POLPP&e$Il_H6#otL2$V={N9!qa| za7#QPxR9Vf_r2QS5%GFdYO=m^B<>--bJO|A{3Iu{p;E#ABj1XIFI>~yf&D)_K`$xlmR-r7PT0WzB)J*C5I$C4*owF5hPc#7!-e`7#@X8^W@usuBBo0sY;9ysmAPlY=T(x|tYoKdj$zm$qrwzw?kp`s5N>DZk*0(A))ls+sH}mrlm>h($ zUtvfQ>Ry6uN-F-8@uzzG<_QX2(gp?OQ{X!UG#}L|QB{UK0InatHzoecITdv~wxF4vCS?poHH#5^9%)=D;iC#18ACE{T2 z6ng^B4nTp0lq3ml5k#Wm;m55B^(xeS_Mm|39?51n2#z9{#Nbf?q8`yPodvk@#b=1mDaF? z>dtwUC}Z4(0I$7HDAHs`^BbSk~1kE!3>!?yt&*{zawiu5JHrk0%2i zN!V7Zv5^&Dg1A$F|0v+z)L%@|E3(Jr3TWB&e{B7b_D7+748d*4KW$x>0RZ zLWe0;en>q`;NwoC+%Fm*5G5FL7=YkIwgJ+%0C`Bv$;kgAT?;Lw^=lw!mj#@?x_;iu z0;wRVAh0rWEKMXUBaHD#8OORX5RJAfx);LijMj&=Yh{1O&dC?#&%81DM}D(JFf|^p z$k)WY#)!7MA%q{4%AaKfU09+EDLhDtpeNjn5vUq)zEkFoD7T@Hbzo4@p;nPI5Jm!7 z{Gprzs1{LVH+y4U_#07k(~`-d$-NjuKv?@j^Ih5;t80!oV3Gr8Cbe#CFGP|9KcvmF z3B7b9CwWVL8I#mX#&tMVhz*IX3PgbK2~$HWH9}O-B!H$vWp&U>#u>9iw#S=Emr;n? zA%Td$$ui*kqcJ?>Fm9KsTHP`bg0=nF&%{%@Ihl$+fmiPA91MOGvWZRFv-jk&P38Gd zZ$0wW-4{dT55FicUtNhXH}>Y1{tRB5Ah8|7mpInXUVv;~3n=$+g2yn%gPp>LOPvbwkOKq3w21E5E(foobfU{HuAzu}m()Ow`UEa9Zwpd$0=eHL(CA@Hu9X&QjQyd7ZPYHmW60I z`Go!qK`QrO1^L7TvA;}Q&isrf6z?Qu?5{7ZNKoFrpkD8CXC#Bz;qAHERQz%3M1P$o zAaaGA2#X*=v$DjZ2#h7uoSU)o83@$(1$umD=NK9om#Sdmbkl`u_Ld(DWB9M*UAQ4TS53 zE>X|5RU5Rh6UHIQP z{vO9cS3{de?*TtWoRLHjd&! z+7fN_%`TLj2}Ki1MyYAg|1{dj>$ns3k%_0Sq`#v6@K>3BfbPf+<*HRiA zYHMhds6{tiUT=rb9gm?mN?-V>$Q^eGtbjV48?wF8`;2joXlzlk9h@WJ={Hz7 zZn+scSx}Q-#)h;AUBaN~=V2&&FW92YBDi%#or_(~_`nwaKsC1)X>>3SgJN(HFFi$C z?eJj{6-Nvflm*m_OE0-_GQCbS60Q*>FQDqAuUFwVA zV~*b8{A!g$RkIZ$6ol@U^fIZ4M|&4PdHPYyMQ#&{hu4m%Tr+&%S0A|dw6yZEwUXG} zm0@^l@@cwBSJuiGA{EBL!*`z}BA2i177OY_BJj$FWh=L>$#k&@Snx2n73;%lg9SqL zTOk!qP}fUE^mwNvk);92M)I#*tYAX@Nybl*2jZA$Ll%+I135s5=|B)pYh@ zujoQjTPL{?nl~F+3{hhY(u9G&r}H+$kYu@ZG#VGJnZ_c)>ZY+A#5)w{oe&_W%;H=| z19C_k$mW4iQDK$`{o-hjT(~GvIoILHv&iZ1>rq|%`f0*Na9$@%5ru>c5wncEISCgh z!w9<`xgjb?-J8-07D3ybz9jheqn7iUY^@nlNx-L`m3|B!BgmGx;`&OP;q3Z-wZUVP zFRH@zT2x%EwqiIWUWMTshQzC@b>kVt*0^j*yf_NP@61X+3`L#~sLKO4fvpae08|5C z$NG7pSYEdSfp0;fLIBW3flWghL!^xU5qLY!vVsen=K-0J=s#vq!W2;I^B6KRttFT<=Y|V34{Y>DD_+{bYlF44j~4k?8#~V)bG@_zUQvhrK9^yH?-y6 zM$3IkK6_^JrRe3p^qsx+#)CWKuQ<6Sweo(fI1$RW3R?r4Ydwd14`o(2E;)hTOvM={seJcO4U-n6o`4M#iC+5h_=p#pqoRqQHTzVUC4nE z($WQwEld=Tub>;ecKUaG$65Fp{x% z2RL+&W6&Bwozcu;9?d=m5(A7EBe{>57-=;C5!avvslaE?Gz|B6m_QOpV%Bk>d2lE* z1YvP^$0BSn;FR?cMUqvtR0By26wfq2H{w)=Vp}Mrhp$IQYaI9tVwl{ zmt|XTlQ-qS%M*9*4}4=uGPu*^spqB7W#$fV(C?En8nXbSDZaS4x_8Uu*CGHk&n#WH z+~2}LG%#Yed%+#PqB+qyE?Rc2%+Aw*H0%1rqiT`?(T3l_qNI~lehEr}`yCFuo$?@WV`8RLK%gRx-8IP|lOM3UUWM}j3Y{e9*!6iIbY zcqp40@WFYH2a+=LC+Y~5(K@m~=R zJ%7tFa7XARH!kGa$K;YSc@7nAQ^yTacZd0^Ztn$!amMxJTuZ}skvi5cDcu}s&0htNlbLL_{a^o0_dkBK_; zk5aFG_K{Wni2nlp1bzy-@(EH~hlmnN%6B43qLX%5MLl>%WIJ4Wr)bA-itr9qEVA2S z(uI3%;0p+=UmJd0Ix?@P>EMCuMf>uorx`=RFy25=@D?+^08P4?4}o|9`i@1u!5qh+ zqt+fZh5*(TJxIaWLZHRN90#H^wq!m7AuYq`|B@NslySuEkRp~h&^!BBfEj?rfx2fa zq7(V(*#={$iq-t|g0%x8(-CNGYTyn{NfFm5u=zqYKdc6n(*Kk%ndf1O(ki>JeEM2X zjb;4>y=7^WY6Atn*^`t-2Zt0(-f;B6fnxcpY8X+<>{I`;ym|RRb-QK>?eN)v&zycz zqE!nLk@`*?jb357uuj^^{bFyA=rv?zNQ$>pbg(3$11J%GaHjp6>|_5%TZ(_PMLoy< zEzZZJlju;9a}0iaRCNF6V%k>)-et?a=3hYM>D7w0mL)y?eOX$1eto5z#eOFMNu#H`a(PIBGN<*HxnIV;<%aja(WOIpa8w5 zh?Hw@Og2R1as}?5UK%7!| zW|ZeD$DI1cCf|E!9QH7^*n5hl@_sJ154iN8UmU ziff@)rBo|5bl)Jm^^WuVb@}i9-4|2`^R0-hBt-92m9OdDt6DZ@HIK8hCRB`_iz*Cj zV0iy1U~XiLPP_z#6kajRFpHvNbm(@gWQK*w3PD`plO%380AEZYe}IR{E7V8qNX!c$ zgS8JMojL1saK!kx@JHasAUj46Aru2hL%i>T!;n>5i>l55!TShy#JI|Hgb~}pJar|wQBM~q?|DECIhf6 zFaIzHEI+?S<4w-bd3x;dS9eAMl!q&;R+X2DrM~0qjs0WWR{oAMl0cLYlVcLgj3EuK zh-l1&>J<|Z$P5sIl_4HMBYaFF2zWrXM^0H}C$r2k#|geMZY`07{)EhCaRfjqYJZVRP?wnBhQRC0gEWyQVFNbLtgsIV{?8aK7a&L$fUj z;)etoqWhyxK;I-7p+>Ou+Kj*i>3V?%0Cgk|4M6C68^HtAypjb4@L)tX0O!K_$~j(- zG4xhcRMb_}p_8r_JH&1?j$W1dh?5(|a`Z+|IdlPI{}}<9@_YqQ%$)u;$o!eiL*ErbsK1PPP_^8c^dh8JUkLetE#GMs6y_H zt`yFD>~pDW$|%@bQ?qE^VcU1$|WfrTi^-_gx$et$^tHDb{5E2GF%w~=;0z_1At8EW(g;eBURjV}Z zyL@%qS5BlpLAU++{ZdiN;*>MysrO6&oL2bK)yYwHYo4s$S2mc<;r6@1>AZWmIxXkv zt%tw1Gf-AuU0IhuZu+-c(L8mF?)Y+vRoU{EkNRI>V<@Y+Oc)VSO+`{}S&=Tu;7?~6 zEH$Y`ADPsT0`_!KZ(4!IeDnbiUXo_6gFR`4(d|Hqg~ts#U&Jhs(Ue?3m$GzLVuI6( zOBZ1bt-+L*(4wy;I~k9IwOxDOhvx;KOXnMgBWzHUSq6+ZHuFei{ga){MiPuB*@zIR ziM@`GmPCh^;3NU-m@p6%OqFA)=I#s^^_}EZY3&-q@E@oBYfx>aqZyS+)$Vy&no1sI~bZovWjzvlErTDT#_N1!XEb>HP1+g>{9aej<1i&QlEiO;Jm0F75ZkS#iHaHV$;N^jfh zB)={9BLG+KL@|XDq3T}0af9k95S98Jrb+Pl8X)9)#c%VI?C4Ab(iI^Z%Gy!o3Ri>L z$FA_lbVAt2MyDA1IN(NmMPn!WC~6<7fhf8q%0MS=uvy`+THt&lS!H27xfcUMEeYJ}qp7R=n zGCQrTI0t0{h(x2WyKcUtP_Z(qdtwKG$LNx%>YsdRRxllB9!#+n1PJBF+Sejj3XcLc z>uRk)b{0FJ(}|8}Je*;dG9+ZEZsdI*>LN;me+Ty(T5JsjPqy|os0Z?MOPlU1pL~cC z=Uipc`4dk~U2Dp+$@0a(CTYc!+{ym?5vVQ*5ST4L0Fc(6gAdk#BB}vL>?k2j$qi6%UAPH_sTz^{?p$P93=x0=I z%=%2AH0;cBg85l}dRQF`a&rYCw>%dIUOVoHbHwxORfBi7f^7NEyde8tZsvaaGpy>` zt$DOJr&nFaMlYtvEk20Fq$Wz`)EFQIb!k{kP`bhCu;}z4Ekv4LXToX%08XoEB1mui zKv_<924~J8GoJbDDmzP!X48j57rbOli{FI9hw=w`cYyb4KI?Gc)!NA#b%r{7#7$0Z z=Q2Z;VI9$X_>uiccwM2@1G!g-|QJ$?q{BI&Gp}f_(};0^ZpQ1eEB6isGL! zguMj8g6J4Sf>XNy7~(9D!405hpmKpB1=Gd!K{QzS%wxcKH#zhU@DffN1+j8el1ZCy zI|w;cm6d`}Sz8Hz2r$ATOb? zVImEoGEuP@rj96!K%}E6hIObX^%^uft>tkBM&|*v_IU3j2i9Ovw^;xMy2WjD!?X>* zbkx|?hd|qqX-7dtb>H1FiA`j5Zy z&fB=zK}RB=3!e0SrSlQ0rMYM6vW|&s*N@v04sUF#IdJsYSfwTiIb}}K+1;H5SkT=} z7Q~Fg_4PYZib~R8BmyPE;P(ha!l<^Cr4+M7@t?he=Osp8!b(?uPI`laE1A zQB;m0oDGtau|(1Bg+d^ALIlmK!K!R_hz6fz7)}y>)L}~WNn;C=6H+}kJ=J!m@Y+sz z=<85C8*$E;g1^=Q95VKJ=An~(l7kJ3re(JqluU&+NYeNmnK*g+O^GNe0JZ!(+4r9=#y_Vfq9ONnh;!O7#sob+l|ePn8tPM$c$OHeckr4 zEyJr;t{5EX?+x?>dKPzeb`Tj4Bn7Sqm8()hh7JVNq6@WpRZ=pcHdbn1jvBQuM|H@G zrjk_N!YX|6!9Az09DeZotFA{pi^uqyX7RjohYtN6iZju*l&)5BS7_OT%bq3vZtt8T9}fQ*MmkL$^6_b zEZE+V`&95t+=-848Nofl{rXFsD2h;{4qD9P+RnU$C58xCjkBZvfX?=+d)_LTz!IuM zh}Mga_Hba#y3GK|x+LJ!T&R&0VT7V@oCPMh6(%@q2S}Yi04G&X3$N2ubO7@KBR_pK zmxw4i1Ln;(4zSf`V5@=em^KnLBkP+!r-3NY)76D0E&`Q1_xH62>N^`cspHa3`nh&JJR zL?>M;Xw=y$VsD29Y)64Ph%IIPM(_<-co#@Ze*-!KP@_de%z$=AO2&;7n47q9M)b0B>hhc%9A}T-mTH(tYvcYjP4Zw%jRRko}|0&7*$#f_VP5JNrt^Av9`T zzIaD7pC2#3nby;C9l#E6(D z^aQ$cQMrkJ84^rfltnc`v z$%n64^Xrcs+ov0xdU`y+(9!Ti9zUTbVaZ|MN1edoe3mTn1LP%0*V!}%2TJ!0a_38r|cYf5K((tQbMg} zOKMASuF{Irit}=^Sj$nI@fRPce26tPjH&XGKZ;dIfV38pGs)Pe zdvSwMsXZb&SOZSpXyCQ~XxfWV6O!Pp_Mh#a+M5w3Z)V2A1<6SmECJ=5`>h@6mXWhl3mF@4~B7~(u>3~na_nY>Qm>i>>9pT_$#)Fr}C?i%HMUesrFCD z4*c!dKBIU=OIW|%y=l`u6EBR9fBybsM#q;!d3(G9<^`AwC1+89kO!7~F#-J`OkgC| zBTX$SdWD=T-1Qc^>%oc$LcWkt+O0M-7e?G1I9O^U*^CU{N;ab~qcA7Sh0e~mX(b!l znM~f{8Pv@*E1sYpjY&}dpx%Fe{Mdfw=)32R)iz1emAL6s`=Y^J>Xa9?q&S{Z^U*9Q zD}M%)_F>x8Om;(H6cPsx0;di2$Ds8<_y;$itTP~~Wr5&X5Xx|v6xcI*oVl>*6&5Cd zWTP&(rHFB9$$!3{MW@L~|W)x*0Jm^YyrKcn( zctcWYpFt|2%<9wvLw1AkeUvXzRpCqR)xS7$;BQrp=*~&KdoD(n3qIY;X7xh%vcn11 zSbi*onH9x~ndKte4aAJU61h(c^{|$D(Hm4;3|fD^S;w1HgFcwLx2uxaHP(#XpXtnHM)!MGtZ2MR{hr5;I8Rv*Y+2FI`aK_kbmj#w zPW6qiN=)3>sf@)O*Y9!AvN`BRPsm` zD%!v87sFXdFDep*qVgidXY+|)ngNbjcR(C?X9(&S?HkbHrzHmWJw;YjgO3N$o< z;LC>&A3h}hv~#R6xTtDTWi7g_PYaxxi*B6y?0E3`CEE-CzGtw`pR7jA{(w8GgDrM8 z4#}>-_Iy#cdqo?CXVG+10_NLA%|=ajOjd1C3*?awbyZ^)Ct9)73E}A{HHev$vtR+x zRsI|_tEHs(g6stpv<1e>gHAh?gK~$atfmOav{O5Tt5U`9aZDQsB^)xcFluV_9s4d{ z-uCbN#M0f3SIWP$50}ERTHOPae=Yycda+KUeYie3DS}r3E^@m$)BPLHl!*hYt(-*)OZvk9b00dIpPM4bsnVb&i zMvGTn4-d1mqSk}A{j8~;ZCw)Hq~Pw(no zI_kY0^>VCgN$xeWZYM5Fmt-LJ1IZXC}bFC7F<6Ae6Z?3<1J~ z`vX1#LrW%*0TNrs-}A1u_c{9<9m$3J$MBm--b;JGYpu6F@AI|+kB2$OFe8{SF4&!j z3(@aDYS!a&J8bG~vK~scrl>${VRouh!C^$^)>s0gUZ@-4##R7qtEws(tZJ-ktgQ)F z24R`NMSm<@>u+Q4izObFmt2Z6U4}}LuZ3r(AQD0M^f*=c_ z^qPcS;T;V%ASTH2gU1gyQHT1mn`kF;7=5^=6L&jYCf|U0zvPR0Ort zRM}Why>b;rG>yDaD5URZ5lbwC58iq>ggP%w!lyI81K&*{4D<4v)TbuTofuy6ArS0X zr1stX!~cg|s>sZRnhghA79KN2GRKaV=O+8|)2Bb!y8)UUU;bs4yet0Yox)ecPV={O zxJaiV0`N586qrOHcxCTOr(c%?NJ@b?#ykv@AhOXHqYH5M)BNTpJWt_XRE}U);G(45 z#603OQM;POIiGH$ps7jFZ>rt#$3`Wygu6Dl0Rm>oy*0U3l#3mrVDSg^9>?#{Y=x@tp718%#n+Un~I(3n}@UXNL*guJV)C@3o^D-PoCRhb@px3o5vnI z|H0n1=$C zLHPhPOfD$Vmm>Oo{!QuLG1b^1;`BU3{RF6;pWwfRvA?_8g!!ajMhzEz{<+PLdwroHdi(`)E8D1Rul&_3o?=C zp=JlVfXHc?F5tZPZ+1rO6=byj@}MVWg?`>hJ)dj%UQ<(6d@k$4p|O!!rv3vxtKEIW zX$k2p?G&U?i3v=8DE7L;02!464dpI|Va-b9M5iqLQ)X>%%d)m#OhgVCFlQEe0ae$L#hZS`8 z(^$c3LASy*>g{DL?%ulJecV00ZRMg1k4j>v?!9P_yt9r>?c$k^x^FbK zPMoRE>@&yTqsR65+kWw+JFBr{wrP2|XJHeCiZ*q(r}>LhL-i&O>D06w#@8*%&3O?6Pi43;0sqfO`YA>LA<*OGZn? z5^Mmrsd;$Vw3<@^hV@pLL#sV|FBGNmVt>n0*w@;|#>z@fYeZBU?j??qmS&#j(<(GH zAr%!C+nG_I+Bu;Wle0@QYgVZGSacs6czu*WF8P5Hsc>!%78Ygd28xi zt$=?f>>^K^^GGn1DTfg~CdGPeMcKhUhx$#M_q}%D z_B%EXbVPopTTtu1Ew8%8Ft-ek_TJT*wX$hgEXZSw(9dd_xVjYhG@}aEC;TMrsTRGi z`T%f++02sijUGf4&34!Ym&ygw1ksDCxL2awffYB0MUk)+o>X^=(+0#q6ov@99Akq< z@e=Ex82}t%f6GGS;rdXB!Xe=KV68(PArLiJHCHv)>7fxm2^)ib;kwE z$s)I?lGB2LrA}r>W502ke*-g0PFwf&aWyQ!`L(S-7s>GoyZw>}IjDVRz51U1+ z;5Md5&m8Lwp-~}p?n+gD?w~3)3n%c@4izpZQ>dh-Jx+W+xkX>~hdzRKF# zYPVCovRr(z?4I(MEs?j^91H%=rX23xCNGb+tbXABnm?B>Jp0<&$p?4T6p!62I_)L- zC9Z>!gFO{FkCux4OR}HN6ifX_Hrf_%-M;F-SX$#fN(7tJ1Qj_ToD1JyEIMrEC6d?P zUM2awZ53JQMxsbV9Yx4#_YzCCL-6_>UNADEjYo0=8$x&iH2<*-HoK^*ps30QP+lfZ zV(IKe8`wZ6C>@9Z5r4Ibm`D+06+(_aKgFZbFg>KxIh3UaLrrP0CS*d&Gz~sA*is-> zc6nPdfttYy0$iFZ?mJJHD3Qst?{}xH|5Vw%_o|I6%G=wvHD%wua`K_`ch@x)tP8%F zp&eY;KBInX>CXIramyQ@0JriwcD;Y#sLdH2ue|H6yrRmn+`^%yCtkkKx!dY~tg>BO zHoEFyWP3;0_o=KJvEhZ({4SmxQno>gH14%pSQlO!1P{8ssUKAg0^~{dxf#1Ty?`8~KYe$|^z@fN?SzBq+3Pdcxw1 z?Zdx#_=ATRA1fF+bMMtd$rKvTR52=$P0al$y)b(e#TT9V@5Uab#3_oYb3G-% zTNFXiLNAPrsQHDdAuXl4it5}LW{e?Tuv@_b#^}#5Xy%FQ`k9X+XX1BSe#qbqTzRN> z;njyfc<9o?v4``n{z$1g8CkIQSP3&(?plEPxQE`{OwWUD3fbTjAjaW*ziB9Q$ZHSfhnI3 z<{*QW4M$y{@}yI;c@rtwD7fk7YaoMsON%fnGrYs~pHHMRL-S6I5{)7qL0AyRmv?ux zg)kX|+5!uGIS5P1r-;D}NfE`XA!MAv&u?_7&Ou=&>Ym1d-RHvRr~5~)e&F4Qn@h_! zm%Sk?)-B+fiKIwt^Gas%%*+(7q0M8;>61%(R-gU(dDl*N_ET2x<`SJ_#%>-1$S7vk zU_U>fq1OO@iTzxNJju9J%@ek{Lm84wTT+;lskkkDxsu1d*dh5n9+0v6qc^yK{i94V zV8K6>-GPLEry=GICjBR3ipK#IE>=_g7IvxWYW4!Rgnpb|UQr96C0qmI%q6%{Ucedg z%O3Er`Y~IOQJu_15<}ONdQ52-4O9qK4^yxz?$8D4p7t6i5VCR}{m+EpuwFc#^p-Y(3!q&YBPiK)P0 zFJd$?v&dqjUUba(UjNhs8%88C`pJ(qdB}H|IAV_UFFbz;ccHE5dUwI#h?(hNH$quy zY6f}lC@5lj*Whxvcg%A+?&C9>*zG7Z2x3^qOQDvxTr|B=_x;DhzM^zVvcbuQ6$dQR zPMHBha5o}Au>nv6e+Suk&=*7H*=5IC!I%;_yE!Hswq^E1Fm6DiAdAh2Qf5Cj9!9E+ z^7iFrg$(sYzCZ~SQ6l|JOdXLYkR-HW-V>%Wp=0Zl=&G66+f7#D@aU1k?%iVjl|RBI zxV!Xq#5ikDAjT1&=E-{=>u`M3(5kb)I@8lu53Z0E3zlU)m66@I6rs*G&PKyJ29>Q4 zUz#q!M&Y*b>VQ|WDh>4%r{rW??N*=@C5REW5OVkQD!JXz1eMhd+2_bm$LlSNF^B zUwK!>Z!M9DIP>__n&V|}a7BA@WPBY=C3j0bW;r3GWwWQqsp%H1D)BhrC;*1*hBKm}3d`9XJhBgZ1_Xp6 z7$Bn@3JGKmr2Tqm5tTUQZ*>(4qI&0B1?Q5OCG-)g$zKMVbDsA|vckOd5R4xJ>5h(A zWQBPtl;$YHkx#-8VVGa;`8JcsA4d-n?;j!6!AT;NKTMrHx8u8ABk#aRT5`Ogb4Pto zkXRyqE5&vI{=w*?=;XRcyY(9(s zzpuQ7LqS0N9${Fl2&Z+oX3Das(FOz3C3^jszN>ht_)eCwU!Zaod??}tM6BQektY$c z`Oth%U9D&$QvC=}y@(n>pocC+YETPcY$9t>WA$Ws-Mo_=OKHSU{l^Tyy6ePDZik+9|e*KU?q=0 z4;~&lRM?pAm&KV$@xS9zTOIg!1W==%{Zm_j`}^pH#VfZN z^@k1Ti~9cnHSxZ|j%}xFGZ$Q~R+nAz(&JU_Yb|Mlpbvp70<< zHr0)K!+l&{PuajTtVEN8C`?O`6V-Togc0FF_-v@Mv`CR%{oO4fo$ta(5l^P5VKBUC zLE;6@r;GuEg62liMxqg}F4^irEJ?I=3Z`;HRZA8s1i8_`>b7h{uMQ5Aa~zdAr*W9r z@Y|7IaB6mTG&kXIqlu#eoiJR8I8{*w9+*~E_D&DBFtyp5ssT|LyM=nmX8xmQk#N-B zx#V=W?a}Kw8_yLD{}%Eb-dE7E?f%-T6C3NBbKbco{D&LAbdzX(_eCgTaql4-p zOK&d;wY|A}aw_cVTc{sIL-CpqBKPISAmDVCk*O1AbWW2LAN-NxU~Z0LW4?%u5g3qF z4VZp~sUqNg~nT?#J-(L6|V;KkU;i@|N4?ZxQ1kSdI91icQP5$ra_ zKK~=(degsl;9m>CP{O~Q`>#N|W^ks$qC#{%qzmbOzpg5>4Vby%FHyOTT=E1p5p&Iz zF~CEA*gy0jl*FO)BMbhse)7sk_8?;(YAH5SSED8n++3+2f0Em^q zK!QRwu-MfA5|r1uxOGBBR4t41M&-X^`cCAo)wLz3e=xQ?WBAn%J#y%_(>b>Fs|!Q5 zS*bJYr4JPq@3=ei#?x!>E=A7fyQY!@>R;_`uk~~^q3p0^IIn4Kll7qW@Sg8m?XW|i zHL^FXys7*MXP+z(8s5cX9<-#DiB?A)I1}zDj>?x!r5W`!ky$7dd(U;AvyU@ zIIPgi$d_1=G`FHE1H}xby$wiIDv9Z-cBC*(&GHm2VLS9@d8qcAT>@;!RwzBV%%(-$ z^d1B=1JUI5UjtX8Al52hQw@+EFQB1N#Iickw2m)UK#SW}-Z>p_RCS#1k4#0gsnMP3 zL;v~VM-GkOpS_}CrY=6sD)%KoetX&*v6IUeDx;e#;*IJG4*eAt1O2@NK4cBh2R*{C z`PIPq0TDC|yU^u}9%nGkpaIH_*-DIh1a$KlMhk99MmW3P4w43_f1?gf-eDVm9MlCj z`#kxm^p|hsQJsmMzs9%_dkf02VeTb>dZ46b1btLx4q$j7rT)DP@dzv@4GWBc(U==Z zd2WMktCV?uEYOvs?w%gvN_BFJ0ZFs%-|_s>llvH@mh|Ft-)~zY*3W$HpE-xtw%IZ6 z{>{N$umVl~<3`4y^{ZcXWS@_Gg*kT$k8@?(6y++5_L_tqu{3ONBn@3e^k4Lf@6Mb(8Jtp}IofEeIW zl&42jaj)ELvV)s^0sSX@)&qW`E65OT1)ETXF}DYB7tuFOgTa990XRABB~Mh@EZ zB)1WhNLc4B(%v`qG(aG;A0!nZc-+XN(pVYu-`20A@h0)R7cS`N=osiAkXvgra)1?R zF)S>gD@oeXbR}7%8k?)5x7g3Rk@IZgfbc$Gt+&%pY z+e*n1-Yl>B$Xb?t`ulaA|NeK=p+yM9u$|4#9UU#d`c!9cTmKVYtuv=b( z5pJ><^Nb4~54xa8!4mOzFAA&}!$KPhaCs1XeXJ{rDcJeJT60`bs<m{(_`5gsq^?ByOC(&voUYEcR<1n}lNA-@k^W?ydhz-*%BeT&^6@6G z!l(+3QRhh|()*D9{N8=i9Xp=C`{X`i%R3{#`273xH??CH+xl8B0QV}AL~^h0vL4I($sg{M5O!S2_ffi z@FMbV1)lAyt3$>=RM$+9keccW>i=d`V)U8h9h$n*lKO_GQ(#c;>!(3o74-;@7@w&h z2Jwz)pThqCY+Yooc)%OXGrm?o6`Y#xvGb2*@o!dM#W$w|B27Gr8^Y^A`3O2IoO-}{ z!DGl85){mqrs_7R)3#BkzlJVxqb-4dcu7fNA^72{OR6i%3X2Po_XhiWCI#{MbY6Il z2JsY_BtQ9q)TU@Rg7PYLBdnSXd@A8{?|IbJjWDq^;q$~}k3AOcL;wN&|Hap3B3hz7 zeS|3BZBA??l9(L-QEU3pxjxY8G_kee8_Oq_mSv|GaB0zjG7lZPp_SeoVP0Djd~8OjgV* z#|1KY^xc@Pz$<4MWlkpw94@ihZrnR*p8c4B)+`Vl67XCk9i8Oaa46Yh@K7<#0fEI_ z&ynXL2ng)Z%|?STgM~TS1nSqdlsCFh*qub>WW?5n7Kef&eovoJ_aBQWqLMANe+~-+_e;Y4_)_ zi#Y&qHG`S15A$iyaJdJD7qnL^iaXqakJpQrdO|PpSD><|WQzVkhv-$pqTP#UKn@n& z$2LgTtvKD-M?)o|3SgJkdcnJ-YsP@j#hZ5htdonY2>p+?&wk!3qFo$I!1bpEP&}M# z0RkuV#4q55P6p+Yj1vLOGbU|aZxz%HH zbl60Pt}q(mt#%ZEH@>}4awynI;Gm%tX8jm*pr8}%*vb%YB8H$L{IDr58`YA*;ReQB zgq{vM2|yOOIX{Bg$l@T8Lcxq%Dm32YvoyCg>0^S!L-+^d1Sa{r*!Fxupv|Vl4|y=W zpvANUQ{x6ts3jOe`{AtJ*7K;QO^??QKc71Fk+XO0J{Q|rCBSvWdafg$<~rhMZ^v}R zTnM+i4Z6TG{?_o?}vsBl500vbyhA8Nr* z^?CShPH`j*q@$>#g+HuK-{jNC#j(G7y$AJ(!}JoSscqPj%9TSU5D;-`CqsF>fs8l%GeZ zjaZSr*~x}4B&r1c(D9^GG`7LXGbM^!12~bE)F9gDksmf010`Mh39$B8-sRYY6X}SZ z$Y1A`Kfi^KU3h+`TR)g;Q3VT{Mb}&PUTZ-+5z1SL$U2&(x_p8%RJWBC8Xkx3S4}+W zm}w9;9(zm+Q7GM68~HjK&U~FXv*y$lm2SSE?#AgYN2f#>UdW}fXUJ${?vfimB&r?8 zq)hxI)%XehIu(S?^lM|@LMH$t76H9$q^^;)l`Sb4k1W%GE^uWKnK-7@rw1@|gyQiu z3|)wu14e(ei!Y(WNN#=&o*iSaF>8%fg0!T%l~k6gocCpLF8xR!_=y#mzD0BpwJU5J z++CzvQz^TEramo|`KB5^&iF1p>1p~(DfW@%hM@UP5EhLM^fiVX(T_mWY1kw(ol2Rq zpiKV}FoiYvvhEH`P|$%XvusonEyx0Gm@bA+iaU$y?vv-9J145)%kV@T`|v*}_SZ$; zEB&5ODOca%2k%OGBcBKIR(-%$*i^f$hy|!0{+(DcHpmZLKF^FkrsGl;!o#g@7w>+| z2D}Q*Gl+bnNwWCcaMpD7_yP`CEr17X+J{&WwpWYR0MsMKtaA0(D+EB+8Q2ByAYE~# z1MDhUQ$5gNlVaJ<$FBofED zCbfXZ4`VqwbW=Rdb8>f)MLcA0IrYBjS-c2{7&x2 z_)JkrVnq%uZ(nFB)tN{+nf5+&IPeS`#5)UxnOQ$N9)%#};YcMBC z#UvcW$OxkV^9W?jCx`3^Z|y}1#?u`u!Jt;+)O64nre452P$Rp>GKE$|#;oY##6S$o zCLLTr-SEJDbr2gmjkZ9VxFTB9V59PGxTaw)V1UsS3YzK~>LZEhuM3abqS*%Z*(?9Z z&YSd|nSc0v`+7oy@$T~ky76qVSELG$q)(w7G~(cawN!+9U@$y z1E4Mkfx3*-hkj4}9AU6bVur_P0A6={zISuv}a53;2x3B{4XK{05A8Kx09gPFc{TS@SG8#l*TIefAuk>`N#Vv*Kl|B z`N&6EX6(m+)}%IW>1*z4d>-2J#cMNa8V)Q`fP|14`^K zD59K>$`#!%!~ow6v@CCfSJNiXM($oz1w!|Y|1q^1H{gxB$O-W@H^CQ*N(!8+8hJe!C@WpJ}zmR!z2`iNZgr7tz?EMPUHCzUBkkzhRC zgo>SmjoXVm?iFZw7-~rK&~d{bv)dixG&Iw`2r(3tq7J8l2UAu;^FJVy;sRdlg*heI zYjRHRxEMZ3f#~~l&~oQ_&loyFIrqrSeOyXsN*-#DoKHr}omOOoMbWa+#E{;Z=7nfz z%505qjgYLco)|eujT1mo z>pg}LU@RAoOj+C$4zjnP5*>mQ_)PisxM}FDLTb@Gy#=ucV{|7AVuGQ8%)KPLBpoz+ zlxp@m;OEOGh*D8$X<1WRI#<0Ru+&5w^t0rDK@$0YE_t-RU1Q=Q+r8tZIjR&{E!7ch z`H?kDH++88*}F=%jP8m|xLE4P0uR+WYPV}fEU^6UHcOhC3cKxG$#B*GK4W&f( znMMOW1R!nrG+Nj5x85h+FEW)e>#o~3wnx0O|B-}SzH;lK?{!Kg zn@2a=9K%aNz0WxJ1?^sZYa4PIcZUx*6S=Rg2DNdpPGX>xTT1}~m_|yM0>o}Xhdhk0 z<_5amjoAarv_k~_4l3*t;oLDVR0HQboB~Bg>cS}!v4G%m0o{n1Kk_2vF!@wML~_-Y zu(-wkK$hPdo1%;@EQ^g%W=OQs(qNGp;*MxeN47I`baVi)c5h^$?i>4`I4TY=>zHgm z)%dNu6t$sZUzDck@b=TSRmYb%cD>Sg<#Fx9SAW!VXK(n6*nL4hn>Q(utIoW_}zWo^);YO zuYg~?2s3OnP@361MF1Y4F~FjEG#XC>MnH_zoCe(AE5f-ZP^cZyJ`2b@10u5Wk_hKI zJtfWW!mW3YBM0P;a^fvq*wrNn3s)>$v2;n-aMy6Shv1ob1JvPx9jYuZEi3?b2-L7~ zc@Wkkz)3i{H0KqjKSQ_5cI!4GIV6sGm zcyK|e+FP2xz;rj|Yrh6B)H2Av7FeSpv5KSoGulM26?_YUkqgF9A5jvA#F){8AbxbH> z*h|bHpXNfhQ+6JNlNO*?91?;N=eWz%UIXjWh+f@#0GLW3oInb(#k&pRu+#^9gj%Uc zgCig7t0ARBJ&cWc5{(NX-$8w0^6bZ!Y*}5Lmszr=UX)JgY-oqKFIb;ieR$=vob=i> zMZ1bIq;N!~>6fPu)&w_|cP_7veRo^)ouiY*zCdpEj}PKQQQ}q!s?sKWdF+{VI8pXu zcuu*Xqhmf6{=>ol14oyBjZ%t46ig5SL;-t*{u7u~Nm8jJ3ql|W4_CqfHo2>a)kBdAc@b{K$&bQY~0f;`Sm?vA;9JeftM$kDlrZooy+~ z?(L4rbh4={nBR7$J}oP|tl{KQGI9TPZJkOW88UI-z9GqWCkiN;WMSq!ZqFtzV06Bi z1dJ;kzcX_Rc+N!_PJ>O;N+xR)+75T~retk!NvZ$$rerRE$V@7AL!zI_;N((tvQ?G1 z_3MSthTY|&V8t~Sq|sba2GWmTDUK zgSneTDes@kCoSA%N*&*BKJtLx%SVE0@0yK^xnW;u64DpFXZKeku zAjm|kx`RLo$rnH%8+{(JTI_Gm@hD<9B#m@ZGa`#(DZ{uaqLiR&TQ~YOka4!bl~Yt39DXOFGf=Q|KaNP) z1>^)&S%eRa^Q}mmJWvbnaRH8;3y{)&q^@L@0tZT5+Ym6!xeP`NCSL{mx07X9Lxj<& zDlI8YDGC+>hipvu!gMDz-VnMD(Gkdr$jX=D{}BEqnl#>N%W^IVE0jJ^Yc+*lJ@SJK z${FjPiI$cZ(!FiLYOCLBP<`@q+))`i+J~i|Gqeo?5nL&*sfTrCIk@6=Zhw znN;y)R_9`zWf5G!Gioj*+a=n<{$@zF9+J(5WGjdw3eu&6+>VQj>YPWnjyc5kAk`1aP>1vkv)u0cei-982ybf*C zEiDA6EUU}3S76ETl@|NK4idLjENz$?EG5=MHme57;JJeyhV92*-LY}Qom-M28xGyqsa*z?fk1dWSc|U5&GYtpbM6pd2OIV`Ed(E? z8|5GrgBT>fsuGpkLN@t_sA^eE!gB2)O(VoKlvGk7@`hcWTIY3K{)c=Js$7iwAbu5Rvll_l)qsxtF*sZIxaeAWcf%z-sX-di83{kioA_`n1ENFlX$~LIAAV#?iNY#9 zEyWE|I^@NGJ&iSJ>Oj*K#*zVt>Ih)8;G9e2#NXh`;Id-x2_yIaZdF{U>P3qdty#2Y z<%+S=p?*|UK1~BB}q5@p8AaTNab((fY(h1Xby`#YjV^noXI2wAMlZHG} z=97kwC=W_sr&(AJj|@I~&qH=kI2OF}?9gouRV&w&_LoSAD5RuycX7m z5}}_GtB^vBtvmFG@&{a#!OjbZn#WT-aYB3bqna z#hp{EdC0OEbTfTG>}tfWNC{IIGUSMnLWgzJ$rjRjxpgEuuB-t$`rn zQ3yq-M#@(5+K2*Twiu}hfo4uwR*185wgkW&B5#coBX==dGkvp+Yw_GCHaob zdLP`U47xp}Rw?&~Eh$gFC9D&aEYw`eHMT7$^lf?Y!kU`(Q=)xjGCp^Dba~C#hx4wy zp{7PR=FCfzZPw{se%pe$%?Yib&5^FX2H9p~bEq=~ne<@3B%`XVIMPL=NkN$60EilK ziw3Vx6EWNszmy$>I@9g5+i8=DwZLT}2rer#8cnb)8cl-Cp0Lt~DaDo4n6L~EvRNTM z>k!=9*=!uhR3OlSZ)IcTEy^KxcdNcG=N^?5>SrYSaS)*5$tzBbjANJ?#CA65yOY-!r4QuC>DFj zK!dG?Ck2DAp?3>ecbE~34o3UB6H+r0?`*IL>;;cs64pSW0;}lpi<=zn`4&MZx&@<& zX@>3f*Fgp(`Mcok=7mC`t`GIURU~4m>EXMYJ;$4$gsL zI59#l0i)FG>+qKVrYSF_uo$f`RS9!*0`OJ?avZ(T6F>Xz5?tVfS`<`^7n{-RRsJ#q9)1z`ZZ+K>xE zLu&ozgq{>*kRmG~5}v%9Dg0{orG4;Kr*V|=U9GOTAE;G5ACYz-dWcZ%)G~b zbw=I`R=x9)w`W26Q~hhr&dubyl3{~WuRDtH*Du6R*@Xy!p5ajVK*D~LG60n#cGyku zW<4IE9rk-AyG!3<&|v^Vz0E_Ci)Y1RxRUl3U?>Pz#&1KM$YQt>14(ingBQh^Fa+aI zIf7A|C8oo7RCVsGyXuzz$iNc`NJdxMx;XKSmqam*G!vHJf;Y54ynteo^QK7(?g=lTLsU1gc_NG9$=3v70KIpc%>qfH_$@jfV2X>4iB1 zDx-uE^NiI)D41g=kGFGoywN|ouCc@Iyn0c7n@Z;&<`{sdSD!x|(iy*4{bp)`yR@)B z?Vt__*s|=8tel~0`S|#-fIj1{4h()mQXKv*=DAm8T4ixq&-b8ogEnh%A84ZNC|}5| zPtFBR$P;J6A`Ct0ZpSdJhPuj%LSGpL3K-?3?4xLRS~#mD7XA-#`w7!ZP7x_*ideOCvUYG!J=2oC9A~Cfpx| z03fmtjGja+<0H1wX}1f!k;s$4O$Cx30lOsnq-`mF53IX)JRo|#hW;BG0%zm0p=FB~ z;g1Xs^!FgR;^HbThP;YV7dB}XQz5vF5=}tz5_jCZT83A@^va-)C83DQ@*A8Rl!RR! zI5*Z5YfTYG@m_dTwvQ&r@W|@Mwyoq?on(A+8QNsrd3x9J$}cVG%q(Cea=>S1r7ek* zW@l$x^V9-YKM3VaXAGqsc$maxNYfrMg{?FQJDiWMZU7cYxGs2_RDu7S3~(c84DkmD zwZ*;7lW}y=h&v*B47xkX-IsRJY(4EmuCSY)(LLTEce(!li(n3k==g}NXyiP7);ECHMNI~}?e z7Hr5G*Q0Puf=NS zw62jYzwTm4$Lj9`lT0g-w**%zG3|c6g zF`~wcU=xd)ngFYAYa;jyujR8gRZ2=Qh-nn+U?PgsedO7@N8YgxcOV{Hi~3CyRooAz zrR4|W%wfv-g8OSns;~AcuP5-t9oV*Uy?K9{I_}WMCO{eY4Mr138J{PWZ)1CUh3|y} zEf~kqC|U?tCX1D**HOxc(%l2NOm=j2Obd4E(%vhm99f1FZ^4OoV(belOb!s!BJ4AR z%;N4Ju|C6$S`liXRw&s~PQBi07||I+teF=Z59hG^0$@o9z845Tg1%B6yvAZRG9Yvf zl44hrTp3+28uvx1n*+UC;!3NVOi+@O%_a56+OPH~zf6R-t=M+x-#c>3f~GxyuFUGA zk_I(92nyYe97X}MGQ2De>c<7GC;>*IkFg?_cpHkQpb16#2V9}sW>dWj0x{n(kZF#P zLp<+9d6LNU4t)`$VTDo%89Kp$&?q=%MDYGn*Wj<;{hs{`?=0xqEY@H3i{2x{!$*e2 zQ?p6$28K`l;@&L)DD!m7fm@-no}WD+e!S|XD&&j)i5AP3?Y!Zo*z9z>S+%EG}14!r;U z2OjEgaXDr#>9Un-regs)Gl{fQ8>*ItT-JbOC}FqQd1$_8pJib!?#ypuC3FC zny|CA7G^ISmyr;Ba52zQjyWpG>I-PZ!&nvS3Sr;u0{+is(L;NJgR`-}+Ij)Avb9CT z#6f&YsEqi1+_UA-gE@JUjl;!F532`Ka1XPEdPsAtnwsd+etB%*hd5>D2HV#$g5x?L}@6)eNg*!zF@)kJMB$u3Z6XJL11hPb1tiQzeNL1L*odF|*8tvA?FSyh`{` zFZT`o{_^GD5BI;^a`h==b1%jDPRp0$E0!&TyQJTl4zttrr2IvEM>TpZv9Cd3Qfg3U z!Gtqe%tBrUks0z=2wIU$K+?;y7YH82B%+nWd*M+L%+-RaEXiQLgmR$nC&ri&)U{UOrSl$ohFYThSXzDAKpiok z7NBD0&C%piW8x{@5lo1t=!b(ELxs_!MIAmmPjD!d&iH{@xsg4ss(*?M*8MY}#X~?A zw*mQj_|SJ6BOj4JF_Xq%t`XmDb!Df2wCnDviB*L)<7nhj_P>00Vzf2Px+?!uqiGKHlul# z8vjnPSfc-I&L^n#yWI2yGe?<}PBl6(%zpuvTz?5Hp6s7;EZrFAFs813M|wtD9Tjt} zL=dDG`6-5KZnc!PmZW1Dq#bA%LnWHU5`v1u?TeCZ$)T zWDeGrjW=b8_Kr~Dn(mdmcYSUkwfN1tx<$3AS@pW|JB^!`itSn=_Jtj_(0!kY(sTS;kIj8i&o1 z7IaPkw4H*g?AS9o*nm}hWmI%$FYR+^dv9&+u>Qg~zARdCKoKs^diB@~V@GkB)6!;N z=d`-CIvPG)?8_?Q-IK`4F&tAFZ8l9?3k7*`rU}P@Ff)2kO`Vc0t*!Bw*#z~_b?@nK z9{tC^`}#z~&gRkqIXrW*yw~k-=$>A6rEF=5yx-EdP`vuFq&N93X?kVZlb0V~-!ME~ zr=@OKnR4)8`qJJz>%pP(Vspo$t*1|T7DxU`zs3I&)4)GPF@}sHnzeq9_U#a%vB~-k zqX8OFeb9B-i0B^&K;#DiY_#wSz|tgv;R&ots;aGrSI7s17*``E%0UqO`MZ9ZLqcO?L zzhAs&`^s~R?tR}ok6u0$`Gs`<&#vwvgZ5TKqM%Jc*55r~1#Z<23-(i2yi9dzzOG9X zj7-#2+$p$__XHfq=CN2nl#WD`hpLzkq$6w~hIInRF3Ic3H2KG@Ud;a!ChRJ_iWElc zOB>QS_QRAdILUQJrYF!8g|uEHNG&-OD$|rb%er(nn(75H553& zw?KtSJ90K)6tr=wdfoaMc1LeQnBy6MehoupHQO#7W7a(9AH##Xkzvo7TLK|wN)jcb8xh?GSgD<5kRm~l`_p}HPs125WB=RZ?nQ$ z+#!#t7!Gz-RgAs`a|mmQe^d1EhIs$`u11m{bqd;JPF>- z1fPq7>;Deh(?u}5qB+a3?NCB+uAqbz2Vg0Cnex$~d~ARx%Myl}J3*tvXyM)5@3LB@ z3A-`Eq@OPhR)I@(sJo*1bch;WgB7G9urG>4&>@TC6)7^nVi3{=7o>P!`7m<(j2b5 z3aU|dz`qJPm!Tu?G|v=y)4eG9LTc_@4Iv_Vy7519L_OREf)~k3x(Dcn1RB6fU6Fe+ zD#?c$h6KwBjtM6?COnAEWd%bS6b1bZ01b(*2{f0c09ntIUVVHaL@$5KN|fgUaUZ=B zU&)Rubt^9gGoO4FO%xq=5yx%*PeiWB_&{>0ff6J>HmdExpaV7odPdm%{5-f@AiqM^ zP7%t)GQXBmB^ot7$|oS-s@wfpDW&4;I0F5wn8yH7nF}JB@;0QFh)I6i0q=3=)hFlh z2`=hIyg%L3)=UYcgEV}LQ_0itt^Z8sBFHRiT7#%552vV6%;!6rQj(Vwa5*)L*x-Y9 zM9c(K9|$)Se@tLMBs9q>C_{6$f>HChlqjiM_d?hRo7Cv_HHA&QdnW#$!(Wg7>p35! zcq^3fcjkQ1Z~%3)*EIV%)_D*Yd|9n=Pto=}0~zTV>2UA7HmZECZ0KxRI??&~?(L)f2%lD#-%sIFYiQ`%g8tT;wT&p)!~rDvYq{Q={(6H|y#b*QB;KMP7B5kChL%*wJFh?*1m+{XC@B`-RuIbJyxe z#40Q5E;m{=(G-ta!m=}f9(vib%?Bu)qOAvVP169A!Ny1vXp1&{3fjXq{c#!W5jXdI zxIO++r0}P2@NYxL0O$1gg?l?0Vx5qcM0i_-x!?G@T)#gB4qZ_Sqm(dv&a?EbNWMsu zGXLe0{xhla{j0Qe^4y=^`Rg2ai;tIz<Vx7Q^T;{pHDI7mG8Z?n9=NxNNCmeN%X% zsS>TylGq^HrA)izu%{qoMaC1}7HS|cZ{+r=3Xufs1RO4#2LHn{j_@BLElU;!gVcat zR}-uXR+ad`9!g0!mby-wbc5Yu8BRSKR5^3BN^)!s;l}gEb9G;Q>gM+0T^TKF51g7( zFJ8GrRI|5)Z*QFWu9C{$d` zQH}Mr#nr{t5K0NlM6$eZGNJG(Ev&T6W8?&>C@gquE=`ciM=y^yoTv|tCl|}-dU_$4 z*<$&~Kd)%<-4U84n3X+KJrE5`?Pn|H5KNX(2p#+=&s=%SN(yB`Eug$FrdBaK9`_@z zd3inwhyYa}43h*ReF;$mi-pIb8gXh+iq<blzU_9(* ztpPY?h-~c)`4fw5K$V}<`+01*7Rd-r{EB;p` zLv#&(AQr`LT2;XW^qouPg-`4ezp?|nO(hTQIOI}-B2bgiMh1P4G83sthdwzC!KzXEY%lnUC+PJEm zwkGnzC4Zpgake*ui$guOhMv!h*>rlZeT1FfLUR;R3juuC{VXf=`J=D#`%JiNfmu z0lpWZk_8z9%Hnju`-fPFg;bCLPyn=9wbPdab7V(;Y`bAWFjU4685xjNRD#By$;1ks zv;y*AC^_8x5~in-GAE|=8-5FohA?GSR}!%(fQ8M~&1_H7`~hEy(b=LWsgXXj=!K(J zYzl!%kkT~vBvi(C4+lP^fu9KOw!C8TrJ!f|g7=*4Ia>AELo3?yTYmt>GxU?0^T#UM z?Z1`;Yg2DW?XKX0h&$5p74e&G8Ns&p<9jQc4Gkcv(BNZ#u8lD1OT_jWr_l12$ndxwlg+dgg9l)GZ?@KDATaJ>uh5|J3rBJm% zHz1J!ORkKgf&iUtwZ?k7OA`MnlroCjo6Jw3hdZ2-no5yJUQTLOY8DKCsn@P$QhdtB zy_i)4Ao)0Us;v5{5zKdDMe32e#Tq289S=>5F}9`P>)Fqz~)mNNRwJy5(MVH2I{#d1MTs+ zz>KRu{^xG}=X&hW2IXo8ix18sda+19!x7RPz(@g-j}-`x>+#t*#cBdyKg9&Sb3P9g zfkRrG@GRl{dDpR_-ub4HnMnQ`2!#Qop8XPu>i}SWy(MrlReV(P@1cMrNN9|~fxa++ zKge)amKT;5mO{`NI#+^{HrWVc7(mQM%sK<<@kc;UyMfp*&P+TsrJIS7p&hxwN25pM zt?0QZ)P5uGV&`Jn4_^7mLkqZ}0PZDbC{h>I-1T7Ww5(2B_MJ=qw4%o&KU=yK=jES< z7Ddekd4W$T?Kn7@$jH&r*%)45ng_@fC>AUjDJNUpAXEVoXfy|RU<6me0+NtAQL2{6lRg1_xSeTWcmG27_2hzb?hB@GLJocin{_Q#<(gx4shU$18m-MvG6ia)Hw5U)9~3S&l8g$ZzGQWj0pX*!?FLgbMkUZ zkrbd74Qoi*Nt+YR*o>&oJQiJFtAqgp*5Y6DROTH27_nEZO3kQelK(>-%{Q!TUW1g zaaMljGwe7?({J8+eBB6FI$wB(iSfa|{AHic%zX(m%!Q>SH=|u_=2A>4FOX!RsSI$t zG|>gEqPkeO7f}_@`kh9gGS8+slc^Twl4dw7`QKUE@{*X#XlY)eI5 zT}4G6h6~lT*TJS%)K&ljQxeQ8%qxVva)HWV*~~ypYrs};dP3H-kz}_}BY{yZjI}9f zmjE|6@|bV${#{G=Pwt<3>-WFs?)<*bNKzcCT+d))JC}4nc!VOtC!XZ4{a^O&`%4Vw z#V!Z4s2-dqvZ)XAf`}_C(=X%ZbB@OBF#B(-@!!}hs+ts_XTyNb*}$NLo1l(^AXtrV z3_IL}$BZH1lKw+<#${)F!7!R#lwFjM^shJI4Inb`prS{|8)lZV+XI?B`)KP0rI6Bw zrp6z1_PhxX`;UL*k~tddV;mdj2m8~X;gT><5^KiM_M?22i)i3m{NvoYIjN9BeT4%y%K{A%uWHG*CG5@Fd74o0bhQvn@C(>CClRLt|g3t@V zmd)|+aPIObe=Z1lC3z)91z8!Gp_xWS3O05uCNeg5Y(A+q^J!yin!8DGufNU(cb6eJ zK4+}sHZHs;KbasrZ21ldFCSTjN}!VO2=A;cLbh70z<{4LG`At6jmQs}GQEEojhCpf z#qJmG8}XdDofv0=^J5){Ylh>)nm4Pe3JR(ks}QD@l@tUEfW+j4$roC>&rvero-21n56m2Gkv%)&PtOyB3zznNoNGqq6-Xcz z7+cD$)C;$Vw+FGuMH%2X1$mQA9`(8;%$fxC2krqT(a9LK2L;1sAUQo&6~%82y^ngb z0EeKahNwT7`QBEq(UytJIO928gq8w>0o!Na}{T)I6(ci9kjBWc*7z;CXc=54h)A;U8 zct%uO?SKoK!4+`|X1NQ!r8#It2jwH#1YowH_v3yH+DG~^t`X_(CO1%bqHKpzr4$^g zZ4ZXP!}A0iZoupE+mN0{9u6~bW6ZhyTD6%T^*AMr7dG_%^_~y6n;tbD;w=F*8d1Ru z%=Nc%{VF>-@15$yc@y(&a9NUF1 zy;*el+O$E3zhh`Jt$B=XVQCMxP~>;^8m}WBpSjpst%nWdqt3`2o0zh_9>yW4J-dkG2mnEe#iN*)frUSp;I>GAu$N z@Bs$YIXByv>B~$B;177&97%Uf&zpT1wMWL?KFXM4o^=dR zvPw6;Q;qgbDIs8f_Y6*DcdTI>Zpqu(JJmAtKDOnOc_{9CMn-#dFZhe0?vZz~EBhS- z`O88^C5+D`Q=g8+ehC^3M@ov}1_v~5+Trv9?W^OL9Ts$FBwBRxK!b(c|MYpI7TOux zxu}I!gQ@8yCI^(@PpxH2c&<;*1D|2pt{IioZ37b61Eg@MY(i7CB@xws&4MB+asc3?VL!5CP*sYE z+B7pl&^7e0LjVwXiP(xbl#sTu*wif;*8{z5QMUQqcEmKCzML>@GT8h%MwI)fU0^Z; zX{rZ3VzU;3I2744-x>fC+nlNssGqo1P<$YTqgtHmmg_D8)l<+2I{%*T#;(RLYNaNM zl5(`B6aoH(S_DgBCQG}+bt;2TNtK5tjrmb5KLN|gSp+QlSW8fSvW$iLN_l5;|-=IG66Kri0Be+E&ls3!P9o^ataGSBcO<_MX_Llva84_c2 z(OR8kcP+|>o7vo1i_pe+=34{BbGEra&c}9_mPy>+`BuU17WeixH}?+p4)ymn_cUW@ zLmRRNU~a9z4yVo!@#dr_vo@KNz7tV|vBkWIfC|e`;3Qlbj>BuC`|NM(>56Uhb9%J}YUtXGg<8XFfW`_7Bf?6_#kbnMaImix z{Mml67^g);a`R6y0}6h4{68~jLiz%J$(`y$7a2O~!J7h`WY@MJSCvNmu4$CSN|P`X zD#PP|RdSA}b8=j`>FaDLftgs12L!9;)vVs>q${S0URuk0{k6!i0r=IWVK@(P6!B}i z@RkTJHLFY8a^p)9+267oSyJ#~5Y~-;c6j-XEeXHOi;y@CX775UL>_HC+`M2xEec*M zmM>YnU}OOU!xOJ-ZCh;{@bC>d0cZdMc(8zJE}E9iCR*u{9^81+LVD-I9B0~eqz$bl zrs^FuzNihg9GbkZ^s7t8g1R7F}!%IvzJ%ZJtIEX9@%Q&zM z)ge$ZyU|t9ylgC>c_nmA#4Y5-LU7mEJl%QU2D@KMghdO72l|QnzNw+Ct_*W$@cBet z1Wgto$}=`~hVM6dd@OcLv`}1m=^Gsi$&^&r8(Ek$80F_yADTK2BR(hUQceuy<5^d_JE%IqiO!qWnz2l`sOB`p!?Z2@zjNrO}lkF^`gJIm-JWh z?LA889fgqxFD~f#G8noG4zKkVS*kflH*Y@Pf^98^Hv2et5kfu>DnclcN?Slm$oCM@ z9pXJr-VOjY?I8GF?C^=%1{!e2P65M0oYq~j$0-QWoXVE#KaI8^nsrvvR?-F}9Xhbe zO7Tj-aFD10$}kl+4X*D*Iipg+JOP#RP8K$-Jq>{)`>6^7{Ifgu|GOvh(WqPv`>&jz zS&;Fevl+$Bg+A57960fT#zXh~Flq^Oi~onCg_9ji&W?1YdehVLd(QIKZRJr&k5UJJ z@tPd~s-Jq_l}E+Mqp>Yv#`-zsOFugoIhygc{*O_C|G~ve z`j1__bl7i=Ziue5%C>jy1J??vCgmmULIrl=)v;$BkX|zp_R1E(m-NC5s1doR>;y6q z{xPOFqoETVT4+(X#@kN-#5mdS%{>fMyA3o^m=iJUdB|C{xYRB4{B1~>520(Uggaba zg^xiKVo?DJn(>#Kh{FkmPAwVKr;%LN`WrzPlbay%`=Vz6(@| z<)y$Qxxs*y^vNk`hkI^na9sqA|FfK z4(as3e}$`?)3uom8FFu24&cD;LudPjCXXMPwL6h-3^d4TC|#vtm%bTG3-D|4S!`Ds zg3TX?-3`D6z|^WGI_)e)8x2tEXx3mT0F}`cr~>*2#4QeU)gKec*4cqHQ&JQ|J2ldS zfK;&J{|!Eg0*C4po$4<0vrfVuIPpiF^ZZd_HB?9q9X_mx$ zU|0i=zP1EW$0OB)6ooV-w$>GF3N5fj3S&E<2ZPEtCeMETe~AZX{+#i5;Y+(ZHL;{> zWlv-DMi{~0%)7t)U1_>vYuAB=`o$o+#5x4^Ln3CrhD0AGlq-IMtCKn+m)x&dcac+L zhf|XR7!kV-u%rAkAi*Mue)ve7Lo4Y`;5P~mj^@{_;GzAS77H&jU8m@JUh~VrQ{va^ z`tODvDsRA@qDdy0^b7a6zN?`t;YJbtPLv{z@JY~LtfglD8>O;s<5s;TmRQoV86l5l z_0WnBq2vl!)f9^Ni(6iv9%^q3 zS|ZO$f8hMn(#pqoiZe$==jv5DH#M(2f3dvlfurXqx_b^EIk4^Lw({1_Ops82eWy6I zV&9gkx=v0jT*5}lVF=Q{;UsknONDjfm9S%#=(5pB2Dj1KGJ-+z9uecA`OMA?A9b~= z9v8T!bq^*D)5W2B5rAi=r}zQlq4Nc|lAW*k`JEJyjhYsu>6?Gsie&PaV?`gmB49B% z-{kMGxtz1usyJm^rHQ%$ecWHMQMmk~0R~6ZTAEr-t_CL6N6E4ey(bX45Yvmgm6P6_&5s@VM3g}L^BGUc(*MB! zFwMsIg&)FnLYh3{-b)CZ8TDb;s7gT6=GP5yAq1^9+PSHpY+( zPz*6;iE*nTeX2^H>%9@IYVvhJ(*|wqDo#<%}7a_ zYnnMPNnt+D5&DL};~k}OLTMt@#F387^NdT8N5d}!#oP;$-;5G@pH32fT{!tfUSuHS z%Y88#?<4!{(e2lxujR`Te;v|G8ePoK1aX4!C%&Aow zhfgO-C2&Wli``TRoBs#3xu; z0e>2|nMJ_V#u^1&>yt|7iOS-pmXb57c5ynXuN{*jkH>B)_gSO0ic6I^I7!8W4C7@1t?O7^U8@CP}yiPQZ?1HlitcKGfZ-EQW z2Bmvln8SuUh;lv+9|Dd+oS;T5j#47!AD#Aka}VRDTO7m@4oEhiFN+8qf7@|Gf1CE9 zyu7Fg^Hb}}k%lWOD=I4v0?P&Wo@rG=6u=8GQgMb45UUgMOF(657M9_HV5-1N#3DYj zBQr8FOZbPM&JY(H7?QV#hI`*hyn_~Sf=(nR_nTP3*tvui1PuChuEk}*6_qw8 zuE)0>Q0>^x@#oDu=ae=iK4&^Kq``_RDuO{lsHm@~uc-=_2g^%}A*Uj?b1Becv7O^s zpTtlu>DGOnqkitKjcl8>chjHB5QmJtWB4EEzUyt@jEe4AT$EO!SFGXs$Bh7244~;4 z8k#Y&;RkNh5AgbETrG=5nV^=~ zSWpd(rJ<$7WP@&DDfoMK*(2LAwselwp#3zf8`+ZUz85yHpslT~x2?CUlhhwgk|+ZO z7*evF^F3CoO#m{%t4Y3%h5QOOm9`q7ravcunzr2A5?PtJr<(Wb?N4WXOFB0PylEUnpP24ing?5%5oakF(H9=LB-t-Uj4wDVj!FMK_Y#id#daPXDDN z$uIT2$EC!)Tx2wyg5Bb@qvip93i^dDkTDL6w9V_Xq8x8Sx^WJ5iiwW0TPB9>TUY|+ z_~_M)t>VCokd0MIw_f)>XphUmeAE)6(bVXjtb$@K5DK_rjk}%{P9@(}oupo5ITlK? zghYV0(BG-at0D0 zKp^1|1pz_1Rb;(I)&nm@MMXu#i;p6@E~_r0i^rlUUg#>K98Q1VPjyevgaFE}fBjxR zhCKarb)8RDJyrG8Q%^~I_0BElR;c(+8ma&7aQI`<^DAcOIX~!Nt-j^l`qZq{vr*V} zFDe_h%DG>&SFi0$4MWAoL#sDe=|_f}XkuB2QNIi3AHjj#*B{&sYFNgG6dJx@UBu*o zAV1Ijs1Cas8VeXev6w7fTL0Tf&8GBlJoKs5^#ZMzdT$` zhTfQwkd{EJ;UpBDPJm$?48DL7`tw(swj~8!yFgDRJKQiprX8*joi@>F3+ki(Q_?#t z+O^b%1)Wo2q#hA}kMns$<4$gzTi!uUB|}33ax!HUd$Y*9978K(rlcs!&{0FN`Hhp+xc@shJEczwU3!p)8ia*JZEr#4HO=(gqackaw2>IQ!ns3Y95&$Qe%lhLhV~ZeL7?aOj0L zAMl(7LtZ#-CzqxAG)><7;aevsXPC(0;N)1?GYYo3c<<4QM&83 zVJa+K~?FmF272<_^-xbu#4M{o0X=ZfEM34gWkZ)x3%&ufVmR{?a1I(JNPOf9T~ zXP{JJwD$s=~zqdrt0OFr;jQTg69;49s?YfbPqJv;jE-s~vifGpnN_b;ZHRNkMt3J!n>0`FzNtp*M%lU! z>iIjBYX=@1RwQyT+gq-4E~-q4h3e_MbDZ1H?NFk-b6fby$|RP$HBJ-s^lcg2H*5CX zw#n|Q(*$qpyTwf@G?kRT9(Hwa$rXF>qo}kL*gLE#s*b_g1D4S%w2KKlPB^xrU(SuW z5;S;lx?7>c-Ew&#?7 zO?1|C^_`ZGjF6zLAhtUv$=`PU)&DqndCz&bj2f~at!2za^LW0Qg;peN8UcgHza6_n zh&y5-L7)bDzqudEN(LPYl(|K-bGk#c$cEvlukf*eGg}pZZuOrGd+ZQ8cEL;$Q)`nC zRGRhm&}7JXz06+Yb%CF5t3gg1Nz*T_APv_`;A%@KU?l36706`1odkXE`gh2~vUC_i zJDZ|OnQ&8|P6kgopH4c`Og8t^qhPPh2qi>+?68fL)HM|u*B_$3kwz( zE$SV`VdD%Gg6f0^g+jV=Ul<4W!E7ZM(i{^M<7jp$%mGmA)Mymwr`_Qfq^WvIA{7*X zhbaXE3UIRkT@Nd5W%rEFOvu!*XU4*I@2P2F~OvUx86z7+IJA^Ag5lAI2`R zmwHZkOgT7%YS;zi!RbxQInm%A2dvJetx($dq#*>IlPs!WC&?}J#F0!AYSNuz)Gh5E z-IAda++7$4P^1B0@mR~X8UJkY_RH(tT3TN}YUS3(0ZrqEI@|fjZ$4d{(!)M)#X#JT zJP@M&_Ol-?sk~)oa8&-tTSl2?-Uv$^NjIPg{`La<`%}5`T`Z$3`s9kVY#0MY8}#C* zLDOR8i6UQEW%p*uiMT?M#&t5CTZkQB1=~E571@Xt*(?x~;zSun5!j#c5tu(4SJIGP z9K@kMKE4f@mxa)^sIdI^yAhzb`}+8LTx}!cF~bHzl~Une-yRqi=iW=v zjJ(S(j(cQ?py%E`LWbE$>Et}@kEySWNwOzST-Gf$Yg|ozZlQIUrJ!%`lu?Zp{StGm zKCwO8>*p+*dHV|s3!BDOJ7Q|9DdXyM0s)jZ-4M|Gk!$s}-5pg}@ zyB0OQJl!;2+|4p85;hP^lw3cS?*f&H>rXD40IqL_WD){mh8qjP_HoFF_ONi&7`rY+ zYZya>>a$7l^)um)1MIq!E*4G%d0D*1!we&6aw$dBsiTJvYih;C1FmP8keY2bdhr z^t^zgYjz`w>3X*A-EiQppFF;8^Ye#EGMwvzmWD6$_A{e}L77$Hjz;(WAOX0_j?QX& z9>UJe#f^={xj2@h-RzK*NV>k^4o6%Nwrm4E4?p8pAuxY=wUBP7k1nHeP1sx(N?mt` zF!zx!^9!T|Hg#}x(~{{C;WPVBU9oaX|LKug*H0|U3=b0QY{}b2%>xEB7qJ;dO-1<6 zy|4@GzPt@LHskX48GKe)DD+#}3T zS*_MkYpA^|?rHSGVXv-Q8xHkCF3F^YL(6n}xA<=Oe|GAO+L>)Bi47vFTerA~h#Om{ zFKVevOuKSA7~F>f+P-2rvKw9$f^2liQcxhbgc`ADMo@GSVi3Uyge^h4-DZlwxPkk= zNVXJ$rU^wMvZAbA3Z&q08@L?KD3Ci0O?UWEw-ah_0VYd$if}-C3OUD#86x-SCiYxS zomU%=i5<#6_a1hnxi%qnHi%0pzJU}2a4AcbM%?b$sla7@GEJO;r174nfs++I?P&UL z=Fl2O+MPYr71@GtkU2iUf-}6xMphx06ilFe z!xNf_QU@ufN4M}0Y{lc^UT>Qf+3^bMY6(eEh&@8pDAz$OG9(0D1LH4Q&nZl0 zkd^fbrA>RNAmPSiYJ~FY5Lu->l-gjo?QQ1L)c93PHfQGanKUGJ=(NX^mM-O4y&Cc+ zlsHP~)%A7Wz!vVSZxm6~xZ=Cz*Yxc-x_wtzaj;)teADnr8FQI$TIP_1NZ&wv^N5Pd z_Ug}Pph3Vy7JFEnMP_>_^EIZBrdV+$4oNm3XlQ`YBak%Hsgo&z91cD*z$`bx{+pfStXg^F?29?)OSg@>qK+{;g4SWWIc`1o(gFJ=)G!El%MrLGS z?v7prUhwq6(`DKu2W$e?L7Q_PH;RFLKv>K&(*1&RFN?KqwpVJglQ&kknvz}yl^xyKi{b& zT=9Xq6{=xLkc)+v;`MM0M~PN!gu_H>G?tdJuu&S+l_pwUHP&H=o~t|tMhxD?L^^bp z6Olb5BYQf#k2}#jY1??dfLA2NyPAQBPmGLAj2wX)uO2+DZgfFj5&m& z&2!#GapIK^ioCIquyuvdik2M2267afe#bZh!3U%v-q>Cz`}U|S@Bs*}8o=uUap-^s z4M>j2x|+P;3+DLB}VOxH6cIDk-a0{GXZIhxzv;o=T}R~CHS&2W)oIM^Y8NhUf!0yb zH$86}rf2yXQ4t;6hclXgqzo0GV9W?s5{u$-h8RQt7_19ml#pSGX)*vxmfX4UVB{FT?B&beGd_n%QXub2yyQNfVlLyvjFL+ooB| zV&ik>$v?RBo!ZHk#u`B=`kb zWjWY&5sq%%91(hXrZyyH^%@uz;XgH7}m7J3iJP>Ie$(f4dbT{^5lM=_4!C#20cv8DS2Ib7bGtJGd6MVl&I) z(fAxF#1a%DMtQKv+k_3nD3aWv9Aqpq9zr@SM{%GT(_W>4dVm~B3{-Xnz3HW(hHy^{ z4v1ihWkFqDEC>cw__om9g`VC)63?MZYuad#J|ILeHA$^XB`a_@N$P42^g9UeV zTbg;$1ml2CAe;b1uOtekfMA~^LSX~|mSz1k9- z`p~%qH#(CeX;Ndpclq^Ww9e#z4&hy$%4AL-lT|#mA-PYlfzj?77_av%wFo_9oaDe! zN=8vH+-#v($8fYh5{pcR6xAf^Xe$mA7)VXc6(qKTxGqTEJK(y44;@AFVPoY*jpQ4x zo2*F6E*jjuf7#VocQqE5j7bxp$PUuW77rSXZ?2rpBAYa5jY& z3}H0=b@ApDsKPUa^k!iBYK(;rK6uMZaOUKXdo1 zFRlYqk9Cn}x{K3eoz)+7x(9UfQWBIqpN_##ut&oN8%ZFf$im+n6L&}~{2;ODs!J?# zjnTnN_ItcV=lw(6r8DEoO*cD7(-O8K5n6b5o5YnHn0q`Cryf=-pR1$7KKf5gP41j!5yWmb?xGI~Dk!W2LCyyF%k-HBDW6oV@=hlXipOVSPNhY*#*|~8W z3h`((Zdb71i-EXdF*0IRaG5K$@&7I&h&wJC2V@?yG;)9Kd_0FnJ}9wdr1wgN{)*$g z9Hh(dbCAxp{iWn3ncyY<=c{uXF^AoN5mWeTOl2fyn$exAUK=qnNm(O$DFaOvX!=34 zJOP)~mnBev;NvZH1681?fY=4sJXJ|24!p1BCp~@yb&&WcDyxgU zaR|YL>5!m#E1e)ogRu`%M?RTkvkU+#dR+~OV7Nt`F(%|`nA#lYX zd?qT1fg}{S2PQe>6$zwVmI<*pc2jA8+F^ly2%T5cj_1Odn`Xc*guU&z@Yt$_g#)I( zo7Grex`IvHKl9enem3XbqK&sEjLChzsouBQVox6)$|p{q)I4i;)7zn`F{Sa?5!H&W zpy=_+^;&Urpd?8rZm^uNV1`PC;6mY;i(*&9OH77-4EU>FKe*UvtSilY?pd# zh6BB^5X1Ej6c|*v^w6LL)P%{5Pa4IA{&botW9V?Bmrl&#IUm}__^9wUDLbRERFH6qONoi=ysO~_Xm@cNaDa~0E z`*P=_^B452u$!k^>$axl{WH%^AN3?3hi24MSql>f&`Jf{AOUE)V)L?k*)R%0ivatq zQXFA}ID%#aq7EDb{LN}rFjLX)c%@nV`9mmH_^~SE-61)2GB7Ep1N||$f;Cj1n)>=4L#91yKGi;`57kpsO2BJw;!m>9MJ95%e^A5*2AK(jbZEp_sF33;F zntG^>&GQ}{KY5V1#b;33#)|g#$0PlM9T81M11C2%Vs9`_HHmE8uS$l^b`%BlN^nGk z2V;c~>v>!r-y>0I99<*>X=umGys=wO9MjZ*C3%RnjY4vcG?!nw>cx77?)@e~hmM{b z3iQ$=M*#i)RPyh>KGic3jK@CV;oV~Gv7UEyLl=)`?eZ>eT+3xS=U%zcFitaj%(Sw3 z>31!GGo}al&sa9F@9~r=cTSmHIb{B>dG&s?dOVjtvUhIQV7W^#hLngFKBhLmGH_A5 zW4NtiWJ=wDsu?pLuCes?Xa2o=5AV~hAWt%0MXI9oQ5uSB6U`i|P{YtrAjrUu8y6NX zW_d6k5Ec_#q2NTFsnN}GXoQpty%1{!spg<}qyz?IV|9tiJ8&)UBj;k78 zFXy>hx+3{cPj@$K*v(e9eb%n0yJo|N)hYIIRU_&=)4lu>)5R6DuJV%phgM$nSEIc9 zS=)ZLa{1!3Cat)XY^q~i)q|d?{uQYPT>_OsW>=~Pm1Ep#vcqiSVYc$OmyI;nujv*4 zScfFv`|p!93hI&MS8Ur?NO6On;@b7=*QEFCkfJH<&rR_Rd-DuZEH_eIw>CX-yJs0q z<^My9aWN)YnI2_iHuf3*R{j<$w7OikZr$46$sN;Nf;2-fp(;t~Oz$vRt~6s~usAhZ z5DR5z@wd|1>ioPqhPji@Oxa#*PxEL;rX7EBfgL=QIoQgxj~NACyRJ`a#{wVy-_n%x zL{B33=4q_=inCW5Nv>O)o&Kn2y_zGCWVcJ8aWE~^NoXwk7&K1fc7N_cr1OVvXPsaF*pd8I7>QYW7(gW4VT^pcyt}Vg4MB=H5E4C7_G^zU%O^~ zUZ0F1T|4FCsXw_1OyQf@)Rku*(Tl%f&6@Rnvmfcu1djd5NzUbuvi6l{78psc-jJWu zAxTU3OHVRZZ*>8&ow*7BoK0p+*~&ARcgTT|g|FUFkk>KIk(ZvPXG`zYxi;`m*oGBn z0`w%WU)?#$l}Ix15?Xd3E=_P1GbV_}dyn31NoOlhf2b3cg*(6MpZ~CDJzAdqUs5CG z+zzQtUU~WfkHiKPbV$rA;7?8L`IVPwHr1{HTK*|z^ZF*mRA8ng1$4p#?oel@t{K~E}LO){;#qHJ8lqieO{_LT<6E&|It zi)SJ82vler2>);e32viD`*5X|-6sI*++J6os;A^;dp*YQ8mcGOj;48RC>DI)&QF!= z)qg^z4GOEYxWT;;q?altLVzjfy&-hxPq^EaK`TK2#@UFvom~Tiq{3=gAM7kUvT-ex z!@E6jKw)NnO74Q8dHpFuWbz%X378223gudgOX5t4!JCG2=*(`_ae*U)PwBYH!;e|H zRry+Xw|gQFy*gtxu=2cg}ama>XDHqR>Pc`&>L5C9Q}qGvGEG>HX3AO8bNL zI$Y+PQi@T^kzxx{q`EG_b3Wc@;jamQ)P|CjRD2sIX*Wx@iIFli(R8k)d!kYSzwOdB zNw&Cl)OPqZ!rIWV}-wn<7i2 zwMA+dR9DT?Z#Ae=f%g%zjZ;f;$6V1N1}f>ft%}+Z{ZTKW`lg(9OxKm0iIR5HWSgF( z({uqsP(HN!9fG4tqa@xA`ozGU+LMb`Z72&-ycKS3NRe803!X&hCeU&O@?G&?h3VMh z&gqM`JXlkw)M0Pz_&uU zy8I1=dm3EQY?(F%n3a!D3k~a69V>9Q%yGlNe%WDQq{ERGH~TkSj<6$e z`Aj?van>W^5$IcN6OTde^SF2tE>DS_aCt`ThRX}$6}Y@AUIo5ayb1g*@fp5;E{!GPxQpdeBvWNLA9oTk6@8Q`{zMHnl{K+ub_BV7Mm#H?6T8IoVmI;zOY&m- zfAx1I^Jcdzzhd>hiQUekK>tL=2^Ft2a>qLqgjj&*SA5B0`8Ex;fHTK;ETS)FTKle;aV&d627G`SG*L1 z9`CakiI-B{Wb*Zh(N}DtoWXqyINx4zKpYd>aFy9Mxa}2t@V8YQBscl>7_ei&4vK@O zXh8BoU$=@A;s~&3g4N>p}L455h-;RLZaKqbS_(2TF z6T%|yEyy>OL`!QEo`;c#)5zt1{D>x$W4HjL+#g4tHP_Rqjc}?J{Oy(aUaC{LozTlg zG3`N^6EdzNa6K$(b{sKMDX63eD1O8Zdfvb!zkln`A#&};@k=ssym_~QBA7>qBXfvD5A+RVA2Qqgs=Vd z741j?zReU(KYTfjKZ=Q3g%%st3w@JrnqTRQ=s_i+5If+GJOCmEz#Vvk;%Jozkb*CK z9l#$^lInpk zzqpQL4q;iww}4w6<@e(2xAaxS@TcJZ0l!Ofv4`NYi$4yRZsf3gK7SVY3!G*l)%;1gWb)^by2^JUo_hXZ2YwWVFA=N={K$fN z&}59dQ{-HSVJ?*q@oo_-VS_O;4`tf{tt|?@A7~0gZxAODgO*(?NR<6KhD4Bzw%QUZ_Tjt>;>~yT|}_xCL%nf?{K7eo4HYErRg!TDH!T$2PKC*=Ba1rG`C>-{au< zyV)yjAA8$!EqjlB$UbFXux~-tUzrmW_2vOQlt*zpPqci&(|8uo=S6%7uK;Chtpl+q z-^i!)R@D4eUPYksD!zel;@-2KTZlc@9ckpNV9=@0F2Xznf!~6(826~?0r@amc z9P|e*yNYlT4LT-^43T5)Dhk9vP;)qFS#K?{4ipo_RMBFs7jwlz&}{`;%?;{mv@Nsx z0Pt5-v`)5DeGG7;dKKUv^;&$5Qojd$M!g&GCzV>^7Bvg_40Sp1#m=Vz_c`~#Wts|{ z4^q(+c#sOg5_?lE27FN+26%@W2KX;E311`BC4fchk7(aqeF6ASD%w5Uu0rwH9IAed z*8c?Mia)4QulSYnV~$ks1KgnAfLp=c8SG`%{?*R{0aaNp%ItdR`F{2be$ryH1>Y`1>D#z57Xl}9+^@NlB znEZ(j=0}LaV!4_Fn4y9rh#o5O2pi$1XH?|b++79lFyEkV!q*+@D!A`fZvyNl<9t}X z5$-pu*snM3r50`)MyZ<$(9&_3OQt@A>eO_HgqzhBh%Jq%XTDy&8ezXtbMZA!{R{H{ zj*KTy##5+%2>1Sy&fluwdZyPYUGal?1q7XcOm>3D}J{Fw4863SGynLzT;TyrhH;enk!&r6i#47d`u@9{S3gu`A z*Qy@@{;E>1yIMZ?9D^;A_ zX1i4z`BaZecR=<7wQhEodOhH6>TQ6F)#-pc)mHfFuD&Dve+8E%>H_qb5K6^Nt9E9( zM*S6EA5ifXyb687^pkY|Sv>+j*Qt;%SQe2VahQ09X|j3@_(SSR;L*g5O!eend?5X7 zQU3;);VSr$DM+k<0Om(3{$Oe|B6x<_sZBNQEaAQ39afr zxI4*@3F9oFKb75l2SHIy+(m>^O$i_M3?SqX@DoKfV%nnq4EVEjIYBPq=wHImlj_TG ze_93qFhvlxP4}yx!+pBC2KZj-o=G_|IaE+X{HUV5rh)3e05?njnMww)>RP~ui1MJD z6R^AFwa>~@;M@hm_K^PXp>$1wvIfhf``y$A!0mF7dJV zY=@+2sJxxHmt(?n&ewXHG@(QZN+G1vv_faGXz9oi)m8`~V~x5y`kd|_D&42(?zbB5VbXnp z?!MG;50~x>0jZogq0s#V)Yu_^lrl)Sq+u$)g(@+Sr)D8PrP#?C3;!mVHRbGbiNW@Z zjzI}e$L1K=Tmyq~9sMgwL$$CZJ0*-H7yVcPE0!yS5s<99b6`iUcuRSQiS2}Rw1w5n zbf1y{kvdN0j5rX&jj8%Az6j%wYrBa8?i5=UldgtzkE_d!S*ri@nC) zVIQ-v*-2c-jhPkFI4W~GTH;@L;9q*+$2{<_JaFtXqQqL*Z#?jCJ@D^5@Z%o%_a68U z9{7Je@E<+!pFHpr9{A55_(>1^7Z3bb5B!t|e%b>+=~+1GjkKULH8wjp4`UfqUyX8HUPd)#xl(i763Shs{x9u@-B` zF#va4r8Y%%uFV)t>~pj(kG9SUu!^%efr-2_UUCkFPZfqiIT|B{&2 z0yO#R9LQIx?t4lpYofaauvL|{i+ILxH;*ucmoP(!O>6R>O1&afiH$rvA3PB@wUrnLy}(ls!$ z45_&V7+9cz(S?fI*B}E6HZUBc*S|&>SfqhZp(Cwh84}~@fh75c*hL@TuqIV1l+DV6 z;O4tAYdD~MsC*87{ww4zzSu{K0Y}e*w51eln6cpLt&p;;z&_Ef;Og5@%P(PH=socD zW00nt#Xe8~kH8*K8st+0AwQ|%6CgQh$DYqBz7Z0st^9H9^z6m{%^}E0zU3#uj=Zr3 zi57`ie-wxzSbNlqMyxv)isfRR?4?JMbIdi-OTRF%FAeONfqi9QSXbyFzA>KX<*os)JgEU8SQi7M zzNWcRU(+z^YZ^vCVcSd@WL@6_C=cWM~* zP7R~psbSPRHH>UZq!dTjQXjD zQ9so%>Zck;{S;#$3_4w4RK=d`KcGSNF8e?!f}G$}WvII^`-Q_C=~zfb*Pss;LLzV# zKaJj%BWfX6+=Sh*A4~^LKbWh`ODqSxvb>hSAY-2Oko9ZZTeg$lwccla_W7KKpgz$z z)3?$0X5R;W_xt|fdm0y*`zuk<)F=U`7>#*uBlHE@p%1WJSp_b>33I_Mm-c!UT7EfT zHJy`3KI#E0c`aZWY2LAZSbJ!;Q46K6N|jQJnR6rN&aId|8+7A1xx)UASg_y7-o$eT zp8FB^bos32b7buE0UP*iz)^e_;7C3Xu$H#~R`Pbh8a@}Wnok3);LU*Lya}+BPX#RI zQvmz(MnF&&^DKWQm|uanYQ7M#iZ1}H#5%#>U0Qw>@~{V~ERjAIlMjA1U^TxIu!t`L z93V&BrR0irCTUJ(Ku@dy+HIxEaI}$JqK&UEyJ>W>b z0kD#<2Q2670L%DVz#)7MUW zz)JKDZ><*j?Rc-_w*eOOTLFvsEr4W<&gEk>-fOWxL}}a!IGEo7SYpKfSNVO5{C+om z_XvBx{C1!Gb}!&i>>HsBM%V}C_Xp(nt@IuB&=nRzqm?+!a3$Ta_eAMGCjD#&tinDN z)#5h5q1bOCnmi0R7&}vxuLw|^TG()`hsS}^q}8_s`kL#MjhI_)R_;?CRvyQ^YPa%= zvQK#%Gpi4kPx+guf%lQle)+8CZ^&mQhsF%_JF59hcv5eD0Z(d`yYQsm_?&!JV;4<; z2i0Pijh@vo9ZR`>5%3h>12~+&23W&)16E>3j(XuTOR0 z?&PlkR$)JlV}|lF;0XQ%pu2A0##=4_8(=km3$PM0i3qg11Zdo3;@ZnX@TXzWmaKtJ z>4(zq2h#5$z$*Se;3$3&@C^Sa;7I-+U?qPSu!6q>SkC_e*qi(>r*u$KP|uoC$gj($D?nrW@jn_3Fqcmrx-3uac2gD<}1t^ur5 zzQz3Zq7q{P4I|VN>O;^f?R`9H756^+1FZz9p3dU=ccf0MN8%#18m0WvYL&PMt!DS* zomRVV;GI^+`|zaI@;BBd8bPy$ zYLN_hR?w_slt=^|DS84{igds_5f4});sDEq1F%fk0SAgSz*-RlI7jpVEOzrKkuASv z0oI62z-rMOuoBWf;@o+j6jnNoR?6+77i1E%m=Iy^8l+wJ7AS)1FRHt0n5Z3z!F%QKtB|-0SAa#fV0F*z$Jx1tY{AfTzUm zfWyUYfR*A_z;ba9U@g|u)B^qrSR*z8o)B9AtHnmZGI1kdiMRoX-PuvUGAl3sO z#fq28LNhUgD?wX=Vto*>MmzvmEw%zyiTeR7#eIOKG!GLG(>K}MWxL_jrfHm@wpGok zoz-$`TUBz_Ch6NTB~E>`ic@bM$*DKDbL!0_IQ7diP8?&_IUy#)t$|a2spHgBYB}|h zYEHeQiq`>_X}y8m-__8bq66pi-=5dqjPLIKM}kl~}Nf^k<=pcJdo`e|*j8fCA* zcY33;lDvmnv4&B*(Xjt>VWN-3u&;rdB%?7eVC`f=&;Lm2#y-K?DGtYHKT{I8ALK?o zc_0r|5+T2cP?DevV#mD90x3y2W?8LhI|m_I%!Bk}E9BTe@C>Z3_F&g^o%q}|#I(lr ztm%X~*<52@YTkx9ACmGW8I`s-5kZ*LSRqZH(a?>atLgQ0(9+q8S%?<0#0ZJqKE+?^ z291SA5VU}>cYeRr;gQ-qXd7AxN=Hj83RoAc9fw1kXe9J}NiXIoI|c2bGhE?+@1YB@1S-36J$+?pjXpE8b-Qbk}qpCh?Rc(vDwh_QDH&COO)&S zNDpX!tw#*Mc3>vRt-SdY7)@oW*1g782e1%mSMA|1a%dRyqtK1A3Loh61VDRdhSYRg zAy#64e2rL(zO98{VT6wZ7Ru-GMN%(I)4|%sKY@0Tu5TqAA|A4@G-y{%gYML=dJF@N z7~+9N@+o{4zXGfI_569h8}hUNg9PnUXh;77eJzrp`HLv8$ocbQ8Z1lDVh(bNm&)kN*w&*GKpl(7*ms_=!Mh zEM-H6&{y;mgP|QzEw#T$H{d$45mJTQ#U0S>x=T-Om62LcVDWqe^uFgnb7~=9$FGMD z_g(w}{xAL!w9dZfs^}qNgkAI$NzjW*hXk;X$QS*^AZQ_!>H1}J#XLv?w}78Y+Il4# z@e>xybNFn&81ls%Az!>1dT(3!!~8M+veYDp{uTdCFi1dBp}#g1x@%)0TWl3=&{4Zt z+$Qc7_k)+pcrDoZ*Qt~QECD)Tg}QznR`wjLeolH8O?)XV*sSEMp#gRSbilUrC;3kP zj36z!-co;}NDPD&bBq`#CPH^&p|}C#hnB)DBZXvOVN#E;FYm{TcrhQ$hw;myXLb!= z0ZHj!_-*`l{vLl{gotp+ZYE)*(BhzwS{qLR<_it`$^20fDk32_9VIYN5u``*l{2Tr=KPzG(2`(15&T!?}U4_!;gL zCee%Lq|&d|@Y`GZ&FAI38mAC0r^fV1Q zx$+j)3gM6i(Qa=e=JRVH^LmB+ipMd^BqJ^>Ng8k>MPRQuS?qx85%GllM!sI{;EPt% zzNMUcI)4sm)~~DZxqAc4!&O0eeIFHUg+@c75&@G^4m-D8^y3q$80Q}P1H}P zOv8@K40gnWCLFU5XhdK=K=e>>?hBSyFs58UhaT;%3O<-TX+t3d_6(o_jd5P1GQ-N4 zcJ9M5qEcOd&*qc$@TuK}MdXw04@zwMXbbcv4GC%?W5tQ_NyEYnEZo4N3@lm4x)}2i(l{QCJ)N)I zI>sD|)kdAsti`I;5qlcXQS2$e;c#U*ElKS{+p{eqjZot)Q=!q<^({{Q#N#a#y~iCt z^;812j`FxMJEs&VHzis4hZ4sudfMnJEZ9e3r?zd*hPTgYo zD)?fLw?e+e<1GV{SGP|)U+VD|%$Iq*S@?3iF*d<) AppText( @@ -350,24 +311,22 @@ class PatientCard extends StatelessWidget { ) ], )), - Row(children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, + SizedBox(height: 10,), + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patientInfo.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), + Padding( + padding: EdgeInsets.only(left: 12.0,top: 5), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patientInfo.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, ), - ], + ), ), SizedBox( width: 10, @@ -378,7 +337,9 @@ class PatientCard extends StatelessWidget { Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ + // SizedBox(height: 10,), CustomRow( label: TranslationBase.of(context).fileNumber, @@ -496,3 +457,21 @@ class PatientCard extends StatelessWidget { )); } } + +class PatientStatus extends StatelessWidget { + PatientStatus({ + Key key, this.label, this.color, + }) : super(key: key); + final String label;final Color color; + + @override + Widget build(BuildContext context) { + return AppText( + label, + color: color??AppGlobal.appGreenColor, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + fontSize: 10, + ); + } +} diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index b66d4926..e08f625e 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -24,17 +24,18 @@ class CustomRow extends StatelessWidget { children: [ AppText( label, - fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.8, + fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, color: Color(0xFF575757), fontWeight: FontWeight.w600, + letterSpacing: -0.4, ), SizedBox( width: 1, ), AppText( value, - fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3, - color: Color(0xFF2E303A), + fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, + color: Color(0xFF2B353E), fontWeight: FontWeight.w700, isCopyable: isCopyable, ), diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 4fcb6792..00000000 --- a/pubspec.lock +++ /dev/null @@ -1,1249 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "12.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.40.6" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.13" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0-nullsafety.1" - autocomplete_textfield: - dependency: "direct main" - description: - name: autocomplete_textfield - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - badges: - dependency: "direct main" - description: - name: badges - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - barcode_scan_fix: - dependency: "direct main" - description: - name: barcode_scan_fix - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.25" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.5" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.7" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "2.12.2" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - cached_network_image: - dependency: "direct main" - description: - name: cached_network_image - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.1" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.3" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - chewie: - dependency: transitive - description: - name: chewie - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.10" - chewie_audio: - dependency: transitive - description: - name: chewie_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0+1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0-nullsafety.3" - connectivity: - dependency: "direct main" - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9+5" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+4" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+7" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - css_colors: - dependency: transitive - description: - name: css_colors - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.10" - date_time_picker: - dependency: "direct main" - description: - name: date_time_picker - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - device_info: - dependency: "direct main" - description: - name: device_info - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2+10" - device_info_platform_interface: - dependency: transitive - description: - name: device_info_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - dropdown_search: - dependency: "direct main" - description: - name: dropdown_search - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.6" - eva_icons_flutter: - dependency: "direct main" - description: - name: eva_icons_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - expandable: - dependency: "direct main" - description: - name: expandable - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.4" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "5.2.1" - firebase: - dependency: transitive - description: - name: firebase - url: "https://pub.dartlang.org" - source: hosted - version: "7.3.3" - firebase_analytics: - dependency: "direct main" - description: - name: firebase_analytics - url: "https://pub.dartlang.org" - source: hosted - version: "6.3.0" - firebase_analytics_platform_interface: - dependency: transitive - description: - name: firebase_analytics_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - firebase_analytics_web: - dependency: transitive - description: - name: firebase_analytics_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1" - firebase_core: - dependency: transitive - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.3" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1+1" - firebase_messaging: - dependency: "direct main" - description: - name: firebase_messaging - url: "https://pub.dartlang.org" - source: hosted - version: "7.0.3" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.3" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" - flutter_cache_manager: - dependency: transitive - description: - name: flutter_cache_manager - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - flutter_device_type: - dependency: "direct main" - description: - name: flutter_device_type - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - flutter_flexible_toast: - dependency: "direct main" - description: - name: flutter_flexible_toast - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - flutter_gifimage: - dependency: "direct main" - description: - name: flutter_gifimage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_html: - dependency: "direct main" - description: - name: flutter_html - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - flutter_inappwebview: - dependency: transitive - description: - name: flutter_inappwebview - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0+4" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_page_indicator: - dependency: transitive - description: - name: flutter_page_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.11" - flutter_staggered_grid_view: - dependency: "direct main" - description: - name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.18.1" - flutter_swiper: - dependency: "direct main" - description: - name: flutter_swiper - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: "direct main" - description: - name: font_awesome_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "8.12.0" - get_it: - dependency: "direct main" - description: - name: get_it - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.4" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - hexcolor: - dependency: "direct main" - description: - name: hexcolor - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - hijri: - dependency: transitive - description: - name: hijri - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - hijri_picker: - dependency: "direct main" - description: - name: hijri_picker - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - html: - dependency: "direct main" - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+4" - html_editor_enhanced: - dependency: "direct main" - description: - name: html_editor_enhanced - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2" - http_interceptor: - dependency: "direct main" - description: - name: http_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.19" - imei_plugin: - dependency: "direct main" - description: - name: imei_plugin - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3-nullsafety.1" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.1" - local_auth: - dependency: "direct main" - description: - name: local_auth - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3+4" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - maps_launcher: - dependency: "direct main" - description: - name: maps_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.2+2" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10-nullsafety.1" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.4" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - octo_image: - dependency: transitive - description: - name: octo_image - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - open_iconic_flutter: - dependency: transitive - description: - name: open_iconic_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1+1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - path_provider: - dependency: transitive - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.28" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+8" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" - percent_indicator: - dependency: "direct main" - description: - name: percent_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.9+1" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0+2" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.13" - progress_hud_v2: - dependency: "direct main" - description: - name: progress_hud_v2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.4" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.3" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8" - quiver: - dependency: "direct main" - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.25.0" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - screen: - dependency: transitive - description: - name: screen - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.12+4" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+4" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+11" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+7" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+3" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.9" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.4+1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.9" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.2" - speech_to_text: - dependency: "direct main" - description: - path: speech_to_text - relative: true - source: path - version: "0.0.0" - sqflite: - dependency: transitive - description: - name: sqflite - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.2+4" - sqflite_common: - dependency: transitive - description: - name: sqflite_common - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3+3" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0-nullsafety.2" - sticky_headers: - dependency: "direct main" - description: - name: sticky_headers - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8+1" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0+2" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19-nullsafety.2" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+3" - transformer_page_view: - dependency: transitive - description: - name: transformer_page_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.6" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.3" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "5.7.10" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+4" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+9" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.9" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5+3" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+3" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.2" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.3" - video_player: - dependency: transitive - description: - name: video_player - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.12+5" - video_player_platform_interface: - dependency: transitive - description: - name: video_player_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - video_player_web: - dependency: transitive - description: - name: video_player_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+1" - wakelock: - dependency: transitive - description: - name: wakelock - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+2" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - webview_flutter: - dependency: transitive - description: - name: webview_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.24" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.4+1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "4.5.1" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" - flutter: ">=1.22.2 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 23d6a2aa..6423a46c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -152,6 +152,8 @@ flutter: weight: 400 - asset: assets/fonts/Poppins/Poppins-Medium.ttf weight: 500 + - asset: assets/fonts/Poppins/Poppins-SemiBold.ttf + weight: 600 - asset: assets/fonts/Poppins/Poppins-Bold.ttf weight: 700 - asset: assets/fonts/Poppins/Poppins-Bold.ttf From 9e1aeb857f459ce3aff267ea7775b2416ddd3fbf Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 11:43:38 +0200 Subject: [PATCH 158/199] Patient card --- .../get_clinic_by_project_id_request.dart | 3 - .../out_patient/out_patient_screen.dart | 6 +- .../patients/patient_card/PatientCard.dart | 335 +++-- lib/widgets/shared/user-guid/CusomRow.dart | 1 + pubspec.lock | 1249 +++++++++++++++++ 5 files changed, 1449 insertions(+), 145 deletions(-) create mode 100644 pubspec.lock diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/models/patient/get_clinic_by_project_id_request.dart index 09198dc0..47122bf1 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/models/patient/get_clinic_by_project_id_request.dart @@ -40,7 +40,6 @@ class ClinicByProjectIdRequest { this.languageID = 2, this.stamp = "2020-06-03T11:18:19.979Z", this.iPAdress = "11.11.11.11", - this.versionID = 5.5, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", @@ -53,7 +52,6 @@ class ClinicByProjectIdRequest { languageID = json['LanguageID']; stamp = json['stamp']; iPAdress = json['IPAdress']; - versionID = json['VersionID']; channel = json['Channel']; tokenID = json['TokenID']; sessionID = json['SessionID']; @@ -68,7 +66,6 @@ class ClinicByProjectIdRequest { data['LanguageID'] = this.languageID; data['stamp'] = this.stamp; data['IPAdress'] = this.iPAdress; - data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['TokenID'] = this.tokenID; data['SessionID'] = this.sessionID; diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index e0e4fb4a..5a6a0083 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -245,9 +245,7 @@ class _OutPatientsScreenState extends State { }, ), ), - SizedBox( - height: 10.0, - ), + Expanded( child: Container( child: model.filterData.isEmpty @@ -269,7 +267,7 @@ class _OutPatientsScreenState extends State { .patientStatusType == 43)) return Padding( - padding: EdgeInsets.all(8.0), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], patientType: patientType, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 3ae07265..1365871c 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../util/extenstions.dart'; @@ -46,17 +45,20 @@ class PatientCard extends StatelessWidget { String nationalityName = patientInfo.nationalityName != null ? patientInfo.nationalityName.trim() : patientInfo.nationality != null - ? patientInfo.nationality.trim() - : patientInfo.nationalityId != - null - ? patientInfo.nationalityId - : ""; + ? patientInfo.nationality.trim() + : patientInfo.nationalityId != null + ? patientInfo.nationalityId + : ""; return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), - padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0), - decoration:Helpers.getCardBoxDecoration(), + padding: EdgeInsets.only( + left: projectViewModel.isArabic ? 5 : 0, + right: projectViewModel.isArabic ? 0 : 5, + bottom: 0, + top: 0), + decoration: Helpers.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, marginLeft: (!isMyPatient && isInpatient) ? 0 : 10, @@ -96,8 +98,11 @@ class PatientCard extends StatelessWidget { patientInfo.patientStatusType == 43 ? Row( children: [ - PatientStatus(label:TranslationBase.of(context) - .arrivedP,color:AppGlobal.appGreenColor,), + PatientStatus( + label: TranslationBase.of(context) + .arrivedP, + color: AppGlobal.appGreenColor, + ), SizedBox( width: 8, ), @@ -111,18 +116,25 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - PatientStatus(label:patientInfo.status == 2 - ? 'Confirmed' - : 'Booked',color: patientInfo.status == 2 - ? AppGlobal.appGreenColor - : Colors.grey,), + PatientStatus( + label: patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? AppGlobal.appGreenColor + : Colors.grey, + ), ], ) : patientInfo.patientStatusType == 42 ? Row( children: [ - PatientStatus(label:TranslationBase.of(context) - .notArrived,color:Colors.red[800],), + PatientStatus( + label: + TranslationBase.of(context) + .notArrived, + color: Colors.red[800], + ), SizedBox( width: 8, ), @@ -136,10 +148,14 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - PatientStatus(label:patientInfo.status == 2 ? 'Confirmed' - : 'Booked',color:patientInfo.status == 2 - ? AppGlobal.appGreenColor - : Colors.grey,) + PatientStatus( + label: patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? AppGlobal.appGreenColor + : Colors.grey, + ) ], ) : !isFromSearch && @@ -148,8 +164,12 @@ class PatientCard extends StatelessWidget { null ? Row( children: [ - PatientStatus(label:TranslationBase.of(context) - .notArrived,color:Colors.red[800],), + PatientStatus( + label: TranslationBase.of( + context) + .notArrived, + color: Colors.red[800], + ), SizedBox( width: 8, ), @@ -163,13 +183,17 @@ class PatientCard extends StatelessWidget { SizedBox( width: 8, ), - - PatientStatus(label:patientInfo.status == 2 - ? 'Booked' - : 'Confirmed',color: - patientInfo.status == 2 - ? Colors.grey - : AppGlobal.appGreenColor,) + PatientStatus( + label: + patientInfo.status == 2 + ? 'Booked' + : 'Confirmed', + color: + patientInfo.status == 2 + ? Colors.grey + : AppGlobal + .appGreenColor, + ) ], ) : SizedBox(), @@ -182,29 +206,55 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null - ? AppText( - AppDateUtils.getDayMonthYearDate( - AppDateUtils - .convertStringToDate( - patientInfo.arrivedOn, - )) + - " " + + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, + ), + isMonthShort: true, + ), + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + AppText( "${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + ], ) : (patientInfo.appointmentDate != null && patientInfo .appointmentDate.isNotEmpty) - ? AppText( - "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( - patientInfo.appointmentDate, - ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( + patientInfo + .appointmentDate, + ), isMonthShort: true)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + AppText( + " ${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ), + ], ) : SizedBox() ], @@ -216,7 +266,9 @@ class PatientCard extends StatelessWidget { SizedBox( width: 12, ), - PatientStatus(label:'My Patient',), + PatientStatus( + label: 'My Patient', + ), ], ), Padding( @@ -229,8 +281,7 @@ class PatientCard extends StatelessWidget { flex: 2, child: Row( crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( isFromLiveCare @@ -259,7 +310,6 @@ class PatientCard extends StatelessWidget { DoctorApp.female_1, color: Colors.pink, size: 18, - ), if (isFromLiveCare) ShowTimer( @@ -311,99 +361,105 @@ class PatientCard extends StatelessWidget { ) ], )), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 12.0,top: 5), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patientInfo.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, + Padding( + padding: EdgeInsets.only(left: 12.0, top: 5), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patientInfo.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Row( - children: [ Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // SizedBox(height: 10,), - CustomRow( - label: - TranslationBase.of(context).fileNumber, - value: patientInfo.patientId.toString(), - ), - CustomRow( - label: - TranslationBase.of(context).age + " : ", - value: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", - ), - if (isInpatient) - CustomRow( - label: patientInfo.admissionDate == null - ? "" - : TranslationBase.of(context) - .admissionDate + + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // SizedBox(height: 10,), + CustomRow( + label: TranslationBase.of(context) + .fileNumber, + value: patientInfo.patientId.toString(), + ), + CustomRow( + label: TranslationBase.of(context).age + + " : ", + value: + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + ), + if (isInpatient) + CustomRow( + label: + patientInfo.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + value: patientInfo.admissionDate == + null + ? "" + : "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate.toString()), isMonthShort: true)}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .numOfDays + " : ", - value: patientInfo.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: TranslationBase.of(context) - .numOfDays + - " : ", - value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: TranslationBase.of(context) - .clinicName + - " : ", - value: "${patientInfo.clinicDescription}", - ), - if (patientInfo.admissionDate != null) - CustomRow( - label: - TranslationBase.of(context).roomNo + + value: + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .clinicName + " : ", - value: "${patientInfo.roomId}", - ), - if (isFromLiveCare) - Column( - children: [ + value: + "${patientInfo.clinicDescription}", + ), + if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .clinic + + .roomNo + " : ", - value: patientInfo.clinicName, + value: "${patientInfo.roomId}", ), - ], - ), - ]), - ), - Icon( - Icons.arrow_forward, - size: 24, - ), - ], - )) - ]), + if (isFromLiveCare) + Column( + children: [ + CustomRow( + label: TranslationBase.of(context) + .clinic + + " : ", + value: patientInfo.clinicName, + ), + ], + ), + ]), + ), + Icon( + Icons.arrow_forward, + size: 24, + ), + ], + )) + ]), isFromLiveCare ? Row( mainAxisAlignment: MainAxisAlignment.end, @@ -459,16 +515,19 @@ class PatientCard extends StatelessWidget { } class PatientStatus extends StatelessWidget { - PatientStatus({ - Key key, this.label, this.color, + PatientStatus({ + Key key, + this.label, + this.color, }) : super(key: key); - final String label;final Color color; + final String label; + final Color color; @override Widget build(BuildContext context) { return AppText( label, - color: color??AppGlobal.appGreenColor, + color: color ?? AppGlobal.appGreenColor, fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 10, diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index e08f625e..0c364474 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -37,6 +37,7 @@ class CustomRow extends StatelessWidget { fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, + letterSpacing: -0.48, isCopyable: isCopyable, ), ], diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 00000000..3f1537d3 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1249 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "12.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.40.7" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.1" + autocomplete_textfield: + dependency: "direct main" + description: + name: autocomplete_textfield + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.3" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + barcode_scan_fix: + dependency: "direct main" + description: + name: barcode_scan_fix + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + bazel_worker: + dependency: transitive + description: + name: bazel_worker + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.25" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.2" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.5" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.7" + build_modules: + dependency: transitive + description: + name: build_modules + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.3" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1+1" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.7" + build_web_compilers: + dependency: "direct dev" + description: + name: build_web_compilers + url: "https://pub.dartlang.org" + source: hosted + version: "2.12.2" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.2" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "7.1.0" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + chewie: + dependency: transitive + description: + name: chewie + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.10" + chewie_audio: + dependency: transitive + description: + name: chewie_audio + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0+1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.3" + connectivity: + dependency: "direct main" + description: + name: connectivity + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.9+5" + connectivity_for_web: + dependency: transitive + description: + name: connectivity_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.1+4" + connectivity_macos: + dependency: transitive + description: + name: connectivity_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+7" + connectivity_platform_interface: + dependency: transitive + description: + name: connectivity_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + css_colors: + dependency: transitive + description: + name: css_colors + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.10" + date_time_picker: + dependency: "direct main" + description: + name: date_time_picker + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + device_info: + dependency: "direct main" + description: + name: device_info + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2+10" + device_info_platform_interface: + dependency: transitive + description: + name: device_info_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + dropdown_search: + dependency: "direct main" + description: + name: dropdown_search + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.9" + equatable: + dependency: transitive + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.6" + eva_icons_flutter: + dependency: "direct main" + description: + name: eva_icons_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + expandable: + dependency: "direct main" + description: + name: expandable + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.4" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.1" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "7.3.3" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + url: "https://pub.dartlang.org" + source: hosted + version: "6.3.0" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.3" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + url: "https://pub.dartlang.org" + source: hosted + version: "7.0.3" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" + fl_chart: + dependency: "direct main" + description: + name: fl_chart + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.3" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + flutter_device_type: + dependency: "direct main" + description: + name: flutter_device_type + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + flutter_flexible_toast: + dependency: "direct main" + description: + name: flutter_flexible_toast + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + flutter_gifimage: + dependency: "direct main" + description: + name: flutter_gifimage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + flutter_inappwebview: + dependency: transitive + description: + name: flutter_inappwebview + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0+4" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.11" + flutter_staggered_grid_view: + dependency: "direct main" + description: + name: flutter_staggered_grid_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.4" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.18.1" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "8.12.0" + get_it: + dependency: "direct main" + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.4" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + hexcolor: + dependency: "direct main" + description: + name: hexcolor + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + hijri: + dependency: transitive + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + html: + dependency: "direct main" + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" + html_editor_enhanced: + dependency: "direct main" + description: + name: html_editor_enhanced + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http_interceptor: + dependency: "direct main" + description: + name: http_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.19" + imei_plugin: + dependency: "direct main" + description: + name: imei_plugin + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" + local_auth: + dependency: "direct main" + description: + name: local_auth + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3+4" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.4" + maps_launcher: + dependency: "direct main" + description: + name: maps_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.2+2" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + open_iconic_flutter: + dependency: transitive + description: + name: open_iconic_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.1" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1+1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.28" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+2" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+8" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+3" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.2" + percent_indicator: + dependency: "direct main" + description: + name: percent_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.9+1" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0+2" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.13" + progress_hud_v2: + dependency: "direct main" + description: + name: progress_hud_v2 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.4" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8" + quiver: + dependency: "direct main" + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.25.0" + scratch_space: + dependency: transitive + description: + name: scratch_space + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+3" + screen: + dependency: transitive + description: + name: screen + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.5" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.12+4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+4" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+11" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+7" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+3" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.9" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.4+1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.9" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.2" + speech_to_text: + dependency: "direct main" + description: + path: speech_to_text + relative: true + source: path + version: "0.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.2+4" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3+3" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.1" + sticky_headers: + dependency: "direct main" + description: + name: sticky_headers + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8+1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0+2" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.2" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+3" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.3" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.7.10" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+4" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+9" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.9" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5+3" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.2" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" + video_player: + dependency: transitive + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.12+5" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + video_player_web: + dependency: transitive + description: + name: video_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4+1" + wakelock: + dependency: transitive + description: + name: wakelock + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4+2" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7+15" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + webview_flutter: + dependency: transitive + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.24" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.4+1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "4.5.1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" +sdks: + dart: ">=2.10.2 <2.11.0" + flutter: ">=1.22.2 <2.0.0" From 5f2e0be78ce1723bc17db1411605ea16237af8e2 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 13:09:21 +0200 Subject: [PATCH 159/199] first step from home page. --- lib/config/config.dart | 3 +- .../home/dashboard_referral_patient.dart | 158 ++++++++++++ lib/screens/home/dashboard_swipe_widget.dart | 151 +----------- lib/screens/home/home_screen.dart | 22 +- lib/screens/home/label.dart | 43 ++++ .../subjective/history/priority_bar.dart | 2 +- lib/util/helpers.dart | 16 ++ lib/widgets/dashboard/out_patient_stack.dart | 233 +++++++++++++++--- lib/widgets/dashboard/row_count.dart | 9 +- 9 files changed, 449 insertions(+), 188 deletions(-) create mode 100644 lib/screens/home/dashboard_referral_patient.dart create mode 100644 lib/screens/home/label.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 4c5374ae..03c74f52 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -455,6 +455,7 @@ const TIMER_MIN = 10; class AppGlobal { static var CONTEX; - static Color appPrimaryColor = Color(0xFFB9382C); + static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); + static Color appTextColor = Color(0xFF2B353E); } diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart new file mode 100644 index 00000000..6a0bcf4b --- /dev/null +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -0,0 +1,158 @@ +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'; + +import 'label.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: false, + 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: [ + 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), + secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 7 + : 12), + ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 10 + : 5)) + ], + ), + ), + 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 * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + 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; + } +} diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 66261292..bcd7864c 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -12,6 +12,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'dashboard_referral_patient.dart'; + class DashboardSwipeWidget extends StatefulWidget { final List dashboardItemList; final DashboardViewModel model; @@ -28,8 +30,11 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { + double height = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31); + return Container( - height: MediaQuery.of(context).size.height * 0.35, + height: height, // height: 230, child: Swiper( onIndexChanged: (index) { @@ -41,7 +46,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, @@ -84,146 +89,14 @@ 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, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - 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]))); + return GetOutPatientStack(dashboardItemList[1]); if (index == 0) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: GetOutPatientStack(dashboardItemList[0]))); + return GetOutPatientStack(dashboardItemList[0]); if (index == 2) - return RoundedContainer( - raduis: 16, - showBorder: false, - borderColor: Colors.white, - shadowWidth: 0.1, - shadowSpreadRadius: 2, - shadowDy: 1, - margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: Row( - 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: 12, - fontWeight: FontWeight.bold, - fontHeight: 0.5, - ), - AppText( - TranslationBase.of(context) - .referral, - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ], - )), - 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), - ), - ], - ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - 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: MediaQuery.of(context).size.height * 0.13, - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); + return Container(); } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 62988caa..281c70e9 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,3 +1,4 @@ +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'; @@ -102,7 +103,8 @@ class _HomeScreenState extends State { DropdownButtonHideUnderline( child: DropdownButton( dropdownColor: Colors.white, - iconEnabledColor: Colors.black, + iconEnabledColor: AppGlobal.appTextColor, + icon: Icon(Icons.keyboard_arrow_down), isExpanded: true, value: clinicId == null ? projectsProvider @@ -127,13 +129,13 @@ class _HomeScreenState extends State { children: [ Container( padding: - EdgeInsets.all(2), + EdgeInsets.all(0), margin: EdgeInsets.all(2), decoration: new BoxDecoration( color: - Colors.red[800], + AppGlobal.appRedColor, borderRadius: BorderRadius .circular( @@ -152,11 +154,13 @@ class _HomeScreenState extends State { .toString(), color: Colors.white, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, fontSize: projectsProvider .isArabic ? 10 - : 11, + : 12, textAlign: TextAlign .center, @@ -165,8 +169,9 @@ class _HomeScreenState extends State { ], ), AppText(item.clinicName, - fontSize: 12, - color: Colors.black, + fontSize: 14, + letterSpacing: -0.96, + color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end), @@ -194,6 +199,11 @@ class _HomeScreenState extends State { return DropdownMenuItem( child: AppText( item.clinicName, + fontSize: 14, + letterSpacing: -0.96, + color: AppGlobal.appTextColor, + fontWeight: + FontWeight.bold, textAlign: TextAlign.left, ), value: item.clinicID, diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart new file mode 100644 index 00000000..0d316652 --- /dev/null +++ b/lib/screens/home/label.dart @@ -0,0 +1,43 @@ +// 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'; + +class Label extends StatelessWidget { + Label({ + Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + }) : super(key: key); + final String firstLine; + final String secondLine; + Color color; + final double secondLineFontSize; + final double firstLineFontSize; + + @override + Widget build(BuildContext context) { + + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstLine, + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + // fontWeight: FontWeight.bold, + color: color, + fontHeight: .5, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + ), + AppText( + secondLine, + color: color, + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index 305b0c65..57698f56 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -76,7 +76,7 @@ class _PriorityBarState extends State { ), ), if(_isActive) - Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) + Container(width: 120,height: 4,color: AppGlobal.appRedColor,) ], ), ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 17e75ba9..86a09468 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -313,4 +313,20 @@ class Helpers { ? 8 : 6); } + + static getLabelFromKPI(String kpi) { + if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1) + return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")")); + else + return ''; + } + + static getNameFromKPI(String kpi) { + if (kpi.indexOf("(") > -1) + return kpi.substring(0, kpi.indexOf("(")); + else + return kpi; + } + + } diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fe05d69d..d7042eb7 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,4 +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/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -9,42 +11,151 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { + + double barHeight = + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); + value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + 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))}); - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - height: 30, - child: AppText( - value.kPIName, - medium: true, - fontSize: 14, - ), + {list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))}); + return Container( + margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), + decoration: BoxDecoration( + + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + bottomLeft: Radius.circular(20), + bottomRight: Radius.circular(20) ), - Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) - ], + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 0, + blurRadius: 9, + offset: Offset(0, 0), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: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), + firstLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 10 + : SizeConfig.isHeightShort + ? 10 + : 8.5), + secondLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 15 + : SizeConfig.isHeightShort + ? 15 + : 14.5), + ), + ), + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) + ], + ) + + ), ); } - getStack(Summaryoptions value, max,context) { + // getStack(Summaryoptions value, max,context) { + // return Expanded( + // child: Container( + // margin: EdgeInsets.symmetric(horizontal: 2), + // decoration: BoxDecoration( + // gradient: LinearGradient( + // begin: Alignment.topLeft, + // end: Alignment( + // 0.0, 1.0), // 10% of the width, so there are ten blinds. + // colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + // tileMode: TileMode.mirror, // repeats the gradient over the canvas + // ), + // borderRadius: BorderRadius.circular(8), + // // color: Colors.red[50], + // ), + // child: Stack(children: [ + // Positioned( + // bottom: 0, + // left: 0, + // right: 0, + // child: Container( + // child: SizedBox(), + // padding: EdgeInsets.all(10), + // height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(8), + // color: Color(0x63D02127), + // ), + // ), + // ), + // Container( + // height: (MediaQuery.of(context).size.height * 0.24 ), + // margin: EdgeInsets.only(left: 5, top: 5), + // padding: EdgeInsets.all(10), + // child: RotatedBox( + // quarterTurns: 3, + // child: Center( + // child: Align( + // child: FittedBox( + // child: Row( + // children: [ + // AppText( + // value.kPIParameter, + // fontSize: 10, + // textAlign: TextAlign.center, + // color: Color(0xFF2B353E), + // fontWeight: FontWeight.w700, + // ), + // AppText( + // ' (' + value.value.toString() + ') ', + // fontSize: 12, + // textAlign: TextAlign.center, + // color: Color(0xFF2B353E), + // fontWeight: FontWeight.bold, + // ), + // ], + // ), + // )), + // ), + // )) + // ]), + // ), + // ); + // } + + + getStack(Summaryoptions value, max, context, barHeight) { return Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, - end: Alignment( - 0.0, 1.0), // 10% of the width, so there are ten blinds. + end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. 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: [ @@ -55,15 +166,15 @@ 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), + borderRadius: BorderRadius.circular(4), color: Color(0x63D02127), ), ), ), Container( - height: (MediaQuery.of(context).size.height * 0.24 ), + height: barHeight, margin: EdgeInsets.only(left: 5, top: 5), padding: EdgeInsets.all(10), child: RotatedBox( @@ -71,29 +182,73 @@ class GetOutPatientStack extends StatelessWidget { child: Center( child: Align( child: FittedBox( - child: Row( - children: [ - AppText( - value.kPIParameter, - fontSize: 10, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - AppText( - ' (' + value.value.toString() + ') ', - fontSize: 12, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, + child: Row( + children: [ + AppText( + value.kPIParameter, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + letterSpacing: -0.3, + ), + AppText( + ' (' + value.value.toString() + ') ', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + letterSpacing: -0.3, + fontWeight: FontWeight.bold, + ), + ], ), - ], - ), - )), + )), ), )) ]), ), ); } + +} + + +// ignore: must_be_immutable +class Label extends StatelessWidget { + Label({ + Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + }) : super(key: key); + final String firstLine; + final String secondLine; + Color color; + final double secondLineFontSize; + final double firstLineFontSize; + + @override + Widget build(BuildContext context) { + + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + firstLine, + fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + // fontWeight: FontWeight.bold, + color: color, + fontHeight: .5, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + ), + AppText( + secondLine, + color: color, + fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + + ), + ], + ); + } } diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index a22932f4..bf39ed27 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'; @@ -5,11 +6,15 @@ class RowCounts extends StatelessWidget { final name; final int count; final Color c; - RowCounts(this.name, this.count, this.c); + final double height; + + + 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: [ From fedb4533c7f0d0b0a439bb082b7fae015e29f2d7 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 14:00:17 +0200 Subject: [PATCH 160/199] second step from home page. --- .../home/dashboard_referral_patient.dart | 220 +++++++++--------- .../home/dashboard_slider-item-widget.dart | 31 ++- lib/screens/home/home_screen.dart | 24 +- lib/widgets/dashboard/activity_button.dart | 57 +++-- lib/widgets/dashboard/out_patient_stack.dart | 64 ----- 5 files changed, 176 insertions(+), 220 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 6a0bcf4b..e616f1ca 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -19,116 +19,128 @@ class DashboardReferralPatient extends StatelessWidget { const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); @override Widget build(BuildContext context) { - return RoundedContainer( - raduis: 16, - showBorder: false, - 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: [ - 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), - secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + return Container( + margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), + decoration: BoxDecoration( + + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + bottomLeft: Radius.circular(20), + bottomRight: Radius.circular(20) + ), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 0, + blurRadius: 9, + offset: Offset(0, 0), // changes position of shadow + ), + ], + ), + 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: [ + 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), + secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * + (SizeConfig.isHeightVeryShort? + 5 + : SizeConfig.isHeightShort? + 7 + : 12), + ), + SizedBox( + height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort? 5 : SizeConfig.isHeightShort? - 7 - : 12), - ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort? - 5 - : SizeConfig.isHeightShort? - 10 - : 5)) - ], - ), + 10 + : 5)) + ], ), - 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: 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, ) ], - )), - ), - 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 * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), - left: 0, - right: 0) - ]), - ), - ], - )), - ])); + ), + top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + left: 0, + right: 0) + ]), + ), + ], + )), + ]), + ); } static List> _createReferralData(List dashboardItemList) { diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 4b7c4f46..9005b816 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,9 +1,12 @@ 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_button.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; @@ -11,27 +14,37 @@ class DashboardSliderItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( + return Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - item.kPIName, - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, + Container( + margin: EdgeInsets.symmetric(horizontal: SizeConfig.widthMultiplier *1), + + child: Label( + firstLine: Helpers.getLabelFromKPI(item.kPIName), + secondLine: Helpers.getNameFromKPI(item.kPIName), + ), ), ], ), new Container( - height: 110, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, - children: - List.generate(item.summaryoptions.length, (int index) { - return GetActivityButton(item.summaryoptions[index]); + children: List.generate(item.summaryoptions.length, (int index) { + return GetActivityCard(item.summaryoptions[index]); }))) ], ); + } } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 281c70e9..508bfe88 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -34,6 +34,7 @@ import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; +import 'label.dart'; class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -284,24 +285,11 @@ class _HomeScreenState extends State { SizedBox( height: 10, ), - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patients, - fontSize: 12, - fontWeight: FontWeight.bold, - fontHeight: .5, - ), - AppText( - TranslationBase.of(context).services, - fontSize: 22, - fontWeight: FontWeight.bold, - ), - ], - )), + + Label( + firstLine: TranslationBase.of(context).patients, + secondLine: TranslationBase.of(context).services, + ), SizedBox( height: 10, ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index ff9db962..5e3cda68 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -1,42 +1,49 @@ +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) { + double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13); return Container( - width: MediaQuery.of(context).size.height * 0.125, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), + width: width, + padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), decoration: BoxDecoration( color: Colors.white, + border: Border.all(width: 1, color: Color(0xFFEFEFEF)), borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - value.value.toString(), - fontSize: 27, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: 10, - color: Color(0xFF2B353E), - textAlign: TextAlign.start, - fontWeight: FontWeight.w700, - ), - ], + padding: const EdgeInsets.fromLTRB(8,8, 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), + letterSpacing: -0.93, + ), + AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), + 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 d7042eb7..fb67d954 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -78,70 +78,6 @@ class GetOutPatientStack extends StatelessWidget { ); } - // getStack(Summaryoptions value, max,context) { - // return Expanded( - // child: Container( - // margin: EdgeInsets.symmetric(horizontal: 2), - // decoration: BoxDecoration( - // gradient: LinearGradient( - // begin: Alignment.topLeft, - // end: Alignment( - // 0.0, 1.0), // 10% of the width, so there are ten blinds. - // colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow - // tileMode: TileMode.mirror, // repeats the gradient over the canvas - // ), - // borderRadius: BorderRadius.circular(8), - // // color: Colors.red[50], - // ), - // child: Stack(children: [ - // Positioned( - // bottom: 0, - // left: 0, - // right: 0, - // child: Container( - // child: SizedBox(), - // padding: EdgeInsets.all(10), - // height: max != 0 ? ((MediaQuery.of(context).size.height * 0.24 )* value.value) / max : 0, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(8), - // color: Color(0x63D02127), - // ), - // ), - // ), - // Container( - // height: (MediaQuery.of(context).size.height * 0.24 ), - // margin: EdgeInsets.only(left: 5, top: 5), - // padding: EdgeInsets.all(10), - // child: RotatedBox( - // quarterTurns: 3, - // child: Center( - // child: Align( - // child: FittedBox( - // child: Row( - // children: [ - // AppText( - // value.kPIParameter, - // fontSize: 10, - // textAlign: TextAlign.center, - // color: Color(0xFF2B353E), - // fontWeight: FontWeight.w700, - // ), - // AppText( - // ' (' + value.value.toString() + ') ', - // fontSize: 12, - // textAlign: TextAlign.center, - // color: Color(0xFF2B353E), - // fontWeight: FontWeight.bold, - // ), - // ], - // ), - // )), - // ), - // )) - // ]), - // ), - // ); - // } getStack(Summaryoptions value, max, context, barHeight) { From ecffe99f1902e54e0db94592b97f1309c805c781 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 14:28:57 +0200 Subject: [PATCH 161/199] small fixes --- lib/screens/home/home_page_card.dart | 35 +++++------ lib/screens/home/home_patient_card.dart | 70 ++++++++++++---------- lib/screens/home/home_screen.dart | 8 +-- lib/widgets/dashboard/activity_button.dart | 7 ++- 4 files changed, 61 insertions(+), 59 deletions(-) diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 503bbe60..df4ae48f 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -4,36 +4,34 @@ import 'package:hexcolor/hexcolor.dart'; class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.color, - this.opacity = 0.4, - this.margin}) + this.imageName, + this.child, + this.onTap, + Key key, + this.color, + this.opacity = 0.4, + this.margin, this.width}) : super(key: key); final bool hasBorder; final String imageName; final Widget child; - final Function onTap; + final GestureTapCallback 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: 120, - height: MediaQuery.of(context).orientation == Orientation.portrait - ? 100 - : 200, + width: width, margin: this.margin, decoration: BoxDecoration( color: !hasBorder ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(17.0), border: hasBorder @@ -41,11 +39,10 @@ class HomePageCard extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/$imageName'), - fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), - ) + image: AssetImage('assets/images/dashboard/$imageName'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) : null, ), child: child, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index a0d0bce7..06ef380f 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -10,25 +10,28 @@ class HomePatientCard extends StatelessWidget { final Color backgroundIconColor; final String text; final Color textColor; - final Function onTap; + final VoidCallback onTap; final double iconSize; HomePatientCard({ - @required this.backgroundColor, - @required this.backgroundIconColor, - this.cardIcon, + this.backgroundColor, + this.backgroundIconColor, + this.cardIcon, this.cardIconImage, - @required this.text, - @required this.textColor, - @required this.onTap, - this.iconSize = 30, + this.text, + this.textColor, + this.onTap, + this.iconSize = 30, }); @override Widget build(BuildContext context) { + double width = SizeConfig.heightMultiplier* + (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( color: backgroundColor, - margin: EdgeInsets.all(4), + width: width, + margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -43,21 +46,21 @@ class HomePatientCard extends StatelessWidget { color: Colors.transparent, child: cardIcon != null ? Icon( - cardIcon, - size: iconSize * 2, - color: backgroundIconColor, - ) + cardIcon, + size: iconSize * 2, + color: backgroundIconColor, + ) : IconButton( - icon: Image.asset( - 'assets/images/patient_register.png', - width: iconSize * 2, - height: iconSize * 2, - fit: BoxFit.fill, - ), - iconSize: iconSize * 2, - color: backgroundIconColor, - onPressed: () => null, - ), + icon: Image.asset( + 'assets/images/patient_register.png', + width: iconSize * 2, + height: iconSize * 2, + fit: BoxFit.fill, + ), + iconSize: iconSize * 2, + color: backgroundIconColor, + onPressed: () => null, + ), ), Container( child: Column( @@ -66,15 +69,16 @@ class HomePatientCard extends StatelessWidget { children: [ cardIcon != null ? Icon( - cardIcon, - size: iconSize, - color: textColor, - ) + cardIcon, + size: + SizeConfig.getWidthMultiplier(width: width) * 30, + color: textColor, + ) : Image.asset( - cardIconImage, - height: iconSize, - width: iconSize, - ), + cardIconImage, + height: iconSize, + width: iconSize, + ), SizedBox( height: 4, ), @@ -90,7 +94,9 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, - fontSize: SizeConfig.textMultiplier * 1.6, + 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 508bfe88..f5b62368 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -290,9 +290,7 @@ class _HomeScreenState extends State { firstLine: TranslationBase.of(context).patients, secondLine: TranslationBase.of(context).services, ), - SizedBox( - height: 10, - ), + Container( height: 120, child: ListView( @@ -322,9 +320,9 @@ class _HomeScreenState extends State { colorIndex = 0; List backgroundColors = List(3); - backgroundColors[0] = Color(0xffD02127); + backgroundColors[0] = AppGlobal.appRedColor; backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xff2B353E); + backgroundColors[2] = Color(0xFF2B353E); List backgroundIconColors = List(3); backgroundIconColors[0] = Colors.white12; backgroundIconColors[1] = Colors.white38; diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index 5e3cda68..f00acef4 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; 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'; @@ -30,16 +31,16 @@ class GetActivityCard extends StatelessWidget { value.value.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), + color: AppGlobal.appTextColor, letterSpacing: -0.93, ), AppText( value.kPIParameter, textOverflow: TextOverflow.clip, fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), - color: Color(0xFF2B353E), + color: AppGlobal.appTextColor, textAlign: TextAlign.start, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, letterSpacing: -0.33, ), ], From 67a5bcff91c1b0758b258d01a7ebfdea7081cea1 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 7 Dec 2021 14:43:35 +0200 Subject: [PATCH 162/199] patient header & app drawer desigining --- .../medicine/medicine_search_screen.dart | 6 +- .../patients/In_patient/InPatientHeader.dart | 138 +++++++++--------- .../patient_search/patient_search_header.dart | 13 +- lib/widgets/shared/app_drawer_widget.dart | 114 ++++++++------- lib/widgets/shared/app_texts_widget.dart | 51 +++++-- lib/widgets/shared/drawer_item_widget.dart | 22 +-- 6 files changed, 198 insertions(+), 146 deletions(-) diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 6ebb2fc8..4998e99c 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/search_drug/get_medication_respons import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.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'; @@ -124,7 +125,10 @@ class _MedicineSearchState extends State { return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchMedicine, + appBar: PatientSearchHeader( + title: TranslationBase.of(context).searchMedicine, + ), + //appBarTitle: TranslationBase.of(context).searchMedicine + "6", body: SingleChildScrollView( child: FractionallySizedBox( widthFactor: 0.97, diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index f2d0f74e..16083b84 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -37,15 +37,16 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget { 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( child: AppText( TranslationBase.of(context).inPatient, - fontSize: SizeConfig.textMultiplier * 2.8, - fontWeight: FontWeight.bold, + fontSize: 24.0, + fontWeight: FontWeight.w700, color: Color(0xFF2B353E), + letterSpacing: -1.44, ), ), if (model.specialClinicalCareMappingList.isNotEmpty && @@ -53,71 +54,72 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget { activeTab != 2) Container( width: MediaQuery.of(context).size.width * .3, - child - : DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedMapId??model.specialClinicalCareMappingList[0].nursingStationID, - 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(selectedMapId == null?TranslationBase.of(context).all:item.description, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (newValue) async { - onChangeFunc(newValue); - }, - items: model.specialClinicalCareMappingList.map((item) { - return DropdownMenuItem( - child: AppText( - item.description, - textAlign: TextAlign.left, - ), - value: item.nursingStationID, - ); - }).toList(), - )), + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedMapId ?? + model.specialClinicalCareMappingList[0].nursingStationID, + 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( + selectedMapId == null + ? TranslationBase.of(context).all + : item.description, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + onChangeFunc(newValue); + }, + items: model.specialClinicalCareMappingList.map((item) { + return DropdownMenuItem( + child: AppText( + item.description, + textAlign: TextAlign.left, + ), + value: item.nursingStationID, + ); + }).toList(), + )), ), ]), ), diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index 7df6905f..2dd01e1a 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -9,27 +9,28 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { @override Widget build(BuildContext context) { - return Container( + return Container( padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + padding: EdgeInsets.only(left: 10, right: 10, bottom: 5), margin: EdgeInsets.only(top: 35), 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( child: AppText( title, - fontSize: SizeConfig.textMultiplier * 2.8, - fontWeight: FontWeight.bold, + fontSize: 24.0, + fontWeight: FontWeight.w700, color: Color(0xFF2B353E), fontFamily: 'Poppins', + letterSpacing: -1.44, ), ), ]), @@ -38,5 +39,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { } @override - Size get preferredSize => Size(double.maxFinite,65); + Size get preferredSize => Size(double.maxFinite, 65); } diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 49f7d4e8..bf2baef5 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -17,7 +17,6 @@ import 'app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - class AppDrawer extends StatefulWidget { @override _AppDrawerState createState() => _AppDrawerState(); @@ -37,7 +36,7 @@ class _AppDrawerState extends State { child: Drawer( child: Column(children: [ Expanded( - flex: 4, + flex: 7, child: ListView(padding: EdgeInsets.zero, children: [ Container( margin: EdgeInsets.symmetric(horizontal: 15), @@ -50,6 +49,8 @@ class _AppDrawerState extends State { Container( child: Image.asset( 'assets/images/dr_app_logo.png', + width: MediaQuery.of(context).size.width * 0.16, + height: MediaQuery.of(context).size.height * 0.16, ), margin: EdgeInsets.only(top: 10, bottom: 10), ), @@ -61,6 +62,7 @@ class _AppDrawerState extends State { child: Icon( DoctorApp.close_1, size: 20, + color: Color(0xff2B353E), ), ), margin: EdgeInsets.only(top: 20, bottom: 10), @@ -83,24 +85,29 @@ class _AppDrawerState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only(top: 10), + padding: EdgeInsets.only(top: 8.0), child: AppText( TranslationBase.of(context).dr + - authenticationViewModel.doctorProfile?.doctorName, - fontWeight: FontWeight.bold, + authenticationViewModel + .doctorProfile?.doctorName, + fontWeight: FontWeight.w700, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontSize: 17, + fontSize: 25.0, + letterSpacing: -1.5, ), ), Padding( padding: EdgeInsets.only(top: 0), child: AppText( - authenticationViewModel.doctorProfile?.clinicDescription, - fontWeight: FontWeight.w600, + authenticationViewModel + .doctorProfile?.clinicDescription, + fontWeight: FontWeight.w500, color: Color(0xFF2E303A), - fontSize: 15, + fontSize: 16, fontFamily: 'Poppins', + letterSpacing: -0.96, + //textAlign: TextAlign.left, )) ], ), @@ -110,6 +117,7 @@ class _AppDrawerState extends State { child: DrawerItem( TranslationBase.of(context).applyOrRescheduleLeave, icon: DoctorApp.reschedule__1, + // subTitle: , ), onTap: () { @@ -117,10 +125,11 @@ class _AppDrawerState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - settings: RouteSettings(name: 'AddRescheduleLeaveScreen') - // MyReferredPatient(), - )); + builder: (context) => AddRescheduleLeavScreen(), + settings: RouteSettings( + name: 'AddRescheduleLeaveScreen') + // MyReferredPatient(), + )); }, ), SizedBox(height: 15), @@ -131,10 +140,11 @@ class _AppDrawerState extends State { // subTitle: , ), ), - SizedBox(height: 15), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), InkWell( child: Container( - height: 80, + height: MediaQuery.of(context).size.height * 0.16, + width: MediaQuery.of(context).size.width * 0.16, child: Image.asset('assets/images/qr_code.png'), ), onTap: () {}, @@ -143,7 +153,7 @@ class _AppDrawerState extends State { ), ), SizedBox( - height: MediaQuery.of(context).size.height * 0.09, + height: MediaQuery.of(context).size.height * 0.02, ), Container( margin: EdgeInsets.symmetric(horizontal: 20), @@ -174,8 +184,8 @@ class _AppDrawerState extends State { ), onTap: () async { Navigator.pop(context); - await authenticationViewModel.logout(isFromLogin: false); - + await authenticationViewModel.logout( + isFromLogin: false); }, ), ], @@ -191,38 +201,44 @@ class _AppDrawerState extends State { child: Align( alignment: FractionalOffset.bottomCenter, child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.3, - child: RichText( - text: TextSpan( - text: 'Powered by', - style: TextStyle( - color: Color(0xFF989898), - fontWeight: FontWeight.bold, - fontSize: 14, - fontFamily: 'Poppins', - ), - children: [ - TextSpan( - text: ' Cloud Solutions', - style: TextStyle( - color: Color(0xFF2E303A), - fontSize: 15, - fontFamily: 'Poppins', - ), - ) - ]), + child: Padding( + padding: EdgeInsets.only( + left: projectsProvider.isArabic ? 0 : 15.0, + right: projectsProvider.isArabic ? 15.0 : 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.3, + child: RichText( + text: TextSpan( + text: 'Powered by', + style: TextStyle( + color: Color(0xFF989898), + fontWeight: FontWeight.w600, + fontSize: 14, + fontFamily: 'Poppins', + letterSpacing: -0.56, + ), + children: [ + TextSpan( + text: ' Cloud Solutions', + style: TextStyle( + color: Color(0xFF2E303A), + fontSize: 14, + fontFamily: 'Poppins', + letterSpacing: -0.56, + fontWeight: FontWeight.w700), + ) + ]), + ), ), - ), - // Text("Powered by"), - Image.asset( - 'assets/images/cs_logo_container.png', - width: SizeConfig.imageSizeMultiplier * 20, - ) - ], + // Text("Powered by"), + Image.asset('assets/images/cs_logo_container.png', + width: + MediaQuery.of(context).size.width * 0.13) + ], + ), )))) ])) ])), diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 56a503a8..f612e9e0 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -103,7 +103,10 @@ class _AppTextState extends State { margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only( - top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), + top: widget.marginTop, + right: widget.marginRight, + bottom: widget.marginBottom, + left: widget.marginLeft), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -118,16 +121,21 @@ class _AppTextState extends State { right: 0, child: Container( decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), + gradient: LinearGradient( + colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), + ], + begin: Alignment.bottomCenter, + end: Alignment.topCenter)), height: 30, ), ) ], ), - if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) + if (widget.allowExpand && + widget.readMore && + text.length > widget.maxLength) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -164,7 +172,13 @@ class _AppTextState extends State { ), child: Container( child: SelectableText( - !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + !hidden + ? text + : (text.substring( + 0, + text.length > widget.maxLength + ? widget.maxLength + : text.length)), textAlign: widget.textAlign, // overflow: widget.maxLines != null // ? ((widget.maxLines > 1) @@ -180,9 +194,11 @@ class _AppTextState extends State { height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color != null ? widget.color : Colors.black, + color: + widget.color != null ? widget.color : Color(0xff2E303A), fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), + letterSpacing: widget.letterSpacing ?? + (widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, @@ -192,9 +208,19 @@ class _AppTextState extends State { ); } else { return Text( - !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + !hidden + ? text + : (text.substring( + 0, + text.length > widget.maxLength + ? widget.maxLength + : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + overflow: widget.maxLines != null + ? ((widget.maxLines > 1) + ? TextOverflow.fade + : TextOverflow.ellipsis) + : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( @@ -206,7 +232,8 @@ class _AppTextState extends State { fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), + letterSpacing: widget.letterSpacing ?? + (widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 2b8ce40d..46497e17 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -12,7 +12,8 @@ class DrawerItem extends StatefulWidget { final Color color; final String assetLink; - DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); + DrawerItem(this.title, + {this.icon, this.color, this.subTitle = '', this.assetLink}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -26,33 +27,34 @@ class _DrawerItemState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(widget.assetLink!=null) + if (widget.assetLink != null) Container( height: 20, width: 20, child: Image.asset(widget.assetLink), ), - if(widget.assetLink==null) - Icon( - widget.icon, - color: widget.color ?? Colors.black87, - size: SizeConfig.imageSizeMultiplier * 5, - ), + if (widget.assetLink == null) + Icon( + widget.icon, + color: widget.color ?? Colors.black87, + size: SizeConfig.imageSizeMultiplier * 5, + ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width *0.45, + width: MediaQuery.of(context).size.width * 0.45, child: AppText( widget.title, marginLeft: 5, marginRight: 5, - color:widget.color ??Color(0xFF2E303A), + color: widget.color ?? Color(0xFF2E303A), fontSize: 14, fontFamily: 'Poppins', fontWeight: FontWeight.w600, + letterSpacing: -0.84, ), ), ], From 2b763e954a11a54bafd303bbf1a69e6d8b0af4e4 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 7 Dec 2021 15:47:06 +0200 Subject: [PATCH 163/199] bottom_sheet_title design fix --- .../add_patient_sick_leave_screen.dart | 473 +++++++++--------- .../bottom_sheet_title.dart | 31 +- .../prescription/add_prescription_form.dart | 454 ++++++++++++----- pubspec.lock | 8 +- 4 files changed, 575 insertions(+), 391 deletions(-) diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 439c9e26..68e29870 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -36,9 +36,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget { final SickLeaveViewModel previousModel; AddPatientSickLeaveScreen( - {this.appointmentNo, - this.patientMRN, - this.patient, this.previousModel}); + {this.appointmentNo, this.patientMRN, this.patient, this.previousModel}); @override _AddPatientSickLeaveScreenState createState() => @@ -59,9 +57,9 @@ class _AddPatientSickLeaveScreenState extends State { void _presentDatePicker() { showDatePicker( context: context, - initialDate: currentDate??DateTime.now(), - firstDate: DateTime(DateTime.now().year-1), - lastDate: DateTime(DateTime.now().year+1), + initialDate: currentDate ?? DateTime.now(), + firstDate: DateTime(DateTime.now().year - 1), + lastDate: DateTime(DateTime.now().year + 1), ).then((pickedDate) { if (pickedDate == null) { return; @@ -70,7 +68,9 @@ class _AddPatientSickLeaveScreenState extends State { final df = new DateFormat('yyyy-MM-dd'); addSickLeave.startDate = df.format(pickedDate); currentDate = pickedDate; - _toDateController.text = AppDateUtils.getDayMonthYearDateFormatted(pickedDate,isMonthShort: true ); + _toDateController.text = AppDateUtils.getDayMonthYearDateFormatted( + pickedDate, + isMonthShort: true); }); }); } @@ -91,256 +91,251 @@ class _AddPatientSickLeaveScreenState extends State { widget.appointmentNo, widget.patientMRN); }, builder: (_, model, w) => GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - baseViewModel: model, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addSickLeave, - ), - isShowAppBar: true, - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - SizedBox( - height: 30, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).sickLeave + - ' ' + - TranslationBase.of(context).days, - maxLines: 1, - minLines: 1, - dropDownColor: Colors.white, - isTextFieldHasSuffix: true, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - inputType:TextInputType.number, - controller: _numberOfDayController, - onChanged: (value) { - if(value.isNotEmpty) - setState(() { - addSickLeave.noOfDays = value; - }); - - }, - validationError: isFormSubmitted && - (addSickLeave.noOfDays == null) - ? TranslationBase.of(context) - .pleaseEnterNoOfDays - : null, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - onClick: () { - Helpers.hideKeyboard(context); - _presentDatePicker(); - }, - hintText: TranslationBase.of(context) - .sickLeaveDate, - enabled: false, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon(Icons.calendar_today)), - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - controller: _toDateController, - onChanged: (value) { - setState(() { - addSickLeave.startDate = value; - }); - - }, - validationError: isFormSubmitted && - (addSickLeave.startDate == null) - ? TranslationBase.of(context) - .pleaseEnterDate - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).clinic, - enabled: false, - maxLines: 1, - minLines: 1, - dropDownColor: Colors.white, - isTextFieldHasSuffix: true, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - controller: _clinicController, - onChanged: (value) {}, - ), - SizedBox( - height: 10, - ), - model.sickLeaveStatistics.recommendedSickLeaveDays!= - null - ? Row( - crossAxisAlignment: - CrossAxisAlignment.center, + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addSickLeave, + ), + isShowAppBar: true, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( children: [ SizedBox( - width: 10, + height: 30, ), - Icon( - DoctorApp.warning, - size: 20, - color: IN_PROGRESS_COLOR, + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).sickLeave + + ' ' + + TranslationBase.of(context).days, + maxLines: 1, + minLines: 1, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + inputType: TextInputType.number, + controller: _numberOfDayController, + onChanged: (value) { + if (value.isNotEmpty) + setState(() { + addSickLeave.noOfDays = value; + }); + }, + validationError: isFormSubmitted && + (addSickLeave.noOfDays == null) + ? TranslationBase.of(context) + .pleaseEnterNoOfDays + : null, ), SizedBox( - width: 10, + height: 10, ), - Expanded( - child: AppText( - model.sickLeaveStatistics.recommendedSickLeaveDays, - textAlign: TextAlign.start, - fontSize: 12, - color: IN_PROGRESS_COLOR, - ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: () { + Helpers.hideKeyboard(context); + _presentDatePicker(); + }, + hintText: + TranslationBase.of(context).sickLeaveDate, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + suffixIcon: + IconButton(icon: Icon(Icons.calendar_today)), + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + controller: _toDateController, + onChanged: (value) { + setState(() { + addSickLeave.startDate = value; + }); + }, + validationError: isFormSubmitted && + (addSickLeave.startDate == null) + ? TranslationBase.of(context).pleaseEnterDate + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).clinic, + enabled: false, + maxLines: 1, + minLines: 1, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + controller: _clinicController, + onChanged: (value) {}, + ), + SizedBox( + height: 10, + ), + model.sickLeaveStatistics + .recommendedSickLeaveDays != + null + ? Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + SizedBox( + width: 10, + ), + Icon( + DoctorApp.warning, + size: 20, + color: IN_PROGRESS_COLOR, + ), + SizedBox( + width: 10, + ), + Expanded( + child: AppText( + model.sickLeaveStatistics + .recommendedSickLeaveDays, + textAlign: TextAlign.start, + fontSize: 12, + color: IN_PROGRESS_COLOR, + ), + ), + ], + ) + : SizedBox( + height: 10, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).doctor, + enabled: false, + maxLines: 1, + minLines: 1, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + controller: _doctorController, + onChanged: (value) {}, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).remarks, + maxLines: 30, + minLines: 5, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + controller: _remarkController, + onChanged: (value) { + setState(() { + addSickLeave.remarks = value; + }); + }, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10) + + 20, ), ], - ) - : SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).doctor, - enabled: false, - maxLines: 1, - minLines: 1, - dropDownColor: Colors.white, - isTextFieldHasSuffix: true, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - controller: _doctorController, - onChanged: (value) {}, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).remarks, - maxLines: 30, - minLines: 5, - dropDownColor: Colors.white, - isTextFieldHasSuffix: true, - controller: _remarkController, - onChanged: (value) { - setState(() { - addSickLeave.remarks = value; - }); - }, ), - - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 10) +20, - ), - ], + ), ), ), - ), - ), - bottomSheet: model.state == ViewState.Busy || - model.state == ViewState.Busy - ? Container( - height: 0, - ) - : Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all( - color: HexColor('#707070'), width: 0), - ), - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 10), - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - FractionallySizedBox( - widthFactor: 0.9, - child: AppButton( - title: TranslationBase.of(context) - .addSickLeaverequest, - color: AppGlobal.appGreenColor, - onPressed: () async { - submitForm(model); - }), - ), - SizedBox( - height: 5, - ), - ], - ), - )), - )); + bottomSheet: model.state == ViewState.Busy || + model.state == ViewState.Busy + ? Container( + height: 0, + ) + : Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all( + color: HexColor('#707070'), width: 0), + ), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: AppButton( + title: TranslationBase.of(context) + .addSickLeaverequest, + color: AppGlobal.appGreenColor, + onPressed: () async { + submitForm(model); + }), + ), + SizedBox( + height: 5, + ), + ], + ), + )), + )); } submitForm(SickLeaveViewModel model) async { { - try { - setState(() { - isFormSubmitted = true; - }); - if (addSickLeave.noOfDays == null || - addSickLeave.startDate == null ) { - return; + try { + setState(() { + isFormSubmitted = true; + }); + if (addSickLeave.noOfDays == null || addSickLeave.startDate == null) { + return; + } else { + GifLoaderDialogUtils.showMyDialog(context); + addSickLeave.patientMRN = widget.patient.patientMRN.toString(); + addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); + await model.addSickLeave(addSickLeave); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); } else { - GifLoaderDialogUtils.showMyDialog(context); - addSickLeave.patientMRN = widget.patient.patientMRN.toString(); - addSickLeave.appointmentNo = - widget.patient.appointmentNo.toString(); - await model.addSickLeave(addSickLeave); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } else { - await widget.previousModel - .getSickLeaveForPatient(widget.patient, isLocalBusy: true); - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).replySuccessfully); - Navigator.of(context).pop(); - } - - GifLoaderDialogUtils.hideDialog(context); + await widget.previousModel + .getSickLeaveForPatient(widget.patient, isLocalBusy: true); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).replySuccessfully); + Navigator.of(context).pop(); } - } catch (err) { - print(err); - } + GifLoaderDialogUtils.hideDialog(context); + } + } catch (err) { + print(err); + } } } - } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index d6c19372..f5134c1c 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -2,13 +2,14 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:flutter/material.dart'; -class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { - BottomSheetTitle({ - Key key, this.title, +class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { + BottomSheetTitle({ + Key key, + this.title, }) : super(key: key); final String title; - double headerHeight = SizeConfig.heightMultiplier*15; + double headerHeight = SizeConfig.heightMultiplier * 15; @override Widget build(BuildContext context) { return Container( @@ -20,29 +21,25 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { height: headerHeight, child: Center( child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), - margin: EdgeInsets.only(top: headerHeight *0.5), + padding: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.only(top: headerHeight * 0.5), child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( - style: TextStyle( - fontSize:20, - color: Colors.black), + style: TextStyle(fontSize: 20, color: Colors.black), children: [ new TextSpan( - text: title, style: TextStyle( color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), + letterSpacing: -1.44, + fontSize: 24.0)), ], ), ), @@ -51,7 +48,7 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { Navigator.pop(context); }, child: Icon(DoctorApp.close_1, - size:SizeConfig.getTextMultiplierBasedOnWidth()*5, + size: SizeConfig.getTextMultiplierBasedOnWidth() * 5, color: Color(0xFF2B353E))) ], ), @@ -63,5 +60,5 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { } @override - Size get preferredSize => Size(double.maxFinite,headerHeight); + Size get preferredSize => Size(double.maxFinite, headerHeight); } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 9cd5121a..8c07afcf 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -37,7 +37,8 @@ import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; -addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { +addPrescriptionForm(context, PrescriptionViewModel model, + PatiantInformtion patient, prescription) { showModalBottomSheet( isScrollControlled: true, context: context, @@ -62,7 +63,8 @@ postPrescription( String icdCode, PatiantInformtion patient, String patientType}) async { - PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); + PostPrescriptionReqModel postProcedureReqModel = + new PostPrescriptionReqModel(); List prescriptionList = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -126,7 +128,8 @@ class _PrescriptionFormWidgetState extends State { DateTime selectedDate; int strengthChar; GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + GlobalKey key = + new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -170,7 +173,8 @@ class _PrescriptionFormWidgetState extends State { 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, @@ -213,7 +217,8 @@ class _PrescriptionFormWidgetState extends State { } 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; } @@ -259,13 +264,15 @@ class _PrescriptionFormWidgetState extends State { initialChildSize: 0.98, maxChildSize: 0.98, minChildSize: 0.9, - builder: (BuildContext context, ScrollController scrollController) { + builder: + (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.65, color: Color(0xffF8F8F8), child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), child: Column( children: [ Column( @@ -287,8 +294,11 @@ class _PrescriptionFormWidgetState extends State { widthFactor: 0.9, child: Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( onTap: () { @@ -296,7 +306,8 @@ class _PrescriptionFormWidgetState extends State { visbiltySearch = true; }, borderColor: Colors.white, - hintText: TranslationBase.of(context).searchMedicineNameHere, + hintText: TranslationBase.of(context) + .searchMedicineNameHere, controller: myController, onSaved: (value) {}, onFieldSubmitted: (value) { @@ -322,9 +333,12 @@ class _PrescriptionFormWidgetState extends State { children: [ // TODO change it secondary button and add loading AppButton( - title: TranslationBase.of(context).search, + title: TranslationBase.of( + context) + .search, onPressed: () async { - await searchMedicine(context, model); + await searchMedicine( + context, model); }, ), ], @@ -333,23 +347,44 @@ class _PrescriptionFormWidgetState extends State { ), if (myController.text != '') Container( - height: MediaQuery.of(context).size.height * 0.5, + height: MediaQuery.of(context) + .size + .height * + 0.5, child: ListView.builder( - padding: const EdgeInsets.only(top: 20), + padding: const EdgeInsets.only( + top: 20), scrollDirection: Axis.vertical, - itemCount: model.allMedicationList == null - ? 0 - : model.allMedicationList.length, - itemBuilder: (BuildContext context, int index) { + itemCount: + model.allMedicationList == + null + ? 0 + : model + .allMedicationList + .length, + itemBuilder: + (BuildContext context, + int index) { return InkWell( child: MedicineItemWidget( - label: model.allMedicationList[index].description), + label: model + .allMedicationList[ + index] + .description), onTap: () { - model.getItem(itemID: model.allMedicationList[index].itemId); - visbiltyPrescriptionForm = true; + model.getItem( + itemID: model + .allMedicationList[ + index] + .itemId); + visbiltyPrescriptionForm = + true; visbiltySearch = false; - _selectedMedication = model.allMedicationList[index]; - uom = _selectedMedication.uom; + _selectedMedication = + model.allMedicationList[ + index]; + uom = _selectedMedication + .uom; }, ); }, @@ -368,53 +403,68 @@ class _PrescriptionFormWidgetState extends State { child: Column( children: [ AppText( - _selectedMedication?.description ?? "", + _selectedMedication?.description ?? + "", bold: true, ), Container( child: Row( children: [ AppText( - TranslationBase.of(context).orderType, + TranslationBase.of(context) + .orderType, fontWeight: FontWeight.w600, ), Radio( - activeColor: Color(0xFFB9382C), + activeColor: + Color(0xFFB9382C), value: 1, groupValue: selectedType, onChanged: (value) { setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular), + Text(TranslationBase.of(context) + .regular), ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), Container( width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.35, + width: MediaQuery.of(context) + .size + .width * + 0.35, child: AppTextFieldCustom( - height: 40, - validationError: strengthError, + //height: 40, + validationError: + strengthError, hintText: 'Strength', isTextFieldHasSuffix: false, enabled: true, - controller: strengthController, + controller: + strengthController, onChanged: (String value) { setState(() { - strengthChar = value.length; + strengthChar = + value.length; }); if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).only5DigitsAllowedForStrength, + DrAppToastMsg + .showErrorToast( + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, ); } }, - inputType: TextInputType.numberWithOptions( + inputType: TextInputType + .numberWithOptions( decimal: true, ), ), @@ -423,15 +473,23 @@ class _PrescriptionFormWidgetState extends State { width: 5.0, ), PrescriptionTextFiled( - width: MediaQuery.of(context).size.width * 0.517, - element: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0] + width: MediaQuery.of(context) + .size + .width * + 0.510, + element: model + .itemMedicineListUnit + .length == + 1 + ? model + .itemMedicineListUnit[0] : units, elementError: unitError, keyName: 'description', keyId: 'parameterCode', - hintText: 'Select', - elementList: model.itemMedicineListUnit, + hintText: 'Unit', + elementList: model + .itemMedicineListUnit, okFunction: (selectedValue) { setState(() { units = selectedValue; @@ -442,10 +500,14 @@ class _PrescriptionFormWidgetState extends State { ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), PrescriptionTextFiled( - elementList: model.itemMedicineListRoute, - element: model.itemMedicineListRoute.length == 1 + elementList: + model.itemMedicineListRoute, + element: model.itemMedicineListRoute + .length == + 1 ? model.itemMedicineListRoute[0] : route, elementError: routeError, @@ -457,40 +519,58 @@ class _PrescriptionFormWidgetState extends State { route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route, + hintText: + TranslationBase.of(context) + .route, ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency, + hintText: + TranslationBase.of(context) + .frequency, elementError: frequencyError, element: frequency, - elementList: model.itemMedicineList, + elementList: + model.itemMedicineList, keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { setState(() { frequency = selectedValue; frequency['isDefault'] = true; - if (_selectedMedication != null && + if (_selectedMedication != + null && duration != null && frequency != null && - strengthController.text != null) { + strengthController.text != + null) { model.getBoxQuantity( - freq: frequency['parameterCode'], - duration: duration['id'], - itemCode: _selectedMedication.itemId, - strength: double.parse(strengthController.text)); + freq: frequency[ + 'parameterCode'], + duration: + duration['id'], + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text)); return; } }); }), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime, + hintText: + TranslationBase.of(context) + .doseTime, elementError: doseTimeError, element: doseTime, - elementList: model.medicationDoseTimeList, + elementList: + model.medicationDoseTimeList, keyId: 'id', keyName: 'nameEn', okFunction: (selectedValue) { @@ -498,8 +578,10 @@ class _PrescriptionFormWidgetState extends State { doseTime = selectedValue; }); }), - SizedBox(height: spaceBetweenTextFileds), - if (model.patientAssessmentList.isNotEmpty) + SizedBox( + height: spaceBetweenTextFileds), + if (model + .patientAssessmentList.isNotEmpty) Container( height: screenSize.height * 0.070, width: double.infinity, @@ -507,25 +589,49 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.29, + width: + MediaQuery.of(context) + .size + .width * + 0.29, child: TextField( - decoration: textFieldSelectorDecoration( - model.patientAssessmentList[0].icdCode10ID.toString(), - indication != null ? indication['name'] : null, - false), + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + indication != null + ? indication[ + 'name'] + : null, + false), enabled: true, readOnly: true, ), ), Container( - width: MediaQuery.of(context).size.width * 0.59, + width: + MediaQuery.of(context) + .size + .width * + 0.57, color: Colors.white, child: TextField( maxLines: 5, - decoration: textFieldSelectorDecoration( - model.patientAssessmentList[0].asciiDesc.toString(), - indication != null ? indication['name'] : null, - false), + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .asciiDesc + .toString(), + indication != null + ? indication[ + 'name'] + : null, + false), enabled: true, readOnly: true, ), @@ -533,47 +639,63 @@ class _PrescriptionFormWidgetState extends State { ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate(context, widget.model), + onTap: () => selectDate( + context, widget.model), child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: + textFieldSelectorDecoration( + TranslationBase.of( + context) + .date, + selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), PrescriptionTextFiled( element: duration, elementError: durationError, - hintText: TranslationBase.of(context).duration, - elementList: model.medicationDurationList, + hintText: + TranslationBase.of(context) + .duration, + elementList: + model.medicationDurationList, keyName: 'nameEn', keyId: 'id', okFunction: (selectedValue) { setState(() { duration = selectedValue; - if (_selectedMedication != null && + if (_selectedMedication != + null && duration != null && frequency != null && - strengthController.text != null) { + strengthController.text != + null) { model.getBoxQuantity( - freq: frequency['parameterCode'], + freq: frequency[ + 'parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, - strength: double.parse(strengthController.text), + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text), ); box = model.boxQuintity; @@ -582,38 +704,53 @@ class _PrescriptionFormWidgetState extends State { }); }, ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), Container( color: Colors.white, child: AppTextFieldCustom( hintText: "UOM", isTextFieldHasSuffix: false, - dropDownText: uom != null ? uom : null, + dropDownText: + uom != null ? uom : null, enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), Container( color: Colors.white, child: AppTextFieldCustom( - hintText: TranslationBase.of(context).boxQuantity, + hintText: + TranslationBase.of(context) + .boxQuantity, isTextFieldHasSuffix: false, - dropDownText: box != null ? model.boxQuintity.toString() : null, + dropDownText: box != null + ? model.boxQuintity.toString() + : null, enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), child: Stack( children: [ TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of(context).instruction, - controller: instructionController, + hintText: TranslationBase.of( + context) + .instruction, + controller: + instructionController, //keyboardType: TextInputType.number, ), Positioned( @@ -626,51 +763,77 @@ class _PrescriptionFormWidgetState extends State { size: 35, ), onPressed: () { - initSpeechState().then((value) => {onVoiceText()}); + initSpeechState().then( + (value) => + {onVoiceText()}); }, ), ), ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox( + height: spaceBetweenTextFileds), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of(context).addMedication, + title: TranslationBase.of( + context) + .addMedication, fontWeight: FontWeight.w600, onPressed: () async { - await locator().logEvent( - eventCategory: "Add Prescription Form", - eventAction: "Add Prescription", + await locator< + AnalyticsService>() + .logEvent( + eventCategory: + "Add Prescription Form", + eventAction: + "Add Prescription", ); if (duration != null && doseTime != null && frequency != null && selectedDate != null && - strengthController.text != "") { - if (_selectedMedication.isNarcotic == true) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context) - .narcoticMedicineCanOnlyBePrescribedFromVida); + strengthController + .text != + "") { + if (_selectedMedication + .isNarcotic == + true) { + DrAppToastMsg.showErrorToast( + TranslationBase.of( + context) + .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; } - if (double.parse(strengthController.text) > 1000.0) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); + if (double.parse( + strengthController + .text) > + 1000.0) { + DrAppToastMsg + .showErrorToast( + "1000 is the MAX for the strength"); return; } - if (double.parse(strengthController.text) < 0.0) { - DrAppToastMsg.showErrorToast("strength can't be zero"); + if (double.parse( + strengthController + .text) < + 0.0) { + DrAppToastMsg + .showErrorToast( + "strength can't be zero"); return; } - if (formKey.currentState.validate()) { + if (formKey.currentState + .validate()) { Navigator.pop(context); openDrugToDrug(model); { @@ -759,32 +922,52 @@ class _PrescriptionFormWidgetState extends State { } else { setState(() { if (duration == null) { - durationError = TranslationBase.of(context).fieldRequired; + durationError = + TranslationBase.of( + context) + .fieldRequired; } else { durationError = null; } if (doseTime == null) { - doseTimeError = TranslationBase.of(context).fieldRequired; + doseTimeError = + TranslationBase.of( + context) + .fieldRequired; } else { doseTimeError = null; } if (route == null) { - routeError = TranslationBase.of(context).fieldRequired; + routeError = + TranslationBase.of( + context) + .fieldRequired; } else { routeError = null; } if (frequency == null) { - frequencyError = TranslationBase.of(context).fieldRequired; + frequencyError = + TranslationBase.of( + context) + .fieldRequired; } else { frequencyError = null; } if (units == null) { - unitError = TranslationBase.of(context).fieldRequired; + unitError = + TranslationBase.of( + context) + .fieldRequired; } else { unitError = null; } - if (strengthController.text == "") { - strengthError = TranslationBase.of(context).fieldRequired; + if (strengthController + .text == + "") { + strengthError = + TranslationBase.of( + context) + .fieldRequired; } else { strengthError = null; } @@ -834,7 +1017,8 @@ class _PrescriptionFormWidgetState extends State { } } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -885,7 +1069,9 @@ class _PrescriptionFormWidgetState extends State { child: Column( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - DrugToDrug(widget.patient, getPriscriptionforDrug(widget.prescriptionList, model), + DrugToDrug( + widget.patient, + getPriscriptionforDrug(widget.prescriptionList, model), model.patientAssessmentList), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), @@ -896,23 +1082,28 @@ class _PrescriptionFormWidgetState extends State { postPrescription( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.isEmpty + ? model.patientAssessmentList[0].icdCode10ID + .isEmpty ? "test" - : model.patientAssessmentList[0].icdCode10ID.toString() + : model.patientAssessmentList[0].icdCode10ID + .toString() : "test", dose: strengthController.text, doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'].toString() + ? model.itemMedicineListUnit[0]['parameterCode'] + .toString() : units['parameterCode'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'].toString() + ? model.itemMedicineList[0]['parameterCode'] + .toString() : frequency['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'].toString() + ? model.itemMedicineListRoute[0]['parameterCode'] + .toString() : route['parameterCode'].toString(), drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, @@ -931,7 +1122,8 @@ class _PrescriptionFormWidgetState extends State { }); } - getPriscriptionforDrug(List prescriptionList, MedicineViewModel model) { + getPriscriptionforDrug( + List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { prescriptionList[0].entityList.forEach((element) { diff --git a/pubspec.lock b/pubspec.lock index 3f1537d3..c20dff3c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -664,7 +664,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: @@ -706,7 +706,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: @@ -1040,7 +1040,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: @@ -1245,5 +1245,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <2.11.0" + dart: ">=2.10.2 <=2.11.0-213.1.beta" flutter: ">=1.22.2 <2.0.0" From 47357fe84e7a3bc2aaabeb9b5759777f8bda0017 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 16:31:05 +0200 Subject: [PATCH 164/199] bottom nav and dashboard_referral_patient --- .../home/dashboard_referral_patient.dart | 17 ++-- lib/widgets/dashboard/out_patient_stack.dart | 44 +--------- .../shared/bottom_navigation_item.dart | 81 +++++++++++-------- 3 files changed, 59 insertions(+), 83 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index e616f1ca..147bd2ab 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -1,4 +1,5 @@ import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/config/config.dart'; 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'; @@ -96,19 +97,19 @@ class DashboardReferralPatient extends StatelessWidget { RowCounts( dashboardItemList[2].summaryoptions[0].kPIParameter, dashboardItemList[2].summaryoptions[0].value, - Colors.black, + AppGlobal.appTextColor, height: height, ), RowCounts( dashboardItemList[2].summaryoptions[1].kPIParameter, dashboardItemList[2].summaryoptions[1].value, - Colors.grey, + Color(0xFFC8D0DC), height: height, ), RowCounts( dashboardItemList[2].summaryoptions[2].kPIParameter, dashboardItemList[2].summaryoptions[2].value, - Colors.red, + Color(0xFFEC6666), height: height, ), ], @@ -132,7 +133,7 @@ class DashboardReferralPatient extends StatelessWidget { ) ], ), - top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.40), + top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), left: 0, right: 0) ]), @@ -146,11 +147,11 @@ class DashboardReferralPatient extends StatelessWidget { static List> _createReferralData(List dashboardItemList) { final data = [ new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), charts.MaterialPalette.black), + getValue(dashboardItemList[1].summaryoptions[0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), charts.MaterialPalette.gray.shadeDefault), + getValue(dashboardItemList[1].summaryoptions[1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),), new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault), + getValue(dashboardItemList[1].summaryoptions[2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),), ]; return [ @@ -158,6 +159,8 @@ class DashboardReferralPatient extends StatelessWidget { id: 'Segments', domainFn: (GaugeSegment segment, _) => segment.segment, measureFn: (GaugeSegment segment, _) => segment.size, + strokeWidthPxFn: (GaugeSegment segment, _)=>200, + data: data, colorFn: (GaugeSegment segment, _) => segment.color, ) diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index fb67d954..4fa6ac82 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,5 +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/screens/home/label.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -88,7 +89,7 @@ class GetOutPatientStack extends StatelessWidget { gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[50]], // red to yellow + colors: [Color(0x8FF5F6FA), Colors.red[100]], // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), borderRadius: BorderRadius.circular(4), @@ -105,7 +106,7 @@ class GetOutPatientStack extends StatelessWidget { height: max != 0 ? ((barHeight) * value.value) / max : 0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), - color: Color(0x63D02127), + color: Color(0xFFD02127).withOpacity(0.39), ), ), ), @@ -149,42 +150,3 @@ class GetOutPatientStack extends StatelessWidget { } -// ignore: must_be_immutable -class Label extends StatelessWidget { - Label({ - Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, - }) : super(key: key); - final String firstLine; - final String secondLine; - Color color; - final double secondLineFontSize; - final double firstLineFontSize; - - @override - Widget build(BuildContext context) { - - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - firstLine, - fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , - // fontWeight: FontWeight.bold, - color: color, - fontHeight: .5, - letterSpacing: -0.72, - fontWeight: FontWeight.w600, - ), - AppText( - secondLine, - color: color, - fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), - fontWeight: FontWeight.bold, - letterSpacing: -1.44, - - ), - ], - ); - } -} diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 02b64c78..151855a0 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -1,4 +1,6 @@ import 'package:badges/badges.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +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/core/viewModel/doctor_replay_view_model.dart'; import 'package:flutter/cupertino.dart'; @@ -16,16 +18,14 @@ class BottomNavigationItem extends StatelessWidget { final String name; final DashboardViewModel dashboardViewModel; - - BottomNavigationItem( {this.icon, this.activeIcon, this.changeIndex, this.index, this.currentIndex, - this.name, this.dashboardViewModel}); - + this.name, + this.dashboardViewModel}); @override Widget build(BuildContext context) { @@ -41,51 +41,62 @@ class BottomNavigationItem extends StatelessWidget { child: Stack( alignment: AlignmentDirectional.center, children: [ + if (currentIndex == index) + Positioned( + top: 0, + child: Container( - + color: AppGlobal.appRedColor, + width: 100, + height: 3, + )), Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - SizedBox(height: 15,), + SizedBox( + height: 15, + ), Container( child: Icon(currentIndex == index ? activeIcon : icon, - color: currentIndex == index - ? Color(0xFF333C45) - : Theme.of(context).dividerColor, - size: 22.0), + color: AppGlobal.appTextColor, size: 22.0), + ), + SizedBox( + height: 8, ), - SizedBox(height: 5,), Expanded( - child: Text( - name, - style: TextStyle( - color: currentIndex == index - ? Theme.of(context).primaryColor - : Theme.of(context).dividerColor, - ), - ), + child: Text(name ?? "", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 2, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600) //#989898, + ), ), ], ), - if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) - Positioned( - right: 18.0, - bottom: 40.0, - child: Badge( - toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: Colors.red[800], - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - // padding: EdgeInsets.all(2.0), - child: Text(dashboardViewModel.notRepliedCount.toString(), - style: TextStyle( - color: Colors.white, fontSize: 12.0)), + if (currentIndex == 3 && + dashboardViewModel.notRepliedCount != 0) + Positioned( + right: 18.0, + bottom: 40.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: Colors.red[800], + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + // padding: EdgeInsets.all(2.0), + child: Text( + dashboardViewModel.notRepliedCount.toString(), + style: + TextStyle(color: Colors.white, fontSize: 12.0)), + ), ), ), - ), ], ), ), From 6c78fda3929cc3d162459ee0f2aa7406a5100a06 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 16:57:14 +0200 Subject: [PATCH 165/199] fix in slider --- .../home/dashboard_referral_patient.dart | 4 ++- lib/widgets/dashboard/activity_button.dart | 2 +- lib/widgets/dashboard/row_count.dart | 26 +++++++++++-------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 147bd2ab..0bae430a 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -110,6 +110,7 @@ class DashboardReferralPatient extends StatelessWidget { dashboardItemList[2].summaryoptions[2].kPIParameter, dashboardItemList[2].summaryoptions[2].value, Color(0xFFEC6666), + height: height, ), ], @@ -128,7 +129,8 @@ class DashboardReferralPatient extends StatelessWidget { children: [ AppText( model.getPatientCount(dashboardItemList[2]).toString(), - fontSize: SizeConfig.textMultiplier * 3.0, + fontSize: SizeConfig.textMultiplier * 3.2, + color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, ) ], diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index f00acef4..b28149b8 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -17,7 +17,7 @@ class GetActivityCard extends StatelessWidget { margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), decoration: BoxDecoration( color: Colors.white, - border: Border.all(width: 1, color: Color(0xFFEFEFEF)), + border: Border.all(width: 1.5, color: Color(0xFFEFEFEF)), borderRadius: BorderRadius.circular(15), ), child: Padding( diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index bf39ed27..820dcd37 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/config.dart'; 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,20 +25,23 @@ class RowCounts extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: AppText( - name, - color: Colors.black, - textAlign: TextAlign.start, // from TextAlign.center - fontSize: 11, - textOverflow: TextOverflow.ellipsis, - ), + AppText( + name, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w400, + textAlign: TextAlign.start, // from TextAlign.center + fontSize: 14, + letterSpacing: -0.84, + + textOverflow: TextOverflow.ellipsis, ), + SizedBox(width: 4,), AppText( - ' (' + count.toString() + ')', - color: Colors.black, + count.toString(), + color: AppGlobal.appTextColor, textAlign: TextAlign.center, - fontSize: 12, + fontSize: 14, + letterSpacing: -0.84, fontWeight: FontWeight.bold, ) ], From a02e89febbd23ae0a8f3596f03cc9baa529cbe2a Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 17:31:25 +0200 Subject: [PATCH 166/199] add verfication svgs --- lib/widgets/auth/method_type_card.dart | 133 +++++++++++++----- .../auth/verification_methods_list.dart | 9 +- pubspec.lock | 2 +- pubspec.yaml | 3 +- 4 files changed, 109 insertions(+), 38 deletions(-) diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6d091756..34b5938c 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -1,21 +1,91 @@ +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:flutter_svg/flutter_svg.dart'; import 'package:hexcolor/hexcolor.dart'; +// class MethodTypeCard extends StatelessWidget { +// const MethodTypeCard({ +// Key key, +// this.assetPath, +// this.onTap, +// this.label, this.height = 20, this.isSvg = true, +// }) : super(key: key); +// final String assetPath; +// final Function onTap; +// final String label; +// final double height; +// final bool isSvg; +// +// @override +// Widget build(BuildContext context) { +// return InkWell( +// onTap: onTap, +// child: Container( +// margin: EdgeInsets.all(10), +// decoration: BoxDecoration( +// color: Colors.white, +// borderRadius: BorderRadius.all( +// Radius.circular(10), +// ), +// border: Border.all( +// color: HexColor('#707070'), +// width: 0.1), +// ), +// height: 170, +// child: Padding( +// padding: EdgeInsets.fromLTRB(20, 15, 20, 15), +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Row( +// children: [ +// isSvg?SvgPicture.asset(assetPath, height: 60, +// width: 60,):Image.asset( +// assetPath, +// height: 60, +// width: 60, +// ), +// ], +// ), +// SizedBox( +// height:height , +// ), +// AppText( +// label, +// fontSize: 14, +// color: Color(0xFF2E303A), +// fontWeight: FontWeight.bold, +// ) +// ], +// ), +// )), +// ); +// } +// } +// +// +// + class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ Key key, - this.assetPath, - this.onTap, - this.label, this.height = 20, + this.assetPath, + this.onTap, + this.label, + this.height = 20, this.isSvg = true, }) : super(key: key); final String assetPath; - final Function onTap; + final GestureTapCallback onTap; final String label; final double height; + final bool isSvg; + @override Widget build(BuildContext context) { + double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : SizeConfig.isHeightLarge?25:20); return InkWell( onTap: onTap, child: Container( @@ -25,38 +95,37 @@ class MethodTypeCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), + border: Border.all(color: HexColor('#707070'), width: 0.1), ), - height: 170, + height: cardHeight, child: Padding( - padding: EdgeInsets.fromLTRB(20, 15, 20, 15), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Image.asset( - assetPath, - height: 60, - width: 60, - ), - ], - ), - SizedBox( - height:height , - ), - AppText( - label, - fontSize: 14, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - ) - ], + padding: const EdgeInsets.all(12.0), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + isSvg?SvgPicture.asset(assetPath, width: SizeConfig.widthMultiplier* (14), + height: cardHeight * 0.20): Image.asset( + assetPath, + width: SizeConfig.widthMultiplier* (12), + height: cardHeight * 0.35, + // height: , + ), + SizedBox( + height: height, + ), + AppText( + label, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ) + ], + ), ), )), ); } } + diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 27dbe8bf..97fbb42b 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -37,7 +37,7 @@ class _VerificationMethodsListState extends State { switch (widget.authMethodType) { case AuthMethodTypes.WhatsApp: return MethodTypeCard( - assetPath: 'assets/images/verify-whtsapp.png', + assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', onTap: () => {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, label: TranslationBase @@ -47,7 +47,7 @@ class _VerificationMethodsListState extends State { break; case AuthMethodTypes.SMS: return MethodTypeCard( - assetPath: "assets/images/verify-sms.png", + assetPath: "assets/images/svgs/verification/verify-sms.svg", onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, label:TranslationBase .of(context) @@ -56,7 +56,7 @@ class _VerificationMethodsListState extends State { break; case AuthMethodTypes.Fingerprint: return MethodTypeCard( - assetPath: 'assets/images/verification_fingerprint_icon.png', + assetPath: 'assets/images/svgs/verification/verify-finger.svg', onTap: () async { if (await widget.authenticationViewModel .checkIfBiometricAvailable(BiometricType.fingerprint)) { @@ -71,7 +71,7 @@ class _VerificationMethodsListState extends State { break; case AuthMethodTypes.FaceID: return MethodTypeCard( - assetPath: 'assets/images/verification_faceid_icon.png', + assetPath: 'assets/images/svgs/verification/verify-face.svg', onTap: () async { if (await widget.authenticationViewModel .checkIfBiometricAvailable(BiometricType.face)) { @@ -88,6 +88,7 @@ class _VerificationMethodsListState extends State { return MethodTypeCard( assetPath: 'assets/images/login/more_icon.png', onTap: widget.onShowMore, + isSvg: false, label: TranslationBase.of(context).moreVerification, height: 0, ); diff --git a/pubspec.lock b/pubspec.lock index 3f1537d3..55c25acc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -516,7 +516,7 @@ packages: source: hosted version: "0.3.4" flutter_svg: - dependency: transitive + dependency: "direct main" description: name: flutter_svg url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index 6423a46c..db678f9e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,7 +60,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 # SVG - #flutter_svg: ^0.17.4 + flutter_svg: ^0.18.1 percent_indicator: ^2.1.1 #Dependency Injection @@ -130,6 +130,7 @@ flutter: - assets/images/ - assets/images/dashboard/ - assets/images/login/ + - assets/images/svgs/verification/ - assets/images/patient/ - assets/images/patient/vital_signs/ From 279004b58b5e2226415c197f011c32bfe6cf91df Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 7 Dec 2021 17:43:12 +0200 Subject: [PATCH 167/199] add svgs --- assets/images/svgs/bottom_nav/Dr reply-active.svg | 6 ++++++ assets/images/svgs/bottom_nav/Dr reply.svg | 6 ++++++ assets/images/svgs/bottom_nav/home-active.svg | 3 +++ assets/images/svgs/bottom_nav/home.svg | 3 +++ assets/images/svgs/bottom_nav/qr reader-active.svg | 9 +++++++++ assets/images/svgs/bottom_nav/qr reader.svg | 9 +++++++++ assets/images/svgs/bottom_nav/schedule-active.svg | 3 +++ assets/images/svgs/bottom_nav/schedule.svg | 3 +++ assets/images/svgs/profile_screen/ECG.svg | 3 +++ .../images/svgs/profile_screen/Order Procedures.svg | 3 +++ .../images/svgs/profile_screen/Progress notes.svg | 13 +++++++++++++ assets/images/svgs/profile_screen/Radiology.svg | 3 +++ assets/images/svgs/profile_screen/UCAF.svg | 3 +++ assets/images/svgs/profile_screen/admission req.svg | 11 +++++++++++ assets/images/svgs/profile_screen/booked.svg | 10 ++++++++++ .../images/svgs/profile_screen/create episode.svg | 4 ++++ .../images/svgs/profile_screen/diabetic chart.svg | 10 ++++++++++ .../svgs/profile_screen/discharge summary.svg | 7 +++++++ .../images/svgs/profile_screen/health summary.svg | 10 ++++++++++ .../svgs/profile_screen/insurance approval.svg | 5 +++++ assets/images/svgs/profile_screen/lab results.svg | 3 +++ assets/images/svgs/profile_screen/livecare.svg | 10 ++++++++++ .../images/svgs/profile_screen/medical report.svg | 3 +++ .../images/svgs/profile_screen/modify episode.svg | 4 ++++ .../svgs/profile_screen/order prescription.svg | 8 ++++++++ .../svgs/profile_screen/patient sick leave.svg | 5 +++++ assets/images/svgs/profile_screen/refer patient.svg | 6 ++++++ assets/images/svgs/profile_screen/vital signs.svg | 8 ++++++++ assets/images/svgs/profile_screen/walkin.svg | 8 ++++++++ assets/images/svgs/verification/verify-face.svg | 7 +++++++ assets/images/svgs/verification/verify-finger.svg | 9 +++++++++ assets/images/svgs/verification/verify-sms.svg | 11 +++++++++++ assets/images/svgs/verification/verify-whtsapp.svg | 12 ++++++++++++ 33 files changed, 218 insertions(+) create mode 100644 assets/images/svgs/bottom_nav/Dr reply-active.svg create mode 100644 assets/images/svgs/bottom_nav/Dr reply.svg create mode 100644 assets/images/svgs/bottom_nav/home-active.svg create mode 100644 assets/images/svgs/bottom_nav/home.svg create mode 100644 assets/images/svgs/bottom_nav/qr reader-active.svg create mode 100644 assets/images/svgs/bottom_nav/qr reader.svg create mode 100644 assets/images/svgs/bottom_nav/schedule-active.svg create mode 100644 assets/images/svgs/bottom_nav/schedule.svg create mode 100644 assets/images/svgs/profile_screen/ECG.svg create mode 100644 assets/images/svgs/profile_screen/Order Procedures.svg create mode 100644 assets/images/svgs/profile_screen/Progress notes.svg create mode 100644 assets/images/svgs/profile_screen/Radiology.svg create mode 100644 assets/images/svgs/profile_screen/UCAF.svg create mode 100644 assets/images/svgs/profile_screen/admission req.svg create mode 100644 assets/images/svgs/profile_screen/booked.svg create mode 100644 assets/images/svgs/profile_screen/create episode.svg create mode 100644 assets/images/svgs/profile_screen/diabetic chart.svg create mode 100644 assets/images/svgs/profile_screen/discharge summary.svg create mode 100644 assets/images/svgs/profile_screen/health summary.svg create mode 100644 assets/images/svgs/profile_screen/insurance approval.svg create mode 100644 assets/images/svgs/profile_screen/lab results.svg create mode 100644 assets/images/svgs/profile_screen/livecare.svg create mode 100644 assets/images/svgs/profile_screen/medical report.svg create mode 100644 assets/images/svgs/profile_screen/modify episode.svg create mode 100644 assets/images/svgs/profile_screen/order prescription.svg create mode 100644 assets/images/svgs/profile_screen/patient sick leave.svg create mode 100644 assets/images/svgs/profile_screen/refer patient.svg create mode 100644 assets/images/svgs/profile_screen/vital signs.svg create mode 100644 assets/images/svgs/profile_screen/walkin.svg create mode 100644 assets/images/svgs/verification/verify-face.svg create mode 100644 assets/images/svgs/verification/verify-finger.svg create mode 100644 assets/images/svgs/verification/verify-sms.svg create mode 100644 assets/images/svgs/verification/verify-whtsapp.svg diff --git a/assets/images/svgs/bottom_nav/Dr reply-active.svg b/assets/images/svgs/bottom_nav/Dr reply-active.svg new file mode 100644 index 00000000..3fc5bd03 --- /dev/null +++ b/assets/images/svgs/bottom_nav/Dr reply-active.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/svgs/bottom_nav/Dr reply.svg b/assets/images/svgs/bottom_nav/Dr reply.svg new file mode 100644 index 00000000..931b5304 --- /dev/null +++ b/assets/images/svgs/bottom_nav/Dr reply.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/svgs/bottom_nav/home-active.svg b/assets/images/svgs/bottom_nav/home-active.svg new file mode 100644 index 00000000..8357b01b --- /dev/null +++ b/assets/images/svgs/bottom_nav/home-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/bottom_nav/home.svg b/assets/images/svgs/bottom_nav/home.svg new file mode 100644 index 00000000..725dd1f9 --- /dev/null +++ b/assets/images/svgs/bottom_nav/home.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/bottom_nav/qr reader-active.svg b/assets/images/svgs/bottom_nav/qr reader-active.svg new file mode 100644 index 00000000..36e7657c --- /dev/null +++ b/assets/images/svgs/bottom_nav/qr reader-active.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/svgs/bottom_nav/qr reader.svg b/assets/images/svgs/bottom_nav/qr reader.svg new file mode 100644 index 00000000..403e3137 --- /dev/null +++ b/assets/images/svgs/bottom_nav/qr reader.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/svgs/bottom_nav/schedule-active.svg b/assets/images/svgs/bottom_nav/schedule-active.svg new file mode 100644 index 00000000..a48e1652 --- /dev/null +++ b/assets/images/svgs/bottom_nav/schedule-active.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/bottom_nav/schedule.svg b/assets/images/svgs/bottom_nav/schedule.svg new file mode 100644 index 00000000..98232af9 --- /dev/null +++ b/assets/images/svgs/bottom_nav/schedule.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/ECG.svg b/assets/images/svgs/profile_screen/ECG.svg new file mode 100644 index 00000000..cc697f9f --- /dev/null +++ b/assets/images/svgs/profile_screen/ECG.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/Order Procedures.svg b/assets/images/svgs/profile_screen/Order Procedures.svg new file mode 100644 index 00000000..9eb44dfb --- /dev/null +++ b/assets/images/svgs/profile_screen/Order Procedures.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/Progress notes.svg b/assets/images/svgs/profile_screen/Progress notes.svg new file mode 100644 index 00000000..5fc41757 --- /dev/null +++ b/assets/images/svgs/profile_screen/Progress notes.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/images/svgs/profile_screen/Radiology.svg b/assets/images/svgs/profile_screen/Radiology.svg new file mode 100644 index 00000000..8f1d8a46 --- /dev/null +++ b/assets/images/svgs/profile_screen/Radiology.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/UCAF.svg b/assets/images/svgs/profile_screen/UCAF.svg new file mode 100644 index 00000000..79100a55 --- /dev/null +++ b/assets/images/svgs/profile_screen/UCAF.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/admission req.svg b/assets/images/svgs/profile_screen/admission req.svg new file mode 100644 index 00000000..1f454266 --- /dev/null +++ b/assets/images/svgs/profile_screen/admission req.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/images/svgs/profile_screen/booked.svg b/assets/images/svgs/profile_screen/booked.svg new file mode 100644 index 00000000..bda90bcf --- /dev/null +++ b/assets/images/svgs/profile_screen/booked.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/svgs/profile_screen/create episode.svg b/assets/images/svgs/profile_screen/create episode.svg new file mode 100644 index 00000000..88c1cc21 --- /dev/null +++ b/assets/images/svgs/profile_screen/create episode.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/svgs/profile_screen/diabetic chart.svg b/assets/images/svgs/profile_screen/diabetic chart.svg new file mode 100644 index 00000000..b558bc64 --- /dev/null +++ b/assets/images/svgs/profile_screen/diabetic chart.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/svgs/profile_screen/discharge summary.svg b/assets/images/svgs/profile_screen/discharge summary.svg new file mode 100644 index 00000000..2edd6a14 --- /dev/null +++ b/assets/images/svgs/profile_screen/discharge summary.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/svgs/profile_screen/health summary.svg b/assets/images/svgs/profile_screen/health summary.svg new file mode 100644 index 00000000..186af7a6 --- /dev/null +++ b/assets/images/svgs/profile_screen/health summary.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/svgs/profile_screen/insurance approval.svg b/assets/images/svgs/profile_screen/insurance approval.svg new file mode 100644 index 00000000..f6a5885f --- /dev/null +++ b/assets/images/svgs/profile_screen/insurance approval.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/svgs/profile_screen/lab results.svg b/assets/images/svgs/profile_screen/lab results.svg new file mode 100644 index 00000000..5e03a2df --- /dev/null +++ b/assets/images/svgs/profile_screen/lab results.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/livecare.svg b/assets/images/svgs/profile_screen/livecare.svg new file mode 100644 index 00000000..452ffc53 --- /dev/null +++ b/assets/images/svgs/profile_screen/livecare.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/svgs/profile_screen/medical report.svg b/assets/images/svgs/profile_screen/medical report.svg new file mode 100644 index 00000000..f40a9607 --- /dev/null +++ b/assets/images/svgs/profile_screen/medical report.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/modify episode.svg b/assets/images/svgs/profile_screen/modify episode.svg new file mode 100644 index 00000000..cdf5d3ab --- /dev/null +++ b/assets/images/svgs/profile_screen/modify episode.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/svgs/profile_screen/order prescription.svg b/assets/images/svgs/profile_screen/order prescription.svg new file mode 100644 index 00000000..21cadf7c --- /dev/null +++ b/assets/images/svgs/profile_screen/order prescription.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/svgs/profile_screen/patient sick leave.svg b/assets/images/svgs/profile_screen/patient sick leave.svg new file mode 100644 index 00000000..f585b177 --- /dev/null +++ b/assets/images/svgs/profile_screen/patient sick leave.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/svgs/profile_screen/refer patient.svg b/assets/images/svgs/profile_screen/refer patient.svg new file mode 100644 index 00000000..65c8f61e --- /dev/null +++ b/assets/images/svgs/profile_screen/refer patient.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/svgs/profile_screen/vital signs.svg b/assets/images/svgs/profile_screen/vital signs.svg new file mode 100644 index 00000000..fe476c3c --- /dev/null +++ b/assets/images/svgs/profile_screen/vital signs.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/svgs/profile_screen/walkin.svg b/assets/images/svgs/profile_screen/walkin.svg new file mode 100644 index 00000000..0ef3ecf9 --- /dev/null +++ b/assets/images/svgs/profile_screen/walkin.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/svgs/verification/verify-face.svg b/assets/images/svgs/verification/verify-face.svg new file mode 100644 index 00000000..7969cad2 --- /dev/null +++ b/assets/images/svgs/verification/verify-face.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/svgs/verification/verify-finger.svg b/assets/images/svgs/verification/verify-finger.svg new file mode 100644 index 00000000..e626bafc --- /dev/null +++ b/assets/images/svgs/verification/verify-finger.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/svgs/verification/verify-sms.svg b/assets/images/svgs/verification/verify-sms.svg new file mode 100644 index 00000000..ae5fa9f7 --- /dev/null +++ b/assets/images/svgs/verification/verify-sms.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/images/svgs/verification/verify-whtsapp.svg b/assets/images/svgs/verification/verify-whtsapp.svg new file mode 100644 index 00000000..09ac85c9 --- /dev/null +++ b/assets/images/svgs/verification/verify-whtsapp.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + From b54b4d96e9c3e413102edeec2f58d7ec7fcc4e3b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 8 Dec 2021 09:03:06 +0200 Subject: [PATCH 168/199] add assets --- pubspec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pubspec.yaml b/pubspec.yaml index db678f9e..0f2d55e8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -131,6 +131,8 @@ flutter: - assets/images/dashboard/ - assets/images/login/ - assets/images/svgs/verification/ + - assets/images/svgs/profile_screen/ + - assets/images/svgs/bottom_nav/ - assets/images/patient/ - assets/images/patient/vital_signs/ From 98bc33042f6c10ff6b3e9c1a5fc88e77d3865a6b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 8 Dec 2021 09:35:28 +0200 Subject: [PATCH 169/199] add icons to bottom sheet --- .../{qr reader-active.svg => reader-active.svg} | 0 .../{Dr reply-active.svg => reply-active.svg} | 0 lib/widgets/shared/bottom_nav_bar.dart | 4 ++++ lib/widgets/shared/bottom_navigation_item.dart | 10 +++++++--- 4 files changed, 11 insertions(+), 3 deletions(-) rename assets/images/svgs/bottom_nav/{qr reader-active.svg => reader-active.svg} (100%) rename assets/images/svgs/bottom_nav/{Dr reply-active.svg => reply-active.svg} (100%) diff --git a/assets/images/svgs/bottom_nav/qr reader-active.svg b/assets/images/svgs/bottom_nav/reader-active.svg similarity index 100% rename from assets/images/svgs/bottom_nav/qr reader-active.svg rename to assets/images/svgs/bottom_nav/reader-active.svg diff --git a/assets/images/svgs/bottom_nav/Dr reply-active.svg b/assets/images/svgs/bottom_nav/reply-active.svg similarity index 100% rename from assets/images/svgs/bottom_nav/Dr reply-active.svg rename to assets/images/svgs/bottom_nav/reply-active.svg diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 16988d82..bcce6818 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -50,6 +50,7 @@ class _BottomNavBarState extends State { BottomNavigationItem( icon: DoctorApp.home_1, activeIcon: DoctorApp.home_active_1, + svgPath: "assets/images/svgs/bottom_nav/home-active.svg", changeIndex: _changeIndex, index: widget.index, currentIndex: 0, @@ -59,6 +60,7 @@ class _BottomNavBarState extends State { BottomNavigationItem( icon: DoctorApp.schedule_1, activeIcon: DoctorApp.schedule_active_1, + svgPath: "assets/images/svgs/bottom_nav/schedule-active.svg", changeIndex: _changeIndex, index: widget.index, currentIndex: 1, @@ -69,6 +71,7 @@ class _BottomNavBarState extends State { BottomNavigationItem( icon: DoctorApp.qr_reader, activeIcon: DoctorApp.qr_reader_active_1, + svgPath: "assets/images/svgs/bottom_nav/reader-active.svg", changeIndex: _changeIndex, index: widget.index, currentIndex: 2, @@ -79,6 +82,7 @@ class _BottomNavBarState extends State { BottomNavigationItem( icon: DoctorApp.dr_reply_1, activeIcon: DoctorApp.dr_reply_active_1, + svgPath: "assets/images/svgs/bottom_nav/reply-active.svg", changeIndex: _changeIndex, index: widget.index, currentIndex: 3, diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 151855a0..7956eb1d 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import '../../locator.dart'; @@ -17,6 +18,8 @@ class BottomNavigationItem extends StatelessWidget { final int currentIndex; final String name; final DashboardViewModel dashboardViewModel; + final String svgPath; + BottomNavigationItem( {this.icon, @@ -25,7 +28,7 @@ class BottomNavigationItem extends StatelessWidget { this.index, this.currentIndex, this.name, - this.dashboardViewModel}); + this.dashboardViewModel, this.svgPath}); @override Widget build(BuildContext context) { @@ -58,8 +61,9 @@ class BottomNavigationItem extends StatelessWidget { height: 15, ), Container( - child: Icon(currentIndex == index ? activeIcon : icon, - color: AppGlobal.appTextColor, size: 22.0), + child: SvgPicture.asset(svgPath,width: SizeConfig.widthMultiplier* (10), height:SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40, + ), ), SizedBox( height: 8, From fc126caddfb0f834da89568a93e602bb60146daa Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 8 Dec 2021 10:57:01 +0200 Subject: [PATCH 170/199] first step from patient profile --- lib/screens/live_care/end_call_screen.dart | 8 ++-- .../patient_profile_screen.dart | 9 +++-- .../profile_gird_for_InPatient.dart | 40 +++++++++---------- .../profile_gird_for_other.dart | 22 +++++----- .../profile_gird_for_search.dart | 20 +++++----- .../profile/PatientProfileButton.dart | 6 +-- .../profile/profile_medical_info_widget.dart | 24 +++++------ ...rofile_medical_info_widget_in_patient.dart | 24 +++++------ .../profile_medical_info_widget_search.dart | 22 +++++----- 9 files changed, 88 insertions(+), 87 deletions(-) diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 060b3844..35c00beb 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -61,7 +61,7 @@ class _EndCallScreenState extends State { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel(TranslationBase.of(context).resume, - TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', + TranslationBase.of(context).theCall, '', 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient, color: AppGlobal.appGreenColor, onTap: () async { @@ -122,7 +122,7 @@ class _EndCallScreenState extends State { TranslationBase.of(context).endLC, TranslationBase.of(context).consultation, '', - 'patient/vital_signs.png', + 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient, color: Colors.red[800], onTap: () { @@ -155,7 +155,7 @@ class _EndCallScreenState extends State { TranslationBase.of(context).sendLC, TranslationBase.of(context).instruction, "", - 'patient/health_summary.png', + 'assets/images/svgs/profile_screen/health summary.svg', onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?", @@ -179,7 +179,7 @@ class _EndCallScreenState extends State { TranslationBase.of(context).transferTo, TranslationBase.of(context).admin, '', - 'patient/health_summary.png', onTap: () { + 'assets/images/svgs/profile_screen/health summary.svg', onTap: () { Navigator.push( context, MaterialPageRoute( 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 16a4f23c..b2261f4c 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/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'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:quiver/async.dart'; @@ -251,8 +252,8 @@ class _PatientProfileScreenState extends State hPadding: 20, fontWeight: FontWeight.normal, fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", + icon: SvgPicture.asset( + "assets/images/svgs/profile_screen/create episode.svg", color: Colors.white, height: 30, ), @@ -283,8 +284,8 @@ class _PatientProfileScreenState extends State hPadding: 20, fontWeight: FontWeight.normal, fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", + icon: SvgPicture.asset( + "assets/images/svgs/profile_screen/modify episode.svg", color: Colors.white, height: 30, ), diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 53d16291..c417860a 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -39,70 +39,70 @@ class ProfileGridForInPatient extends StatelessWidget { TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, - 'patient/lab_results.png', + 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, - 'patient/lab_results.png', + 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).radiology, TranslationBase.of(context).result, RADIOLOGY_PATIENT, - 'patient/health_summary.png', + 'assets/images/svgs/profile_screen/Radiology.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, - 'patient/order_prescription.png', + 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).progress, TranslationBase.of(context).note, PROGRESS_NOTE, - 'patient/Progress_notes.png', + 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( TranslationBase.of(context).order, TranslationBase.of(context).sheet, ORDER_NOTE, - 'patient/Progress_notes.png', + 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, - 'patient/Order_Procedures.png', + 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, - 'patient/health_summary.png', + 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).medical, TranslationBase.of(context).report, PATIENT_MEDICAL_REPORT, - 'patient/health_summary.png', + 'assets/images/svgs/profile_screen/medical report.svg', isInPatient: isInpatient, isDisable: false), PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_IN_PATIENT_TO_DOCTOR, - 'patient/refer_patient.png', + 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), @@ -110,62 +110,62 @@ class ProfileGridForInPatient extends StatelessWidget { TranslationBase.of(context).insurance, TranslationBase.of(context).approvals, PATIENT_INSURANCE_APPROVALS_NEW, - 'patient/vital_signs.png', + 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).discharge, TranslationBase.of(context).report, DISCHARGE_SUMMARY, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/discharge summary.svg', isInPatient: isInpatient, ), PatientProfileCardModel( TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient, ), PatientProfileCardModel( TranslationBase.of(context).operation, TranslationBase.of(context).report, GET_OPERATION_REPORT, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient, ), PatientProfileCardModel( TranslationBase.of(context).pending, TranslationBase.of(context).orders, PENDING_ORDERS, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient, ), PatientProfileCardModel( TranslationBase.of(context).admission, TranslationBase.of(context).orders, ADMISSION_ORDERS, - 'patient/Progress_notes.png', + 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, ), PatientProfileCardModel( "Nursing", TranslationBase.of(context).progressNote, NURSING_PROGRESS_NOTE, - 'patient/Progress_notes.png', + 'assets/images/svgs/profile_screen/Progress notes.svg', isInPatient: isInpatient, ), PatientProfileCardModel( TranslationBase.of(context).diagnosis, "", DIAGNOSIS_FOR_IN_PATIENT, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient, ), PatientProfileCardModel( TranslationBase.of(context).diabetic, TranslationBase.of(context).chart, DIABETIC_CHART_VALUES, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient, ), ]; diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index a374898c..2254f964 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -34,37 +34,37 @@ class ProfileGridForOther extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, - ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', + ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, - RADIOLOGY_PATIENT, 'patient/health_summary.png', + RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', + ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, - 'patient/health_summary.png', + 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, - ORDER_PROCEDURE, 'patient/Order_Procedures.png', + ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, - PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', + PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, 'patient/ucaf.png', + PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 5bcc398d..f628811d 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -24,33 +24,33 @@ class ProfileGridForSearch extends StatelessWidget { Widget build(BuildContext context) { final List cardsList = [ PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, - 'patient/vital_signs.png', + 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, - ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', + ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, - RADIOLOGY_PATIENT, 'patient/health_summary.png', + RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', + ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, - 'patient/health_summary.png', + 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, - ORDER_PROCEDURE, 'patient/Order_Procedures.png', + ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, - PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', + PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, - 'patient/patient_sick_leave.png', + 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 073a6d51..e62c061d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -81,11 +82,10 @@ class PatientProfileButton extends StatelessWidget { size: 30, color: color ?? Color(0xFF333C45), ) - : new Image.asset( - url + icon, + : new SvgPicture.asset( + icon, width: 30, height: 30, - fit: BoxFit.contain, ), ) ], diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index a7832481..fec33a62 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -40,7 +40,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + icon: 'assets/images/svgs/profile_screen/vital signs.svg'), // if (selectedPatientType != 7) PatientProfileButton( key: key, @@ -50,7 +50,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -59,7 +59,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + icon: 'assets/images/svgs/profile_screen/lab results.svg'), PatientProfileButton( key: key, patient: patient, @@ -68,7 +68,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ALL_SPECIAL_LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).special, - icon: 'patient/lab_results.png'), + icon: 'assets/images/svgs/profile_screen/lab results.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -79,7 +79,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -88,7 +88,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: 'assets/images/svgs/profile_screen/ECG.svg'), PatientProfileButton( key: key, patient: patient, @@ -97,7 +97,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + icon: 'assets/images/svgs/profile_screen/order prescription.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -107,7 +107,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -117,7 +117,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -127,7 +127,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( key: key, @@ -170,7 +170,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), if (isInpatient) PatientProfileButton( key: key, @@ -180,7 +180,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ORDER_NOTE, nameLine1: "Order", //"Text", nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), + icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), ], ), ); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index 17feaf0a..a7ab2412 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -49,7 +49,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, isInPatient: true, - icon: 'patient/vital_signs.png'), + icon: 'assets/images/svgs/profile_screen/vital signs.svg'), PatientProfileButton( key: key, patient: patient, @@ -59,7 +59,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { isInPatient: true, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + icon: 'assets/images/svgs/profile_screen/lab results.svg'), PatientProfileButton( key: key, patient: patient, @@ -69,7 +69,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), + icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -78,7 +78,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + icon: 'assets/images/svgs/profile_screen/order prescription.svg'), PatientProfileButton( key: key, patient: patient, @@ -88,7 +88,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { isDischargedPatient: isDischargedPatient, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), PatientProfileButton( key: key, patient: patient, @@ -98,7 +98,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { isDischargedPatient: isDischargedPatient, nameLine1: "Order", //"Text", nameLine2: "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), PatientProfileButton( key: key, patient: patient, @@ -107,7 +107,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), PatientProfileButton( key: key, patient: patient, @@ -118,7 +118,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { //TranslationBase.of(context).medicalReport, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -130,7 +130,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -149,7 +149,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), + icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), PatientProfileButton( key: key, patient: patient, @@ -159,7 +159,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { route: null, nameLine1: "Discharge", nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), PatientProfileButton( key: key, patient: patient, @@ -168,7 +168,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), ], ), ); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 573ada32..386581bf 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -64,7 +64,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + icon: 'assets/images/svgs/profile_screen/vital signs.svg'), // if (selectedPatientType != 7) PatientProfileButton( key: key, @@ -76,7 +76,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -85,7 +85,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + icon: 'assets/images/svgs/profile_screen/lab results.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -96,7 +96,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -105,7 +105,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: 'assets/images/svgs/profile_screen/ECG.svg'), PatientProfileButton( key: key, patient: patient, @@ -114,7 +114,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + icon: 'assets/images/svgs/profile_screen/order prescription.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -124,7 +124,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -134,7 +134,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -144,7 +144,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( @@ -193,7 +193,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), if (isInpatient) PatientProfileButton( key: key, @@ -203,7 +203,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: ORDER_NOTE, nameLine1: "Order", //"Text", nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), + icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), ], ), ), From 753a72b85e067b48e31465c0cc4930783b0f7657 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 8 Dec 2021 11:51:32 +0200 Subject: [PATCH 171/199] add missing code --- .../images/svgs/profile_screen/diagnosis.svg | 3 +++ .../svgs/profile_screen/operating report.svg | 6 ++++++ .../svgs/profile_screen/order sheets.svg | 3 +++ .../svgs/profile_screen/pending orders.svg | 7 +++++++ .../images/svgs/profile_screen/sick leave.svg | 5 +++++ .../profile_gird_for_InPatient.dart | 10 +++++----- .../profile_gird_for_other.dart | 8 ++++---- .../profile_gird_for_search.dart | 10 +++++----- .../profile/PatientProfileButton.dart | 19 ++++++++++++------- .../profile_medical_info_widget_search.dart | 6 +++--- 10 files changed, 53 insertions(+), 24 deletions(-) create mode 100644 assets/images/svgs/profile_screen/diagnosis.svg create mode 100644 assets/images/svgs/profile_screen/operating report.svg create mode 100644 assets/images/svgs/profile_screen/order sheets.svg create mode 100644 assets/images/svgs/profile_screen/pending orders.svg create mode 100644 assets/images/svgs/profile_screen/sick leave.svg diff --git a/assets/images/svgs/profile_screen/diagnosis.svg b/assets/images/svgs/profile_screen/diagnosis.svg new file mode 100644 index 00000000..b0c9b83c --- /dev/null +++ b/assets/images/svgs/profile_screen/diagnosis.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/operating report.svg b/assets/images/svgs/profile_screen/operating report.svg new file mode 100644 index 00000000..8d9766be --- /dev/null +++ b/assets/images/svgs/profile_screen/operating report.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/svgs/profile_screen/order sheets.svg b/assets/images/svgs/profile_screen/order sheets.svg new file mode 100644 index 00000000..c9e61e92 --- /dev/null +++ b/assets/images/svgs/profile_screen/order sheets.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/profile_screen/pending orders.svg b/assets/images/svgs/profile_screen/pending orders.svg new file mode 100644 index 00000000..ffe95e3b --- /dev/null +++ b/assets/images/svgs/profile_screen/pending orders.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/svgs/profile_screen/sick leave.svg b/assets/images/svgs/profile_screen/sick leave.svg new file mode 100644 index 00000000..0774eb79 --- /dev/null +++ b/assets/images/svgs/profile_screen/sick leave.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index c417860a..6dc954c3 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -76,7 +76,7 @@ class ProfileGridForInPatient extends StatelessWidget { TranslationBase.of(context).order, TranslationBase.of(context).sheet, ORDER_NOTE, - 'assets/images/svgs/profile_screen/Progress notes.svg', + 'assets/images/svgs/profile_screen/order sheets.svg', isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), PatientProfileCardModel( @@ -130,14 +130,14 @@ class ProfileGridForInPatient extends StatelessWidget { TranslationBase.of(context).operation, TranslationBase.of(context).report, GET_OPERATION_REPORT, - 'assets/images/svgs/profile_screen/patient sick leave.svg', + 'assets/images/svgs/profile_screen/operating report.svg', isInPatient: isInpatient, ), PatientProfileCardModel( TranslationBase.of(context).pending, TranslationBase.of(context).orders, PENDING_ORDERS, - 'assets/images/svgs/profile_screen/patient sick leave.svg', + 'assets/images/svgs/profile_screen/pending orders.svg', isInPatient: isInpatient, ), PatientProfileCardModel( @@ -158,7 +158,7 @@ class ProfileGridForInPatient extends StatelessWidget { TranslationBase.of(context).diagnosis, "", DIAGNOSIS_FOR_IN_PATIENT, - 'assets/images/svgs/profile_screen/patient sick leave.svg', + 'assets/images/svgs/profile_screen/diagnosis.svg', isInPatient: isInpatient, ), PatientProfileCardModel( @@ -179,7 +179,7 @@ class ProfileGridForInPatient extends StatelessWidget { // if you want IOS bouncing effect, otherwise remove this line gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisSpacing: 10, - mainAxisSpacing: 10, + mainAxisSpacing: 8, crossAxisCount: 3, ), //change the number as you want diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 2254f964..dbdaf4a8 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -74,7 +74,7 @@ class ProfileGridForOther extends StatelessWidget { TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, - 'patient/refer_patient.png', + 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null @@ -82,7 +82,7 @@ class ProfileGridForOther extends StatelessWidget { ), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, - PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', + PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null @@ -96,8 +96,8 @@ class ProfileGridForOther extends StatelessWidget { child: StaggeredGridView.countBuilder( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, + crossAxisSpacing: 8, + mainAxisSpacing: 8, crossAxisCount: 3, itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index f628811d..b1438e70 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -54,15 +54,15 @@ class ProfileGridForSearch extends StatelessWidget { isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, 'patient/ucaf.png', + PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel(TranslationBase.of(context).referral, TranslationBase.of(context).patient, - REFER_PATIENT_TO_DOCTOR, 'patient/refer_patient.png', + REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, - PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', + PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), ]; @@ -73,8 +73,8 @@ class ProfileGridForSearch extends StatelessWidget { child: StaggeredGridView.countBuilder( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, + crossAxisSpacing: 8, + mainAxisSpacing: 8, crossAxisCount: 3, itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index e62c061d..31c4c903 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -1,3 +1,4 @@ +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/models/patient/patiant_info_model.dart'; @@ -60,7 +61,7 @@ class PatientProfileButton extends StatelessWidget { return Container( margin: EdgeInsets.symmetric(horizontal: 0.0), - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), child: InkWell( onTap: isDisable ? null @@ -69,7 +70,9 @@ class PatientProfileButton extends StatelessWidget { : () { navigator(context, this.route); }, - child: Column(children: [ + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ Container( padding: EdgeInsets.fromLTRB(8, 0, 8, 8), child: Row( @@ -98,17 +101,19 @@ class PatientProfileButton extends StatelessWidget { children: [ AppText( !projectsProvider.isArabic ? this.nameLine1 : nameLine2, - color: color ?? Color(0xFF2B353E), + color: color ?? AppGlobal.appTextColor, + letterSpacing: -0.33, fontWeight: FontWeight.w600, + textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 1.35, + fontSize: SizeConfig.textMultiplier * 1.30, ), AppText( !projectsProvider.isArabic ? this.nameLine2 : nameLine1, color: color ?? Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 1.35, + fontSize: SizeConfig.textMultiplier * 1.30, ), if (isLoading) DrAppCircularProgressIndeicator() ], @@ -119,9 +124,9 @@ class PatientProfileButton extends StatelessWidget { decoration: BoxDecoration( // border: Border.all(), color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white, - borderRadius: BorderRadius.all(Radius.circular(10)), + borderRadius: BorderRadius.all(Radius.circular(15)), border: Border.fromBorderSide(BorderSide( - color: color ?? Color(0xffBBBBBB), + color: color ?? Color(0xFFEFEFEF), width: 1, )), ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 386581bf..a45f7cdc 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -157,7 +157,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), + icon: 'assets/images/svgs/profile_screen/UCAF.svg'), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( @@ -170,7 +170,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + icon: 'assets/images/svgs/profile_screen/refer patient.svg'), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( @@ -183,7 +183,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + icon: 'assets/images/svgs/profile_screen/admission req.svg'), if (isInpatient) PatientProfileButton( key: key, From 6b0e790cd29d0d48fa4a1b1f4ee50f9da690cfa1 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 8 Dec 2021 15:09:24 +0200 Subject: [PATCH 172/199] add gradiant to home page --- lib/screens/home/home_page_card.dart | 18 +++++---- lib/screens/home/home_patient_card.dart | 6 ++- lib/screens/home/home_screen.dart | 37 +++++++++++++------ .../In_patient/in_patient_screen.dart | 7 ++-- .../shared/bottom_navigation_item.dart | 1 + pubspec.lock | 6 +-- 6 files changed, 50 insertions(+), 25 deletions(-) diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index df4ae48f..7a0d5167 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/config.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -10,7 +11,7 @@ class HomePageCard extends StatelessWidget { Key key, this.color, this.opacity = 0.4, - this.margin, this.width}) + this.margin, this.width, this.gradient}) : super(key: key); final bool hasBorder; final String imageName; @@ -20,6 +21,8 @@ class HomePageCard extends StatelessWidget { final double opacity; final double width; final EdgeInsets margin; + final LinearGradient gradient; + @override Widget build(BuildContext context) { return InkWell( @@ -28,12 +31,13 @@ class HomePageCard extends StatelessWidget { width: width, margin: this.margin, decoration: BoxDecoration( - color: !hasBorder - ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) - : Colors.white, - borderRadius: BorderRadius.circular(17.0), + // color: !hasBorder + // ? color != null + // ? color + // : HexColor('#050705').withOpacity(opacity) + // : Colors.white, + gradient: gradient, + borderRadius: BorderRadius.circular(20.0), border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 06ef380f..0180fc14 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -12,6 +12,7 @@ class HomePatientCard extends StatelessWidget { final Color textColor; final VoidCallback onTap; final double iconSize; + final LinearGradient gradient; HomePatientCard({ this.backgroundColor, @@ -21,7 +22,7 @@ class HomePatientCard extends StatelessWidget { this.text, this.textColor, this.onTap, - this.iconSize = 30, + this.iconSize = 30, this.gradient, }); @override @@ -31,6 +32,7 @@ class HomePatientCard extends StatelessWidget { return HomePageCard( color: backgroundColor, width: width, + gradient: gradient, margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), child: Container( padding: EdgeInsets.all(8), @@ -94,6 +96,8 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, + letterSpacing: -0.33, + fontWeight: FontWeight.w600, 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 f5b62368..1014566f 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -319,10 +319,25 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = AppGlobal.appRedColor; - backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xFF2B353E); + List backgroundColors = List(3); + backgroundColors[0] = LinearGradient( + begin: Alignment(-1.0, -2.0), + end: Alignment(1.0, 2.0), + colors: [ + AppGlobal.appRedColor,Color(0xFFAD3B3B), + ]);//AppGlobal.appRedColor; + backgroundColors[1] = LinearGradient( + begin: Alignment(-1.0, -2.0), + end: Alignment(1.0, 2.0), + colors: [ + Color(0xFFC9C9C9),Color(0xFFEDEDED) + ]); + backgroundColors[2] = LinearGradient( + begin: Alignment.center, + end: Alignment.center, + colors: [ + Color(0xFF71787E),AppGlobal.appTextColor + ]); List backgroundIconColors = List(3); backgroundIconColors[0] = Colors.white12; backgroundIconColors[1] = Colors.white38; @@ -336,7 +351,7 @@ class _HomeScreenState extends State { if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], @@ -373,7 +388,7 @@ class _HomeScreenState extends State { } patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.inpatient, textColor: textColors[colorIndex], @@ -393,7 +408,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], //TODO Elham* match the of the icon cardIcon: DoctorApp.arrival_patients, @@ -411,7 +426,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], @@ -438,7 +453,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.referral_1, textColor: textColors[colorIndex], @@ -456,7 +471,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search, textColor: textColors[colorIndex], @@ -473,7 +488,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search_medicines, textColor: textColors[colorIndex], diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index ef9f8b03..a8900213 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -1,3 +1,4 @@ +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'; @@ -197,9 +198,9 @@ class _InPatientScreenState extends State child: Container( height: screenSize.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, + isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + borderRadius: isActive?4:0, borderWidth: 0), child: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 7956eb1d..37aff38f 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -75,6 +75,7 @@ class BottomNavigationItem extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2, + letterSpacing: 0.24, color: AppGlobal.appTextColor, fontWeight: FontWeight.w600) //#989898, ), diff --git a/pubspec.lock b/pubspec.lock index 6fcaaa5a..86ae6905 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -706,7 +706,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: @@ -1040,7 +1040,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: @@ -1245,5 +1245,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" + dart: ">=2.10.2 <2.11.0" flutter: ">=1.22.2 <2.0.0" From f97b0bee141f69828c6d2322602231ef590ed44e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 8 Dec 2021 15:23:54 +0200 Subject: [PATCH 173/199] add gradiant to home page --- lib/screens/home/home_screen.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 1014566f..4e577bb9 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -327,10 +327,10 @@ class _HomeScreenState extends State { AppGlobal.appRedColor,Color(0xFFAD3B3B), ]);//AppGlobal.appRedColor; backgroundColors[1] = LinearGradient( - begin: Alignment(-1.0, -2.0), - end: Alignment(1.0, 2.0), + begin: Alignment.center, + end: Alignment.center, colors: [ - Color(0xFFC9C9C9),Color(0xFFEDEDED) + Color(0xFFC9C9C9),Color(0xFFC9C9C9), ]); backgroundColors[2] = LinearGradient( begin: Alignment.center, @@ -344,7 +344,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(); From 658a28e558091ea52dcbe16f3b94496979225205 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 8 Dec 2021 16:55:24 +0200 Subject: [PATCH 174/199] referal patient card design fix --- .../insurance_approval_screen_patient.dart | 127 ++++++++++-------- .../profile/lab_result/labs_home_page.dart | 95 +++++++------ .../prescription/prescriptions_page.dart | 33 ++--- .../patient-referral-item-widget.dart | 112 ++++++--------- .../patients/patient_service_title.dart | 43 ++++++ .../profile/add-order/addNewOrder.dart | 21 +-- 6 files changed, 234 insertions(+), 197 deletions(-) create mode 100644 lib/widgets/patients/patient_service_title.dart diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 2c89425e..ca018916 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_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/patient_service_title.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'; @@ -22,10 +23,12 @@ class InsuranceApprovalScreenNew extends StatefulWidget { InsuranceApprovalScreenNew({this.appointmentNo}); @override - _InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState(); + _InsuranceApprovalScreenNewState createState() => + _InsuranceApprovalScreenNewState(); } -class _InsuranceApprovalScreenNewState extends State { +class _InsuranceApprovalScreenNewState + extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -39,9 +42,11 @@ class _InsuranceApprovalScreenNewState extends State ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: int.parse(patient?.appointmentNo.toString()), projectId: patient.projectId) + appointmentNo: int.parse(patient?.appointmentNo.toString()), + projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( appBar: PatientProfileAppBar( patient, isInpatient: isInpatient, @@ -59,32 +64,11 @@ class _InsuranceApprovalScreenNewState extends State ), child: model.insuranceApprovalInPatient.length != 0 ? Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), + ServiceTitle( + title: TranslationBase.of(context).insurance22, + subTitle: TranslationBase.of(context).approvals22, ), ...List.generate( model.insuranceApprovalInPatient.length, @@ -94,25 +78,40 @@ class _InsuranceApprovalScreenNewState extends State Navigator.push( context, MaterialPageRoute( - builder: (context) => InsuranceApprovalsDetails( + builder: (context) => + InsuranceApprovalsDetails( patient: patient, indexInsurance: index, patientType: patientType, ), - settings: RouteSettings(name: 'InsuranceApprovalsDetails'), + settings: RouteSettings( + name: 'InsuranceApprovalsDetails'), ), ); }, child: DoctorCardInsurance( patientOut: "In Patient", - profileUrl: model.insuranceApprovalInPatient[index].doctorImage, - clinic: model.insuranceApprovalInPatient[index].clinicName, - doctorName: model.insuranceApprovalInPatient[index].doctorName, - branch: model.insuranceApprovalInPatient[index].approvalNo.toString(), + profileUrl: model + .insuranceApprovalInPatient[index] + .doctorImage, + clinic: model + .insuranceApprovalInPatient[index] + .clinicName, + doctorName: model + .insuranceApprovalInPatient[index] + .doctorName, + branch: model + .insuranceApprovalInPatient[index] + .approvalNo + .toString(), isPrescriptions: true, - approvalStatus: - model.insuranceApprovalInPatient[index].approvalStatusDescption ?? '', - branch2: model.insuranceApprovalInPatient[index].projectName, + approvalStatus: model + .insuranceApprovalInPatient[index] + .approvalStatusDescption ?? + '', + branch2: model + .insuranceApprovalInPatient[index] + .projectName, ), ), ), @@ -129,7 +128,8 @@ class _InsuranceApprovalScreenNewState extends State Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noInsuranceApprovalFound), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ), SizedBox( height: 150.0, @@ -156,7 +156,8 @@ class _InsuranceApprovalScreenNewState extends State Row( children: [ AppText( - TranslationBase.of(context).insurance22, + TranslationBase.of(context) + .insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -166,7 +167,8 @@ class _InsuranceApprovalScreenNewState extends State Row( children: [ AppText( - TranslationBase.of(context).approvals22, + TranslationBase.of(context) + .approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -180,31 +182,47 @@ class _InsuranceApprovalScreenNewState extends State (index) => Container( child: InkWell( onTap: () async { - await locator().logEvent( - eventCategory: "Insurance Approval Screen New", - eventAction: "Insurance Approval Details", + await locator() + .logEvent( + eventCategory: + "Insurance Approval Screen New", + eventAction: + "Insurance Approval Details", ); Navigator.push( context, MaterialPageRoute( - builder: (context) => InsuranceApprovalsDetails( + builder: (context) => + InsuranceApprovalsDetails( patient: patient, indexInsurance: index, patientType: patientType, ), - settings: RouteSettings(name: 'InsuranceApprovalsDetails'), + settings: RouteSettings( + name: + 'InsuranceApprovalsDetails'), ), ); }, child: DoctorCardInsurance( - patientOut: model.insuranceApproval[index].patientDescription, - profileUrl: model.insuranceApproval[index].doctorImage, - clinic: model.insuranceApproval[index].clinicName, - doctorName: model.insuranceApproval[index].doctorName, - branch: model.insuranceApproval[index].approvalNo.toString(), + patientOut: model.insuranceApproval[index] + .patientDescription, + profileUrl: model + .insuranceApproval[index].doctorImage, + clinic: model + .insuranceApproval[index].clinicName, + doctorName: model + .insuranceApproval[index].doctorName, + branch: model + .insuranceApproval[index].approvalNo + .toString(), isPrescriptions: true, - approvalStatus: model.insuranceApproval[index].approvalStatusDescption ?? '', - branch2: model.insuranceApproval[index].projectName, + approvalStatus: model + .insuranceApproval[index] + .approvalStatusDescption ?? + '', + branch2: model + .insuranceApproval[index].projectName, ), ), ), @@ -221,7 +239,8 @@ class _InsuranceApprovalScreenNewState extends State Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noInsuranceApprovalFound), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ) ], ), 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 2c6dbb0c..67303256 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laborator 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/patient_service_title.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'; @@ -66,27 +67,14 @@ class _LabsHomePageState extends State { SizedBox( height: 12, ), - if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).lab, - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - AppText( - TranslationBase.of(context).result, - bold: true, - fontSize: 22, - ), - ], - ), + if (model.patientLabOrdersList.isNotEmpty && + patient.patientStatusType != 43) + ServiceTitle( + title: TranslationBase.of(context).lab, + subTitle: TranslationBase.of(context).result, ), - if (patient.patientStatusType != null && patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -106,7 +94,8 @@ class _LabsHomePageState extends State { ], ), ), - if ((patient.patientStatusType != null && patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { @@ -146,26 +135,44 @@ class _LabsHomePageState extends State { child: Container( width: 20, decoration: BoxDecoration( - color: model.patientLabOrdersList[index].isLiveCareAppointment + color: model.patientLabOrdersList[index] + .isLiveCareAppointment ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient + : !model.patientLabOrdersList[index] + .isInOutPatient ? 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, child: Center( child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient - ? TranslationBase.of(context).inPatientLabel.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), + model.patientLabOrdersList[index] + .isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.patientLabOrdersList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -181,7 +188,8 @@ class _LabsHomePageState extends State { context, FadePage( page: LaboratoryResultPage( - patientLabOrders: model.patientLabOrdersList[index], + patientLabOrders: + model.patientLabOrdersList[index], patient: patient, isInpatient: isInpatient, arrivalType: arrivalType, @@ -189,12 +197,18 @@ class _LabsHomePageState extends State { ), ), ), - doctorName: model.patientLabOrdersList[index].doctorName, - invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model.patientLabOrdersList[index].doctorImageURL, - branch: model.patientLabOrdersList[index].projectName, - clinic: model.patientLabOrdersList[index].clinicDescription, - appointmentDate: model.patientLabOrdersList[index].orderDate, + doctorName: + model.patientLabOrdersList[index].doctorName, + invoiceNO: + ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model + .patientLabOrdersList[index].doctorImageURL, + branch: + model.patientLabOrdersList[index].projectName, + clinic: model + .patientLabOrdersList[index].clinicDescription, + appointmentDate: + model.patientLabOrdersList[index].orderDate, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), @@ -203,7 +217,8 @@ class _LabsHomePageState extends State { ), ), ), - if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) + if (model.patientLabOrdersList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index b3cb4ec0..d61ac08d 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -7,6 +7,7 @@ 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/patient_service_title.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'; @@ -57,16 +58,10 @@ class PrescriptionsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context).orders, - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - AppText( - TranslationBase.of(context).prescriptions, - bold: true, - fontSize: 22, + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: + TranslationBase.of(context).prescriptions, ), ], ), @@ -78,16 +73,10 @@ class PrescriptionsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context).orders, - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - AppText( - TranslationBase.of(context).prescriptions, - bold: true, - fontSize: 22, + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: + TranslationBase.of(context).prescriptions, ), ], ), @@ -169,10 +158,6 @@ class PrescriptionsPage extends StatelessWidget { child: ListView( physics: BouncingScrollPhysics(), children: [ - // SizedBox( - // height: 12, - // ), - ListView.builder( scrollDirection: Axis.vertical, physics: NeverScrollableScrollPhysics(), diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 3d49c1e1..d2e495ee 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -5,6 +5,7 @@ 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_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -81,8 +82,9 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralStatus != null ? referralStatus : "", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700, + fontSize: 10.0, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, color: referralStatusCode == 1 ? Color(0xffc4aa54) : referralStatusCode == 2 @@ -97,7 +99,8 @@ class PatientReferralItemWidget extends StatelessWidget { referredDate, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + letterSpacing: -0.48, + fontSize: 12.0, color: Color(0XFF28353E), ) ], @@ -108,24 +111,23 @@ class PatientReferralItemWidget extends StatelessWidget { Expanded( child: AppText( patientName, - fontSize: SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, - color: Colors.black, + fontSize: 16.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), fontFamily: 'Poppins', + letterSpacing: -0.64, ), ), SizedBox( - width: 4, + width: 0, ), patientGender == 1 ? Icon( DoctorApp.male_2, color: Colors.blue, ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), + : Icon(DoctorApp.female_1, + color: Color(0xffF0448D)), SizedBox( width: 4, ), @@ -133,8 +135,9 @@ class PatientReferralItemWidget extends StatelessWidget { referredTime, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 12.0, color: Color(0XFF575757), + letterSpacing: 0.48, ) ], ), @@ -148,19 +151,10 @@ class PatientReferralItemWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context).fileNumber, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - AppText( - patientID, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + CustomRow( + label: + TranslationBase.of(context).fileNumber, + value: patientID, ), ], ), @@ -168,30 +162,18 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - isSameBranch + CustomRow( + label: isSameBranch ? TranslationBase.of(context) .referredFrom : TranslationBase.of(context).refClinic, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - !isReferralClinic - ? isSameBranch - ? TranslationBase.of(context) - .sameBranch - : TranslationBase.of(context) - .otherBranch - : " " + referralClinic, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), + value: !isReferralClinic + ? isSameBranch + ? TranslationBase.of(context) + .sameBranch + : TranslationBase.of(context) + .otherBranch + : " " + referralClinic, ), ], ), @@ -202,9 +184,10 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ AppText( nationality != null ? nationality : "", - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w600, color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: 10.0, + letterSpacing: -0.4, ), nationalityFlag != null ? ClipRRect( @@ -228,22 +211,9 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context).remarks + " : ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - remark ?? "", - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - maxLines: 1, - ), + CustomRow( + label: TranslationBase.of(context).remarks + " : ", + value: remark ?? "", ), ], ), @@ -301,17 +271,19 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralDoctorName, fontFamily: 'Poppins', - fontWeight: FontWeight.w800, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14.0, + color: Color(0xff2E303A), + letterSpacing: -0.56, ), if (clinicDescription != null) AppText( clinicDescription, fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.4 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 10.0, + color: Color(0xff575757), + letterSpacing: -0.4, ), ], ), diff --git a/lib/widgets/patients/patient_service_title.dart b/lib/widgets/patients/patient_service_title.dart new file mode 100644 index 00000000..08ce9293 --- /dev/null +++ b/lib/widgets/patients/patient_service_title.dart @@ -0,0 +1,43 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ServiceTitle extends StatefulWidget { + final String title; + final String subTitle; + + const ServiceTitle({Key key, this.title, this.subTitle}) : super(key: key); + + @override + _ServiceTitleState createState() => _ServiceTitleState(); +} + +class _ServiceTitleState extends State { + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.title, + color: Color(0xff2E303A), + fontSize: 12.0, + letterSpacing: -0.72, + fontWeight: FontWeight.w600, + fontHeight: 1.0, + ), + AppText( + widget.subTitle, + color: Color(0xff2E303A), + fontSize: 24, + fontWeight: FontWeight.w700, + letterSpacing: -1.44, + fontHeight: 1.0, + ), + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart index 275888e3..cc9223f6 100644 --- a/lib/widgets/patients/profile/add-order/addNewOrder.dart +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -4,7 +4,8 @@ import 'package:flutter/material.dart'; class AddNewOrder extends StatelessWidget { const AddNewOrder({ Key key, - this.onTap, this.label, + this.onTap, + this.label, }) : super(key: key); final Function onTap; @@ -16,22 +17,22 @@ class AddNewOrder extends StatelessWidget { onTap: onTap, child: Container( width: double.maxFinite, - height: 140, + height: MediaQuery.of(context).size.height * 0.18, margin: EdgeInsets.all(10), decoration: BoxDecoration( - color: Colors.grey[300], + color: Color(0xffEAEAEA), borderRadius: BorderRadius.circular(10), ), child: Center( child: Container( - height: 90, + height: MediaQuery.of(context).size.height * 0.11, child: Column( children: [ Container( - height: 40, - width: 40, + height: MediaQuery.of(context).size.height * 0.05, + width: MediaQuery.of(context).size.height * 0.05, decoration: BoxDecoration( - color: Colors.grey[600], + color: Color(0xff7E7E7E), borderRadius: BorderRadius.circular(10), ), child: Center( @@ -45,8 +46,10 @@ class AddNewOrder extends StatelessWidget { height: 10, ), AppText( - label ??'', - color: Colors.grey[600], + label ?? '', + color: Color(0xff7E7E7E), + letterSpacing: -0.64, + fontSize: 16.0, fontWeight: FontWeight.w600, ) ], From 9e4a9c4b6ac0570a970135bd6f7faf310e675627 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 09:15:37 +0200 Subject: [PATCH 175/199] fix in patient --- ios/Runner.xcodeproj/project.pbxproj | 7 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 10 ++--- .../In_patient/in_patient_screen.dart | 43 ++++++++++--------- lib/util/helpers.dart | 23 +++++++++- 4 files changed, 50 insertions(+), 33 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 77994274..80868187 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -215,7 +215,6 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = 3A359E86ZF; LastSwiftMigration = 1100; }; }; @@ -416,7 +415,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = 3A359E86ZF; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -551,7 +550,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = 3A359E86ZF; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -582,7 +581,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = 3A359E86ZF; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..bfbb2561 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - Expanded( child: Scaffold( extendBodyBehindAppBar: false, + appBar: PreferredSize( preferredSize: Size.fromHeight( MediaQuery.of(context).size.height * 0.070), @@ -124,26 +125,28 @@ class _InPatientScreenState extends State width: 0.5), //width: 0.7 ), color: Colors.white), - child: Center( + child: Container( + margin: EdgeInsets.only(top: 9), child: TabBar( isScrollable: false, controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, + indicatorColor: Colors.red, + indicatorWeight: 0.001, + indicator:BoxDecoration(), + // indicatorSize: TabBarIndicatorSize.tab, + // labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only( top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], + // unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, - counter: model.inPatientList.length), + counter: model.inPatientList.length, isFirst: true), tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).myInPatientTitle, - counter: model.myIinPatientList.length), + counter: model.myIinPatientList.length, isMiddle: true), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged), + TranslationBase.of(context).discharged, isLast:true), ], ), ), @@ -193,23 +196,23 @@ class _InPatientScreenState extends State } Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + {int counter = -1, + bool isFirst = false, + bool isMiddle = false, + bool isLast = false,}) { return Center( child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), - isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), - borderRadius: isActive?4:0, - borderWidth: 0), + height: screenSize.height * 0.060, + decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ AppText( title, fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, + color: isActive ? Colors.white : AppGlobal.appTextColor, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, ), if (counter != -1) Container( @@ -217,7 +220,7 @@ class _InPatientScreenState extends State width: 15, height: 15, decoration: BoxDecoration( - color: isActive ? Colors.white : Color(0xFFD02127), + color: isActive ? Colors.white : AppGlobal.appRedColor, shape: BoxShape.circle, ), child: Center( @@ -225,7 +228,7 @@ class _InPatientScreenState extends State child: AppText( "$counter", fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : Color(0xFFD02127), + color: !isActive ? Colors.white : AppGlobal.appRedColor, fontWeight: FontWeight.w700, ), ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 86a09468..b81269b7 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -188,7 +188,8 @@ class Helpers { static clearSharedPref() async { await sharedPref.clear(); } - static getCardBoxDecoration(){ + + static getCardBoxDecoration() { return BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.white, @@ -328,5 +329,23 @@ class Helpers { return kpi; } - + static getBoxTabsBoxDecoration( + { + bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + bool isActive = false, + double radius = 6.0 + }) { + return BoxDecoration( + color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + topRight: Radius.circular(isActive?isFirst || isMiddle?radius:0:0), + bottomRight: Radius.circular(isActive?isFirst || isMiddle?radius:0:0), + topLeft: Radius.circular(isActive?isLast|| isMiddle?radius:0:0), + bottomLeft: Radius.circular(isActive?isLast || isMiddle?radius:0:0) + ), + ); + } } From 85e6f63094580f351770c378730680d9efa35c7c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 9 Dec 2021 09:19:12 +0200 Subject: [PATCH 176/199] app button color fix in multiple screens --- .../patients/profile/UCAF/ucaf_pager_screen.dart | 3 ++- .../RegisterConfirmationPatientPage.dart | 9 ++++++--- .../patients/register_patient/RegisterPatientPage.dart | 3 ++- .../register_patient/RegisterSearchPatientPage.dart | 10 ++++++---- .../patients/register_patient/VerifyMethodPage.dart | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 8c38ece7..5608c461 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -9,6 +9,7 @@ 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:hexcolor/hexcolor.dart'; import '../../../../routes.dart'; import 'UCAF-detail-screen.dart'; @@ -195,7 +196,7 @@ class _UCAFPagerScreenState extends State vPadding: 8, hPadding: 8, borderColor: Color(0xFFB8382B), - color: Color(0xFFB8382B), + color: HexColor("#D02127"), fontColor: Colors.white, fontSize: 2.0, onPressed: () { diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index be79162b..6443e972 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -29,6 +29,7 @@ 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/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -134,7 +135,8 @@ class _RegisterConfirmationPatientPageState CustomEditableText( controller: firstNameAr, isSubmitted: isSubmitted, - hint: TranslationBase.of(context).firstNameInAr), + hint: + TranslationBase.of(context).firstNameInAr), SizedBox( height: 4, ), @@ -142,7 +144,8 @@ class _RegisterConfirmationPatientPageState controller: middleNameAr, isEditable: middleNameN.text.isEmpty, isSubmitted: isSubmitted, - hint: TranslationBase.of(context).middleNameInAr), + hint: + TranslationBase.of(context).middleNameInAr), SizedBox( height: 4, ), @@ -381,7 +384,7 @@ class _RegisterConfirmationPatientPageState vPadding: 12, hPadding: 8, borderColor: Color(0xFFB8382B), - color: Color(0xFFB8382B), + color: HexColor("#D02127"), fontColor: Colors.white, fontSize: 2.0, onPressed: () async { diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 28e44c6a..2a2e7ed5 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -8,6 +8,7 @@ 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/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'RegisterSearchPatientPage.dart'; @@ -202,7 +203,7 @@ class _RegisterPatientPageState extends State vPadding: 12, hPadding: 8, borderColor: Color(0xFFB8382B), - color: Color(0xFFB8382B), + color: HexColor("#D02127"), fontColor: Colors.white, fontSize: 2.0, onPressed: () { diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 6b10bfd1..ab14f601 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -20,6 +20,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/country_textfield_custom.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:hijri_picker/hijri_picker.dart'; import 'package:doctor_app_flutter/core/enum/CalenderType.dart'; @@ -44,7 +45,7 @@ class _RegisterSearchPatientPageState extends State { List countryList; - dynamic country ; + dynamic country; bool isSubmitted = false; @@ -226,7 +227,8 @@ class _RegisterSearchPatientPageState extends State { children: [ Expanded( child: RadioListTile( - title: AppText(TranslationBase.of(context).gregorian), + title: + AppText(TranslationBase.of(context).gregorian), value: CalenderType.Gregorian, groupValue: calenderType, onChanged: (CalenderType value) { @@ -255,7 +257,7 @@ class _RegisterSearchPatientPageState extends State { ), AppTextFieldCustom( height: screenSize.height * 0.075, - hintText:TranslationBase.of(context).birthdate, + hintText: TranslationBase.of(context).birthdate, dropDownText: getBirthdate(), enabled: false, isTextFieldHasSuffix: true, @@ -342,7 +344,7 @@ class _RegisterSearchPatientPageState extends State { vPadding: 12, hPadding: 8, borderColor: Color(0xFFB8382B), - color: Color(0xFFB8382B), + color: HexColor("#D02127"), fontColor: Colors.white, fontSize: 2.0, onPressed: () async { diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 2759c326..9636f2ca 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -458,7 +458,7 @@ class _ActivationPageState extends State { vPadding: 12, hPadding: 8, borderColor: Color(0xFFB8382B), - color: Color(0xFFB8382B), + color: HexColor("#D02127"), fontColor: Colors.white, fontSize: 2.0, onPressed: () async { From c6a77563cc1dd0a9decd2d47230ddb4ec8c4bce7 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 9 Dec 2021 09:52:17 +0200 Subject: [PATCH 177/199] app button color match --- lib/screens/auth/login_screen.dart | 3 +- .../profile/UCAF/ucaf_pager_screen.dart | 3 +- .../referral/my-referral-detail-screen.dart | 150 +++++++++++++----- .../register_patient/RegisterPatientPage.dart | 3 +- .../RegisterSearchPatientPage.dart | 2 +- lib/screens/procedures/update-procedure.dart | 3 +- .../prescription_in_patinets_widget.dart | 3 +- 7 files changed, 117 insertions(+), 50 deletions(-) diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 083c2ab3..78c68256 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -1,3 +1,4 @@ +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/hospitals/get_hospitals_response_model.dart'; @@ -195,7 +196,7 @@ class _LoginScreenState extends State { children: [ AppButton( title: TranslationBase.of(context).login, - color: Color(0xFFD02127), + color: AppGlobal.appRedColor, fontWeight: FontWeight.w600, disabled: authenticationViewModel.userInfo.userID == null || authenticationViewModel.userInfo.password == null, diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 5608c461..b6fce680 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -1,3 +1,4 @@ +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/models/patient/patiant_info_model.dart'; @@ -196,7 +197,7 @@ class _UCAFPagerScreenState extends State vPadding: 8, hPadding: 8, borderColor: Color(0xFFB8382B), - color: HexColor("#D02127"), + color: AppGlobal.appRedColor, fontColor: Colors.white, fontSize: 2.0, onPressed: () { diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 218c568d..bd349f0f 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -19,7 +19,8 @@ import 'package:flutter/material.dart'; class MyReferralDetailScreen extends StatelessWidget { final MyReferralPatientModel referralPatient; - const MyReferralDetailScreen({Key key, this.referralPatient}) : super(key: key); + const MyReferralDetailScreen({Key key, this.referralPatient}) + : super(key: key); @override Widget build(BuildContext context) { @@ -54,7 +55,9 @@ class MyReferralDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize(referralPatient.firstName + " " + referralPatient.lastName)), + (Helpers.capitalize(referralPatient.firstName + + " " + + referralPatient.lastName)), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -94,23 +97,31 @@ class MyReferralDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( referralPatient.referralStatus != null - ? model.getReferralStatusNameByCode(referralPatient.referralStatus, context) + ? model.getReferralStatusNameByCode( + referralPatient.referralStatus, + context) : "", fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referralPatient.referralStatus == 1 ? Color(0xffc4aa54) - : referralPatient.referralStatus == 46 || referralPatient.referralStatus == 2 + : referralPatient.referralStatus == + 46 || + referralPatient + .referralStatus == + 2 ? AppGlobal.appGreenColor : Colors.red[700], ), AppText( - AppDateUtils.getDayMonthYearDateFormatted(referralPatient.referralDate), + AppDateUtils.getDayMonthYearDateFormatted( + referralPatient.referralDate), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -119,29 +130,35 @@ class MyReferralDetailScreen 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( "${referralPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), AppText( - AppDateUtils.getTimeHHMMA(referralPatient.referralDate), + AppDateUtils.getTimeHHMMA( + referralPatient.referralDate), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -150,50 +167,70 @@ class MyReferralDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).referredFrom, + TranslationBase.of(context) + .referredFrom, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( - referralPatient.targetProjectId == referralPatient.sourceProjectId - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch, + referralPatient + .targetProjectId == + referralPatient + .sourceProjectId + ? TranslationBase.of( + context) + .sameBranch + : TranslationBase.of( + context) + .otherBranch, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks + " : ", + TranslationBase.of(context) + .remarks + + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referralPatient.referringDoctorRemarks ?? '', + referralPatient + .referringDoctorRemarks ?? + '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -205,22 +242,29 @@ class MyReferralDetailScreen extends StatelessWidget { Row( children: [ AppText( - referralPatient.nationalityName != null + referralPatient.nationalityName != + null ? referralPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: + 1.4 * SizeConfig.textMultiplier, ), - referralPatient.nationalityFlagURL != null + referralPatient.nationalityFlagURL != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), + borderRadius: + BorderRadius.circular(20.0), child: Image.network( - referralPatient.nationalityFlagURL, + referralPatient + .nationalityFlagURL, height: 25, width: 30, - errorBuilder: - (BuildContext context, Object exception, StackTrace stackTrace) { + errorBuilder: (BuildContext + context, + Object exception, + StackTrace stackTrace) { return Text('No Image'); }, )) @@ -233,7 +277,8 @@ class MyReferralDetailScreen 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, @@ -241,14 +286,20 @@ class MyReferralDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), + margin: EdgeInsets.only( + left: 0, + top: 25, + right: 0, + bottom: 0), + padding: EdgeInsets.only( + left: 4.0, right: 4.0), child: Container( width: 40, height: 40, child: CircleAvatar( radius: 25.0, - backgroundImage: NetworkImage(referralPatient.doctorImageURL), + backgroundImage: NetworkImage( + referralPatient.doctorImageURL), backgroundColor: Colors.transparent, ), ), @@ -256,14 +307,19 @@ class MyReferralDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only( + left: 10, + top: 25, + right: 10, + bottom: 0), child: Column( children: [ AppText( referralPatient.doctorName, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -294,7 +350,8 @@ class MyReferralDetailScreen extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 16), child: SizedBox( child: ProfileMedicalInfoWidgetSearch( - patient: model.getPatientFromReferralO(referralPatient), + patient: model + .getPatientFromReferralO(referralPatient), patientType: "7", isInpatient: false, from: null, @@ -326,7 +383,9 @@ class MyReferralDetailScreen extends StatelessWidget { if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context) + .referralSuccessMsgAccept); model.getMyReferralOutPatientService(); Navigator.pop(context); Navigator.pop(context); @@ -340,18 +399,21 @@ class MyReferralDetailScreen extends StatelessWidget { Expanded( child: AppButton( title: TranslationBase.of(context).reject, - color: Color(0xFFB9382C), + color: AppGlobal.appRedColor, fontColor: Colors.white, fontSize: 1.6, hPadding: 8, vPadding: 12, disabled: model.state == ViewState.Busy, onPressed: () async { - await model.responseReferral(referralPatient, false); + await model.responseReferral( + referralPatient, false); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context) + .referralSuccessMsgReject); model.getMyReferralOutPatientService(); Navigator.pop(context); Navigator.pop(context); diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 2a2e7ed5..e7423f89 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; @@ -203,7 +204,7 @@ class _RegisterPatientPageState extends State vPadding: 12, hPadding: 8, borderColor: Color(0xFFB8382B), - color: HexColor("#D02127"), + color: AppGlobal.appRedColor, fontColor: Colors.white, fontSize: 2.0, onPressed: () { diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index ab14f601..69a2c643 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -344,7 +344,7 @@ class _RegisterSearchPatientPageState extends State { vPadding: 12, hPadding: 8, borderColor: Color(0xFFB8382B), - color: HexColor("#D02127"), + color: AppGlobal.appRedColor, fontColor: Colors.white, fontSize: 2.0, onPressed: () async { diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 24c4ea41..a11ac875 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -1,3 +1,4 @@ +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/procedure/ControlsModel.dart'; @@ -324,7 +325,7 @@ class _UpdateProcedureWidgetState extends State { ), AppButton( title: TranslationBase.of(context).cancel, - color: Color(0xFFB9382C), + color: AppGlobal.appRedColor, onPressed: () { Navigator.pop(context); }, diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 0d622420..52af839c 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/routes.dart'; @@ -29,7 +30,7 @@ class PrescriptionInPatientWidget extends StatelessWidget { padding: EdgeInsets.all(40), decoration: BoxDecoration( border: - Border.all(color: HexColor('#D02127'), width: 4), + Border.all(color: AppGlobal.appRedColor, width: 4), borderRadius: BorderRadius.all(Radius.circular(100))), child: IconButton( icon: Icon( From 25e09fa105ed152d6a7da26b52077bfb9b8d8db6 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 10:59:17 +0200 Subject: [PATCH 178/199] fix taps inside in patient --- lib/config/localized_values.dart | 8 +-- .../In_patient/in_patient_screen.dart | 32 ++--------- .../out_patient/out_patient_screen.dart | 57 +++++-------------- lib/util/helpers.dart | 41 +++++++++++++ 4 files changed, 64 insertions(+), 74 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 189eb976..3fa70057 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -52,11 +52,11 @@ const Map> localizedValues = { "radiology": {"en": "Radiology", "ar": "الأشعة"}, "service": {"en": "Service", "ar": "خدمة"}, "referral": {"en": "Referral", "ar": "الإحالة"}, - "inPatient": {"en": "InPatients", "ar": "مرضاي"}, - "myInPatient": {"en": "My\nInPatients", "ar": "مرضاي\nالمنومين"}, - "myInPatientTitle": {"en": "My InPatients", "ar": "مرضاي المنومين"}, + "inPatient": {"en": "In Patients", "ar": "مرضاي"}, + "myInPatient": {"en": "My\n Patients", "ar": "مرضاي\nالمنومين"}, + "myInPatientTitle": {"en": "My Patients", "ar": "مرضاي المنومين"}, "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, - "inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, + "inPatientAll": {"en": "All Patients", "ar": "جميع المرضى المنومين"}, "operations": {"en": "Operations", "ar": "عمليات"}, "patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"}, "searchMedicineDashboard": { diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 93b90512..5be1c1c5 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -130,7 +130,7 @@ class _InPatientScreenState extends State child: TabBar( isScrollable: false, controller: _tabController, - indicatorColor: Colors.red, + indicatorColor: AppGlobal.appRedColor, indicatorWeight: 0.001, indicator:BoxDecoration(), // indicatorSize: TabBarIndicatorSize.tab, @@ -202,38 +202,14 @@ class _InPatientScreenState extends State bool isLast = false,}) { return Center( child: Container( - height: screenSize.height * 0.060, + height: Helpers.getTabHeight(context), decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : AppGlobal.appTextColor, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, - ), + Helpers.getTabText(title:title, isActive:isActive), if (counter != -1) - Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : AppGlobal.appRedColor, - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : AppGlobal.appRedColor, - fontWeight: FontWeight.w700, - ), - ), - ), - ), + Helpers.getTabCounter(isActive:isActive,counter:counter) ], ), ), diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 5a6a0083..ab320f07 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; 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/helpers.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_scaffold_widget.dart'; @@ -105,7 +106,7 @@ class _OutPatientsScreenState extends State { children: [ Container( // color: Colors.red, - height: screenSize.height * 0.070, + height: Helpers.getTabHeight(context), decoration: TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC), borderRadius: 4, borderWidth: 0), @@ -143,52 +144,24 @@ class _OutPatientsScreenState extends State { child: 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), + decoration: Helpers.getBoxTabsBoxDecoration( + isActive: _isActive, + isFirst: _times.indexOf(item) == 0, + isLast: + _times.indexOf(item) == _times.length - 1, + isMiddle: _times.indexOf(item) != 0 && _times.indexOf(item) != _times.length - 1 + + ), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive - ? Colors.white - : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), + Helpers.getTabText(title: item, isActive: _isActive), _isActive && _activeLocation != 0 && model.state == ViewState.Idle - ? Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.symmetric( - horizontal: 5), - decoration: new BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.circular(50), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - model.filterData.length.toString(), - style: new TextStyle( - color: Colors.red, - fontSize: 10), - textAlign: TextAlign.center, - ), - ) + ? Helpers.getTabCounter(isActive:_isActive,counter: model.filterData.length) + : Container(), ], ), @@ -245,7 +218,6 @@ class _OutPatientsScreenState extends State { }, ), ), - Expanded( child: Container( child: model.filterData.isEmpty @@ -267,7 +239,8 @@ class _OutPatientsScreenState extends State { .patientStatusType == 43)) return Padding( - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), + padding: EdgeInsets.symmetric( + horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], patientType: patientType, diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index b81269b7..0d7cd088 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -348,4 +348,45 @@ class Helpers { ), ); } + + static getTabText({String title, bool isActive = false,}){ + return AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.8, + color: isActive ? Colors.white : AppGlobal.appTextColor, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ); + + } + + + static getTabHeight(BuildContext context){ + final screenSize = MediaQuery.of(context).size; + return screenSize.height * 0.07; + } + + static getTabCounter({bool isActive: false,int counter}){ + return Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : AppGlobal.appRedColor, + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : AppGlobal.appRedColor, + fontWeight: FontWeight.w700, + ), + ), + ), + ); + } + + } From fb513251885f3669eeac0835a67cd1d81d66cc0d Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 11:15:11 +0200 Subject: [PATCH 179/199] fix tabs inside doctor replay --- .../doctor_replay/doctor_reply_screen.dart | 99 +++++++------------ 1 file changed, 36 insertions(+), 63 deletions(-) diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 8b51319c..4905da58 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -81,38 +81,33 @@ class _DoctorReplyScreenState extends State 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 + 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, + /// TODO Elham* Add Tran + "Not Replied", + isFirst: true, context: context ), - 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, - "Not Replied", - ), - tabWidget( - screenSize, - _activeTab == 1, - TranslationBase.of(context).all, - ), - ], - ), + tabWidget( + screenSize, + _activeTab == 1, + + TranslationBase.of(context).all, + isLast: true, + context: context + ), + ], ), ), ), @@ -140,44 +135,22 @@ class _DoctorReplyScreenState extends State } Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + {int counter = -1, bool isFirst = false, + bool isMiddle = false, + bool isLast = false,context}) { 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), + height: Helpers.getTabHeight(context), + decoration: Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), + Helpers.getTabText(title: title, isActive: isActive), 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, - ), - ), - ), - ), + Helpers.getTabCounter( + isActive: isActive, + counter:counter + ) ], ), ), From c6635397bbb5aa4535d4199407f349291f1a1b3b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 9 Dec 2021 11:36:35 +0200 Subject: [PATCH 180/199] referral screen design fix --- lib/landing_page.dart | 11 +- .../referral/my-referral-patient-screen.dart | 1 - .../referral/patient_referral_screen.dart | 240 ++++++++---------- .../referral/refer-patient-screen.dart | 216 ++++++++++------ .../patient-referral-item-widget.dart | 2 +- 5 files changed, 265 insertions(+), 205 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 72b5c857..69cae394 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -5,6 +5,7 @@ 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/app_texts_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'; @@ -41,7 +42,13 @@ class _LandingPageState extends State { backgroundColor: Colors.grey[100], //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), title: currentTab != 0 - ? Text(getText(currentTab).toUpperCase()) + ? AppText( + getText(currentTab), + letterSpacing: -1.44, + fontWeight: FontWeight.w700, + fontSize: 24.0, + color: Color(0xff2B353E), + ) : SizedBox(), leading: Builder( builder: (BuildContext context) { @@ -49,7 +56,7 @@ class _LandingPageState extends State { icon: Image.asset('assets/images/menu.png', height: 50, width: 50), iconSize: 15, - color: Colors.black, + color: Color(0xff2B353E), onPressed: () => Scaffold.of(context).openDrawer(), ); }, diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index fe6fd2db..2eefeb43 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -12,7 +12,6 @@ import '../../../../routes.dart'; class MyReferralPatientScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return BaseView( onModelReady: (model) => model.getPendingReferralPatients(), builder: (_, model, w) => AppScaffold( diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de1d5958..58ccde6a 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -1,6 +1,7 @@ import 'dart:ui'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -17,10 +18,10 @@ class PatientReferralScreen extends StatefulWidget { _PatientReferralScreen createState() => _PatientReferralScreen(); } -class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - +class _PatientReferralScreen extends State + with SingleTickerProviderStateMixin { TabController _tabController; - int index=0; + int index = 0; @override void initState() { @@ -41,143 +42,126 @@ class _PatientReferralScreen extends State with SingleTic _tabController.dispose(); } - @override Widget build(BuildContext context) { return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).patientsreferral, - body: Scaffold( - extendBodyBehindAppBar: true, - // backgroundColor: Colors.white, - appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 1), //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: [ - Container( - width: MediaQuery.of(context).size.width * 0.33, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 0 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).myReferredPatient, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 0 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), + appBar: PatientSearchHeader( + title: TranslationBase.of(context).patientsreferral, + ), + body: Column( + children: [ + Container( + //height: MediaQuery.of(context).size.height * 0.050, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 1), //width: 0.7 + ), + color: Colors.white), + 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: [ + Container( + width: MediaQuery.of(context).size.width * 0.33, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + TranslationBase.of(context).myReferredPatient, + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 0 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), ), - Container( - width: MediaQuery.of(context).size.width * 0.34, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 1 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).referral, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 1 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), + ), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.34, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + TranslationBase.of(context).referral, + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 1 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), ), - Container( - width: MediaQuery.of(context).size.width * 0.33, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 2 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).discharged, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 2 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), + ), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.33, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + TranslationBase.of(context).discharged, + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 2 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), ), - - ], + ), ), ), - ), + ], ), ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - ReferredPatientScreen(), - MyReferralInPatientScreen(), - ReferralDischargedPatientPage() - // MyReferredPatient(), - ], - ), - ) - ], - ), - )); + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + ReferredPatientScreen(), + MyReferralInPatientScreen(), + ReferralDischargedPatientPage() + // MyReferredPatient(), + ], + ), + ) + ], + ), + ); } } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 6010a422..f9371834 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -23,7 +23,8 @@ import 'package:hexcolor/hexcolor.dart'; class PatientMakeReferralScreen extends StatefulWidget { // previous design page is: ReferPatientScreen @override - _PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState(); + _PatientMakeReferralScreenState createState() => + _PatientMakeReferralScreenState(); } class _PatientMakeReferralScreenState extends State { @@ -56,8 +57,14 @@ class _PatientMakeReferralScreenState extends State { String arrivalType = routeArgs['arrivalType']; 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); @@ -103,25 +110,57 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? referralForm(model, screenSize) : PatientReferralItemWidget( - referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus, - patientName: model.patientReferral[model.patientReferral.length - 1].patientName, - patientGender: - model.patientReferral[model.patientReferral.length - 1].patientDetails.gender, - referredDate: - model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[0], - referredTime: - model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[1], - patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", - isSameBranch: - model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, + referralStatus: model + .patientReferral[ + model.patientReferral.length - 1] + .referralStatus, + patientName: model + .patientReferral[ + model.patientReferral.length - 1] + .patientName, + patientGender: model + .patientReferral[ + model.patientReferral.length - 1] + .patientDetails + .gender, + referredDate: model + .patientReferral[ + model.patientReferral.length - 1] + .referredOn + .split(" ")[0], + referredTime: model + .patientReferral[ + model.patientReferral.length - 1] + .referredOn + .split(" ")[1], + patientID: + "${model.patientReferral[model.patientReferral.length - 1].patientID}", + isSameBranch: model + .patientReferral[ + model.patientReferral.length - 1] + .isReferralDoctorSameBranch, isReferral: true, - remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource, - nationality: - model.patientReferral[model.patientReferral.length - 1].patientDetails.nationalityName, - nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl, - doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl, - referralDoctorName: - model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo, + remark: model + .patientReferral[ + model.patientReferral.length - 1] + .remarksFromSource, + nationality: model + .patientReferral[ + model.patientReferral.length - 1] + .patientDetails + .nationalityName, + nationalityFlag: model + .patientReferral[ + model.patientReferral.length - 1] + .nationalityFlagUrl, + doctorAvatar: model + .patientReferral[ + model.patientReferral.length - 1] + .doctorImageUrl, + referralDoctorName: model + .patientReferral[ + model.patientReferral.length - 1] + .referredByDoctorInfo, clinicDescription: null, ), ], @@ -140,22 +179,26 @@ class _PatientMakeReferralScreenState extends State { eventAction: "Submit Refer", ); 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; } @@ -166,10 +209,16 @@ class _PatientMakeReferralScreenState extends State { _selectedDoctor == null || _remarksController.text == null) return; model - .makeReferral(patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'], - _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) + .makeReferral( + patient, + appointmentDate.toIso8601String(), + _selectedBranch['facilityId'], + _selectedClinic['ClinicID'], + _selectedDoctor['DoctorID'], + _remarksController.text) .then((_) { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); }); }, @@ -215,7 +264,8 @@ class _PatientMakeReferralScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); await model .getClinics(_selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils.hideDialog(context)); + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } @@ -242,42 +292,47 @@ class _PatientMakeReferralScreenState extends State { 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, - onClick: - model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.branchesList, - attributeName: 'facilityName', - attributeValueId: 'facilityId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedBranch = selectedValue; - _selectedClinic = null; - _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinics(_selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, + onClick: model.branchesList != null && + model.branchesList.length > 0 && + _referTo != null && + _referTo['id'] == 2 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.branchesList, + attributeName: 'facilityName', + attributeValueId: 'facilityId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() async { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, ), SizedBox( height: 10, @@ -285,11 +340,15 @@ class _PatientMakeReferralScreenState extends State { 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, - onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 + onClick: _selectedBranch != null && + model.clinicsList != null && + model.clinicsList.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.clinicsList, @@ -304,8 +363,12 @@ class _PatientMakeReferralScreenState extends State { _selectedClinic = selectedValue; GifLoaderDialogUtils.showMyDialog(context); await model - .getClinicDoctors(patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils.hideDialog(context)); + .getClinicDoctors( + patient, + _selectedClinic['ClinicID'], + _selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } @@ -328,11 +391,14 @@ class _PatientMakeReferralScreenState extends State { 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 + onClick: _selectedClinic != null && + model.doctorsList != null && + model.doctorsList.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( list: model.doctorsList, @@ -357,9 +423,12 @@ class _PatientMakeReferralScreenState extends State { } : () { 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"); + 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"); } }, ), @@ -369,8 +438,9 @@ class _PatientMakeReferralScreenState extends State { AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).date, - dropDownText: - appointmentDate != null ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null, + dropDownText: appointmentDate != null + ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" + : null, enabled: false, isTextFieldHasSuffix: true, suffixIcon: IconButton( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index d2e495ee..cfa086b5 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -269,7 +269,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName, + referralDoctorName ?? "", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 14.0, From 70b3776aa77948055b4394873db7df7c274b2301 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 11:52:51 +0200 Subject: [PATCH 181/199] fix tabs --- .../referral/patient_referral_screen.dart | 111 ++++-------------- 1 file changed, 24 insertions(+), 87 deletions(-) diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de1d5958..f4459dba 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -17,10 +18,10 @@ class PatientReferralScreen extends StatefulWidget { _PatientReferralScreen createState() => _PatientReferralScreen(); } -class _PatientReferralScreen extends State with SingleTickerProviderStateMixin { - +class _PatientReferralScreen extends State + with SingleTickerProviderStateMixin { TabController _tabController; - int index=0; + int index = 0; @override void initState() { @@ -41,7 +42,6 @@ class _PatientReferralScreen extends State with SingleTic _tabController.dispose(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -51,17 +51,11 @@ class _PatientReferralScreen extends State with SingleTic extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + preferredSize: + Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 1), //width: 0.7 - ), - color: Colors.white), + height: Helpers.getTabHeight(context), child: Center( child: TabBar( isScrollable: false, @@ -69,93 +63,36 @@ class _PatientReferralScreen extends State with SingleTic 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), + labelPadding: + EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.33, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + decoration: Helpers.getBoxTabsBoxDecoration( + isActive: index == 0, isFirst: true), child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 0 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).myReferredPatient, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 0 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), + child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) ), ), - Container( - width: MediaQuery.of(context).size.width * 0.34, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 1 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).referral, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 1 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), + Center( + child: Container( + decoration:Helpers.getBoxTabsBoxDecoration( + isActive: index == 1, isMiddle: true), + child: Center( + child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) ), ), ), - Container( - width: MediaQuery.of(context).size.width * 0.33, - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - index == 2 - ? Color(0xFFD02127 ) - : Color(0xFFEAEAEA), - index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - TranslationBase.of(context).discharged, - fontSize: SizeConfig.textMultiplier * 1.8, - color: index == 2 ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), + Center( + child: Container( + decoration:Helpers.getBoxTabsBoxDecoration( + isActive: index == 2, isLast: true), + child: Center( + child: Helpers.getTabText(title:TranslationBase.of(context).discharged, isActive:index == 2 ), ), ), ), - ], ), ), From af10c60a7e329e19ccb0a1ce9292c2798f05fd87 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 12:00:36 +0200 Subject: [PATCH 182/199] fix merge issue in patient_referral_screen.dart --- .../referral/patient_referral_screen.dart | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 7454bcde..bb9db904 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -46,15 +46,17 @@ class _PatientReferralScreen extends State @override Widget build(BuildContext context) { return AppScaffold( + isShowAppBar: true, appBar: PatientSearchHeader( title: TranslationBase.of(context).patientsreferral, ), + appBarTitle: TranslationBase.of(context).patientsreferral, body: Scaffold( extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( preferredSize: - Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( height: Helpers.getTabHeight(context), @@ -67,14 +69,14 @@ class _PatientReferralScreen extends State indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( decoration: Helpers.getBoxTabsBoxDecoration( isActive: index == 0, isFirst: true), child: Center( - child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) + child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) ), ), Center( @@ -82,7 +84,7 @@ class _PatientReferralScreen extends State decoration:Helpers.getBoxTabsBoxDecoration( isActive: index == 1, isMiddle: true), child: Center( - child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) + child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) ), ), ), @@ -101,20 +103,22 @@ class _PatientReferralScreen extends State ), ), ), - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - ReferredPatientScreen(), - MyReferralInPatientScreen(), - ReferralDischargedPatientPage() - // MyReferredPatient(), - ], - ), - ) - ], - ), - ); + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + ReferredPatientScreen(), + MyReferralInPatientScreen(), + ReferralDischargedPatientPage() + // MyReferredPatient(), + ], + ), + ) + ], + ), + )); } } From c2fbd99cede6d57d52a51e36e907eb3130c2385d Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 14:15:51 +0200 Subject: [PATCH 183/199] small fixes --- lib/config/localized_values.dart | 2 +- .../my-referral-inpatient-screen.dart | 200 +++++++++--------- lib/widgets/auth/method_type_card.dart | 6 +- lib/widgets/dashboard/activity_button.dart | 4 +- lib/widgets/dashboard/out_patient_stack.dart | 2 +- .../patient-referral-item-widget.dart | 2 +- .../profile/PatientProfileButton.dart | 2 +- 7 files changed, 113 insertions(+), 105 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3fa70057..09562b9f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -53,7 +53,7 @@ const Map> localizedValues = { "service": {"en": "Service", "ar": "خدمة"}, "referral": {"en": "Referral", "ar": "الإحالة"}, "inPatient": {"en": "In Patients", "ar": "مرضاي"}, - "myInPatient": {"en": "My\n Patients", "ar": "مرضاي\nالمنومين"}, + "myInPatient": {"en": "My\n In Patients", "ar": "مرضاي\nالمنومين"}, "myInPatientTitle": {"en": "My Patients", "ar": "مرضاي المنومين"}, "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, "inPatientAll": {"en": "All Patients", "ar": "جميع المرضى المنومين"}, 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 29697dc1..b2242ff7 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -37,19 +37,21 @@ class _MyReferralInPatientScreenState extends State { children: [ Container( margin: EdgeInsets.only(top: 70), - child: PatientTypeRadioWidget( - (patientType) async { - setState(() { - 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); - }, + child: Container( + child: PatientTypeRadioWidget( + (patientType) async { + setState(() { + 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 @@ -74,91 +76,93 @@ class _MyReferralInPatientScreenState extends State { : Expanded( child: SingleChildScrollView( child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ListView.builder( - itemCount: model.myReferralPatients.length, - scrollDirection: Axis.vertical, - physics: ScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, index) { - return InkWell( - onTap: () { - if (patientType == - PatientType.OUT_PATIENT) { - Navigator.push( - context, - FadePage( - page: MyReferralDetailScreen( - referralPatient: model - .myReferralPatients[index]), - ), - ); - } else { - 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: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListView.builder( + itemCount: model.myReferralPatients.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + if (patientType == + PatientType.OUT_PATIENT) { + Navigator.push( + context, + FadePage( + page: MyReferralDetailScreen( + referralPatient: model + .myReferralPatients[index]), + ), + ); + } else { + 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), + ), + ); + }) + ], + ), ), ), ), diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 34b5938c..9839d0ad 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/config.dart'; 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'; @@ -118,8 +119,9 @@ class MethodTypeCard extends StatelessWidget { AppText( label, fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, ) ], ), diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index b28149b8..4a6e90cd 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -37,7 +37,9 @@ class GetActivityCard extends StatelessWidget { AppText( value.kPIParameter, textOverflow: TextOverflow.clip, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9), + fontHeight: 1.4, + + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9.3), color: AppGlobal.appTextColor, textAlign: TextAlign.start, fontWeight: FontWeight.w600, diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 4fa6ac82..6b3d87d5 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -126,7 +126,7 @@ class GetOutPatientStack extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, textAlign: TextAlign.center, color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w500, letterSpacing: -0.3, ), AppText( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index cfa086b5..0e077895 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -55,7 +55,7 @@ class PatientReferralItemWidget extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), + margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0), child: Column( children: [ Container( diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 31c4c903..a3c4492f 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -104,7 +104,6 @@ class PatientProfileButton extends StatelessWidget { color: color ?? AppGlobal.appTextColor, letterSpacing: -0.33, fontWeight: FontWeight.w600, - textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.30, ), @@ -113,6 +112,7 @@ class PatientProfileButton extends StatelessWidget { color: color ?? Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, + fontHeight: 1.4, fontSize: SizeConfig.textMultiplier * 1.30, ), if (isLoading) DrAppCircularProgressIndeicator() From 46ec7d4c992a11f747f17d5e2604ec25690a9f57 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 9 Dec 2021 14:42:54 +0200 Subject: [PATCH 184/199] app drawer design --- lib/widgets/shared/app_drawer_widget.dart | 4 ++-- lib/widgets/shared/buttons/app_buttons_widget.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index bf2baef5..c645913b 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -209,7 +209,7 @@ class _AppDrawerState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width * 0.3, + width: MediaQuery.of(context).size.width * 0.5, child: RichText( text: TextSpan( text: 'Powered by', @@ -243,7 +243,7 @@ class _AppDrawerState extends State { ])) ])), ), - width: SizeConfig.realScreenWidth * 0.60, + width: SizeConfig.realScreenWidth * 0.80, margin: EdgeInsets.all(0), customCornerRaduis: false, diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 0a225dde..cc9559e3 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -107,7 +107,7 @@ class _AppButtonState extends State { child: AppText( widget.title, color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.48, ), From 75a10939fbf4721e807579497b2566be03195a86 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 9 Dec 2021 16:12:20 +0200 Subject: [PATCH 185/199] adding appText to the bottom navagation --- .../shared/bottom_navigation_item.dart | 56 ++++++++++--------- pubspec.lock | 6 +- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 37aff38f..6d7efa95 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; 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/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -20,7 +21,6 @@ class BottomNavigationItem extends StatelessWidget { final DashboardViewModel dashboardViewModel; final String svgPath; - BottomNavigationItem( {this.icon, this.activeIcon, @@ -28,7 +28,8 @@ class BottomNavigationItem extends StatelessWidget { this.index, this.currentIndex, this.name, - this.dashboardViewModel, this.svgPath}); + this.dashboardViewModel, + this.svgPath}); @override Widget build(BuildContext context) { @@ -46,13 +47,12 @@ class BottomNavigationItem extends StatelessWidget { children: [ if (currentIndex == index) Positioned( - top: 0, + top: 0, child: Container( - - color: AppGlobal.appRedColor, - width: 100, - height: 3, - )), + color: AppGlobal.appRedColor, + width: 100, + height: 3, + )), Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, @@ -61,25 +61,31 @@ class BottomNavigationItem extends StatelessWidget { height: 15, ), Container( - child: SvgPicture.asset(svgPath,width: SizeConfig.widthMultiplier* (10), height:SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40, - ), + child: SvgPicture.asset( + svgPath, + width: SizeConfig.widthMultiplier * (10), + height: SizeConfig.getHeightMultiplier( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 10 + : SizeConfig.isHeightShort + ? 8.5 + : 7)) * + 40, + ), ), SizedBox( height: 8, ), Expanded( - child: Text(name ?? "", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - 2, - letterSpacing: 0.24, - color: AppGlobal.appTextColor, - fontWeight: FontWeight.w600) //#989898, - ), - ), + child: AppText(name ?? "", + textAlign: TextAlign.center, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * 2, + letterSpacing: -0.24, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600) //#989898, + ), ], ), if (currentIndex == 3 && @@ -95,10 +101,10 @@ class BottomNavigationItem extends StatelessWidget { borderRadius: BorderRadius.circular(8), badgeContent: Container( // padding: EdgeInsets.all(2.0), - child: Text( + child: AppText( dashboardViewModel.notRepliedCount.toString(), - style: - TextStyle(color: Colors.white, fontSize: 12.0)), + color: Colors.white, + fontSize: 12.0), ), ), ), diff --git a/pubspec.lock b/pubspec.lock index 86ae6905..6fcaaa5a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -706,7 +706,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: @@ -1040,7 +1040,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: @@ -1245,5 +1245,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <2.11.0" + dart: ">=2.10.2 <=2.11.0-213.1.beta" flutter: ">=1.22.2 <2.0.0" From ad1ae9970704e05c96045b71c02927022a03972e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 9 Dec 2021 16:15:52 +0200 Subject: [PATCH 186/199] fix bottom_nav_bar --- lib/widgets/shared/bottom_nav_bar.dart | 99 ++++++++++++++------------ 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index bcce6818..dca59ee0 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -41,56 +41,61 @@ class _BottomNavBarState extends State { elevation: 4, shape: CircularNotchedRectangle(), color: Colors.white, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 18), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - BottomNavigationItem( - icon: DoctorApp.home_1, - activeIcon: DoctorApp.home_active_1, - svgPath: "assets/images/svgs/bottom_nav/home-active.svg", - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 0, - name: TranslationBase.of(context).home, - dashboardViewModel: widget.dashboardViewModel, - ), - BottomNavigationItem( - icon: DoctorApp.schedule_1, - activeIcon: DoctorApp.schedule_active_1, - svgPath: "assets/images/svgs/bottom_nav/schedule-active.svg", - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 1, - name: TranslationBase.of(context).mySchedule, - dashboardViewModel: widget.dashboardViewModel, + child: Container( + decoration: BoxDecoration( + border: Border.all(color: Color(0XFFEFEFEF), width: 1) + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 18), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + BottomNavigationItem( + icon: DoctorApp.home_1, + activeIcon: DoctorApp.home_active_1, + svgPath: "assets/images/svgs/bottom_nav/home-active.svg", + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 0, + name: TranslationBase.of(context).home, + dashboardViewModel: widget.dashboardViewModel, + ), + BottomNavigationItem( + icon: DoctorApp.schedule_1, + activeIcon: DoctorApp.schedule_active_1, + svgPath: "assets/images/svgs/bottom_nav/schedule-active.svg", + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 1, + name: TranslationBase.of(context).mySchedule, + dashboardViewModel: widget.dashboardViewModel, - ), - BottomNavigationItem( - icon: DoctorApp.qr_reader, - activeIcon: DoctorApp.qr_reader_active_1, - svgPath: "assets/images/svgs/bottom_nav/reader-active.svg", - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 2, - name: TranslationBase.of(context).qr, - dashboardViewModel: widget.dashboardViewModel, + ), + BottomNavigationItem( + icon: DoctorApp.qr_reader, + activeIcon: DoctorApp.qr_reader_active_1, + svgPath: "assets/images/svgs/bottom_nav/reader-active.svg", + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 2, + name: TranslationBase.of(context).qr, + dashboardViewModel: widget.dashboardViewModel, - ), - BottomNavigationItem( - icon: DoctorApp.dr_reply_1, - activeIcon: DoctorApp.dr_reply_active_1, - svgPath: "assets/images/svgs/bottom_nav/reply-active.svg", - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 3, - name: TranslationBase.of(context).replay2, - dashboardViewModel: widget.dashboardViewModel, + ), + BottomNavigationItem( + icon: DoctorApp.dr_reply_1, + activeIcon: DoctorApp.dr_reply_active_1, + svgPath: "assets/images/svgs/bottom_nav/reply-active.svg", + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 3, + name: TranslationBase.of(context).replay2, + dashboardViewModel: widget.dashboardViewModel, - ), - ], + ), + ], + ), ), ), ); From f68c0fe42648d8973db798cb2b8c12de9e720c29 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 12 Dec 2021 10:11:56 +0200 Subject: [PATCH 187/199] fix issues on Patient card --- lib/config/config.dart | 4 ++-- .../patients/patient_card/PatientCard.dart | 21 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 03c74f52..09a3fcf8 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 = diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 1365871c..9741b34a 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import '../../../util/extenstions.dart'; @@ -61,7 +62,7 @@ class PatientCard extends StatelessWidget { decoration: Helpers.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, - marginLeft: (!isMyPatient && isInpatient) ? 0 : 10, + marginLeft: (!isMyPatient && isInpatient) ||isFromLiveCare ? 0 : 10, marginSymmetric: isFromSearch ? 10 : 0.0, hasBorder: false, bgColor: isFromLiveCare @@ -466,11 +467,11 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.all(4), - child: Image.asset( - 'assets/images/livecare.png', - height: 25, - width: 35, - color: Colors.grey.shade700, + child: SvgPicture.asset( + 'assets/images/svgs/profile_screen/livecare.svg', + height: 20, + width: 20, + // color: Colors.grey.shade700, )), ], ) @@ -480,15 +481,15 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.all(4), - child: Image.asset( + child: SvgPicture.asset( patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' + ? 'assets/images/svgs/profile_screen/livecare.svg' : patientInfo.appointmentType == 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', + ? 'assets/images/svgs/profile_screen/walkin.svg' + : 'assets/images/svgs/profile_screen/booked.svg', height: 25, width: 35, )), From bd133f8f319ff7013c2ad70a295dbe9e74b3f331 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 12 Dec 2021 10:15:15 +0200 Subject: [PATCH 188/199] fix issues on Patient card --- lib/widgets/patients/patient_card/PatientCard.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 9741b34a..00e43d71 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -318,6 +318,7 @@ class PatientCard extends StatelessWidget { ), ]), ), + if(nationalityName.isNotEmpty) Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.end, From 6f1790d71eadf1a401bb01abb5fa3ac29165765f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 12 Dec 2021 13:26:29 +0200 Subject: [PATCH 189/199] Insurance Approval design fix --- .../insurance_approval_screen_patient.dart | 39 +-- .../patients/insurance_approvals_details.dart | 261 ++++++++---------- lib/widgets/shared/doctor_card_insurance.dart | 154 +++++------ .../text_fields/app-textfield-custom.dart | 2 +- lib/widgets/shared/user-guid/CusomRow.dart | 28 +- 5 files changed, 218 insertions(+), 266 deletions(-) diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index ca018916..0ad4abd0 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -100,11 +100,11 @@ class _InsuranceApprovalScreenNewState doctorName: model .insuranceApprovalInPatient[index] .doctorName, - branch: model + approvalNo: model .insuranceApprovalInPatient[index] .approvalNo .toString(), - isPrescriptions: true, + isInsurance: true, approvalStatus: model .insuranceApprovalInPatient[index] .approvalStatusDescption ?? @@ -149,33 +149,10 @@ class _InsuranceApprovalScreenNewState child: model.insuranceApproval.length != 0 ? Column( children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context) - .insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), + ServiceTitle( + title: TranslationBase.of(context).insurance22, + subTitle: + TranslationBase.of(context).approvals22, ), ...List.generate( model.insuranceApproval.length, @@ -213,10 +190,10 @@ class _InsuranceApprovalScreenNewState .insuranceApproval[index].clinicName, doctorName: model .insuranceApproval[index].doctorName, - branch: model + approvalNo: model .insuranceApproval[index].approvalNo .toString(), - isPrescriptions: true, + isInsurance: true, approvalStatus: model .insuranceApproval[index] .approvalStatusDescption ?? diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 0945df37..e81a843a 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -5,9 +5,11 @@ 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/patient_service_title.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/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -54,38 +56,16 @@ class _InsuranceApprovalsDetailsState extends State { AppScaffold( isShowAppBar: true, baseViewModel: model, - appBar: PatientProfileAppBar( - patient), + appBar: PatientProfileAppBar(patient), body: patient.admissionNo != null ? SingleChildScrollView( child: Container( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).insurance22, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvals22, - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), + ServiceTitle( + title: TranslationBase.of(context).insurance22, + subTitle: TranslationBase.of(context).approvals22, ), Container( margin: EdgeInsets.all(10), @@ -128,6 +108,11 @@ class _InsuranceApprovalsDetailsState extends State { ? Color(0xff359846) : Color(0xffD02127) : Color(0xffD02127), + letterSpacing: -0.4, + fontWeight: FontWeight.w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.7, ), ], ), @@ -139,9 +124,10 @@ class _InsuranceApprovalsDetailsState extends State { indexInsurance] .doctorName .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, + color: Color(0xff2E303A), + fontSize: 16, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, ) ], ), @@ -153,8 +139,14 @@ class _InsuranceApprovalsDetailsState extends State { Column( children: [ Container( - height: 85.0, - width: 85.0, + height: MediaQuery.of(context) + .size + .height * + 0.065, + width: MediaQuery.of(context) + .size + .height * + 0.065, child: CircleAvatar( radius: SizeConfig .imageSizeMultiplier * @@ -192,112 +184,55 @@ class _InsuranceApprovalsDetailsState extends State { SizedBox( height: 25.0, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .clinicName, - fontSize: 14, - ), - ) - ], + CustomRow( + label: TranslationBase.of( + context) + .clinic + + ": ", + value: model + .insuranceApprovalInPatient[ + indexInsurance] + .clinicName, ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .approvalNo + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - 'Unused Count:', - color: Colors.grey[500], - fontSize: 14, - ), - AppText( - model - .insuranceApprovalInPatient[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .companyName + - ": ", - color: Colors.grey[500], - ), - AppText('Sample') - ], - ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn + - ": ", - color: Colors.grey[500], - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ), - ], + CustomRow( + label: TranslationBase.of( + context) + .approvalNo + + ": ", + value: model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalNo + .toString(), ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate + - ": ", - color: Colors.grey[500], - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: - FontWeight.w600, - ), - ], + CustomRow( + label: 'Unused Count:', + value: model + .insuranceApprovalInPatient[ + indexInsurance] + .unUsedCount + .toString(), ), + CustomRow( + label: TranslationBase.of( + context) + .companyName + + ": ", + value: 'Sample'), + CustomRow( + label: TranslationBase.of( + context) + .receiptOn + + ": ", + value: + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn ?? ""), isArabic: projectViewModel.isArabic)}'), + CustomRow( + label: TranslationBase.of( + context) + .expiryDate + + ": ", + value: + '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}'), ], ), ), @@ -320,21 +255,36 @@ class _InsuranceApprovalsDetailsState extends State { child: AppText( TranslationBase.of(context) .procedure, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.48, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.9, ), ), Expanded( child: AppText( TranslationBase.of(context) .status, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.48, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.9, ), ), Expanded( child: AppText( TranslationBase.of(context) .usageStatus, - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + letterSpacing: -0.48, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.9, ), ) ], @@ -374,7 +324,18 @@ class _InsuranceApprovalsDetailsState extends State { "", textAlign: TextAlign - .start, + .center, + fontSize: + SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.7, + letterSpacing: + -0.4, + color: Color( + 0xff575757), + fontWeight: + FontWeight + .w500, ), ), ), @@ -391,6 +352,17 @@ class _InsuranceApprovalsDetailsState extends State { textAlign: TextAlign .center, + fontSize: + SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.7, + letterSpacing: + -0.4, + color: Color( + 0xff575757), + fontWeight: + FontWeight + .w500, ), ), ), @@ -407,6 +379,17 @@ class _InsuranceApprovalsDetailsState extends State { textAlign: TextAlign .center, + fontSize: + SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.7, + letterSpacing: + -0.4, + color: Color( + 0xff575757), + fontWeight: + FontWeight + .w500, ), ), ), diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index 5615015e..abb8efcc 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -1,7 +1,9 @@ +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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -9,13 +11,13 @@ import 'package:provider/provider.dart'; class DoctorCardInsurance extends StatelessWidget { final String doctorName; - final String branch; + final String approvalNo; final DateTime appointmentDate; final String profileUrl; final String invoiceNO; final String orderNo; final Function onTap; - final bool isPrescriptions; + final bool isInsurance; final String clinic; final String approvalStatus; final String patientOut; @@ -23,13 +25,13 @@ class DoctorCardInsurance extends StatelessWidget { DoctorCardInsurance( {this.doctorName, - this.branch, + this.approvalNo, this.profileUrl, this.invoiceNO, this.onTap, this.appointmentDate, this.orderNo, - this.isPrescriptions = false, + this.isInsurance = false, this.clinic, this.approvalStatus, this.patientOut, @@ -59,7 +61,8 @@ class DoctorCardInsurance extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -67,7 +70,8 @@ class DoctorCardInsurance extends StatelessWidget { Expanded( child: Container( padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), child: InkWell( onTap: onTap, child: Column( @@ -78,22 +82,32 @@ class DoctorCardInsurance extends StatelessWidget { children: [ AppText( "$approvalStatus", - color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), + letterSpacing: -0.4, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 2.7, ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular(25.0), + Radius.circular(20.0), ), color: Color(0xff2E303A)), child: Padding( - padding: const EdgeInsets.all(12.0), + padding: const EdgeInsets.symmetric( + vertical: 6.5, horizontal: 11.5), child: AppText( '$patientOut'.replaceAll(" ", ""), color: Colors.white, - fontSize: 13.0, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 2.7, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, ), ), ) @@ -104,7 +118,9 @@ class DoctorCardInsurance extends StatelessWidget { Expanded( child: AppText( doctorName, - bold: true, + fontSize: 16.0, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, )), ], ), @@ -123,86 +139,54 @@ class DoctorCardInsurance extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.all(10), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (orderNo != null && !isPrescriptions) - Row( - children: [ - AppText( - 'order No:', - color: Colors.grey[500], + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (orderNo != null && !isInsurance) + CustomRow( + label: 'Invoice:', + value: invoiceNO, ), - AppText( - orderNo ?? '', - ) - ], - ), - if (invoiceNO != null && !isPrescriptions) - Row( - children: [ - AppText( - 'Invoice:', - color: Colors.grey[500], + if (invoiceNO != null && !isInsurance) + CustomRow( + label: 'Invoice:', + value: invoiceNO, ), - AppText( - invoiceNO, - ) - ], - ), - if (isPrescriptions) - Row( - children: [ - AppText( - TranslationBase.of(context).clinic + ": ", - color: Colors.grey[500], - fontSize: 14, - //fontWeight: FontWeight.w600, - //color: Colors.grey[500], + if (isInsurance) + CustomRow( + label: + TranslationBase.of(context).clinic + + ": ", + value: clinic, ), - Expanded( - child: AppText( - clinic, - //fontWeight: FontWeight.w700, - fontSize: 14.0, - ), - ) - ], - ), - if (branch2 != null) - Row( - children: [ - AppText( - TranslationBase.of(context).branch + ": ", - fontSize: 14, - color: Colors.grey[500], + if (branch2 != null) + CustomRow( + label: + TranslationBase.of(context).branch + + ": ", + value: branch2, ), - AppText( - branch2, - fontSize: 14.0, - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).approvalNo + ": ", - fontSize: 14, - color: Colors.grey[500], - //color: Colors.grey[500], - ), - AppText( - branch, - fontSize: 14.0, - ) - ], - ), - ]), + if (approvalNo != null) + CustomRow( + label: TranslationBase.of(context) + .approvalNo + + ": ", + value: approvalNo, + ), + ]), ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Icon( - EvaIcons.eye, - ), + Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 15.0), + child: Icon( + EvaIcons.eye, + color: Color(0xff2E303A), + ), + ), + ], ) ], ), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 2a77eb2d..0cb8ad67 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -135,7 +135,7 @@ class _AppTextFieldCustomState extends State { // SizeConfig.getHeightMultiplier() * // (SizeConfig.isWidthLarge ? 1.1 : 1.3) : 0, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w600, letterSpacing: -0.44, fontFamily: 'Poppins', ), diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 0c364474..21875e4d 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -7,7 +7,11 @@ class CustomRow extends StatelessWidget { const CustomRow({ Key key, this.label, - this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, + this.value, + this.labelSize, + this.valueSize, + this.width, + this.isCopyable = true, }) : super(key: key); final String label; @@ -24,7 +28,8 @@ class CustomRow extends StatelessWidget { children: [ AppText( label, - fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, + fontSize: + labelSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, color: Color(0xFF575757), fontWeight: FontWeight.w600, letterSpacing: -0.4, @@ -32,15 +37,18 @@ class CustomRow extends StatelessWidget { SizedBox( width: 1, ), - AppText( - value, - fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, - letterSpacing: -0.48, - isCopyable: isCopyable, + Expanded( + child: AppText( + value, + fontSize: + valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + isCopyable: isCopyable, + ), ), ], ); } -} \ No newline at end of file +} From ae5c9170a713bbf3fee8f76418b8eff5540d1803 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 13 Dec 2021 16:31:05 +0200 Subject: [PATCH 190/199] fix patient gird --- lib/screens/home/home_page_card.dart | 5 - .../profile_gird_for_other.dart | 60 +- .../profile_gird_for_search.dart | 62 +- pubspec.lock | 1249 ----------------- 4 files changed, 62 insertions(+), 1314 deletions(-) delete mode 100644 pubspec.lock diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 7a0d5167..39a99e65 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -31,11 +31,6 @@ class HomePageCard extends StatelessWidget { width: width, margin: this.margin, decoration: BoxDecoration( - // color: !hasBorder - // ? color != null - // ? color - // : HexColor('#050705').withOpacity(opacity) - // : Colors.white, gradient: gradient, borderRadius: BorderRadius.circular(20.0), border: hasBorder diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index dbdaf4a8..0c3da34b 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -88,38 +88,38 @@ class ProfileGridForOther extends StatelessWidget { ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), ]; + return Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: GridView( + shrinkWrap: true, - return Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: StaggeredGridView.countBuilder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 8, - mainAxisSpacing: 8, - crossAxisCount: 3, - itemCount: cardsList.length, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: cardsList[index].nameLine1, - nameLine2: cardsList[index].nameLine2, - route: cardsList[index].route, - icon: cardsList[index].icon, - isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, - isDisable: cardsList[index].isDisable, - onTap: cardsList[index].onTap, - isLoading: cardsList[index].isLoading, - isFromLiveCare: isFromLiveCare), - ), + physics: BouncingScrollPhysics(), + // if you want IOS bouncing effect, otherwise remove this line + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: 10, + mainAxisSpacing: 8, + crossAxisCount: 3, ), - ], + //change the number as you want + children: cardsList.map((item) { + return PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: item.nameLine1, + nameLine2: item.nameLine2, + route: item.route, + icon: item.icon, + isInPatient: item.isInPatient, + isDischargedPatient: item.isDischargedPatient, + isDisable: item.isDisable, + onTap: item.onTap, + isLoading: item.isLoading, + ); + }).toList(), + ), ); } } diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index b1438e70..cc738b17 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -66,37 +66,39 @@ class ProfileGridForSearch extends StatelessWidget { isInPatient: isInpatient, isDisable: patient.patientStatusType != 43 ? true : false), ]; - return Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: StaggeredGridView.countBuilder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 8, - mainAxisSpacing: 8, - crossAxisCount: 3, - itemCount: cardsList.length, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: cardsList[index].nameLine1, - nameLine2: cardsList[index].nameLine2, - route: cardsList[index].route, - icon: cardsList[index].icon, - isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, - isDisable: cardsList[index].isDisable, - onTap: cardsList[index].onTap, - isLoading: cardsList[index].isLoading, - ), - ), + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: GridView( + shrinkWrap: true, + + physics: BouncingScrollPhysics(), + // if you want IOS bouncing effect, otherwise remove this line + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: 10, + mainAxisSpacing: 8, + crossAxisCount: 3, ), - ], + //change the number as you want + children: cardsList.map((item) { + return PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: item.nameLine1, + nameLine2: item.nameLine2, + route: item.route, + icon: item.icon, + isInPatient: item.isInPatient, + isDischargedPatient: item.isDischargedPatient, + isDisable: item.isDisable, + onTap: item.onTap, + isLoading: item.isLoading, + ); + }).toList(), + ), ); } } diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 6fcaaa5a..00000000 --- a/pubspec.lock +++ /dev/null @@ -1,1249 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "12.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.40.7" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.13" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0-nullsafety.1" - autocomplete_textfield: - dependency: "direct main" - description: - name: autocomplete_textfield - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - badges: - dependency: "direct main" - description: - name: badges - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - barcode_scan_fix: - dependency: "direct main" - description: - name: barcode_scan_fix - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.25" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.5" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1+1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.7" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "2.12.2" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - cached_network_image: - dependency: "direct main" - description: - name: cached_network_image - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.1" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.3" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - chewie: - dependency: transitive - description: - name: chewie - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.10" - chewie_audio: - dependency: transitive - description: - name: chewie_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0+1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0-nullsafety.3" - connectivity: - dependency: "direct main" - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9+5" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+4" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+7" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - css_colors: - dependency: transitive - description: - name: css_colors - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.10" - date_time_picker: - dependency: "direct main" - description: - name: date_time_picker - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - device_info: - dependency: "direct main" - description: - name: device_info - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2+10" - device_info_platform_interface: - dependency: transitive - description: - name: device_info_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - dropdown_search: - dependency: "direct main" - description: - name: dropdown_search - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.6" - eva_icons_flutter: - dependency: "direct main" - description: - name: eva_icons_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - expandable: - dependency: "direct main" - description: - name: expandable - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.4" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "5.2.1" - firebase: - dependency: transitive - description: - name: firebase - url: "https://pub.dartlang.org" - source: hosted - version: "7.3.3" - firebase_analytics: - dependency: "direct main" - description: - name: firebase_analytics - url: "https://pub.dartlang.org" - source: hosted - version: "6.3.0" - firebase_analytics_platform_interface: - dependency: transitive - description: - name: firebase_analytics_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - firebase_analytics_web: - dependency: transitive - description: - name: firebase_analytics_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1" - firebase_core: - dependency: transitive - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.3" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1+1" - firebase_messaging: - dependency: "direct main" - description: - name: firebase_messaging - url: "https://pub.dartlang.org" - source: hosted - version: "7.0.3" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.3" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" - flutter_cache_manager: - dependency: transitive - description: - name: flutter_cache_manager - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - flutter_device_type: - dependency: "direct main" - description: - name: flutter_device_type - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - flutter_flexible_toast: - dependency: "direct main" - description: - name: flutter_flexible_toast - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - flutter_gifimage: - dependency: "direct main" - description: - name: flutter_gifimage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_html: - dependency: "direct main" - description: - name: flutter_html - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - flutter_inappwebview: - dependency: transitive - description: - name: flutter_inappwebview - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0+4" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_page_indicator: - dependency: transitive - description: - name: flutter_page_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.11" - flutter_staggered_grid_view: - dependency: "direct main" - description: - name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.18.1" - flutter_swiper: - dependency: "direct main" - description: - name: flutter_swiper - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: "direct main" - description: - name: font_awesome_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "8.12.0" - get_it: - dependency: "direct main" - description: - name: get_it - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.4" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - hexcolor: - dependency: "direct main" - description: - name: hexcolor - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - hijri: - dependency: transitive - description: - name: hijri - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - hijri_picker: - dependency: "direct main" - description: - name: hijri_picker - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - html: - dependency: "direct main" - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+4" - html_editor_enhanced: - dependency: "direct main" - description: - name: html_editor_enhanced - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2" - http_interceptor: - dependency: "direct main" - description: - name: http_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.19" - imei_plugin: - dependency: "direct main" - description: - name: imei_plugin - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3-nullsafety.1" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.1" - local_auth: - dependency: "direct main" - description: - name: local_auth - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3+4" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - maps_launcher: - dependency: "direct main" - description: - name: maps_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.2+2" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10-nullsafety.1" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.4" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - octo_image: - dependency: transitive - description: - name: octo_image - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - open_iconic_flutter: - dependency: transitive - description: - name: open_iconic_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1+1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - path_provider: - dependency: transitive - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.28" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+8" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" - percent_indicator: - dependency: "direct main" - description: - name: percent_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.9+1" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0+2" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.13" - progress_hud_v2: - dependency: "direct main" - description: - name: progress_hud_v2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.4" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.3" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8" - quiver: - dependency: "direct main" - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.25.0" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - screen: - dependency: transitive - description: - name: screen - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.12+4" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+4" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+11" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+7" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+3" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.9" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.4+1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.9" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.2" - speech_to_text: - dependency: "direct main" - description: - path: speech_to_text - relative: true - source: path - version: "0.0.0" - sqflite: - dependency: transitive - description: - name: sqflite - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.2+4" - sqflite_common: - dependency: transitive - description: - name: sqflite_common - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3+3" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0-nullsafety.2" - sticky_headers: - dependency: "direct main" - description: - name: sticky_headers - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8+1" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0+2" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19-nullsafety.2" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+3" - transformer_page_view: - dependency: transitive - description: - name: transformer_page_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.6" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.3" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "5.7.10" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+4" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+9" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.9" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5+3" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+3" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.2" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.3" - video_player: - dependency: transitive - description: - name: video_player - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.12+5" - video_player_platform_interface: - dependency: transitive - description: - name: video_player_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - video_player_web: - dependency: transitive - description: - name: video_player_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+1" - wakelock: - dependency: transitive - description: - name: wakelock - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+2" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - webview_flutter: - dependency: transitive - description: - name: webview_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.24" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.4+1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "4.5.1" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" - flutter: ">=1.22.2 <2.0.0" From 34b44849723b673829291a30be3e06631961919b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 08:30:32 +0200 Subject: [PATCH 191/199] fix tabs --- lib/config/config.dart | 4 ++-- lib/screens/doctor/doctor_replay/doctor_reply_screen.dart | 2 ++ lib/screens/patients/In_patient/in_patient_screen.dart | 2 ++ lib/screens/patients/out_patient/out_patient_screen.dart | 4 +--- .../patients/profile/referral/patient_referral_screen.dart | 1 + 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 09a3fcf8..03c74f52 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 = diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 4905da58..d30457b4 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -81,6 +81,8 @@ class _DoctorReplyScreenState extends State preferredSize: Size.fromHeight( MediaQuery.of(context).size.height * 0.070), child: Container( + color: Helpers.getBgTabColor(), + child: TabBar( isScrollable: false, controller: _tabController, diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 5be1c1c5..ebb3118a 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -127,6 +127,8 @@ class _InPatientScreenState extends State color: Colors.white), child: Container( margin: EdgeInsets.only(top: 9), + color: Helpers.getBgTabColor(), + child: TabBar( isScrollable: false, controller: _tabController, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index ab320f07..59601ea7 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -107,9 +107,7 @@ class _OutPatientsScreenState extends State { Container( // color: Colors.red, height: Helpers.getTabHeight(context), - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), + color: Helpers.getBgTabColor(), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index bb9db904..4dab4270 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -60,6 +60,7 @@ class _PatientReferralScreen extends State child: Center( child: Container( height: Helpers.getTabHeight(context), + color: Helpers.getBgTabColor(), child: Center( child: TabBar( isScrollable: false, From 56fbc4783581cc481a080771b28028720625fd07 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 08:56:40 +0200 Subject: [PATCH 192/199] fix home page --- assets/images/svgs/female avatar.svg | 57 +++++++++++++++ assets/images/svgs/female.svg | 3 + assets/images/svgs/inpatient.svg | 4 ++ assets/images/svgs/male avatar.svg | 56 +++++++++++++++ assets/images/svgs/male.svg | 3 + assets/images/svgs/menu.svg | 19 +++++ assets/images/svgs/no data.svg | 69 +++++++++++++++++++ lib/landing_page.dart | 3 +- lib/screens/home/home_screen.dart | 33 ++++++--- lib/util/helpers.dart | 38 ++++++++++ .../shared/bottom_navigation_item.dart | 2 +- pubspec.yaml | 1 + 12 files changed, 276 insertions(+), 12 deletions(-) create mode 100644 assets/images/svgs/female avatar.svg create mode 100644 assets/images/svgs/female.svg create mode 100644 assets/images/svgs/inpatient.svg create mode 100644 assets/images/svgs/male avatar.svg create mode 100644 assets/images/svgs/male.svg create mode 100644 assets/images/svgs/menu.svg create mode 100644 assets/images/svgs/no data.svg diff --git a/assets/images/svgs/female avatar.svg b/assets/images/svgs/female avatar.svg new file mode 100644 index 00000000..1cf831e1 --- /dev/null +++ b/assets/images/svgs/female avatar.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/svgs/female.svg b/assets/images/svgs/female.svg new file mode 100644 index 00000000..307729c2 --- /dev/null +++ b/assets/images/svgs/female.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/inpatient.svg b/assets/images/svgs/inpatient.svg new file mode 100644 index 00000000..0f6b79bb --- /dev/null +++ b/assets/images/svgs/inpatient.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/svgs/male avatar.svg b/assets/images/svgs/male avatar.svg new file mode 100644 index 00000000..ff177416 --- /dev/null +++ b/assets/images/svgs/male avatar.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/svgs/male.svg b/assets/images/svgs/male.svg new file mode 100644 index 00000000..80cd0c7f --- /dev/null +++ b/assets/images/svgs/male.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/svgs/menu.svg b/assets/images/svgs/menu.svg new file mode 100644 index 00000000..6808f518 --- /dev/null +++ b/assets/images/svgs/menu.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/svgs/no data.svg b/assets/images/svgs/no data.svg new file mode 100644 index 00000000..c54f0430 --- /dev/null +++ b/assets/images/svgs/no data.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 69cae394..cd9507fd 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -10,6 +10,7 @@ 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'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class LandingPage extends StatefulWidget { @override @@ -53,7 +54,7 @@ class _LandingPageState extends State { leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Image.asset('assets/images/menu.png', + icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 50, width: 50), iconSize: 15, color: Color(0xff2B353E), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 4e577bb9..5cf849e8 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'; @@ -20,6 +21,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_ref import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPatientPage.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'; @@ -29,6 +31,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; @@ -40,7 +43,6 @@ class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); final String title; - final String iconURL = 'assets/images/dashboard_icon/'; @override _HomeScreenState createState() => _HomeScreenState(); @@ -83,12 +85,16 @@ class _HomeScreenState extends State { color: Colors.grey[100], padding: EdgeInsets.only(top: 10), child: Stack(children: [ - IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), - iconSize: 18, - color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), + Container( + width: 40, + margin: EdgeInsets.only(left: projectsProvider.isArabic? 0:32, right: projectsProvider.isArabic? 23:0), + child: IconButton( + icon: SvgPicture.asset('assets/images/svgs/menu.svg', + height: 25, width: 10), + iconSize: 15, + color: Colors.black, + onPressed: () => Scaffold.of(context).openDrawer(), + ), ), Column(children: [ ProfileWelcomeWidget( @@ -169,7 +175,7 @@ class _HomeScreenState extends State { )), ], ), - AppText(item.clinicName, + AppText(Helpers.convertToTitleCase(item.clinicName), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -199,7 +205,7 @@ class _HomeScreenState extends State { .map((item) { return DropdownMenuItem( child: AppText( - item.clinicName, + Helpers.convertToTitleCase(item.clinicName), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, @@ -292,7 +298,14 @@ class _HomeScreenState extends State { ), Container( - height: 120, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, children: [ diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 0d7cd088..6a3ca933 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:html/parser.dart'; +import 'package:intl/intl.dart'; import '../UpdatePage.dart'; import '../config/size_config.dart'; @@ -235,6 +236,9 @@ class Helpers { return parsedString; } + + + static InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { @@ -349,6 +353,10 @@ class Helpers { ); } + static getBgTabColor(){ + return Color(0xFFEAEAEA); + } + static getTabText({String title, bool isActive = false,}){ return AppText( title, @@ -389,4 +397,34 @@ class Helpers { } + + static String convertToTitleCase(String text) { + if (text == null) { + return null; + } + + if (text.length <= 1) { + return text.toUpperCase(); + } + + // Split string into multiple words + final List words = text.split(' '); + + // Capitalize first letter of each words + final capitalizedWords = words.map((word) { + if (word.trim().isNotEmpty) { + final String firstLetter = word.trim().substring(0, 1).toUpperCase(); + final String remainingLetters = word.trim().substring(1).toLowerCase(); + + return '$firstLetter$remainingLetters'; + } + return ''; + }); + + // Join/Merge all words back to one String + return capitalizedWords.join(' '); + } + } + + diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 6d7efa95..8924d719 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -81,7 +81,7 @@ class BottomNavigationItem extends StatelessWidget { child: AppText(name ?? "", textAlign: TextAlign.center, fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * 2, + SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, letterSpacing: -0.24, color: AppGlobal.appTextColor, fontWeight: FontWeight.w600) //#989898, diff --git a/pubspec.yaml b/pubspec.yaml index 0f2d55e8..1e5125de 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -130,6 +130,7 @@ flutter: - assets/images/ - assets/images/dashboard/ - assets/images/login/ + - assets/images/svgs/ - assets/images/svgs/verification/ - assets/images/svgs/profile_screen/ - assets/images/svgs/bottom_nav/ From 3e1ac71a480cb32dea9fa362f073b7ac041ffad9 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 10:06:24 +0200 Subject: [PATCH 193/199] fix some design issues --- lib/config/config.dart | 4 +- .../patient_profile_screen.dart | 4 +- .../patients/patient_card/PatientCard.dart | 151 ++++++++++-------- .../shared/buttons/app_buttons_widget.dart | 4 +- lib/widgets/shared/errors/error_message.dart | 3 +- 5 files changed, 92 insertions(+), 74 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 03c74f52..09a3fcf8 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 = 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 b2261f4c..a62fae57 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -251,7 +251,7 @@ class _PatientProfileScreenState extends State radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 1.6, + fontSize: 12, icon: SvgPicture.asset( "assets/images/svgs/profile_screen/create episode.svg", color: Colors.white, @@ -283,7 +283,7 @@ class _PatientProfileScreenState extends State radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 1.6, + fontSize: 12, icon: SvgPicture.asset( "assets/images/svgs/profile_screen/modify episode.svg", color: Colors.white, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 00e43d71..4c13d1f6 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -62,7 +62,7 @@ class PatientCard extends StatelessWidget { decoration: Helpers.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, - marginLeft: (!isMyPatient && isInpatient) ||isFromLiveCare ? 0 : 10, + marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 10, marginSymmetric: isFromSearch ? 10 : 0.0, hasBorder: false, bgColor: isFromLiveCare @@ -95,6 +95,7 @@ class PatientCard extends StatelessWidget { padding: EdgeInsets.only(left: 12.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ patientInfo.patientStatusType == 43 ? Row( @@ -210,6 +211,8 @@ class PatientCard extends StatelessWidget { ? Column( crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( AppDateUtils @@ -221,14 +224,16 @@ class PatientCard extends StatelessWidget { isMonthShort: true, ), fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), AppText( "${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), ], ) @@ -239,6 +244,8 @@ class PatientCard extends StatelessWidget { ? Column( crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( @@ -246,14 +253,16 @@ class PatientCard extends StatelessWidget { .appointmentDate, ), isMonthShort: true)}", fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), AppText( " ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, ), ], ) @@ -301,66 +310,66 @@ class PatientCard extends StatelessWidget { textOverflow: TextOverflow.ellipsis, ), if (patientInfo.gender == 1) - Icon( - DoctorApp.male_2, - color: Colors.blue, - size: 18, - ) + Container( + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), + child: SvgPicture.asset("assets/images/svgs/male.svg"),) else - Icon( - DoctorApp.female_1, - color: Colors.pink, - size: 18, - ), + Container( + padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), + child: SvgPicture.asset("assets/images/svgs/female.svg"),), if (isFromLiveCare) ShowTimer( patientInfo: patientInfo, ), ]), ), - if(nationalityName.isNotEmpty) - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(top: 8), - alignment: Alignment.centerRight, - child: AppText( - nationalityName.truncate(14), - fontWeight: FontWeight.w600, - fontSize: 10, - color: Color(0xFF2E303A), - textOverflow: TextOverflow.ellipsis, + if (nationalityName.isNotEmpty) + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(top: 5), + alignment: Alignment.centerRight, + child: AppText( + nationalityName.truncate(14), + fontWeight: FontWeight.w600, + fontSize: 10, + color: Color(0xFF2E303A), + textOverflow: TextOverflow.ellipsis, + ), ), ), - ), - patientInfo.nationality != null || - patientInfo.nationalityId != null - ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), - child: CachedNetworkImage( - imageUrl: patientInfo - .nationalityFlagURL != - null - ? patientInfo.nationalityFlagURL - : '', - height: 16, - width: 22, - errorWidget: - (context, url, error) => - AppText( - 'No Image', - fontSize: 10, - ), - )) - : SizedBox() - ], - ), - ) + patientInfo.nationality != null || + patientInfo.nationalityId != null + ? Container( + padding: EdgeInsets.only(top: 5), + child: ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: CachedNetworkImage( + imageUrl: patientInfo + .nationalityFlagURL != + null + ? patientInfo + .nationalityFlagURL + : '', + height: 16, + width: 22, + errorWidget: + (context, url, error) => + AppText( + 'No Image', + fontSize: 10, + ), + )), + ) + : SizedBox() + ], + ), + ) ], )), SizedBox( @@ -374,10 +383,11 @@ class PatientCard extends StatelessWidget { child: Container( width: 60, height: 60, - child: Image.asset( + //TODO Elham* create widget for this to make it use every where + child: SvgPicture.asset( patientInfo.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + ? 'assets/images/svgs/male avatar.svg' + : 'assets/images/svgs/female avatar.svg', fit: BoxFit.cover, ), ), @@ -479,9 +489,11 @@ class PatientCard extends StatelessWidget { : !isInpatient && !isFromSearch ? Row( mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.all(4), + padding: EdgeInsets.only( + left: 13, right: 13, bottom: 13), child: SvgPicture.asset( patientInfo.appointmentType == 'Regular' && @@ -498,11 +510,16 @@ class PatientCard extends StatelessWidget { : (isInpatient == true) ? Row( mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Container( - padding: EdgeInsets.all(4), - child: Image.asset( - 'assets/images/inpatient.png', + padding: EdgeInsets.only( + left: 13, + right: 13, + bottom: 13), + child: SvgPicture.asset( + 'assets/images/svgs/inpatient.svg', height: 25, width: 35, )), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index cc9559e3..bb43dc8c 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -32,7 +32,7 @@ class AppButton extends StatefulWidget { this.iconData, this.icon, this.color, - this.fontSize = 2, + this.fontSize = 16, this.padding = 13, this.loading = false, this.disabled = false, @@ -107,7 +107,7 @@ class _AppButtonState extends State { child: AppText( widget.title, color: widget.fontColor, - fontSize: 16.0, + fontSize: widget.fontSize, fontWeight: FontWeight.w600, letterSpacing: -0.48, ), diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 21e04e6c..2930ae84 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import '../app_texts_widget.dart'; @@ -18,7 +19,7 @@ class ErrorMessage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), + SvgPicture.asset('assets/images/svgs/no data.svg'), Center( child: Center( child: Padding( From 4dcc20b68112dc29aa2e2a2fd3b9886199e84740 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 10:35:15 +0200 Subject: [PATCH 194/199] fix issues related to card --- lib/config/config.dart | 4 +- .../patients/patient_card/PatientCard.dart | 173 +++++++++++------- 2 files changed, 109 insertions(+), 68 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 09a3fcf8..03c74f52 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 = diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 4c13d1f6..49d2eb7a 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -208,64 +208,31 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null - ? Column( - crossAxisAlignment: - CrossAxisAlignment.end, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - AppDateUtils - .getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - patientInfo.arrivedOn, - ), - isMonthShort: true, - ), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - AppText( - "${AppDateUtils.getStartTime(patientInfo.startTime)}", + ? Container( + padding: EdgeInsets.only(right: 9), + + child: AppText( + "${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, + ), + ) + : (patientInfo.appointmentDate != + null && + patientInfo + .appointmentDate.isNotEmpty) + ? Container( + padding: EdgeInsets.only(right: 9), + child: AppText( + " ${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 11, letterSpacing: -0.64, ), - ], - ) - : (patientInfo.appointmentDate != - null && - patientInfo - .appointmentDate.isNotEmpty) - ? Column( - crossAxisAlignment: - CrossAxisAlignment.end, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( - patientInfo - .appointmentDate, - ), isMonthShort: true)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - AppText( - " ${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - ], - ) + ) : SizedBox() ], )) @@ -311,12 +278,18 @@ class PatientCard extends StatelessWidget { ), if (patientInfo.gender == 1) Container( - padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), - child: SvgPicture.asset("assets/images/svgs/male.svg"),) + padding: EdgeInsets.symmetric( + horizontal: 4, vertical: 2), + child: SvgPicture.asset( + "assets/images/svgs/male.svg"), + ) else Container( - padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2), - child: SvgPicture.asset("assets/images/svgs/female.svg"),), + padding: EdgeInsets.symmetric( + horizontal: 4, vertical: 2), + child: SvgPicture.asset( + "assets/images/svgs/female.svg"), + ), if (isFromLiveCare) ShowTimer( patientInfo: patientInfo, @@ -345,7 +318,8 @@ class PatientCard extends StatelessWidget { patientInfo.nationality != null || patientInfo.nationalityId != null ? Container( - padding: EdgeInsets.only(top: 5), + padding: EdgeInsets.only( + right: 7, top: 5), child: ClipRRect( borderRadius: BorderRadius.circular(20.0), @@ -416,6 +390,69 @@ class PatientCard extends StatelessWidget { value: "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", ), + + patientInfo.arrivedOn != null + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + // AppText( + // AppDateUtils + // .getDayMonthYearDateFormatted( + // AppDateUtils + // .convertStringToDate( + // patientInfo.arrivedOn, + // ), + // isMonthShort: true, + // ), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // fontSize: 11, + // letterSpacing: -0.64, + // ), + + CustomRow( + label: TranslationBase.of( + context) + .arrivedP + + " : ", + value: AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, + ), + isMonthShort: true, + ), + ), + ], + ) + : (patientInfo.appointmentDate != + null && + patientInfo.appointmentDate + .isNotEmpty) + ? Column( + crossAxisAlignment: + CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of( + context) + .appointmentDate + + " : ", + value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( + patientInfo + .appointmentDate, + ), isMonthShort: true)}", + ), + ], + ) + : SizedBox(), + if (isInpatient) CustomRow( label: @@ -465,9 +502,12 @@ class PatientCard extends StatelessWidget { ), ]), ), - Icon( - Icons.arrow_forward, - size: 24, + Padding( + padding: const EdgeInsets.only(right: 8), + child: Icon( + Icons.arrow_forward, + size: 24, + ), ), ], )) @@ -477,7 +517,8 @@ class PatientCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ Container( - padding: EdgeInsets.all(4), + padding: EdgeInsets.only( + left: 9, right: 9, bottom: 9), child: SvgPicture.asset( 'assets/images/svgs/profile_screen/livecare.svg', height: 20, @@ -493,7 +534,7 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.only( - left: 13, right: 13, bottom: 13), + left: 9, right: 9, bottom: 9), child: SvgPicture.asset( patientInfo.appointmentType == 'Regular' && @@ -515,9 +556,9 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.only( - left: 13, - right: 13, - bottom: 13), + left: 9, + right: 9, + bottom: 9), child: SvgPicture.asset( 'assets/images/svgs/inpatient.svg', height: 25, From 3431c353e9443c345e4756695d8859b62f4b1574 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 12:14:13 +0200 Subject: [PATCH 195/199] fix issues in design --- .../auth/verification_methods_screen.dart | 797 ++++++++++-------- lib/widgets/shared/card_with_bg_widget.dart | 2 +- 2 files changed, 434 insertions(+), 365 deletions(-) diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index fc85db8f..e1f2f49b 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -15,37 +15,32 @@ 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(); +///TODO Elham* check if this still in user or not class VerificationMethodsScreen extends StatefulWidget { - - final password; - - VerificationMethodsScreen({this.password, }); + VerificationMethodsScreen({ + this.password, + }); @override - _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); + _VerificationMethodsScreenState createState() => + _VerificationMethodsScreenState(); } class _VerificationMethodsScreenState extends State { - ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; @@ -58,367 +53,440 @@ class _VerificationMethodsScreenState extends State { projectsProvider = Provider.of(context); authenticationViewModel = Provider.of(context); - - return AppScaffold( isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - // baseViewModel: model, body: SingleChildScrollView( child: Center( child: FractionallySizedBox( - child: Container( - margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - height: SizeConfig.realScreenHeight * .95, - width: SizeConfig.realScreenWidth, - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SizedBox( - height: 80, - ), - if(authenticationViewModel.isFromLogin) + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 6 : 4), + ), + if (authenticationViewModel.isFromLogin) InkWell( - onTap: (){ - authenticationViewModel.setUnverified(false,isFromLogin: false); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + onTap: () { + authenticationViewModel.setUnverified(false, + isFromLogin: false); + authenticationViewModel + .setAppStatus(APP_STATUS.UNAUTHENTICATED); }, - child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - - ), - Container( - - child: Column( - children: [ - SizedBox( - height: 20, - ), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - AppText( - TranslationBase.of(context).welcomeBack, - fontSize:12, - fontWeight: FontWeight.w700, - color: Color(0xFF2B353E), - ), - AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), - fontSize: 24, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context).accountInfo , - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 20, - ), - Container( - padding: EdgeInsets.all(15), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), + child: Icon( + Icons.arrow_back_ios, + color: AppGlobal.appTextColor, + )), + Column( + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 3 : 4), + ), + authenticationViewModel.user != null && + isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).welcomeBack, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontWeight: FontWeight.w600, + color: AppGlobal.appTextColor, + letterSpacing: -0.72, ), - 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,), - + AppText( + Helpers.convertToTitleCase( + authenticationViewModel.user.doctorName), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 6, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + ), + SizedBox( + height: SizeConfig.heightMultiplier * 4, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + SizedBox( + height: SizeConfig.heightMultiplier * 4), + 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, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + 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.w600, + letterSpacing: -0.4), + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.55, + child: RichText( + text: TextSpan( + text: TranslationBase.of( + context) + .verifyWith + + ':', + style: TextStyle( + color: + Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600, + letterSpacing: -0.4), + children: [ + TextSpan( + text: authenticationViewModel + .getType( + authenticationViewModel + .user + .logInTypeID, + context), + style: TextStyle( + color: AppGlobal + .appTextColor, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + letterSpacing: + -0.48), + ) + ]), + ), + ), + ], + crossAxisAlignment: + CrossAxisAlignment.start, + ), ), - Row( + Column( + mainAxisAlignment: + MainAxisAlignment.start, 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), - + authenticationViewModel + .user.editedOn != + null + ? AppDateUtils + .getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + authenticationViewModel + .user + .editedOn), + isMonthShort: true) + : authenticationViewModel + .user.createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .convertStringToDate( + authenticationViewModel + .user + .createdOn), + isMonthShort: true) + : '--', + textAlign: TextAlign.right, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2E303A), fontWeight: FontWeight.w700, + letterSpacing: -0.48, ), + 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: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xFF575757), + ) ], + crossAxisAlignment: + CrossAxisAlignment.end, ) ], - crossAxisAlignment: CrossAxisAlignment.start,), - Column(children: [ - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 13, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - ), - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, - - ) + ), + ), + SizedBox( + height: SizeConfig.heightMultiplier * 3, + ), + Row( + children: [ + //todo add translation + AppText( + "Please Verify", + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.5, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600, + letterSpacing: -.64, + ), ], ), - ), - SizedBox( - height: 20, - ), - Row( - children: [ - AppText( - "Please Verify", - fontSize: 16, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ) - ], - ) - : Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, + SizedBox( + height: SizeConfig.heightMultiplier * 2, + ), + ], + ) + : 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( + this.onlySMSBox == false + ? Container( + margin: EdgeInsets.only( + bottom: 20, top: 30), + child: AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + textAlign: TextAlign.left, + ), + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + 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) - }, + 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: SelectedAuthMethodTypesService - .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => + 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), + 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.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), - )) - ], - ), - ]), + 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), + )) + ], + ), + ]), - // ) - ], - ), - ), - ], - ), + // ) + ], + ), + ], ), ), ), ), ), - bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( - height: 90, - width: double.infinity, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SecondaryButton( - label: TranslationBase - .of(context) - .useAnotherAccount, - color: Color(0xFFD02127), - //fontWeight: FontWeight.w700, - onTap: () { - authenticationViewModel.deleteUser(); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, + bottomSheet: authenticationViewModel.user == null + ? SizedBox( + height: 0, + ) + : Container( + height: 90, + width: double.infinity, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SecondaryButton( + label: + TranslationBase.of(context).useAnotherAccount ?? '', + color: Color(0xFFD02127), + //fontWeight: FontWeight.w700, + onTap: () { + authenticationViewModel.deleteUser(); + authenticationViewModel + .setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + ), + SizedBox( + height: 25, + ) + ], + ), ), - - SizedBox(height: 25,) - ], + ), ), - ), - ),), ); } @@ -428,13 +496,13 @@ class _VerificationMethodsScreenState extends State { authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); - - await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: authenticationViewModel.userInfo.password ); + await authenticationViewModel.sendActivationCodeForDoctorApp( + authMethodType: authMethodType, + password: authenticationViewModel.userInfo.password); if (authenticationViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); } else { - GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); } @@ -455,12 +523,14 @@ class _VerificationMethodsScreenState extends State { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { - await sharedPref.setString(TOKEN, - authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + await sharedPref.setString( + TOKEN, + authenticationViewModel + .activationCodeVerificationScreenRes.logInTokenID); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); - this.startSMSService(authMethodType,isSilentLogin: true); + this.startSMSService(authMethodType, isSilentLogin: true); } else { checkActivationCode(isSilentLogin: true); } @@ -473,7 +543,7 @@ class _VerificationMethodsScreenState extends State { fingerPrintBefore = authMethodType; } this.selectedOption = - fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + fingerPrintBefore != null ? fingerPrintBefore : authMethodType; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -503,11 +573,13 @@ class _VerificationMethodsScreenState extends State { } } - startSMSService(AuthMethodTypes type,{isSilentLogin: false}) { + startSMSService(AuthMethodTypes type, {isSilentLogin: false}) { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, + authenticationViewModel.loggedUser != null + ? authenticationViewModel.loggedUser.mobileNumber + : authenticationViewModel.user.mobile, (value) { showDialog( context: context, @@ -515,25 +587,26 @@ class _VerificationMethodsScreenState extends State { return AppLoaderWidget(); }); - this.checkActivationCode(value: value,isSilentLogin: isSilentLogin); + this.checkActivationCode(value: value, isSilentLogin: isSilentLogin); }, - () => - { + () => { print('Faild..'), }, ).displayDialog(context); } - loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, - isActive) async { + + loginWithFingerPrintOrFaceID( + AuthMethodTypes authMethodTypes, isActive) async { if (isActive) { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && (SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == - AuthMethodTypes.Fingerprint || + authenticationViewModel.user.logInTypeID) == + AuthMethodTypes.Fingerprint || SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { + authenticationViewModel.user.logInTypeID) == + AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -543,22 +616,19 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String value,bool isSilentLogin = false}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); + checkActivationCode({String value, bool isSilentLogin = false}) async { + await authenticationViewModel.checkActivationCodeForDoctorApp( + activationCode: value, isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(authenticationViewModel.error); } else { await authenticationViewModel.onCheckActivationCodeSuccess(); - if(value !=null){ - if(Navigator.canPop(context)) - Navigator.pop(context); - } - if(Navigator.canPop(context)) - Navigator.pop(context); - navigateToLandingPage(); - - + if (value != null) { + if (Navigator.canPop(context)) Navigator.pop(context); + } + if (Navigator.canPop(context)) Navigator.pop(context); + navigateToLandingPage(); } } @@ -569,5 +639,4 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED); } } - } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 8dd7ba65..d7513975 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -71,7 +71,7 @@ class CardWithBgWidget extends StatelessWidget { ), Container( padding: EdgeInsets.all(padding), - margin: EdgeInsets.only(left: marginLeft), + margin: EdgeInsets.only(left: !projectProvider.isArabic?marginLeft:0, right:projectProvider.isArabic?marginLeft:0 ), child: widget) ], ), From 5d20480e9b725748c72a131c6e92cf01e0cc3cc5 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 13:28:37 +0200 Subject: [PATCH 196/199] fix issues in home design --- lib/landing_page.dart | 19 +++++++---- lib/screens/home/home_screen.dart | 1 + lib/util/helpers.dart | 54 +++++++++++++++++-------------- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index cd9507fd..fcdb1eff 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/home/home_screen.dart'; @@ -11,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget. import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; class LandingPage extends StatefulWidget { @override @@ -36,6 +38,7 @@ class _LandingPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBar: currentTab != 0 ? AppBar( @@ -53,12 +56,16 @@ class _LandingPageState extends State { : SizedBox(), leading: Builder( builder: (BuildContext context) { - return IconButton( - icon: SvgPicture.asset('assets/images/svgs/menu.svg', - height: 50, width: 50), - iconSize: 15, - color: Color(0xff2B353E), - onPressed: () => Scaffold.of(context).openDrawer(), + return Container( + width: 40, + margin: EdgeInsets.only(left: projectViewModel.isArabic? 0:20, right: projectViewModel.isArabic? 20:0), + child: IconButton( + icon: SvgPicture.asset('assets/images/svgs/menu.svg', + height: 25, width: 10), + iconSize: 15, + color: Color(0xff2B353E), + onPressed: () => Scaffold.of(context).openDrawer(), + ), ); }, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 5cf849e8..a0b03656 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -85,6 +85,7 @@ class _HomeScreenState extends State { color: Colors.grey[100], padding: EdgeInsets.only(top: 10), child: Stack(children: [ + //TODO Elham* make it componet Container( width: 40, margin: EdgeInsets.only(left: projectsProvider.isArabic? 0:32, right: projectsProvider.isArabic? 23:0), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 6a3ca933..cdf45732 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -236,9 +236,6 @@ class Helpers { return parsedString; } - - - static InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { @@ -334,30 +331,46 @@ class Helpers { } static getBoxTabsBoxDecoration( - { - bool isFirst = false, + {bool isFirst = false, bool isMiddle = false, bool isLast = false, bool isActive = false, - double radius = 6.0 - }) { - return BoxDecoration( + double radius = 6.0}) { + return BoxDecoration( color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), shape: BoxShape.rectangle, borderRadius: BorderRadius.only( - topRight: Radius.circular(isActive?isFirst || isMiddle?radius:0:0), - bottomRight: Radius.circular(isActive?isFirst || isMiddle?radius:0:0), - topLeft: Radius.circular(isActive?isLast|| isMiddle?radius:0:0), - bottomLeft: Radius.circular(isActive?isLast || isMiddle?radius:0:0) - ), + topRight: Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + topLeft: Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0), + bottomRight: Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + bottomLeft: Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0)), ); } - static getBgTabColor(){ + static getBgTabColor() { return Color(0xFFEAEAEA); } - static getTabText({String title, bool isActive = false,}){ + static getTabText({ + String title, + bool isActive = false, + }) { return AppText( title, fontSize: SizeConfig.textMultiplier * 1.8, @@ -365,16 +378,14 @@ class Helpers { letterSpacing: -0.48, fontWeight: FontWeight.w600, ); - } - - static getTabHeight(BuildContext context){ + static getTabHeight(BuildContext context) { final screenSize = MediaQuery.of(context).size; return screenSize.height * 0.07; } - static getTabCounter({bool isActive: false,int counter}){ + static getTabCounter({bool isActive: false, int counter}) { return Container( margin: EdgeInsets.all(4), width: 15, @@ -396,8 +407,6 @@ class Helpers { ); } - - static String convertToTitleCase(String text) { if (text == null) { return null; @@ -424,7 +433,4 @@ class Helpers { // Join/Merge all words back to one String return capitalizedWords.join(' '); } - } - - From 74540f054a64be38e49a71b582900f98786aa768 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 13:39:04 +0200 Subject: [PATCH 197/199] fix sms pop up --- lib/widgets/auth/sms-popup.dart | 517 ++++++++++++++++++-------------- 1 file changed, 296 insertions(+), 221 deletions(-) diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 0c374e58..4e99d316 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'; @@ -9,6 +8,7 @@ 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 SMSOTP { final AuthMethodTypes type; final mobileNo; @@ -48,231 +48,307 @@ class SMSOTP { String displayTime = ''; 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, - 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: MediaQuery.of(context).size.height * 0.50, - width: MediaQuery.of(context).size.width * 0.84, - 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), - ), + 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( + 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.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), + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Icon( + type == AuthMethodTypes.SMS + ? 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; + 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.w700, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + 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: 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: dialogInputWidth, + height: + SizeConfig.getHeightMultiplier( + height: dialogHeight) * + 30, + margin: EdgeInsets.symmetric( + vertical: 2, horizontal: 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.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)), + ], + )), ), - 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, - ), - 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 + + ' ', + textAlign: TextAlign.start, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + 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, + ) + ]) + ], + ), + ), + ); + })), + ), + ), + ), + ), + ), + ); } TextStyle buildTextStyle() { return TextStyle( - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2.5, ); } @@ -316,7 +392,6 @@ class SMSOTP { digit3.text.toString() + digit4.text.toString()); this.isClosed = true; - } } @@ -341,7 +416,7 @@ class SMSOTP { displayTime = this.getSecondsAsDigitalClock(this.remainingTime); }); - Future.delayed(Duration(seconds: 1), () { + Future.delayed(Duration(seconds: 1), () { if (this.remainingTime > 0) { if (isClosed == false) { startTimer(setState); From a578d92cb7a080ce2b874a362aa1adde7de01b71 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 14 Dec 2021 15:25:50 +0200 Subject: [PATCH 198/199] fix the arabic issues --- .../doctor_replay/doctor_reply_screen.dart | 8 ++++-- .../In_patient/in_patient_screen.dart | 15 ++++++---- .../out_patient/out_patient_screen.dart | 14 ++++++---- .../referral/patient_referral_screen.dart | 10 +++++-- lib/util/helpers.dart | 28 +++++++++++++++---- 5 files changed, 53 insertions(+), 22 deletions(-) diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index d30457b4..7957d4bd 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -1,6 +1,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/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -14,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'all_doctor_questions.dart'; import 'not_replaied_Doctor_Questions.dart'; @@ -139,11 +141,13 @@ class _DoctorReplyScreenState extends State Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1, bool isFirst = false, bool isMiddle = false, - bool isLast = false,context}) { + bool isLast = false,context, }) { + ProjectViewModel projectViewModel= Provider.of(context); + return Center( child: Container( height: Helpers.getTabHeight(context), - decoration: Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), + decoration: Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast, projectViewModel: projectViewModel), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index ebb3118a..cadab9be 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -63,7 +63,6 @@ class _InPatientScreenState extends State Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; PatientSearchRequestModel requestModel = PatientSearchRequestModel(); - ProjectViewModel projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) async { @@ -142,13 +141,13 @@ class _InPatientScreenState extends State // unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll, + TranslationBase.of(context).inPatientAll,context: context, counter: model.inPatientList.length, isFirst: true), tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).myInPatientTitle, - counter: model.myIinPatientList.length, isMiddle: true), + counter: model.myIinPatientList.length, isMiddle: true, context: context,), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged, isLast:true), + TranslationBase.of(context).discharged, isLast:true, context: context,), ], ), ), @@ -201,11 +200,15 @@ class _InPatientScreenState extends State {int counter = -1, bool isFirst = false, bool isMiddle = false, - bool isLast = false,}) { + bool isLast = false,BuildContext context}) { + + ProjectViewModel projectsProvider = Provider.of(context); + + return Center( child: Container( height: Helpers.getTabHeight(context), - decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast), + decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast,projectViewModel: projectsProvider), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 59601ea7..a43a4582 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -147,19 +147,21 @@ class _OutPatientsScreenState extends State { isFirst: _times.indexOf(item) == 0, isLast: _times.indexOf(item) == _times.length - 1, - isMiddle: _times.indexOf(item) != 0 && _times.indexOf(item) != _times.length - 1 - - ), + isMiddle: _times.indexOf(item) != 0 && + _times.indexOf(item) != _times.length - 1, + projectViewModel: projectsProvider), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText(title: item, isActive: _isActive), + Helpers.getTabText( + title: item, isActive: _isActive), _isActive && _activeLocation != 0 && model.state == ViewState.Idle - ? Helpers.getTabCounter(isActive:_isActive,counter: model.filterData.length) - + ? Helpers.getTabCounter( + isActive: _isActive, + counter: model.filterData.length) : Container(), ], ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 4dab4270..59e58198 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -1,6 +1,7 @@ import 'dart:ui'; 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/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -10,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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 'package:provider/provider.dart'; import '../../ReferralDischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; @@ -45,6 +47,8 @@ class _PatientReferralScreen extends State @override Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + return AppScaffold( isShowAppBar: true, appBar: PatientSearchHeader( @@ -75,7 +79,7 @@ class _PatientReferralScreen extends State tabs: [ Container( decoration: Helpers.getBoxTabsBoxDecoration( - isActive: index == 0, isFirst: true), + isActive: index == 0, isFirst: true, projectViewModel:projectsProvider ), child: Center( child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) ), @@ -83,7 +87,7 @@ class _PatientReferralScreen extends State Center( child: Container( decoration:Helpers.getBoxTabsBoxDecoration( - isActive: index == 1, isMiddle: true), + isActive: index == 1, isMiddle: true, projectViewModel:projectsProvider ), child: Center( child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) ), @@ -92,7 +96,7 @@ class _PatientReferralScreen extends State Center( child: Container( decoration:Helpers.getBoxTabsBoxDecoration( - isActive: index == 2, isLast: true), + isActive: index == 2, isLast: true, projectViewModel:projectsProvider ), child: Center( child: Helpers.getTabText(title:TranslationBase.of(context).discharged, isActive:index == 2 ), ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index cdf45732..42816f9f 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -335,27 +335,45 @@ class Helpers { bool isMiddle = false, bool isLast = false, bool isActive = false, - double radius = 6.0}) { + double radius = 6.0, ProjectViewModel projectViewModel}) { return BoxDecoration( color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), shape: BoxShape.rectangle, borderRadius: BorderRadius.only( - topRight: Radius.circular(isActive + topRight: projectViewModel.isArabic?Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0):Radius.circular(isActive ? isFirst || isMiddle ? radius : 0 : 0), - topLeft: Radius.circular(isActive + + + topLeft: projectViewModel.isArabic? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0):Radius.circular(isActive ? isLast || isMiddle ? radius : 0 : 0), - bottomRight: Radius.circular(isActive + bottomRight: projectViewModel.isArabic? Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0): Radius.circular(isActive ? isFirst || isMiddle ? radius : 0 : 0), - bottomLeft: Radius.circular(isActive + bottomLeft:projectViewModel.isArabic? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0): Radius.circular(isActive ? isLast || isMiddle ? radius : 0 From a4aa695f258dbf5e910b814e69dedcc83253d11b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 14 Dec 2021 15:57:33 +0200 Subject: [PATCH 199/199] TextField & page header design fix --- .../live_care/live_care_patient_screen.dart | 26 +++---------- .../profile/patient-profile-app-bar.dart | 19 ++++++--- lib/widgets/shared/app_drawer_widget.dart | 13 ++++++- .../text_fields/app-textfield-custom.dart | 39 ++++++++++--------- .../shared/text_fields/text_fields_utils.dart | 2 +- 5 files changed, 51 insertions(+), 48 deletions(-) diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index d3217a95..a434a212 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -7,6 +7,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/patient/patiant_info_model.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/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; @@ -60,7 +61,10 @@ class _LiveCarePatientScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientSearchHeader( + title: "LiveCare Patients", + ), body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -69,25 +73,7 @@ class _LiveCarePatientScreenState extends State { decoration: BoxDecoration( color: Colors.white, ), - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - "LiveCare Patients", - fontSize: SizeConfig.textMultiplier * 2.8, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - ), - ]), - ), + child: Container(), ), SizedBox( height: 20, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 1bd9c50d..974d3590 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -138,7 +138,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', + gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -175,7 +177,10 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { 3.5, ), patient.startTime != null - ? AppText(patient.startTime != null ? patient.startTime : '', + ? AppText( + patient.startTime != null + ? patient.startTime + : '', fontWeight: FontWeight.w700, fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -303,7 +308,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5), + left: projectViewModel.isArabic ? 10 : 85, + right: projectViewModel.isArabic ? 85 : 10, + top: 5), decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( @@ -350,7 +357,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), if (invoiceNO != null && !isPrescriptions) HeaderRow( - label: 'Invoice: ', + label: 'Invoice: ', value: invoiceNO ?? "", ), if (branch != null) @@ -380,8 +387,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { : 'Prescriptions Date ', value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - ), - ]), + ), + ]), ), ), ], diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index c645913b..4444cf0a 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -88,8 +88,11 @@ class _AppDrawerState extends State { padding: EdgeInsets.only(top: 8.0), child: AppText( TranslationBase.of(context).dr + - authenticationViewModel - .doctorProfile?.doctorName, + capitalizeOnlyFirstLater( + authenticationViewModel + .doctorProfile.doctorName + .replaceAll("DR.", "") + .toLowerCase()), fontWeight: FontWeight.w700, color: Color(0xFF2E303A), fontFamily: 'Poppins', @@ -257,3 +260,9 @@ class _AppDrawerState extends State { Navigator.of(context).pushNamed(routeName); } } + +String capitalizeOnlyFirstLater(String text) { + if (text.trim().isEmpty) return ""; + + return "${text[0].toUpperCase()}${text.substring(1)}"; +} diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 0cb8ad67..769cd4f8 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -96,7 +96,7 @@ class _AppTextFieldCustomState extends State { Container( height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 - : null, + : MediaQuery.of(context).size.height * 0.098, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -106,7 +106,7 @@ class _AppTextFieldCustomState extends State { ) : null, padding: - EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0), child: InkWell( onTap: widget.onClick ?? null, child: Row( @@ -123,28 +123,29 @@ class _AppTextFieldCustomState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - if ((widget.controller != null && - widget.controller.text != "") || - widget.dropDownText != null) - AppText( - widget.hintText, - // marginTop: widget.hasHintmargin ? 0 : 30, - color: Color(0xFF2E303A), - fontSize: widget.isPrscription == false - ? 11.0 - // SizeConfig.getHeightMultiplier() * - // (SizeConfig.isWidthLarge ? 1.1 : 1.3) - : 0, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - fontFamily: 'Poppins', - ), + // if ((widget.controller != null && + // widget.controller.text != "") || + // widget.dropDownText != null) + AppText( + widget.hintText, + // marginTop: widget.hasHintmargin ? 0 : 30, + color: Color(0xFF2E303A), + fontSize: widget.isPrscription == false + ? 11.0 + // SizeConfig.getHeightMultiplier() * + // (SizeConfig.isWidthLarge ? 1.1 : 1.3) + : 0, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + fontFamily: 'Poppins', + ), widget.dropDownText == null ? Container( height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 - : null, + : MediaQuery.of(context).size.height * + 0.045, child: TextFormField( textAlign: projectViewModel.isArabic ? TextAlign.right diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 8ca24a68..23ae13a8 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -45,7 +45,7 @@ class TextFieldsUtils { borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderRadius: BorderRadius.circular(8), ),*/ - hintText: selectedText != null ? selectedText : hintText ?? "", + hintText: selectedText != null ? selectedText : "" ?? "", suffixIcon: Icon( suffixIcon ?? null, color: Colors.grey.shade600,