From de75c6adc1d2a40dabc8a6a0f8c5145e7f74236e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 1 Sep 2026 14:13:00 +0300 Subject: [PATCH] Updates --- .../authentication/authentication_view_model.dart | 4 ++++ .../medical_file/medical_file_view_model.dart | 10 ++++++++++ .../prescriptions/prescriptions_view_model.dart | 5 +++++ .../livecare/immediate_livecare_payment_page.dart | 15 ++++++++++++--- .../medical_file/medical_file_page.dart | 2 -- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 72ca42cb..a8719f29 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -31,6 +31,7 @@ import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_mode import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_model.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/authentication/login.dart'; @@ -1280,6 +1281,9 @@ class AuthenticationViewModel extends ChangeNotifier { getIt.get().setIsWalletAmountToBeLoaded(true); getIt.get().setIsInsuranceDataToBeLoaded(true); getIt.get().setHasVitalSignDataLoaded(false); + getIt.get().setIsSickLeavesDataNeedsReloading(true); + getIt.get().setIsMedicalReportsDataNeedsReloading(true); + getIt.get().setIsPrescriptionDataNeedsReloading(true); if (isUserAgreedBefore) { LoaderBottomSheet.hideLoader(); navigateToHomeScreen(); diff --git a/lib/features/medical_file/medical_file_view_model.dart b/lib/features/medical_file/medical_file_view_model.dart index a9bfb09c..29f653ec 100644 --- a/lib/features/medical_file/medical_file_view_model.dart +++ b/lib/features/medical_file/medical_file_view_model.dart @@ -168,6 +168,16 @@ class MedicalFileViewModel extends ChangeNotifier { notifyListeners(); } + setIsSickLeavesDataNeedsReloading(bool value) { + isSickLeavesDataNeedsReloading = value; + notifyListeners(); + } + + setIsMedicalReportsDataNeedsReloading(bool value) { + isMedicalReportsDataNeedsReloading = value; + notifyListeners(); + } + setIsPatientSickLeaveListLoading(bool val) { if (val && isSickLeavesDataNeedsReloading) { patientSickLeaveList.clear(); diff --git a/lib/features/prescriptions/prescriptions_view_model.dart b/lib/features/prescriptions/prescriptions_view_model.dart index d75b3f8e..1e33b509 100644 --- a/lib/features/prescriptions/prescriptions_view_model.dart +++ b/lib/features/prescriptions/prescriptions_view_model.dart @@ -78,6 +78,11 @@ class PrescriptionsViewModel extends ChangeNotifier { notifyListeners(); } + void setIsPrescriptionDataNeedsReloading(bool value) { + isPrescriptionsDataNeedsReloading = value; + notifyListeners(); + } + Future checkIfReminderExistForPrescription(int index) async { final item = prescriptionDetailsList[index]; // Check device calendar diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart index 96e38363..31defa56 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart @@ -819,14 +819,23 @@ class _ImmediateLiveCarePaymentPageState extends State { dividerColor: AppColors.dividerColor, itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h), onItemToggled: (index, isExpanded) { - debugPrint("Item at index $index is now ${isExpanded ? 'expanded' : 'collapsed'}"); - if (index == 0 && isExpanded) { myAppointmentsViewModel.getPatientMyDoctors(isTop8: true); prescriptionsViewModel.initPrescriptionsViewModel();