diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 0dec7b1d..bf1aedd0 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -301,7 +301,7 @@ "vitalSignsSubTitle": "التقارير", "myMedical": "نشط", "myMedicalSubtitle": "الأدوية", - "myDoctor": "طبيبي", + "myDoctor": "أطبائي", "myDoctorSubtitle": "القائمة", "eye": "العين", "eyeSubtitle": "القياس", @@ -1646,6 +1646,7 @@ "later": "لاحقاً", "cancelAppointmentConfirmMessage": "هل أنت متأكد من رغبتك في إلغاء هذا الموعد؟", "acknowledged": "معترف به", - "searchLabResults": "بحث نتائج المختبر" + "searchLabResults": "بحث نتائج المختبر", + "callForAssistance": "اتصل للحصول على المساعدة الفورية" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index b839d7d7..61245515 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -300,7 +300,7 @@ "vitalSignsSubTitle": "Reports", "myMedical": "Active", "myMedicalSubtitle": "Medications", - "myDoctor": "My Doctor", + "myDoctor": "My Doctors", "myDoctorSubtitle": "List", "eye": "Eye", "eyeSubtitle": "Measurement", @@ -1638,5 +1638,6 @@ "later": "Later", "cancelAppointmentConfirmMessage": "Are you sure you want to cancel this appointment?", "acknowledged": "Acknowledged", - "searchLabResults": "Search lab results" + "searchLabResults": "Search lab results", + "callForAssistance": "Call for immediate assistance" } diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 5fb73a37..63d36252 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart'; class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT diff --git a/lib/core/utils/loading_utils.dart b/lib/core/utils/loading_utils.dart index bd24d30c..48d4f2dd 100644 --- a/lib/core/utils/loading_utils.dart +++ b/lib/core/utils/loading_utils.dart @@ -15,37 +15,37 @@ class LoadingUtils { static bool get isLoading => _isLoadingVisible; - static showFullScreenLoader({bool barrierDismissible = true, isSuccessDialog = false, String loadingText = "Loading, Please wait..."}) { - if (!_isLoadingVisible) { - _isLoadingVisible = true; - final context = _navigationService.navigatorKey.currentContext; - log("got the context in showFullScreenLoading"); - if (context == null) return; - - showDialog( - barrierDismissible: barrierDismissible, - context: context, - barrierColor: AppColors.blackColor.withOpacity(0.5), - useRootNavigator: false, - useSafeArea: false, - builder: (BuildContext context) { - return Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 20.h, - hasShadow: false, - ), - child: Material( - child: Center( - child: isSuccessDialog ? Utils.getSuccessWidget(loadingText: loadingText) : Utils.getLoadingWidget(loadingText: loadingText), - ).paddingSymmetrical(24.w, 0), - ), - ); - }).then((value) { - _isLoadingVisible = false; - }); - } - } + // static showFullScreenLoader({bool barrierDismissible = true, isSuccessDialog = false, String loadingText = "Loading, Please wait..."}) { + // if (!_isLoadingVisible) { + // _isLoadingVisible = true; + // final context = _navigationService.navigatorKey.currentContext; + // log("got the context in showFullScreenLoading"); + // if (context == null) return; + // + // showDialog( + // barrierDismissible: barrierDismissible, + // context: context, + // barrierColor: AppColors.blackColor.withOpacity(0.5), + // useRootNavigator: false, + // useSafeArea: false, + // builder: (BuildContext context) { + // return Container( + // decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + // color: AppColors.whiteColor, + // borderRadius: 20.h, + // hasShadow: false, + // ), + // child: Material( + // child: Center( + // child: isSuccessDialog ? Utils.getSuccessWidget(loadingText: loadingText) : Utils.getLoadingWidget(loadingText: loadingText), + // ).paddingSymmetrical(24.w, 0), + // ), + // ); + // }).then((value) { + // _isLoadingVisible = false; + // }); + // } + // } static hideFullScreenLoader() { if (!_isLoadingVisible) return; diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 4dc43272..407380c1 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -303,10 +303,11 @@ extension EmailValidator on String { height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.f, letterSpacing: letterSpacing ?? -1, fontWeight: isBold ? FontWeight.bold : fontWeight ?? FontWeight.normal), ); - Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text( + Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing, bool isEnglishOnly = false,}) => Text( this, textAlign: isCenter ? TextAlign.center : null, style: TextStyle( + fontFamily: (isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'), height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.f, letterSpacing: letterSpacing ?? -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), ); diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index c0bc4dd1..6072e8b9 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -862,17 +862,17 @@ class AuthenticationViewModel extends ChangeNotifier { resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { if (apiResponse.data is String) { //TODO: This Section Need to Be Testing. - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); _dialogService.showExceptionBottomSheet(message: apiResponse.data, onOkPressed: () {}, onCancelPressed: () {}); //TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result. } else { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); if (apiResponse.data["MessageStatus"] == 1) { - LoadingUtils.showFullScreenLoader(isSuccessDialog: true, loadingText: "Your medical file has been created successfully. \nPlease proceed to login."); + LoaderBottomSheet.showLoader(loadingText: "Your medical file has been created successfully. \nPlease proceed to login."); //TODO: Here We Need to Show a Dialog Of Something in the case of Success. await clearDefaultInputValues(); // This will Clear All Default Values Of User. Future.delayed(Duration(seconds: 1), () { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); // _navigationService.pushAndReplace(AppRoutes.loginScreen); _navigationService.pushAndRemoveUntil(CustomPageRoute(page: LandingNavigation()), (r) => false); _navigationService.push(CustomPageRoute(page: LoginScreen())); diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 59ceddde..2d077b5f 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:get_it/get_it.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/location_util.dart'; @@ -11,6 +12,7 @@ import 'package:hmg_patient_app_new/core/utils/loading_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; +import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/LaserCategoryType.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/free_slot.dart'; @@ -879,30 +881,35 @@ class BookAppointmentsViewModel extends ChangeNotifier { ); await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { - LoaderBottomSheet.hideLoader(); + // LoaderBottomSheet.hideLoader(); Future.delayed(Duration(milliseconds: 50)).then((value) async {}); - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); + // LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr()); await insertSpecificAppointment( onError: (err) {}, onSuccess: (apiResp) async { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); await Future.delayed(Duration(milliseconds: 50)).then((value) async { - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); - await Future.delayed(Duration(milliseconds: 4000)).then((value) { - setIsPatientRescheduleAppointment(false); - LoadingUtils.hideFullScreenLoader(); - Navigator.pushAndRemoveUntil( - navigationService.navigatorKey.currentContext!, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }); + showCommonBottomSheetWithoutHeight( + GetIt.instance().navigatorKey.currentContext!, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h), + callBackFunc: () { + setIsPatientRescheduleAppointment(false); + Navigator.pushAndRemoveUntil( + navigationService.navigatorKey.currentContext!, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, + isFullScreen: false, + isCloseButtonVisible: false, + isAutoDismiss: true + ); }); }); }); } else { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), navigationService.navigatorKey.currentContext!, @@ -933,22 +940,28 @@ class BookAppointmentsViewModel extends ChangeNotifier { await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { LoaderBottomSheet.hideLoader(); Future.delayed(Duration(milliseconds: 50)).then((value) async {}); - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr()); await insertSpecificAppointment( onError: (err) {}, onSuccess: (apiResp) async { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); await Future.delayed(Duration(milliseconds: 50)).then((value) async { - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); - await Future.delayed(Duration(milliseconds: 4000)).then((value) { - LoadingUtils.hideFullScreenLoader(); - Navigator.pushAndRemoveUntil( - navigationService.navigatorKey.currentContext!, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }); + showCommonBottomSheetWithoutHeight( + GetIt.instance().navigatorKey.currentContext!, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h), + callBackFunc: () { + setIsPatientRescheduleAppointment(false); + Navigator.pushAndRemoveUntil( + navigationService.navigatorKey.currentContext!, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, + isFullScreen: false, + isCloseButtonVisible: false, + isAutoDismiss: true + ); }); }); }); @@ -994,7 +1007,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { (apiResponse) { if (apiResponse.messageStatus == 2) { // onError!(apiResponse); - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), navigationService.navigatorKey.currentContext!, @@ -1030,22 +1043,28 @@ class BookAppointmentsViewModel extends ChangeNotifier { await cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel).then((val) async { navigationService.pop(); Future.delayed(Duration(milliseconds: 50)).then((value) async {}); - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr()); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingYourAppointment.tr()); await insertSpecificAppointment( onError: (err) {}, onSuccess: (apiResp) async { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); await Future.delayed(Duration(milliseconds: 50)).then((value) async { - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); - await Future.delayed(Duration(milliseconds: 4000)).then((value) { - LoadingUtils.hideFullScreenLoader(); - Navigator.pushAndRemoveUntil( - navigationService.navigatorKey.currentContext!, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }); + showCommonBottomSheetWithoutHeight( + GetIt.instance().navigatorKey.currentContext!, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h), + callBackFunc: () { + setIsPatientRescheduleAppointment(false); + Navigator.pushAndRemoveUntil( + navigationService.navigatorKey.currentContext!, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, + isFullScreen: false, + isCloseButtonVisible: false, + isAutoDismiss: true + ); }); }); }); @@ -1539,7 +1558,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { }, (apiResponse) { if (apiResponse.messageStatus == 2) { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), navigationService.navigatorKey.currentContext!, diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 6a6d71e7..285567e1 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1639,5 +1639,6 @@ abstract class LocaleKeys { static const cancelAppointmentConfirmMessage = 'cancelAppointmentConfirmMessage'; static const acknowledged = 'acknowledged'; static const searchLabResults = 'searchLabResults'; + static const callForAssistance = 'callForAssistance'; } diff --git a/lib/presentation/appointments/my_doctors_page.dart b/lib/presentation/appointments/my_doctors_page.dart index 664c973e..26e5927b 100644 --- a/lib/presentation/appointments/my_doctors_page.dart +++ b/lib/presentation/appointments/my_doctors_page.dart @@ -218,8 +218,17 @@ class _MyDoctorsPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppCustomChipWidget(labelText: "${group.length} ${'doctors'}"), - Icon(isExpanded ? Icons.expand_less : Icons.expand_more), + AppCustomChipWidget( + richText: Row( + children: [ + "${group.length} ".toText10(isEnglishOnly: true), + "${LocaleKeys.doctors.tr(context: context)} ".toText10() + ], + ), + // labelText: "${group.length} ${'doctors'}", + isEnglishOnly: true, + ), + Icon(isExpanded ? Icons.expand_less : Icons.expand_more), ], ), SizedBox(height: 8.h), @@ -289,10 +298,10 @@ class _MyDoctorsPageState extends State { flex: 2, child: CustomButton( icon: AppAssets.view_report_icon, - iconColor: AppColors.primaryRedColor, + iconColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 1.0) : AppColors.primaryRedColor, iconSize: 16.h, text: LocaleKeys.viewProfile.tr(context: context), - onPressed: () async { + onPressed: doctor?.isActiveDoctorProfile == false ? () {} : () async { bookAppointmentsViewModel.setSelectedDoctor(DoctorsListResponseModel( clinicID: doctor?.clinicID ?? 0, projectID: doctor?.projectID ?? 0, @@ -323,10 +332,9 @@ class _MyDoctorsPageState extends State { ); }); }, - isDisabled: doctor?.isActiveDoctorProfile == false, - backgroundColor: AppColors.secondaryLightRedColor, - borderColor: AppColors.secondaryLightRedColor, - textColor: AppColors.primaryRedColor, + backgroundColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 0.3) : AppColors.secondaryLightRedColor, + borderColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 0.01) : AppColors.secondaryLightRedColor, + textColor: doctor?.isActiveDoctorProfile == false ? AppColors.inputLabelTextColor.withValues(alpha: 1.0) : AppColors.primaryRedColor, fontSize: 14, fontWeight: FontWeight.w500, borderRadius: 12, diff --git a/lib/presentation/authentication/saved_login_screen.dart b/lib/presentation/authentication/saved_login_screen.dart index 44bcc5ab..dcb2c765 100644 --- a/lib/presentation/authentication/saved_login_screen.dart +++ b/lib/presentation/authentication/saved_login_screen.dart @@ -84,7 +84,7 @@ class _SavedLogin extends State { SizedBox(height: 16.h), appState.getSelectDeviceByImeiRespModelElement != null ? appState.getSelectDeviceByImeiRespModelElement!.name!.toCamelCase - .toText26(isBold: true, height: 26 / 36, color: AppColors.textColor) + .toText26(isBold: true, height: 26 / 36, color: AppColors.textColor, isEnglishOnly: true) : SizedBox(), SizedBox(height: 24.h), Container( diff --git a/lib/presentation/book_appointment/review_appointment_page.dart b/lib/presentation/book_appointment/review_appointment_page.dart index eb39b5d4..a9f07b05 100644 --- a/lib/presentation/book_appointment/review_appointment_page.dart +++ b/lib/presentation/book_appointment/review_appointment_page.dart @@ -316,34 +316,42 @@ class _ReviewAppointmentPageState extends State { } void initiateBookAppointment() async { - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context)); + // LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context)); + LoaderBottomSheet.showLoader(loadingText: bookAppointmentsViewModel.isPatientRescheduleAppointment ? LocaleKeys.reschedulingAppo.tr(context: context) : LocaleKeys.bookingYourAppointment.tr(context: context)); myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); if (bookAppointmentsViewModel.isLiveCareSchedule) { await bookAppointmentsViewModel.insertSpecificAppointmentForLiveCare(onError: (err) { print(err.data["ErrorEndUserMessage"]); - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); }, onSuccess: (apiResp) async { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); await Future.delayed(Duration(milliseconds: 50)).then((value) async { - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); - await Future.delayed(Duration(milliseconds: 4000)).then((value) { - LoadingUtils.hideFullScreenLoader(); - bookAppointmentsViewModel.setIsLiveCareSchedule(false); - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }); + // LoaderBottomSheet.showLoader(loadingText: LocaleKeys.appointmentSuccess.tr()); + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()), + callBackFunc: () { + bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false); + bookAppointmentsViewModel.setIsLiveCareSchedule(false); + Navigator.pushAndRemoveUntil( + context, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, + isFullScreen: false, + isCloseButtonVisible: false, + isAutoDismiss: true + ); }); }); } else { //TODO: Add patient Derma package check API Here await bookAppointmentsViewModel.insertSpecificAppointment(onError: (err) { // print(err.data["ErrorEndUserMessage"]); - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( title: LocaleKeys.notice.tr(context: context), context, @@ -357,19 +365,25 @@ class _ReviewAppointmentPageState extends State { isCloseButtonVisible: true, ); }, onSuccess: (apiResp) async { - LoadingUtils.hideFullScreenLoader(); + LoaderBottomSheet.hideLoader(); await Future.delayed(Duration(milliseconds: 50)).then((value) async { - LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: true, loadingText: LocaleKeys.appointmentSuccess.tr()); - await Future.delayed(Duration(milliseconds: 4000)).then((value) { - LoadingUtils.hideFullScreenLoader(); - bookAppointmentsViewModel.setIsLiveCareSchedule(false); - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }); + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentSuccess.tr()).paddingSymmetrical(0.h, 24.h), + callBackFunc: () { + bookAppointmentsViewModel.setIsLiveCareSchedule(false); + bookAppointmentsViewModel.setIsPatientRescheduleAppointment(false); + Navigator.pushAndRemoveUntil( + context, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, + isFullScreen: false, + isCloseButtonVisible: false, + isAutoDismiss: true + ); }); }); } diff --git a/lib/presentation/contact_us/contact_us.dart b/lib/presentation/contact_us/contact_us.dart index c064a230..fbbd11bc 100644 --- a/lib/presentation/contact_us/contact_us.dart +++ b/lib/presentation/contact_us/contact_us.dart @@ -39,8 +39,8 @@ class ContactUs extends StatelessWidget { checkInOptionCard( AppAssets.call_fill, LocaleKeys.callNow.tr(), - // LocaleKeys.viewNearestHMGLocationsviewNearestHMGLocations.tr(), - "Call for immediate assistance", + LocaleKeys.callForAssistance.tr(), + // "Call for immediate assistance", ).onPress(() { launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); }), diff --git a/lib/presentation/home/data/landing_page_data.dart b/lib/presentation/home/data/landing_page_data.dart index 4606c800..33b12855 100644 --- a/lib/presentation/home/data/landing_page_data.dart +++ b/lib/presentation/home/data/landing_page_data.dart @@ -1,6 +1,8 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; +import 'package:hmg_patient_app_new/core/app_state.dart'; +import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/home/data/service_card_data.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -123,8 +125,8 @@ class LandingPageData { ServiceCardData( serviceName: "my_doctors", icon: AppAssets.my_doctors_icon, - title: "My", - subtitle: "Doctors", + title: getIt.get().isArabic() ? LocaleKeys.myDoctor : "My", + subtitle: getIt.get().isArabic() ? "" : "Doctors", backgroundColor: AppColors.whiteColor, iconColor: AppColors.blackColor, textColor: AppColors.blackColor, diff --git a/lib/presentation/home/widgets/welcome_widget.dart b/lib/presentation/home/widgets/welcome_widget.dart index eb9ec02c..b05aeb99 100644 --- a/lib/presentation/home/widgets/welcome_widget.dart +++ b/lib/presentation/home/widgets/welcome_widget.dart @@ -43,7 +43,11 @@ class WelcomeWidget extends StatelessWidget { children: [ Icon(Icons.menu, color: AppColors.textColor).onPress(() { getIt.get().getProfileSettings(); - Navigator.of(context).push(springPageRoute(ProfileSettings())); + Navigator.of(context).push( + CustomPageRoute( + page: ProfileSettings(), + ), + ); }), Image.asset(imageUrl, width: 40, height: 40), Column( diff --git a/lib/presentation/lab/alphabeticScroll.dart b/lib/presentation/lab/alphabeticScroll.dart index e230fbcb..933f399c 100644 --- a/lib/presentation/lab/alphabeticScroll.dart +++ b/lib/presentation/lab/alphabeticScroll.dart @@ -159,7 +159,6 @@ class _AlphabetScrollPageState extends State { crossAxisAlignment: CrossAxisAlignment.center, children:List.generate(widget.alpahbetsAvailable.length, (i) { final isActive = (i == _activeIndex); - return GestureDetector( onTap: () { setState(() => _activeIndex = i); @@ -175,7 +174,7 @@ class _AlphabetScrollPageState extends State { child: Opacity( opacity: isActive ? 1.0 : 0.5, child: widget.alpahbetsAvailable[i].toUpperCase().toText14( - color: !isActive ? AppColors.greyTextColor : AppColors.primaryRedColor + color: !isActive ? AppColors.greyTextColor : AppColors.primaryRedColor, isEnglishOnly: true ), ), ); diff --git a/lib/presentation/lab/lab_order_by_test.dart b/lib/presentation/lab/lab_order_by_test.dart index ac6f0f3b..5cb94320 100644 --- a/lib/presentation/lab/lab_order_by_test.dart +++ b/lib/presentation/lab/lab_order_by_test.dart @@ -11,6 +11,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; +import 'dart:ui' as ui; class LabOrderByTest extends StatelessWidget { final VoidCallback onTap; @@ -36,7 +37,7 @@ class LabOrderByTest extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - '${tests!.description}'.toText16(isBold: true), + '${tests!.description}'.toText16(isBold: true, isEnglishOnly: true), SizedBox(height: 4.h), (appState.isArabic() ? tests!.testDescriptionAr : tests!.testDescriptionEn)!.toText12(fontWeight: FontWeight.w500), SizedBox(height: 8.h), @@ -44,7 +45,13 @@ class LabOrderByTest extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppCustomChipWidget( - richText: '${"${LocaleKeys.lastTested.tr(context: context)}:"} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(tests!.createdOn), false)}'.toText12(fontWeight: FontWeight.w500), + richText: Row( + children: [ + "${LocaleKeys.lastTested.tr(context: context)}: ".toText12(fontWeight: FontWeight.w500), + Directionality( + textDirection: ui.TextDirection.ltr,child: DateUtil.formatDateToDate(DateUtil.convertStringToDate(tests!.createdOn), false).toText12(fontWeight: FontWeight.w500, isEnglishOnly: true)) + ], + ), backgroundColor: AppColors.greyLightColor, textColor: AppColors.textColor, ), diff --git a/lib/services/dialog_service.dart b/lib/services/dialog_service.dart index b3ccbf51..ac7acf9e 100644 --- a/lib/services/dialog_service.dart +++ b/lib/services/dialog_service.dart @@ -132,6 +132,7 @@ class DialogServiceImp implements DialogService { cancelLabel: cancelLabel, onOkPressed: onOkPressed, onCancelPressed: onCancelPressed, + isConfirmButton: isConfirmButton ), callBackFunc: () {}, ); @@ -266,7 +267,7 @@ Widget exceptionBottomSheetWidget({required BuildContext context, required Strin child: CustomButton( text: okLabel ?? LocaleKeys.confirm.tr(context: context), onPressed: onOkPressed, - backgroundColor: isConfirmButton ? AppColors.successColor : AppColors.bgGreenColor, + backgroundColor: AppColors.bgGreenColor, borderColor: AppColors.successColor, textColor: Colors.white, icon: AppAssets.confirm, @@ -284,8 +285,9 @@ Widget exceptionBottomSheetWidget({required BuildContext context, required Strin context.pop(); } : onCancelPressed, - backgroundColor: AppColors.primaryRedColor, - borderColor: AppColors.primaryRedBorderColor, + // backgroundColor: AppColors.primaryRedColor, + backgroundColor: isConfirmButton ? AppColors.successColor : AppColors.primaryRedColor, + borderColor: isConfirmButton ? AppColors.successColor : AppColors.primaryRedColor, textColor: Colors.white, icon: AppAssets.confirm, ), diff --git a/lib/widgets/routes/custom_page_route.dart b/lib/widgets/routes/custom_page_route.dart index b89d7102..7cddf18d 100644 --- a/lib/widgets/routes/custom_page_route.dart +++ b/lib/widgets/routes/custom_page_route.dart @@ -10,7 +10,6 @@ class CustomPageRoute extends PageRouteBuilder { CustomPageRoute({required this.page, this.direction = AxisDirection.right, this.fullScreenDialog = false, super.settings}) : super( - transitionDuration: const Duration(milliseconds: 1500), reverseTransitionDuration: const Duration(milliseconds: 500), fullscreenDialog: fullScreenDialog,