diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index ea8062d0..231b037b 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -181,6 +181,16 @@ class ApiClientImp implements ApiClient { body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken; } + if (url.contains("HMGAI_Lab_Analyze_Orders_API")) { + url = "https://uat.hmgwebservices.com/Services/Patients.svc/REST/HMGAI_Lab_Analyze_Orders_API"; + body['TokenID'] = "@dm!n"; + } + + if (url.contains("HMGAI_Lab_Analyzer_API")) { + url = "https://uat.hmgwebservices.com/Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API"; + body['TokenID'] = "@dm!n"; + } + // body['TokenID'] = "@dm!n"; // body['PatientID'] = 4768663; // body['PatientTypeID'] = 1; diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index c08cdda9..f78c0201 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -908,7 +908,8 @@ class ApiConsts { static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API"; // ************ static values for Api **************** - static final double appVersionID = 19.7; + // static final double appVersionID = 19.7; + static final double appVersionID = 50.7; static final int appChannelId = 3; static final String appIpAddress = "10.20.10.20"; static final String appGeneralId = "Cs2020@2016\$2958"; diff --git a/lib/core/utils/loading_utils.dart b/lib/core/utils/loading_utils.dart index 1a99278d..bd24d30c 100644 --- a/lib/core/utils/loading_utils.dart +++ b/lib/core/utils/loading_utils.dart @@ -38,7 +38,7 @@ class LoadingUtils { child: Material( child: Center( child: isSuccessDialog ? Utils.getSuccessWidget(loadingText: loadingText) : Utils.getLoadingWidget(loadingText: loadingText), - ), + ).paddingSymmetrical(24.w, 0), ), ); }).then((value) { diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 6a009428..f087f748 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -423,11 +423,12 @@ extension DynamicTextStyleExtension on BuildContext { Locale? locale, TextBaseline? textBaseline, FontStyle? fontStyle, + String? fontFamily, bool isLanguageSwitcher = false}) { AppState appState = getIt.get(); final family = appState.getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'; return TextStyle( - fontFamily: family, + fontFamily: fontFamily ?? family, fontSize: fontSize, fontWeight: fontWeight, color: color, diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 50bd1cae..18147a34 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -584,8 +584,7 @@ class AuthenticationViewModel extends ChangeNotifier { if (!_appState.getIsChildLoggedIn) { await medicalVm.getFamilyFiles(status: 0); // await medicalVm.getAllPendingRecordsByResponseId(); - // _navigationService.replaceAllRoutesAndNavigateToLanding(); - _navigationService.popUntilNamed(AppRoutes.landingScreen); + _navigationService.replaceAllRoutesAndNavigateToLanding(); } } else { if (activation.list != null && activation.list!.isNotEmpty) { @@ -745,7 +744,10 @@ class AuthenticationViewModel extends ChangeNotifier { Future onWrongActivationCode({String? message}) async { otpScreenNotifier.value = true; - await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {}); + await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () { + LoaderBottomSheet.hideLoader(); + _navigationService.pushAndReplace(AppRoutes.loginScreen); + }); } loginWithFingerPrintFace(Function success) async { diff --git a/lib/features/lab/lab_view_model.dart b/lib/features/lab/lab_view_model.dart index 04c945df..22e48595 100644 --- a/lib/features/lab/lab_view_model.dart +++ b/lib/features/lab/lab_view_model.dart @@ -400,6 +400,10 @@ class LabViewModel extends ChangeNotifier { lowRefenceValue = minY; } + if (minY > lowRefenceValue) { + minY = lowRefenceValue - 25; + } + this.flagForHighReferenceRange = flagForHighReferenceRange; this.flagForLowReferenceRange = flagForLowReferenceRange; highTransformedReferenceValue = double.parse(transformValueInRange(highRefrenceValue, flagForHighReferenceRange ?? "").toStringAsFixed(1)); @@ -728,8 +732,9 @@ class LabViewModel extends ChangeNotifier { notifyListeners(); } - Future getAiOverviewLabOrders({required PatientLabOrdersResponseModel labOrder}) async { - LoadingUtils.showFullScreenLoader(loadingText: "Loading and analysing your data,\nPlease be patient and let the AI do the magic"); + Future getAiOverviewLabOrders({required PatientLabOrdersResponseModel labOrder, required String loadingText}) async { + // LoadingUtils.showFullScreenLoader(loadingText: "Loading and analysing your data,\nPlease be patient and let the AI do the magic. \nPlease be patient, This might take some time."); + LoadingUtils.showFullScreenLoader(loadingText: loadingText); List> results = []; Map orderData = {"order_date": labOrder.orderDate ?? "", "clinic": labOrder.clinicDescription ?? "", "doctor": labOrder.doctorName ?? "", "results": []}; List> testResults = []; @@ -769,8 +774,8 @@ class LabViewModel extends ChangeNotifier { LoadingUtils.hideFullScreenLoader(); } - Future getAiOverviewSingleLabResult({required String langId, required LabResult recentLabResult}) async { - LoaderBottomSheet.showLoader(); + Future getAiOverviewSingleLabResult({required String langId, required LabResult recentLabResult, required String loadingText}) async { + LoaderBottomSheet.showLoader(loadingText: loadingText); List> results = []; results.add({ "Description": recentLabResult.description ?? '', diff --git a/lib/features/prescriptions/prescriptions_repo.dart b/lib/features/prescriptions/prescriptions_repo.dart index 2eb5d43e..dcc9de92 100644 --- a/lib/features/prescriptions/prescriptions_repo.dart +++ b/lib/features/prescriptions/prescriptions_repo.dart @@ -193,8 +193,8 @@ class PrescriptionsRepoImp implements PrescriptionsRepo { "ProjectID": prescriptionsResponseModel.projectID, "DischargeNo": prescriptionsResponseModel.dischargeNo, "IsDownload": true, - // "To": Utils.appState.getAuthenticatedUser()!.emailAddress, - "To": "amjad.haroon@cloudsolutions.com.sa", + "To": Utils.appState.getAuthenticatedUser()!.emailAddress, + // "To": "amjad.haroon@cloudsolutions.com.sa", "ClinicName": prescriptionsResponseModel.clinicDescription, "DoctorName": prescriptionsResponseModel.doctorName, }; diff --git a/lib/features/prescriptions/prescriptions_view_model.dart b/lib/features/prescriptions/prescriptions_view_model.dart index a7cd42f6..319e5fc1 100644 --- a/lib/features/prescriptions/prescriptions_view_model.dart +++ b/lib/features/prescriptions/prescriptions_view_model.dart @@ -54,7 +54,7 @@ class PrescriptionsViewModel extends ChangeNotifier { PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices}); initPrescriptionsViewModel() { - if (isPrescriptionsDataNeedsReloading) { + // if (isPrescriptionsDataNeedsReloading) { patientPrescriptionOrders.clear(); patientPrescriptionOrdersByClinic.clear(); patientPrescriptionOrdersByHospital.clear(); @@ -62,7 +62,7 @@ class PrescriptionsViewModel extends ChangeNotifier { prescriptionsOrderList.clear(); isPrescriptionsOrdersLoading = true; getPatientPrescriptionOrders(); - } + // } isSortByClinic = true; isPrescriptionsDeliveryOrdersLoading = true; notifyListeners(); @@ -102,9 +102,9 @@ class PrescriptionsViewModel extends ChangeNotifier { } Future getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { - if (!isPrescriptionsDataNeedsReloading) { - return; - } + // if (!isPrescriptionsDataNeedsReloading) { + // return; + // } final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755"); diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index b3be44e1..7bafadf2 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1513,8 +1513,6 @@ abstract class LocaleKeys { static const trackerAndOthers = 'trackerAndOthers'; static const bmi = 'bmi'; static const yesPleaseINeedHelp = 'yesPleaseINeedHelp'; - static const noThanksIKnowTheClinic = 'noThanksIKnowTheClinic'; - static const unableToSendOTP = 'unableToSendOTP'; static const aiOverView = 'aiOverView'; static const generateAiAnalysis = 'generateAiAnalysis'; static const aiAnalysis = 'aiAnalysis'; @@ -1562,19 +1560,8 @@ abstract class LocaleKeys { static const servicePriceListRights = 'servicePriceListRights'; static const serviceName = 'serviceName'; static const noFreeSlot = 'noFreeSlot'; - static const applewatch = 'applewatch'; - static const applehealthapplicationshouldbeinstalledinyourphone = 'applehealthapplicationshouldbeinstalledinyourphone'; - static const unabletodetectapplicationinstalledpleasecomebackonceinstalled = 'unabletodetectapplicationinstalledpleasecomebackonceinstalled'; - static const applewatchshouldbeconnected = 'applewatchshouldbeconnected'; - static const samsungwatch = 'samsungwatch'; - static const samsunghealthapplicationshouldbeinstalledinyourphone = 'samsunghealthapplicationshouldbeinstalledinyourphone'; - static const samsungwatchshouldbeconnected = 'samsungwatchshouldbeconnected'; - static const huaweiwatch = 'huaweiwatch'; - static const huaweihealthapplicationshouldbeinstalledinyourphone = 'huaweihealthapplicationshouldbeinstalledinyourphone'; - static const huaweiwatchshouldbeconnected = 'huaweiwatchshouldbeconnected'; - static const whoopwatch = 'whoopwatch'; - static const whoophealthapplicationshouldbeinstalledinyourphone = 'whoophealthapplicationshouldbeinstalledinyourphone'; - static const whoopwatchshouldbeconnected = 'whoopwatchshouldbeconnected'; - static const updatetheinformation = 'updatetheinformation'; + static const noThanksIKnowTheClinic = 'noThanksIKnowTheClinic'; + static const unableToSendOTP = 'unableToSendOTP'; + static const loadingAIAnalysis = 'loadingAIAnalysis'; } diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index 097efaf6..e70ddf49 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -491,6 +491,7 @@ class _AppointmentPaymentPageState extends State { patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, onSuccess: (apiResponse) { Future.delayed(Duration(milliseconds: 500), () { + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.getPatientAppointments(true, false); LoaderBottomSheet.hideLoader(); @@ -511,6 +512,7 @@ class _AppointmentPaymentPageState extends State { isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!, onSuccess: (apiResponse) { Future.delayed(Duration(milliseconds: 500), () { + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.getPatientAppointments(true, false); LoaderBottomSheet.hideLoader(); diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 49aad51f..971e9ca8 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -193,7 +193,7 @@ class AppointmentCard extends StatelessWidget { ? 'Cardiology'.toText10().toShimmer2(isShow: isLoading) : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}" .toText10(isEnglishOnly: true), - ), + ).toShimmer2(isShow: isLoading), ), // AppCustomChipWidget( diff --git a/lib/presentation/home/widgets/habib_wallet_card.dart b/lib/presentation/home/widgets/habib_wallet_card.dart index 72565d03..01359837 100644 --- a/lib/presentation/home/widgets/habib_wallet_card.dart +++ b/lib/presentation/home/widgets/habib_wallet_card.dart @@ -87,7 +87,10 @@ class HabibWalletCard extends StatelessWidget { fit: BoxFit.contain, ), SizedBox(width: 8.h), - habibWalletVM.habibWalletAmount.toString().toText32(isBold: true, isEnglishOnly: true).toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h), + habibWalletVM.habibWalletAmount + .toString() + .toText32(isBold: true, isEnglishOnly: true) + .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 40.h), ], ); }), diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart index 954c09bc..8fb30900 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart @@ -50,7 +50,7 @@ class LabResultByClinic extends StatelessWidget { cancelLabel: LocaleKeys.rejectView.tr(), onOkPressed: () { context.pop(); - labViewModel.getAiOverviewLabOrders(labOrder: labOrder); + labViewModel.getAiOverviewLabOrders(labOrder: labOrder, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); }, onCancelPressed: () { context.pop(); diff --git a/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart b/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart index a2d0ff6b..f0c9b26b 100644 --- a/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart +++ b/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart @@ -62,6 +62,7 @@ class AiAnalysisWidget extends StatelessWidget { SizedBox(height: 20.h), ], Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Icon(Icons.info_outline, color: AppColors.greyTextColor, size: 20.r), SizedBox(width: 8.w), diff --git a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart index e3320662..ba97731f 100644 --- a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart +++ b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.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:provider/provider.dart'; +import 'dart:ui' as ui; class LabOrderResultItem extends StatelessWidget { final VoidCallback onTap; @@ -43,49 +44,52 @@ class LabOrderResultItem extends StatelessWidget { ), (tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), SizedBox(height: 12.h), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Flexible( - child: Text( - "${tests?.resultValue} ${tests?.uOM}", - style: TextStyle( - fontSize: 24.f, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - color: tests!.checkIfGraphShouldBeDisplayed() - ? context.read().getColor( - tests?.calculatedResultFlag ?? "", - ) - : Colors.grey.shade700, - letterSpacing: -2, - ), - ), - ), - SizedBox(width: 4.h,), - Visibility( - // visible: tests?.checkIfGraphShouldBeDisplayed() == true, - visible: true, - child: Expanded( - flex: 2, - child: Visibility( - visible: tests?.referanceRange != null, + Directionality( + textDirection: ui.TextDirection.ltr, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Flexible( child: Text( - "(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})", + "${tests?.resultValue} ${tests?.uOM}", style: TextStyle( - fontSize: 12.f, - fontWeight: FontWeight.w500, + fontSize: 24.f, + fontWeight: FontWeight.w600, fontFamily: 'Poppins', - color: AppColors.greyTextColor, + color: tests!.checkIfGraphShouldBeDisplayed() + ? context.read().getColor( + tests?.calculatedResultFlag ?? "", + ) + : Colors.grey.shade700, + letterSpacing: -2, ), - // overflow: TextOverflow.ellipsis, - // maxLines: 2, - softWrap: true, ), ), - ), - ) - ], + SizedBox(width: 4.h,), + Visibility( + // visible: tests?.checkIfGraphShouldBeDisplayed() == true, + visible: true, + child: Expanded( + flex: 2, + child: Visibility( + visible: tests?.referanceRange != null, + child: Text( + "(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})", + style: TextStyle( + fontSize: 12.f, + fontWeight: FontWeight.w500, + fontFamily: 'Poppins', + color: AppColors.greyTextColor, + ), + // overflow: TextOverflow.ellipsis, + // maxLines: 2, + softWrap: true, + ), + ), + ), + ) + ], + ), ), SizedBox(height: 12.h), diff --git a/lib/presentation/lab/lab_results/lab_result_details.dart b/lib/presentation/lab/lab_results/lab_result_details.dart index c67c39dd..cab20aed 100644 --- a/lib/presentation/lab/lab_results/lab_result_details.dart +++ b/lib/presentation/lab/lab_results/lab_result_details.dart @@ -45,7 +45,7 @@ class LabResultDetails extends StatelessWidget { cancelLabel: LocaleKeys.rejectView.tr(), onOkPressed: () { context.pop(); - labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult); + labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); }, onCancelPressed: () { context.pop(); diff --git a/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart b/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart index 5a5aed7f..5d4fe4b0 100644 --- a/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart +++ b/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart @@ -341,7 +341,7 @@ class _LabAiAnalysisDetailedPageState extends State { case 'high': return AppColors.primaryRedColor; case 'medium' || 'moderate': - return AppColors.lightGreenColor; + return AppColors.textGreenColor; case 'low': return AppColors.alertColor; default: @@ -361,7 +361,7 @@ class _LabAiAnalysisDetailedPageState extends State { case 'L': // Low case 'LL': // Very Low case 'CRITICAL LOW': - return AppColors.chipColorSeekMedicalAdvice; + return AppColors.chipColorSeekMedicalAdvice.withAlpha(75); case 'N': // Normal return AppColors.lightGreenButtonColor; case 'A': // Abnormal @@ -379,7 +379,7 @@ class _LabAiAnalysisDetailedPageState extends State { case 'CRITICAL HIGH': return AppColors.primaryRedColor; case 'N': - return AppColors.lightGreenColor; + return AppColors.textGreenColor; case 'L': // Low case 'LL': // Very Low case 'CRITICAL LOW': diff --git a/lib/presentation/prescriptions/prescription_item_view.dart b/lib/presentation/prescriptions/prescription_item_view.dart index a41b53ff..03a343f7 100644 --- a/lib/presentation/prescriptions/prescription_item_view.dart +++ b/lib/presentation/prescriptions/prescription_item_view.dart @@ -155,26 +155,26 @@ class PrescriptionItemView extends StatelessWidget { ], ).paddingSymmetrical(16.h, 0.h), SizedBox(height: 14.h), - Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), - Row( - children: [ - Expanded( - child: CustomButton( - text: LocaleKeys.checkAvailability.tr(context: context), - onPressed: () {}, - backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), - borderColor: AppColors.primaryRedColor.withOpacity(0.0), - textColor: AppColors.primaryRedColor, - fontSize: 14.f, - fontWeight: FontWeight.w500, - borderRadius: 12.r, - padding: EdgeInsets.fromLTRB(10, 0, 10, 0), - height: 40.h, - ).toShimmer2(isShow: isLoading), - ), - // SizedBox(width: 16.h), - ], - ).paddingSymmetrical(16.h, 16.h), + // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), + // Row( + // children: [ + // Expanded( + // child: CustomButton( + // text: LocaleKeys.checkAvailability.tr(context: context), + // onPressed: () {}, + // backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), + // borderColor: AppColors.primaryRedColor.withOpacity(0.0), + // textColor: AppColors.primaryRedColor, + // fontSize: 14.f, + // fontWeight: FontWeight.w500, + // borderRadius: 12.r, + // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + // height: 40.h, + // ).toShimmer2(isShow: isLoading), + // ), + // // SizedBox(width: 16.h), + // ], + // ).paddingSymmetrical(16.h, 16.h), ], ), ); diff --git a/lib/presentation/symptoms_checker/possible_conditions_screen.dart b/lib/presentation/symptoms_checker/possible_conditions_screen.dart index 8fb0e0fd..3d288d78 100644 --- a/lib/presentation/symptoms_checker/possible_conditions_screen.dart +++ b/lib/presentation/symptoms_checker/possible_conditions_screen.dart @@ -205,7 +205,8 @@ class PossibleConditionsPage extends StatelessWidget { final SymptomsCheckerViewModel symptomsCheckerViewModel = context.read(); symptomsCheckerViewModel.reset(); // Clear all symptoms checker data final navigationService = getIt.get(); - navigationService.replaceAllRoutesAndNavigateToLanding(); + // navigationService.replaceAllRoutesAndNavigateToLanding(); + navigationService.replaceAllRoutesAndNavigateToLandingAuth(); }, ), trailing: _buildTrailingSection(context), diff --git a/lib/presentation/symptoms_checker/symptoms_selector_screen.dart b/lib/presentation/symptoms_checker/symptoms_selector_screen.dart index 2bfcb62f..cbbfc68e 100644 --- a/lib/presentation/symptoms_checker/symptoms_selector_screen.dart +++ b/lib/presentation/symptoms_checker/symptoms_selector_screen.dart @@ -89,7 +89,8 @@ class _SymptomsSelectorPageState extends State { context.pop(); viewModel.reset(); // Clear all symptoms checker data final navigationService = getIt.get(); - navigationService.replaceAllRoutesAndNavigateToLanding(); + // navigationService.replaceAllRoutesAndNavigateToLanding(); + navigationService.replaceAllRoutesAndNavigateToLandingAuth(); }), child: viewModel.isBodySymptomsLoading ? _buildLoadingShimmer() diff --git a/lib/presentation/symptoms_checker/triage_screen.dart b/lib/presentation/symptoms_checker/triage_screen.dart index 0811833e..0231ef19 100644 --- a/lib/presentation/symptoms_checker/triage_screen.dart +++ b/lib/presentation/symptoms_checker/triage_screen.dart @@ -316,7 +316,8 @@ class _TriagePageState extends State { context.pop(); viewModel.reset(); // Clear all symptoms checker data final navigationService = getIt.get(); - navigationService.replaceAllRoutesAndNavigateToLanding(); + // navigationService.replaceAllRoutesAndNavigateToLanding(); + navigationService.replaceAllRoutesAndNavigateToLandingAuth(); }, ), callBackFunc: () {}, diff --git a/lib/services/navigation_service.dart b/lib/services/navigation_service.dart index fe951400..da4a75b9 100644 --- a/lib/services/navigation_service.dart +++ b/lib/services/navigation_service.dart @@ -34,6 +34,13 @@ class NavigationService { ); } + void replaceAllRoutesAndNavigateToLandingAuth() { + navigatorKey.currentState?.pushNamedAndRemoveUntil( + AppRoutes.landingScreen, + (Route route) => false, + ); + } + void pushAndReplace(String routeName) { navigatorKey.currentState?.pushReplacementNamed(routeName); } diff --git a/lib/widgets/app_language_change.dart b/lib/widgets/app_language_change.dart index c94195a5..e75ff6f6 100644 --- a/lib/widgets/app_language_change.dart +++ b/lib/widgets/app_language_change.dart @@ -4,9 +4,14 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/extensions/int_extensions.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/emergency_services/emergency_services_view_model.dart'; +import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart'; +import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/features/todo_section/todo_section_view_model.dart'; 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:provider/provider.dart'; class AppLanguageChange extends StatefulWidget { AppLanguageChange({Key? key}) : super(key: key); @@ -20,6 +25,11 @@ class AppLanguageChange extends StatefulWidget { class _AppLanguageChangeState extends State { String? selectedValue; + late MyAppointmentsViewModel myAppointmentsViewModel; + late ImmediateLiveCareViewModel immediateLiveCareViewModel; + late EmergencyServicesViewModel emergencyServicesViewModel; + late TodoSectionViewModel todoSectionViewModel; + @override void initState() { super.initState(); @@ -33,6 +43,12 @@ class _AppLanguageChangeState extends State { @override Widget build(BuildContext context) { selectedValue ??= context.locale.languageCode; + + myAppointmentsViewModel = Provider.of(context, listen: false); + immediateLiveCareViewModel = Provider.of(context, listen: false); + emergencyServicesViewModel = Provider.of(context, listen: false); + todoSectionViewModel = Provider.of(context, listen: false); + return Column( spacing: 24.h, children: [ @@ -51,6 +67,18 @@ class _AppLanguageChangeState extends State { text: LocaleKeys.save.tr(context: context), onPressed: () { context.setLocale(selectedValue == 'en' ? Locale('en', 'US') : Locale('ar', 'SA')).then((val) { + //Reload My Appointments Data + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); + myAppointmentsViewModel.initAppointmentsViewModel(); + myAppointmentsViewModel.getPatientAppointments(true, false); + + //Reload Immediate LiveCare Data + immediateLiveCareViewModel.initImmediateLiveCare(); + immediateLiveCareViewModel.getPatientLiveCareHistory(); + + //Reload Emergency Services Data + emergencyServicesViewModel.checkPatientERAdvanceBalance(); + Navigator.pop(context); }); }), diff --git a/lib/widgets/appbar/collapsing_list_view.dart b/lib/widgets/appbar/collapsing_list_view.dart index aaaaa51a..25221962 100644 --- a/lib/widgets/appbar/collapsing_list_view.dart +++ b/lib/widgets/appbar/collapsing_list_view.dart @@ -310,7 +310,7 @@ class _ScrollAnimatedTitleState extends State { child: Container( height: 40.h, padding: EdgeInsets.all(8.w), - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent, borderRadius: 10.r, side: BorderSide(width: 1, color: AppColors.borderGrayColor)), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 8.r, side: BorderSide(width: 1, color: AppColors.borderGrayColor)), child: ShaderMask( blendMode: BlendMode.srcIn, shaderCallback: (bounds) => AppColors.aiLinearGradient.createShader(bounds), @@ -326,7 +326,7 @@ class _ScrollAnimatedTitleState extends State { style: context.dynamicTextStyle( color: AppColors.primaryRedColor, letterSpacing: -0.4, - fontSize: (12 - (2 * (1 - t))).f, + fontSize: (14 - (2 * (1 - t))).f, fontWeight: FontWeight.lerp( FontWeight.w400, FontWeight.w500, diff --git a/lib/widgets/language_switcher.dart b/lib/widgets/language_switcher.dart index 91e45b22..033eaaff 100644 --- a/lib/widgets/language_switcher.dart +++ b/lib/widgets/language_switcher.dart @@ -59,14 +59,15 @@ class _LanguageSelectorState extends State { Utils.buildSvgWithAssets(icon: AppAssets.language), SizedBox(width: 6.h), Text( - currentLangData['name']?.toUpperCase() ?? 'EN', + // currentLangData['name']?.toUpperCase() ?? 'EN', + widget.currentLanguage == 'ar' ? "ENGLISH" : "العربية", style: context.dynamicTextStyle( fontWeight: FontWeight.w500, fontSize: 14.f, color: AppColors.primaryRedColor, letterSpacing: 0.1, isLanguageSwitcher: true, - ), + fontFamily: widget.currentLanguage == 'ar' ? "Poppins" : "GESSTwo"), ), ], ), diff --git a/lib/widgets/loader/bottomsheet_loader.dart b/lib/widgets/loader/bottomsheet_loader.dart index 813ad5b5..71b83415 100644 --- a/lib/widgets/loader/bottomsheet_loader.dart +++ b/lib/widgets/loader/bottomsheet_loader.dart @@ -3,7 +3,9 @@ import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/enums.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/widget_extensions.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; class LoaderBottomSheet { @@ -31,7 +33,7 @@ class LoaderBottomSheet { ), child: Center( child: Utils.getLoadingWidget(loadingText: loadingText), - ), + ).paddingSymmetrical(24.w, 0), ); }, ).whenComplete(() {