From 1712874c87943bfaa8ce88a702b4459dea93ea3b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 23 Aug 2021 14:12:50 +0300 Subject: [PATCH] fix show count in home page --- lib/config/localized_values.dart | 2 +- lib/screens/doctor/doctor_repaly_chat.dart | 40 +++++++++++-------- lib/screens/patients/InPatientPage.dart | 3 ++ .../patient_profile_screen.dart | 14 +++++-- 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6500c10e..665563db 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -665,7 +665,7 @@ const Map> localizedValues = { 'noteVerify': {'en': 'Verify', 'ar': 'تحقق'}, 'noteConfirm': {'en': 'Confirm', 'ar': 'تاكيد'}, 'noteAdd': {'en': 'Add ', 'ar': 'اضف '}, - 'noteUpdateْْ': {'en': 'Update ', 'ar': 'تحديت'}, + 'noteUpdate': {'en': 'Update ', 'ar': 'تحديت'}, 'orderSheet': {'en': 'Order Sheet', 'ar': 'ورقة الطلب'}, 'order': {'en': 'Order', 'ar': 'الطلب'}, 'sheet': {'en': 'Sheet', 'ar': 'ورقة'}, diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index afe8e750..c3b58806 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -148,7 +148,7 @@ class DoctorReplayChat extends StatelessWidget { child: AppText( reply.patientName .toString(), - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Colors.white, fontWeight: FontWeight.bold, @@ -170,7 +170,7 @@ class DoctorReplayChat extends StatelessWidget { ], ), Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( @@ -178,11 +178,11 @@ class DoctorReplayChat extends StatelessWidget { fontWeight: FontWeight .w500, color: Colors.white, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Colors.white, // fontSize: 18 @@ -223,6 +223,7 @@ class DoctorReplayChat extends StatelessWidget { SizedBox(height: 30,), SizedBox(height: 30,), + if(reply.doctorResponse != null && reply.doctorResponse.isNotEmpty) Align( alignment: Alignment.centerRight, child: Container( @@ -267,7 +268,7 @@ class DoctorReplayChat extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.35, child: AppText( previousModel.doctorProfile.doctorName, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF2B353E), fontWeight: FontWeight.bold, @@ -278,18 +279,18 @@ class DoctorReplayChat extends StatelessWidget { ], ), Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w500, color: Color(0xFF2B353E), - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Color(0xFF2B353E), // fontSize: 18 @@ -358,16 +359,23 @@ class DoctorReplayChat extends StatelessWidget { suffixIcon: FontAwesomeIcons.arrowRight, suffixIconColor: Colors.green, onSuffixTap: ()async { - GifLoaderDialogUtils.showMyDialog(context); - await previousModel.createDoctorResponse(msgController.text, reply); - if(previousModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(previousModel.error); + + if(msgController.text.isEmpty){ + Helpers.showErrorToast("Please Add Doctor Reply"); + return; } else { - DrAppToastMsg.showSuccesToast("Thank you for your replay "); - await previousModel.getDoctorReply(); - Navigator.pop(context); + GifLoaderDialogUtils.showMyDialog(context); + await previousModel.createDoctorResponse(msgController.text, reply); + if(previousModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(previousModel.error); + } else { + DrAppToastMsg.showSuccesToast("Thank you for your replay "); + await previousModel.getDoctorReply(); + Navigator.pop(context); + } + GifLoaderDialogUtils.hideDialog(context); } - GifLoaderDialogUtils.hideDialog(context); + diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index ffc3d03f..0c0d548d 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -161,6 +161,9 @@ class _InPatientPageState extends State { "isSearch": false, "isInpatient": true, "arrivalType": "1", + "isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index] + .doctorId == + widget.patientSearchViewModel.doctorProfile.doctorID, }); }, ); 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 56dc848f..eec42b86 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -39,6 +39,7 @@ class _PatientProfileScreenState extends State with Single bool isFromLiveCare = false; bool isInpatient = false; + bool isMyPatient = false; bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; @@ -97,6 +98,9 @@ class _PatientProfileScreenState extends State with Single if (routeArgs.containsKey("isCallFinished")) { isCallFinished = routeArgs['isCallFinished']; } + if (routeArgs.containsKey("isMyPatient")) { + isMyPatient = routeArgs['isMyPatient']; + } if (isInpatient) _activeTab = 0; else @@ -132,7 +136,9 @@ class _PatientProfileScreenState extends State with Single if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); }, builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false, body: Column( @@ -198,11 +204,13 @@ class _PatientProfileScreenState extends State with Single ), ], ), - if ( isInpatient? true:isFromLiveCare + if ( (isInpatient && isMyPatient )? true:isFromLiveCare ? patient.episodeNo != null : patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( - onModelReady: (model) async {}, + onModelReady: (model) async { + model.getDoctorProfile(); + }, builder: (_, model, w) => Positioned( top: 180, left: 20, @@ -253,7 +261,7 @@ class _PatientProfileScreenState extends State with Single AppButton( title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: isInpatient || isFromLiveCare + color: (isInpatient &&isMyPatient ) || isFromLiveCare ? Colors.red.shade700 : patient.patientStatusType == 43 ? Colors.red.shade700