From 1da9cac4bfa235f908ade20cee044de03a2d55f5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Sep 2026 12:25:26 +0300 Subject: [PATCH 1/9] Medical report date fix --- lib/presentation/medical_report/medical_reports_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/presentation/medical_report/medical_reports_page.dart b/lib/presentation/medical_report/medical_reports_page.dart index 9463debe..e1ac3969 100644 --- a/lib/presentation/medical_report/medical_reports_page.dart +++ b/lib/presentation/medical_report/medical_reports_page.dart @@ -260,7 +260,7 @@ class _MedicalReportsPageState extends State { runSpacing: 6.h, children: [ AppCustomChipWidget( - labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(report.appointmentDate), false), + labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(report.encounterDate), false), ), AppCustomChipWidget( labelText: medicalFileVM.isMedicalReportsSortByClinic ? report.projectName! : report.clinicDescription!, From c4cf67119c9b020881b8bd149ae68d524f3b78f0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Sep 2026 16:56:59 +0300 Subject: [PATCH 2/9] Dubai timezone handled --- lib/core/utils/date_util.dart | 20 +++++++++---------- .../widgets/appointment_card.dart | 2 +- .../widgets/appointment_doctor_card.dart | 5 +---- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/core/utils/date_util.dart b/lib/core/utils/date_util.dart index 97c8dad0..7510786d 100644 --- a/lib/core/utils/date_util.dart +++ b/lib/core/utils/date_util.dart @@ -28,21 +28,21 @@ class DateUtil { const end = "+0300)"; final startIndex = date.indexOf(start); final endIndex = date.indexOf(end, startIndex + start.length); - // if (projectId == 2 || projectId == 3) { - // return DateTime.fromMillisecondsSinceEpoch( - // int.parse( - // date.substring(startIndex + start.length, endIndex), - // ), - // isUtc: true) - // .add(Duration(hours: 4)); - // } else { - return DateTime.fromMillisecondsSinceEpoch( + if (projectId == 2 || projectId == 3) { + return DateTime.fromMillisecondsSinceEpoch( + int.parse( + date.substring(startIndex + start.length, endIndex), + ), + isUtc: true) + .add(Duration(hours: 4)); + } else { + return DateTime.fromMillisecondsSinceEpoch( int.parse( date.substring(startIndex + start.length, endIndex), ), isUtc: true) .add(Duration(hours: 3)); - // } + } } else { return DateTime.now(); } diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 38c6c7d3..1eeb842c 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -321,7 +321,7 @@ class _AppointmentCardState extends State { icon: AppAssets.appointment_calendar_icon, richText: widget.isLoading ? 'Cardiology'.toText10().toShimmer2(isShow: widget.isLoading) - : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)}" + : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)} ${(widget.patientAppointmentHistoryResponseModel.startTime != null && widget.patientAppointmentHistoryResponseModel.startTime!.isNotEmpty) ? widget.patientAppointmentHistoryResponseModel.startTime!.substring(0, 5) : DateUtil.formatDateToTimeLang(DateUtil.convertStringToDateSaudiTimezone(widget.patientAppointmentHistoryResponseModel.appointmentDate!, widget.patientAppointmentHistoryResponseModel.projectID), false)}" .toText10(isEnglishOnly: true, isBold: true), ).toShimmer2(isShow: widget.isLoading), ), diff --git a/lib/presentation/appointments/widgets/appointment_doctor_card.dart b/lib/presentation/appointments/widgets/appointment_doctor_card.dart index dc7bb0af..4dd838ea 100644 --- a/lib/presentation/appointments/widgets/appointment_doctor_card.dart +++ b/lib/presentation/appointments/widgets/appointment_doctor_card.dart @@ -142,10 +142,7 @@ class AppointmentDoctorCard extends StatelessWidget { child: AppCustomChipWidget( labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 6.w), icon: AppAssets.doctor_calendar_icon, - richText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang( - DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), - false, - )}" + richText: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${(patientAppointmentHistoryResponseModel.startTime != null && patientAppointmentHistoryResponseModel.startTime!.isNotEmpty) ? patientAppointmentHistoryResponseModel.startTime!.substring(0, 5) : DateUtil.formatDateToTimeLang(DateUtil.convertStringToDateSaudiTimezone(patientAppointmentHistoryResponseModel.appointmentDate!, patientAppointmentHistoryResponseModel.projectID), false)}" .toText10(isBold: true), ), ), From 621cbdb165e2b6655ccd2c814614f1f26c4ebb08 Mon Sep 17 00:00:00 2001 From: Haroon6138 Date: Mon, 14 Sep 2026 06:59:20 +0000 Subject: [PATCH 3/9] Habib Wallet & Lakum card updates --- .../habib_wallet/habib_wallet_view_model.dart | 34 ++- .../appointment_payment_page.dart | 2 +- .../waiting_appointment_payment_page.dart | 2 +- .../er_online_checkin_payment_page.dart | 248 +++++++++--------- lib/presentation/home/landing_page.dart | 16 +- .../home/widgets/habib_wallet_card.dart | 39 ++- .../home/widgets/lakum_wallet_card.dart | 49 ++-- lib/widgets/in_app_browser/InAppBrowser.dart | 2 +- 8 files changed, 203 insertions(+), 189 deletions(-) diff --git a/lib/features/habib_wallet/habib_wallet_view_model.dart b/lib/features/habib_wallet/habib_wallet_view_model.dart index cc87bb7b..e888600a 100644 --- a/lib/features/habib_wallet/habib_wallet_view_model.dart +++ b/lib/features/habib_wallet/habib_wallet_view_model.dart @@ -30,7 +30,35 @@ class HabibWalletViewModel extends ChangeNotifier { num habibWalletAmount = 0; num walletRechargeAmount = 0; String notesText = ""; - bool isWalletAmountToBeLoaded = true; + bool isWalletAmountToBeLoaded = false; + + // ── Balance visibility (show/hide like a password field) ────────────────── + bool isWalletAmountHidden = true; + bool isLakumPointsHidden = true; + + // Track whether data has already been fetched (to avoid re-calling APIs). + bool isWalletAmountFetched = false; + bool isLakumInfoFetched = false; + + void toggleWalletAmountVisibility() { + isWalletAmountHidden = !isWalletAmountHidden; + notifyListeners(); + // On first unhide, fetch the data if not already fetched. + if (!isWalletAmountHidden && !isWalletAmountFetched) { + isWalletAmountToBeLoaded = true; + getPatientBalanceAmount(); + } + } + + void toggleLakumPointsVisibility() { + isLakumPointsHidden = !isLakumPointsHidden; + notifyListeners(); + // On first unhide, fetch the data if not already fetched. + if (!isLakumPointsHidden && !isLakumInfoFetched) { + isWalletAmountToBeLoaded = true; + getLakumAccountInformation(); + } + } bool isBottomSheetContentLoading = false; @@ -70,6 +98,8 @@ class HabibWalletViewModel extends ChangeNotifier { bool isLakumAccountInfoLoading = false; LakumInquiryInformationResponseModel? lakumAccountInfo; + + // Get all flattened transactions sorted by date descending List getAllLakumTransactions() { if (lakumAccountInfo?.gainedPointsAmountPerYear == null) { @@ -437,6 +467,7 @@ class HabibWalletViewModel extends ChangeNotifier { isWalletAmountLoading = false; isWalletAmountToBeLoaded = false; + isWalletAmountFetched = true; notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); @@ -581,6 +612,7 @@ class HabibWalletViewModel extends ChangeNotifier { ); } isLakumAccountInfoLoading = false; + isLakumInfoFetched = true; notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index 85a606b3..ffa9b723 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -726,7 +726,7 @@ class _AppointmentPaymentPageState extends State { ); }); } else { - openPaymentURL("tamara"); + openPaymentURL("TAMARA"); } }) : SizedBox.shrink(), diff --git a/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart b/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart index 82ea1578..970bfb4e 100644 --- a/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart +++ b/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart @@ -471,7 +471,7 @@ class _WaitingAppointmentPaymentPageState extends State emergencyServicesViewModel.selectedHospital!.iD, appState.getAuthenticatedUser()!.patientId!, ); - paytabsViewModel.setPaymentConfiguration( - "ER Online Check-In Payment", - emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!, + paytabsViewModel.setPaymentConfiguration("ER Online Check-In Payment", emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!, ServiceTypeEnum.erOnlineCheckIn.getIdFromServiceEnum(), emergencyServicesViewModel.selectedHospital!.iD); paytabsViewModel.startCardPayment( paymentOption: selectedPaymentMethod, @@ -147,45 +145,46 @@ class _ErOnlineCheckinPaymentPageState extends State projectID: emergencyServicesViewModel.selectedHospital!.iD.toString(), onSuccess: (PaytabsTransactionResponseModel transactionData) async { if (emergencyServicesViewModel.isERBookAppointment) { - await emergencyServicesViewModel.ER_CreateAdvancePayment( - paymentMethodName: selectedPaymentMethod, - paymentReference: transactionData.transactionReference!, - onSuccess: (value) async { - await emergencyServicesViewModel.addAdvanceNumberRequest( - advanceNumber: value, - paymentReference: transactionData.transactionReference!, - appointmentNo: "0", - onSuccess: (val) { - emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); - LoaderBottomSheet.hideLoader(); - if (emergencyServicesViewModel.isERBookAppointment) { - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)), - callBackFunc: () { - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }, - isFullScreen: false, - isCloseButtonVisible: true, - ); - } else {} - }); - }); - } else {} - }, onError: (errMsg) { - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: errMsg.toString()), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); - }); + await emergencyServicesViewModel.ER_CreateAdvancePayment( + paymentMethodName: selectedPaymentMethod, + paymentReference: transactionData.transactionReference!, + onSuccess: (value) async { + await emergencyServicesViewModel.addAdvanceNumberRequest( + advanceNumber: value, + paymentReference: transactionData.transactionReference!, + appointmentNo: "0", + onSuccess: (val) { + emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); + LoaderBottomSheet.hideLoader(); + if (emergencyServicesViewModel.isERBookAppointment) { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)), + callBackFunc: () { + Navigator.pushAndRemoveUntil( + context, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } else {} + }); + }); + } else {} + }, + onError: (errMsg) { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: errMsg.toString()), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + }); } else { openPaymentURL("mada"); } @@ -235,9 +234,7 @@ class _ErOnlineCheckinPaymentPageState extends State emergencyServicesViewModel.selectedHospital!.iD, appState.getAuthenticatedUser()!.patientId!, ); - paytabsViewModel.setPaymentConfiguration( - "ER Online Check-In Payment", - emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!, + paytabsViewModel.setPaymentConfiguration("ER Online Check-In Payment", emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!, ServiceTypeEnum.erOnlineCheckIn.getIdFromServiceEnum(), emergencyServicesViewModel.selectedHospital!.iD); paytabsViewModel.startCardPayment( paymentOption: selectedPaymentMethod, @@ -254,45 +251,46 @@ class _ErOnlineCheckinPaymentPageState extends State projectID: emergencyServicesViewModel.selectedHospital!.iD.toString(), onSuccess: (PaytabsTransactionResponseModel transactionData) async { if (emergencyServicesViewModel.isERBookAppointment) { - await emergencyServicesViewModel.ER_CreateAdvancePayment( - paymentMethodName: selectedPaymentMethod, - paymentReference: transactionData.transactionReference!, - onSuccess: (value) async { - await emergencyServicesViewModel.addAdvanceNumberRequest( - advanceNumber: value, - paymentReference: transactionData.transactionReference!, - appointmentNo: "0", - onSuccess: (val) { - emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); - LoaderBottomSheet.hideLoader(); - if (emergencyServicesViewModel.isERBookAppointment) { - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)), - callBackFunc: () { - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }, - isFullScreen: false, - isCloseButtonVisible: true, - ); - } else {} - }); - }); - } else {} - }, onError: (errMsg) { - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: errMsg.toString()), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); - }); + await emergencyServicesViewModel.ER_CreateAdvancePayment( + paymentMethodName: selectedPaymentMethod, + paymentReference: transactionData.transactionReference!, + onSuccess: (value) async { + await emergencyServicesViewModel.addAdvanceNumberRequest( + advanceNumber: value, + paymentReference: transactionData.transactionReference!, + appointmentNo: "0", + onSuccess: (val) { + emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); + LoaderBottomSheet.hideLoader(); + if (emergencyServicesViewModel.isERBookAppointment) { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)), + callBackFunc: () { + Navigator.pushAndRemoveUntil( + context, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } else {} + }); + }); + } else {} + }, + onError: (errMsg) { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: errMsg.toString()), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + }); } else { openPaymentURL("visa"); } @@ -332,7 +330,7 @@ class _ErOnlineCheckinPaymentPageState extends State ).paddingSymmetrical(16.h, 16.h), ).paddingSymmetrical(24.h, 0.h).onPress(() { selectedPaymentMethod = "TAMARA"; - openPaymentURL("tamara"); + openPaymentURL("TAMARA"); }) : SizedBox.shrink(), ], @@ -353,39 +351,39 @@ class _ErOnlineCheckinPaymentPageState extends State children: [ (emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.isCash ?? true) ? Container( - height: 50.h, - decoration: ShapeDecoration( - color: AppColors.secondaryLightRedBorderColor, - shape: SmoothRectangleBorder( - borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)), - smoothness: 1, - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + height: 50.h, + decoration: ShapeDecoration( + color: AppColors.secondaryLightRedBorderColor, + shape: SmoothRectangleBorder( + borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)), + smoothness: 1, + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ LocaleKeys.insuranceExpiredOrInactive.tr(context: context).toText14(color: AppColors.primaryRedColor, isBold: true).paddingSymmetrical(24.h, 0.h), CustomButton( - text: LocaleKeys.updateInsurance.tr(context: context), - onPressed: () { - Navigator.of(context).push( - CustomPageRoute( - page: InsuranceHomePage(), - ), - ); - }, - backgroundColor: AppColors.primaryRedColor, - borderColor: AppColors.secondaryLightRedBorderColor, - textColor: AppColors.whiteColor, - fontSize: 10, - isBold: true, - borderRadius: 8, - padding: EdgeInsets.fromLTRB(15, 0, 15, 0), - height: 30.h, - ).paddingSymmetrical(24.h, 0.h), - ], - ), - ) + text: LocaleKeys.updateInsurance.tr(context: context), + onPressed: () { + Navigator.of(context).push( + CustomPageRoute( + page: InsuranceHomePage(), + ), + ); + }, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.secondaryLightRedBorderColor, + textColor: AppColors.whiteColor, + fontSize: 10, + isBold: true, + borderRadius: 8, + padding: EdgeInsets.fromLTRB(15, 0, 15, 0), + height: 30.h, + ).paddingSymmetrical(24.h, 0.h), + ], + ), + ) : const SizedBox(), SizedBox(height: 24.h), LocaleKeys.totalAmountToPay.tr(context: context).toText18(isBold: true).paddingSymmetrical(24.h, 0.h), @@ -403,7 +401,9 @@ class _ErOnlineCheckinPaymentPageState extends State children: [ LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor), Utils.getPaymentAmountWithSymbol( - emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientTaxAmount.toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13, + emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientTaxAmount.toString().toText14(isBold: true, color: AppColors.greyTextColor), + AppColors.greyTextColor, + 13, isSaudiCurrency: true), ], ).paddingSymmetrical(24.h, 0.h), @@ -417,14 +417,8 @@ class _ErOnlineCheckinPaymentPageState extends State ], ).paddingSymmetrical(24.h, 0.h), Platform.isIOS - ? Utils.buildSvgWithAssets( - icon: AppAssets.apple_pay_button, - width: 200.h, - height: 80.h, - fit: BoxFit.contain, - applyThemeColor: false - ).paddingSymmetrical(24.h, 0.h).onPress(() { - if (Utils.havePrivilege(103)) { + ? Utils.buildSvgWithAssets(icon: AppAssets.apple_pay_button, width: 200.h, height: 80.h, fit: BoxFit.contain, applyThemeColor: false).paddingSymmetrical(24.h, 0.h).onPress(() { + if (Utils.havePrivilege(103)) { startApplePay(); } else { openPaymentURL("ApplePay"); @@ -530,9 +524,7 @@ class _ErOnlineCheckinPaymentPageState extends State if (appState.isPaytabsEnabled) { selectedPaymentMethod = "VISA"; LoaderBottomSheet.hideLoader(); - paytabsViewModel.setPaymentConfiguration( - "ER Online Check-In Payment", - emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!, + paytabsViewModel.setPaymentConfiguration("ER Online Check-In Payment", emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!, ServiceTypeEnum.erOnlineCheckIn.getIdFromServiceEnum(), emergencyServicesViewModel.selectedHospital!.iD); paytabsViewModel.startApplePayPayment(onSuccess: (PaytabsTransactionResponseModel transactionData) async { LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingPaymentStatusPleaseWait.tr(context: context)); diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 1f8def35..367a9b51 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -159,9 +159,11 @@ class _LandingPageState extends State { if (appState.isAuthenticated) { Clarity.setCustomUserId(appState.getAuthenticatedUser()!.patientId.toString()); - habibWalletVM.initHabibWalletProvider(); - habibWalletVM.getPatientBalanceAmount(); - habibWalletVM.getLakumAccountInformation(); + // habibWalletVM.initHabibWalletProvider(); + // Wallet & Lakum data are fetched lazily when the user unhides the values. + // habibWalletVM.getPatientBalanceAmount(); + // habibWalletVM.getLakumAccountInformation(); + todoSectionViewModel.initializeTodoSectionViewModel(); immediateLiveCareViewModel.initImmediateLiveCare(); immediateLiveCareViewModel.getPatientLiveCareHistory(); @@ -234,9 +236,9 @@ class _LandingPageState extends State { myAppointmentsViewModel.getPatientAppointments(true, false, isForTimeLine: true); // Refresh Appointments Data - habibWalletVM.initHabibWalletProvider(); - habibWalletVM.getPatientBalanceAmount(); - habibWalletVM.getLakumAccountInformation(); + // habibWalletVM.initHabibWalletProvider(); + // habibWalletVM.getPatientBalanceAmount(); + // habibWalletVM.getLakumAccountInformation(); // Refresh Ancillary Orders todoSectionViewModel.setIsAncillaryOrdersNeedReloading(true); @@ -952,7 +954,7 @@ class _LandingPageState extends State { children: [ LocaleKeys.myBalanceSubtitle.tr(context: context).toText16(isBold: true).paddingSymmetrical(24.h, 0.h), SizedBox( - height: 175.h, + height: 180.h, child: ListView.separated( scrollDirection: Axis.horizontal, itemCount: 2, diff --git a/lib/presentation/home/widgets/habib_wallet_card.dart b/lib/presentation/home/widgets/habib_wallet_card.dart index 0bfba696..803b9b5a 100644 --- a/lib/presentation/home/widgets/habib_wallet_card.dart +++ b/lib/presentation/home/widgets/habib_wallet_card.dart @@ -59,26 +59,19 @@ class HabibWalletCard extends StatelessWidget { // Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ - LocaleKeys.habibWallet.tr(context: context).toText16(isBold: true, letterSpacing: -0.2), - // Container( - // height: 40.h, - // width: 40.h, - // decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - // color: AppColors.textColor, - // borderRadius: 8.h, - // ), - // child: Padding( - // padding: EdgeInsets.all(8.h), - // child: Utils.buildSvgWithAssets( - // icon: AppAssets.show_icon, - // width: 12.h, - // height: 12.h, - // fit: BoxFit.contain, - // ), - // ), - // ), - // ], - // ), + Consumer(builder: (context, habibWalletVM, child) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + LocaleKeys.habibWallet.tr(context: context).toText16(isBold: true, letterSpacing: -0.2), + Icon( + habibWalletVM.isWalletAmountHidden ? Icons.visibility_off : Icons.visibility, + color: AppColors.textColor, + size: 24.h, + ).onPress(() => habibWalletVM.toggleWalletAmountVisibility()), + ], + ); + }), SizedBox(height: 4.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -98,9 +91,9 @@ class HabibWalletCard extends StatelessWidget { fit: BoxFit.contain, ), SizedBox(width: 8.h), - NumberFormat.decimalPattern() - .format(habibWalletVM.habibWalletAmount) - .toString() + (habibWalletVM.isWalletAmountHidden + ? "••••" + : NumberFormat.decimalPattern().format(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/home/widgets/lakum_wallet_card.dart b/lib/presentation/home/widgets/lakum_wallet_card.dart index 3645a2d3..feea02ba 100644 --- a/lib/presentation/home/widgets/lakum_wallet_card.dart +++ b/lib/presentation/home/widgets/lakum_wallet_card.dart @@ -67,26 +67,19 @@ class LakumWalletCard extends StatelessWidget { // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ // LocaleKeys.habibWallet.tr(context: context).toText16(isBold: true, letterSpacing: -0.2), - LocaleKeys.lakumPoints.tr(context: context).toText16(isBold: true, letterSpacing: -0.2), - // Container( - // height: 40.h, - // width: 40.h, - // decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - // color: AppColors.textColor, - // borderRadius: 8.h, - // ), - // child: Padding( - // padding: EdgeInsets.all(8.h), - // child: Utils.buildSvgWithAssets( - // icon: AppAssets.show_icon, - // width: 12.h, - // height: 12.h, - // fit: BoxFit.contain, - // ), - // ), - // ), - // ], - // ), + Consumer(builder: (context, habibWalletVM, child) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + LocaleKeys.lakumPoints.tr(context: context).toText16(isBold: true, letterSpacing: -0.2), + Icon( + habibWalletVM.isLakumPointsHidden ? Icons.visibility_off : Icons.visibility, + color: AppColors.textColor, + size: 24.h, + ).onPress(() => habibWalletVM.toggleLakumPointsVisibility()), + ], + ); + }), SizedBox(height: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -98,13 +91,15 @@ class LakumWalletCard extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ - NumberFormat.decimalPattern() - .format(habibWalletVM.isLakumAccountInfoLoading - ? 123 - : habibWalletVM.yahalaAccountNumber == "0" - ? 0 - : (habibWalletVM.lakumAccountInfo?.pointsBalance ?? 0)) - .toString() + (habibWalletVM.isLakumPointsHidden + ? "••••" + : NumberFormat.decimalPattern() + .format(habibWalletVM.isLakumAccountInfoLoading + ? 123 + : habibWalletVM.yahalaAccountNumber == "0" + ? 0 + : (habibWalletVM.lakumAccountInfo?.pointsBalance ?? 0)) + .toString()) .toText32(isBold: true, isEnglishOnly: true) .toShimmer2(isShow: habibWalletVM.isLakumAccountInfoLoading, radius: 12.h, width: 80.h, height: 40.h), SizedBox(width: 4.h), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 7f4836f6..fe08fbbe 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -187,7 +187,7 @@ class MyInAppBrowser extends InAppBrowser { // if (context != null) GifLoaderDialogUtils.hideDialog(context); // AppToast.showErrorToast(message: err); // }); - } else if (paymentMethod == "TAMARA") { + } else if (paymentMethod.toLowerCase() == "tamara") { // LiveCareService service = new LiveCareService(); TamaraRequestModel tamaraRequestModel = new TamaraRequestModel(); From e96f2c3ecd13c7b99aa0c20ff593b3fb2a807e3b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 14 Sep 2026 10:21:54 +0300 Subject: [PATCH 4/9] Habib Wallet & Lakum data updates --- .../habib_wallet/habib_wallet_view_model.dart | 15 +++++++++++++-- lib/widgets/app_language_change.dart | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/features/habib_wallet/habib_wallet_view_model.dart b/lib/features/habib_wallet/habib_wallet_view_model.dart index e888600a..21ec0e79 100644 --- a/lib/features/habib_wallet/habib_wallet_view_model.dart +++ b/lib/features/habib_wallet/habib_wallet_view_model.dart @@ -31,6 +31,7 @@ class HabibWalletViewModel extends ChangeNotifier { num walletRechargeAmount = 0; String notesText = ""; bool isWalletAmountToBeLoaded = false; + bool isLakumInfoToBeLoaded = false; // ── Balance visibility (show/hide like a password field) ────────────────── bool isWalletAmountHidden = true; @@ -55,7 +56,7 @@ class HabibWalletViewModel extends ChangeNotifier { notifyListeners(); // On first unhide, fetch the data if not already fetched. if (!isLakumPointsHidden && !isLakumInfoFetched) { - isWalletAmountToBeLoaded = true; + isLakumInfoToBeLoaded = true; getLakumAccountInformation(); } } @@ -358,6 +359,8 @@ class HabibWalletViewModel extends ChangeNotifier { if (isWalletAmountToBeLoaded) { isWalletAmountLoading = true; habibWalletAmount = 0; + } + if (isLakumInfoToBeLoaded) { isLakumAccountInfoLoading = true; yahalaAccountNumber = ""; } @@ -429,6 +432,11 @@ class HabibWalletViewModel extends ChangeNotifier { notifyListeners(); } + setIsLakumInfoToBeLoaded(bool value) { + isLakumInfoToBeLoaded = value; + notifyListeners(); + } + String getSelectedRechargeTypeValue() { switch (selectedRechargeType) { case 1: @@ -571,7 +579,7 @@ class HabibWalletViewModel extends ChangeNotifier { } Future getLakumAccountInformation({Function(dynamic)? onSuccess, Function(String)? onError}) async { - if (!isWalletAmountToBeLoaded) { + if (!isLakumInfoToBeLoaded) { return; } @@ -586,6 +594,8 @@ class HabibWalletViewModel extends ChangeNotifier { (failure) async { yahalaAccountNumber = "0"; isLakumAccountInfoLoading = false; + isLakumInfoFetched = true; + isLakumInfoToBeLoaded = false; notifyListeners(); // 675534 }, (apiResponse) async { @@ -613,6 +623,7 @@ class HabibWalletViewModel extends ChangeNotifier { } isLakumAccountInfoLoading = false; isLakumInfoFetched = true; + isLakumInfoToBeLoaded = false; notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); diff --git a/lib/widgets/app_language_change.dart b/lib/widgets/app_language_change.dart index c2ae0272..7810457b 100644 --- a/lib/widgets/app_language_change.dart +++ b/lib/widgets/app_language_change.dart @@ -76,6 +76,7 @@ class _AppLanguageChangeState extends State { myAppointmentsViewModel.getPatientAppointments(true, false); habibWalletVM.setIsWalletAmountToBeLoaded(true); + habibWalletVM.setIsLakumInfoToBeLoaded(true); habibWalletVM.initHabibWalletProvider(); habibWalletVM.getPatientBalanceAmount(); habibWalletVM.getLakumAccountInformation(); From 67bdc6123b1459fcaf930cdfc5f4c9087b8a4a8d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 14 Sep 2026 10:52:35 +0300 Subject: [PATCH 5/9] Insurance model updates --- lib/presentation/home/landing_page.dart | 5 ++++- lib/presentation/medical_file/medical_file_page.dart | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 367a9b51..2fbd9417 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -172,7 +172,10 @@ class _LandingPageState extends State { emergencyServicesViewModel.checkPatientERAdvanceBalance(); // myAppointmentsViewModel.getPatientAppointmentQueueDetails(); notificationsViewModel.initNotificationsViewModel(); - insuranceViewModel.initInsuranceProvider(); + + if (Utils.havePrivilege(122)) { + insuranceViewModel.initInsuranceProvider(); + } if (!appState.isRatedVisible) { appointmentRatingViewModel.getLastRatingAppointment( diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index a3de6c08..27978723 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -110,7 +110,7 @@ class _MedicalFilePageState extends State { appState = getIt.get(); scheduleMicrotask(() { if (appState.isAuthenticated) { - insuranceViewModel.initInsuranceProvider(); + // insuranceViewModel.initInsuranceProvider(); // Load vital signs hmgServicesViewModel.getPatientVitalSign(); @@ -495,6 +495,9 @@ class _MedicalFilePageState extends State { medicalFileViewModel.setIsPatientMedicalReportsLoading(true); medicalFileViewModel.getPatientMedicalReportList(); } + if (index == 2 && isExpanded) { + insuranceViewModel.initInsuranceProvider(); + } }, items: [ ExpandableListItem( From a02af3897f0eddb0f43d00a67030f554da880189 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 14 Sep 2026 12:02:38 +0300 Subject: [PATCH 6/9] Update to Stores VersionID 22.0 --- lib/core/api/api_client.dart | 2 +- lib/core/api_consts.dart | 2 +- lib/features/insurance/insurance_repo.dart | 8 +++++--- lib/features/insurance/insurance_view_model.dart | 8 ++++---- lib/presentation/home/landing_page.dart | 2 +- pubspec.yaml | 4 ++-- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 4db0cf8b..784c2f44 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -211,7 +211,7 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 1307867; + // body['PatientID'] = 226077; // body['PatientID'] = 53320; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 094fa680..40f04b1e 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -301,7 +301,7 @@ class ApiConsts { static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations"; // ************ static values for Api **************** - static final double appVersionID = 21.9; + static final double appVersionID = 22.0; // static final double appVersionID = 50.7; static final int appChannelId = 3; diff --git a/lib/features/insurance/insurance_repo.dart b/lib/features/insurance/insurance_repo.dart index 2719035b..0a0ee0be 100644 --- a/lib/features/insurance/insurance_repo.dart +++ b/lib/features/insurance/insurance_repo.dart @@ -11,7 +11,7 @@ import 'package:hmg_patient_app_new/features/insurance/models/resp_models/upload import 'package:hmg_patient_app_new/services/logger_service.dart'; abstract class InsuranceRepo { - Future>>> getPatientInsuranceDetails(); + Future>>> getPatientInsuranceDetails({bool isFromHomePage = false}); Future>>> getPatientInsuranceCardHistory(); @@ -35,8 +35,10 @@ class InsuranceRepoImp implements InsuranceRepo { InsuranceRepoImp({required this.loggerService, required this.apiClient}); @override - Future>>> getPatientInsuranceDetails() async { - Map mapDevice = {}; + Future>>> getPatientInsuranceDetails({bool isFromHomePage = false}) async { + Map mapDevice = { + "IsFromHomePage": isFromHomePage + }; try { GenericApiModel>? apiResponse; diff --git a/lib/features/insurance/insurance_view_model.dart b/lib/features/insurance/insurance_view_model.dart index 2422920a..caeba030 100644 --- a/lib/features/insurance/insurance_view_model.dart +++ b/lib/features/insurance/insurance_view_model.dart @@ -32,11 +32,11 @@ class InsuranceViewModel extends ChangeNotifier { InsuranceViewModel({required this.insuranceRepo, required this.errorHandlerService}); - initInsuranceProvider() { + initInsuranceProvider({bool isFromHomePage = false}) { if (isInsuranceDataToBeLoaded) { patientInsuranceList.clear(); isInsuranceLoading = true; - getPatientInsuranceDetails(); + getPatientInsuranceDetails(isFromHomePage: isFromHomePage); } patientInsuranceCardHistoryList.clear(); isInsuranceHistoryLoading = true; @@ -76,12 +76,12 @@ class InsuranceViewModel extends ChangeNotifier { notifyListeners(); } - Future getPatientInsuranceDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async { + Future getPatientInsuranceDetails({bool isFromHomePage = false, Function(dynamic)? onSuccess, Function(String)? onError}) async { if (!isInsuranceDataToBeLoaded) { return; } - final result = await insuranceRepo.getPatientInsuranceDetails(); + final result = await insuranceRepo.getPatientInsuranceDetails(isFromHomePage: isFromHomePage); result.fold( // (failure) async => await errorHandlerService.handleError(failure: failure), diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 2fbd9417..fdb8afcf 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -174,7 +174,7 @@ class _LandingPageState extends State { notificationsViewModel.initNotificationsViewModel(); if (Utils.havePrivilege(122)) { - insuranceViewModel.initInsuranceProvider(); + insuranceViewModel.initInsuranceProvider(isFromHomePage: true); } if (!appState.isRatedVisible) { diff --git a/pubspec.yaml b/pubspec.yaml index e471cada..82ae76ac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,8 +2,8 @@ name: hmg_patient_app_new description: "New HMG Patient App" publish_to: 'none' # Remove this line if you wish to publish to pub.dev -#version: 0.0.45+46 -version: 0.0.15+2 +version: 0.0.48+49 +#version: 0.0.16+1 environment: sdk: ">=3.6.0 <4.0.0" From c03da1c541e7c77c9b6be4ba20bd5b9be03a438f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 15 Sep 2026 12:28:11 +0300 Subject: [PATCH 7/9] Locale fix --- .../book_appointments_view_model.dart | 111 ++++++++++-------- lib/main.dart | 2 + .../book_appointment_page.dart | 2 + 3 files changed, 63 insertions(+), 52 deletions(-) diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index dbed528e..a4530eee 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:easy_localization/easy_localization.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; @@ -842,67 +843,73 @@ class BookAppointmentsViewModel extends ChangeNotifier { } Future getDoctorFreeSlots({bool isBookingForLiveCare = false, Function(dynamic)? onSuccess, Function(String)? onError}) async { - docFreeSlots.clear(); - DateTime date; - final DateFormat formatter = DateFormat('HH:mm', "en-US"); - final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); - Map _eventsParsed; - - final result = await bookAppointmentsRepo.getDoctorFreeSlots( - selectedDoctor.clinicID ?? 0, - selectedDoctor.projectID ?? 0, - selectedDoctor.doctorID ?? 0, - isBookingForLiveCare, - continueDentalPlan: isContinueDentalPlan, - onError: onError, - ); - - result.fold( - (failure) async { - print(failure); - if (onError != null) { - onError(failure.message); - } - }, - (apiResponse) { - if (apiResponse.messageStatus == 2) { - onError!(apiResponse.errorMessage ?? "Unknown error occurred"); - // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); - } else if (apiResponse.messageStatus == 1) { - if (apiResponse.data['FreeTimeSlots'] == null || apiResponse.data['FreeTimeSlots'].isEmpty) { - onError!("No free slots available".tr()); - return; + // try { + docFreeSlots.clear(); + DateTime date; + final DateFormat formatter = DateFormat('HH:mm', "en-US"); + // final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); + // Map _eventsParsed; + + final result = await bookAppointmentsRepo.getDoctorFreeSlots( + selectedDoctor.clinicID ?? 0, + selectedDoctor.projectID ?? 0, + selectedDoctor.doctorID ?? 0, + isBookingForLiveCare, + continueDentalPlan: isContinueDentalPlan, + onError: onError, + ); + + result.fold( + (failure) async { + print(failure); + if (onError != null) { + onError(failure.message); } - initialSlotDuration = apiResponse.data["InitialSlotDuration"]; - freeSlotsResponse = apiResponse.data['FreeTimeSlots']; - isWaitingAppointmentAvailable = apiResponse.data["IsAllowToBookWaitingAppointment"]; - - // isWaitingAppointmentAvailable = true; - - freeSlotsResponse.forEach((element) { - // date = (isLiveCareSchedule != null && isLiveCareSchedule) - // ? DateUtil.convertStringToDate(element) - // : - date = DateUtil.convertStringToDateSaudiTimezone(element, int.parse(selectedDoctor.projectID.toString())); - slotsList.add(FreeSlot(date, ['slot'])); - docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date, vidaDate: element)); - }); + }, + (apiResponse) { + if (apiResponse.messageStatus == 2) { + onError!(apiResponse.errorMessage ?? "Unknown error occurred"); + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { + if (apiResponse.data['FreeTimeSlots'] == null || apiResponse.data['FreeTimeSlots'].isEmpty) { + onError!("No free slots available".tr()); + return; + } + initialSlotDuration = apiResponse.data["InitialSlotDuration"]; + freeSlotsResponse = apiResponse.data['FreeTimeSlots']; + isWaitingAppointmentAvailable = apiResponse.data["IsAllowToBookWaitingAppointment"]; + + // isWaitingAppointmentAvailable = true; + + freeSlotsResponse.forEach((element) { + // date = (isLiveCareSchedule != null && isLiveCareSchedule) + // ? DateUtil.convertStringToDate(element) + // : + date = DateUtil.convertStringToDateSaudiTimezone(element, int.parse(selectedDoctor.projectID.toString())); + slotsList.add(FreeSlot(date, ['slot'])); + docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date, vidaDate: element)); + }); - notifyListeners(); - if (onSuccess != null) { - onSuccess(apiResponse); + notifyListeners(); + if (onSuccess != null) { + onSuccess(apiResponse); + } } - } - }, - ); + }, + ); + // } catch(ex) { + // if (onError != null) { + // onError(ex.toString()); + // } + // } } Future getLiveCareDoctorFreeSlots({bool isBookingForLiveCare = false, Function(dynamic)? onSuccess, Function(String)? onError}) async { docFreeSlots.clear(); DateTime date; final DateFormat formatter = DateFormat('HH:mm', "en-US"); - final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); - Map _eventsParsed; + // final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); + // Map _eventsParsed; final result = await bookAppointmentsRepo.getLiveCareDoctorFreeSlots( selectedDoctor.clinicID ?? 0, selectedLiveCareClinic.serviceID ?? 0, selectedDoctor.projectID ?? 0, selectedDoctor.doctorID ?? 0, isBookingForLiveCare, diff --git a/lib/main.dart b/lib/main.dart index 223103ae..4e60c2a0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -117,6 +117,8 @@ Future callInitializations() async { WidgetsFlutterBinding.ensureInitialized(); await EasyLocalization.ensureInitialized(); + Intl.defaultLocale = "en_US"; + SafeDevice.init( SafeDeviceConfig(mockLocationCheckEnabled: false), // disables mock location check on Android ); diff --git a/lib/presentation/book_appointment/book_appointment_page.dart b/lib/presentation/book_appointment/book_appointment_page.dart index 53d4b1b1..c2560ecd 100644 --- a/lib/presentation/book_appointment/book_appointment_page.dart +++ b/lib/presentation/book_appointment/book_appointment_page.dart @@ -523,6 +523,7 @@ class _BookAppointmentPageState extends State { ], ).onPress(() { bookAppointmentsViewModel.setIsDoctorSearchByNameStarted(false); + bookAppointmentsViewModel.setIsLiveCareSchedule(false); bookAppointmentsViewModel.setProjectID(null); Navigator.of(context).push( CustomPageRoute( @@ -554,6 +555,7 @@ class _BookAppointmentPageState extends State { ).onPress(() { Clarity.sendCustomEvent('Select_Region_Page'); bookAppointmentsViewModel.setProjectID(null); + bookAppointmentsViewModel.setIsLiveCareSchedule(false); openRegionListBottomSheet(context, RegionBottomSheetType.FOR_REGION); }), ], From 34b671236efd84493a0a94bd3791583983228b7a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 15 Sep 2026 15:50:52 +0300 Subject: [PATCH 8/9] Updates --- lib/core/api/api_client.dart | 2 +- .../immediate_livecare/immediate_livecare_view_model.dart | 4 +++- lib/presentation/book_appointment/search_doctor_by_name.dart | 2 +- lib/presentation/book_appointment/widgets/doctor_card.dart | 2 +- lib/splashPage.dart | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 784c2f44..4c961843 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -211,7 +211,7 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 226077; + // body['PatientID'] = 5422188; // body['PatientID'] = 53320; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; diff --git a/lib/features/immediate_livecare/immediate_livecare_view_model.dart b/lib/features/immediate_livecare/immediate_livecare_view_model.dart index e2e8d2cb..57bf6553 100644 --- a/lib/features/immediate_livecare/immediate_livecare_view_model.dart +++ b/lib/features/immediate_livecare/immediate_livecare_view_model.dart @@ -135,7 +135,9 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { result.fold( (failure) async { - onError!(failure.message); + if(onError != null) { + onError(failure.message); + } }, (apiResponse) { if (apiResponse.messageStatus == 2) { diff --git a/lib/presentation/book_appointment/search_doctor_by_name.dart b/lib/presentation/book_appointment/search_doctor_by_name.dart index 4e9f1435..f1f391b0 100644 --- a/lib/presentation/book_appointment/search_doctor_by_name.dart +++ b/lib/presentation/book_appointment/search_doctor_by_name.dart @@ -218,7 +218,7 @@ class _SearchDoctorByNameState extends State { bookAppointmentsViewModel: bookAppointmentsViewModel, isDoctorNameSearch: true, ).paddingSymmetrical(16.h, 0.h).onPress(() async { - if (bookAppointmentsVM.filteredDoctorList[index].clinicID == 17 && getIt.get().getAuthenticatedUser()!.age! < 12) { + if (getIt.get().isAuthenticated && bookAppointmentsVM.filteredDoctorList[index].clinicID == 17 && getIt.get().getAuthenticatedUser()!.age! < 12) { bookAppointmentsViewModel.setProjectID(bookAppointmentsVM.filteredDoctorList[index].projectID.toString()); bookAppointmentsViewModel.setSelectedClinic(GetClinicsListResponseModel( clinicID: bookAppointmentsVM.filteredDoctorList[index].clinicID, diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index d2f431a9..23a9cbcd 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -186,7 +186,7 @@ class DoctorCard extends StatelessWidget { if (isDoctorNameSearch && doctorsListResponseModel.clinicID == 17) { GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel( clinicID: doctorsListResponseModel.clinicID, clinicDescription: doctorsListResponseModel.clinicName, isLiveCareClinicAndOnline: false, liveCareServiceID: 0, liveCareClinicID: 0); - if (getIt.get().getAuthenticatedUser()!.age! > 12) { + if (getIt.get().isAuthenticated && getIt.get().getAuthenticatedUser()!.age! > 12) { bookAppointmentsViewModel.setProjectID(doctorsListResponseModel.projectID.toString()); bookAppointmentsViewModel.setSelectedClinic(selectedClinic); bookAppointmentsViewModel.setIsChiefComplaintsListLoading(true); diff --git a/lib/splashPage.dart b/lib/splashPage.dart index fe223fc2..cf407d41 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -116,8 +116,8 @@ class _SplashScreenState extends State { logLevel: LogLevel.Error, // Optional: Set the log level (Verbose, Debug, Info, Warning, Error, None) ); - Clarity.initialize(context, config); - + Clarity.initialize(getIt.get().navigatorKey.currentContext!, config); + // Set initial app context tags try { final appState = getIt.get(); From 648cdafacd4bb69a8748a19660e8025b61a9e233 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 16 Sep 2026 11:15:01 +0300 Subject: [PATCH 9/9] Update to stores Version 22.1 --- lib/core/api_consts.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 40f04b1e..45d6f48c 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -301,7 +301,7 @@ class ApiConsts { static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations"; // ************ static values for Api **************** - static final double appVersionID = 22.0; + static final double appVersionID = 22.1; // static final double appVersionID = 50.7; static final int appChannelId = 3;