diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 542a169c..9f3bb907 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -290,7 +290,7 @@ class ApiConsts { static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations"; // ************ static values for Api **************** - static final double appVersionID = 21.2; + static final double appVersionID = 21.3; // static final double appVersionID = 50.7; static final int appChannelId = 3; diff --git a/lib/core/utils/push_notification_handler.dart b/lib/core/utils/push_notification_handler.dart index 4b7250ba..e179a1ab 100644 --- a/lib/core/utils/push_notification_handler.dart +++ b/lib/core/utils/push_notification_handler.dart @@ -49,10 +49,10 @@ _incomingCall(Map data) async { log('the value of the _incomingCall remote message is $data'); // Check if there's already a call in progress to prevent duplicates - if (_isCallInProgress && _currentCallId != null) { - log('⚠️ Call already in progress (ID: $_currentCallId), ignoring duplicate notification'); - return; - } + // if (_isCallInProgress && _currentCallId != null) { + // log('⚠️ Call already in progress (ID: $_currentCallId), ignoring duplicate notification'); + // return; + // } String roomID = data['session_id'] ?? ''; String callTypeID = data['AppointmentNo'] ?? ''; diff --git a/lib/features/emergency_services/emergency_services_view_model.dart b/lib/features/emergency_services/emergency_services_view_model.dart index 83d2a564..d581d0f5 100644 --- a/lib/features/emergency_services/emergency_services_view_model.dart +++ b/lib/features/emergency_services/emergency_services_view_model.dart @@ -117,6 +117,13 @@ class EmergencyServicesViewModel extends ChangeNotifier { bool historyLoading = false; OrderDislpay currentlyDisplayedOrder = OrderDislpay.ALL; + bool isAdvanceERBalanceNeedToBeLoaded = true; + + setIsAdvanceERBalanceNeedToBeLoaded(bool value) { + isAdvanceERBalanceNeedToBeLoaded = value; + notifyListeners(); + } + setSelectedRRTProcedure(RRTProceduresResponseModel procedure) { selectedRRTProcedure = procedure; notifyListeners(); @@ -331,6 +338,8 @@ class EmergencyServicesViewModel extends ChangeNotifier { } Future checkPatientERAdvanceBalance({Function(dynamic)? onSuccess, Function(String)? onError}) async { + if (!isAdvanceERBalanceNeedToBeLoaded) return; + final result = await emergencyServicesRepo.checkPatientERAdvanceBalance(); result.fold( @@ -338,6 +347,7 @@ class EmergencyServicesViewModel extends ChangeNotifier { (failure) { patientHasAdvanceERBalance = false; isERBookAppointment = true; + isAdvanceERBalanceNeedToBeLoaded = true; if (onSuccess != null) { onSuccess(failure.message); } @@ -347,9 +357,11 @@ class EmergencyServicesViewModel extends ChangeNotifier { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); patientHasAdvanceERBalance = false; isERBookAppointment = true; + isAdvanceERBalanceNeedToBeLoaded = true; } else if (apiResponse.messageStatus == 1) { patientHasAdvanceERBalance = apiResponse.data; isERBookAppointment = !patientHasAdvanceERBalance; + isAdvanceERBalanceNeedToBeLoaded = false; notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); diff --git a/lib/features/habib_wallet/habib_wallet_view_model.dart b/lib/features/habib_wallet/habib_wallet_view_model.dart index 5605281d..76886045 100644 --- a/lib/features/habib_wallet/habib_wallet_view_model.dart +++ b/lib/features/habib_wallet/habib_wallet_view_model.dart @@ -325,10 +325,12 @@ class HabibWalletViewModel extends ChangeNotifier { } initHabibWalletProvider() { - isWalletAmountLoading = true; + if (isWalletAmountToBeLoaded) { + isWalletAmountLoading = true; + habibWalletAmount = 0; + isLakumAccountInfoLoading = true; + } isBottomSheetContentLoading = false; - isLakumAccountInfoLoading = true; - habibWalletAmount = 0; walletRechargeAmount = 0; selectedRechargeType = 1; advancePaymentHospitals.clear(); @@ -538,6 +540,10 @@ class HabibWalletViewModel extends ChangeNotifier { } Future getLakumAccountInformation({Function(dynamic)? onSuccess, Function(String)? onError}) async { + if (!isWalletAmountToBeLoaded) { + return; + } + isLakumAccountInfoLoading = true; lakumAccountInfo = LakumInquiryInformationResponseModel(); notifyListeners(); diff --git a/lib/features/todo_section/todo_section_view_model.dart b/lib/features/todo_section/todo_section_view_model.dart index 131774d6..7d1fb88a 100644 --- a/lib/features/todo_section/todo_section_view_model.dart +++ b/lib/features/todo_section/todo_section_view_model.dart @@ -13,13 +13,13 @@ class TodoSectionViewModel extends ChangeNotifier { String? notificationsCount = "0"; initializeTodoSectionViewModel() async { - // if (isAncillaryOrdersNeedReloading) { - patientAncillaryOrdersList.clear(); - isAncillaryOrdersLoading = true; + if (isAncillaryOrdersNeedReloading) { + patientAncillaryOrdersList.clear(); + isAncillaryOrdersLoading = true; isAncillaryDetailsProceduresLoading = true; notificationsCount = "0"; getPatientOnlineAncillaryOrderList(); - // } + } getPatientDashboard(); } @@ -67,9 +67,9 @@ class TodoSectionViewModel extends ChangeNotifier { } Future getPatientOnlineAncillaryOrderList({Function(dynamic)? onSuccess, Function(String)? onError}) async { - // if (!isAncillaryOrdersNeedReloading) { - // return; - // } + if (!isAncillaryOrdersNeedReloading) { + return; + } patientAncillaryOrdersList.clear(); isAncillaryOrdersLoading = true; diff --git a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart index ea24490b..fca64321 100644 --- a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart +++ b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart @@ -139,6 +139,7 @@ class _ErOnlineCheckinPaymentPageState extends State paymentReference: transactionData.transactionReference!, appointmentNo: "0", onSuccess: (val) { + emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); LoaderBottomSheet.hideLoader(); if (emergencyServicesViewModel.isERBookAppointment) { showCommonBottomSheetWithoutHeight( @@ -228,6 +229,7 @@ class _ErOnlineCheckinPaymentPageState extends State paymentReference: transactionData.transactionReference!, appointmentNo: "0", onSuccess: (val) { + emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); LoaderBottomSheet.hideLoader(); if (emergencyServicesViewModel.isERBookAppointment) { showCommonBottomSheetWithoutHeight( @@ -510,6 +512,7 @@ class _ErOnlineCheckinPaymentPageState extends State paymentReference: transactionData.transactionReference!, appointmentNo: "0", onSuccess: (val) { + emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); LoaderBottomSheet.hideLoader(); if (emergencyServicesViewModel.isERBookAppointment) { showCommonBottomSheetWithoutHeight( @@ -590,6 +593,7 @@ class _ErOnlineCheckinPaymentPageState extends State paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, appointmentNo: "0", onSuccess: (val) { + emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true); LoaderBottomSheet.hideLoader(); if (emergencyServicesViewModel.isERBookAppointment) { showCommonBottomSheetWithoutHeight( diff --git a/lib/presentation/habib_wallet/habib_wallet_page.dart b/lib/presentation/habib_wallet/habib_wallet_page.dart index 4f056dad..c4ee9356 100644 --- a/lib/presentation/habib_wallet/habib_wallet_page.dart +++ b/lib/presentation/habib_wallet/habib_wallet_page.dart @@ -136,23 +136,23 @@ class _HabibWalletState extends State { }, ), ), - SizedBox(width: 8.w), - Flexible( - child: CustomButton( - height: 40.h, - icon: AppAssets.refundIcon, - iconSize: 24.w, - backgroundColor: AppColors.successColor, - textColor: Colors.white, - text: LocaleKeys.withdraw.tr(context: context), - borderWidth: 0.w, - fontWeight: FontWeight.w600, - borderColor: Colors.transparent, - padding: EdgeInsets.fromLTRB(4, 0, 12, 0), - fontSize: 14.f, - onPressed: () => Navigator.of(context).push(CustomPageRoute(page: WithdrawRequestCreatePage())), - ), - ), + // SizedBox(width: 8.w), + // Flexible( + // child: CustomButton( + // height: 40.h, + // icon: AppAssets.refundIcon, + // iconSize: 24.w, + // backgroundColor: AppColors.successColor, + // textColor: Colors.white, + // text: LocaleKeys.withdraw.tr(context: context), + // borderWidth: 0.w, + // fontWeight: FontWeight.w600, + // borderColor: Colors.transparent, + // padding: EdgeInsets.fromLTRB(4, 0, 12, 0), + // fontSize: 14.f, + // onPressed: () => Navigator.of(context).push(CustomPageRoute(page: WithdrawRequestCreatePage())), + // ), + // ), ], ), SizedBox(height: 24.h), diff --git a/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart b/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart index 58840c66..dd3c5ff8 100644 --- a/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart +++ b/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart @@ -127,6 +127,7 @@ class _WalletPaymentConfirmPageState extends State { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight(getIt.get().navigatorKey.currentContext!, child: Utils.getSuccessWidget(loadingText: "Payment Successful!"), callBackFunc: () { + habibWalletVM.setIsWalletAmountToBeLoaded(true); habibWalletVM.initHabibWalletProvider(); habibWalletVM.getPatientBalanceAmount(); Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); @@ -228,6 +229,7 @@ class _WalletPaymentConfirmPageState extends State { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight(getIt.get().navigatorKey.currentContext!, child: Utils.getSuccessWidget(loadingText: "Payment Successful!"), callBackFunc: () { + habibWalletVM.setIsWalletAmountToBeLoaded(true); habibWalletVM.initHabibWalletProvider(); habibWalletVM.getPatientBalanceAmount(); Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); @@ -411,8 +413,9 @@ class _WalletPaymentConfirmPageState extends State { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight(getIt.get().navigatorKey.currentContext!, child: Utils.getSuccessWidget(loadingText: "Payment Successful!"), callBackFunc: () { - habibWalletVM.initHabibWalletProvider(); - habibWalletVM.getPatientBalanceAmount(); + habibWalletVM.setIsWalletAmountToBeLoaded(true); + habibWalletVM.initHabibWalletProvider(); + habibWalletVM.getPatientBalanceAmount(); Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); }, isFullScreen: false, isCloseButtonVisible: true, isAutoDismiss: true); @@ -503,6 +506,7 @@ class _WalletPaymentConfirmPageState extends State { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight(getIt.get().navigatorKey.currentContext!, child: Utils.getSuccessWidget(loadingText: "Payment Successful!"), callBackFunc: () { + habibWalletVM.setIsWalletAmountToBeLoaded(true); habibWalletVM.initHabibWalletProvider(); habibWalletVM.getPatientBalanceAmount(); Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 8512dddc..40028315 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -213,6 +213,7 @@ class _LandingPageState extends State { habibWalletVM.getLakumAccountInformation(); // Refresh Ancillary Orders + todoSectionViewModel.setIsAncillaryOrdersNeedReloading(true); todoSectionViewModel.initializeTodoSectionViewModel(); // Refresh Immediate LiveCare Data diff --git a/lib/presentation/my_invoices/widgets/invoice_list_card.dart b/lib/presentation/my_invoices/widgets/invoice_list_card.dart index dc5414cd..0bd312c5 100644 --- a/lib/presentation/my_invoices/widgets/invoice_list_card.dart +++ b/lib/presentation/my_invoices/widgets/invoice_list_card.dart @@ -212,28 +212,28 @@ class InvoiceListCard extends StatelessWidget { iconSize: 14.h, ), ), - if (getInvoicesListResponseModel.isAllowRefund == true) ...[ - SizedBox(width: 8.w), - Expanded( - child: CustomButton( - text: LocaleKeys.requestRefund.tr(context: context), - onPressed: () { - _handleRefundInvoiceTap(context); - }, - icon: AppAssets.refundIcon, - iconColor: AppColors.caloriesCalculatorColor, - backgroundColor: AppColors.blueColor.withValues(alpha: 0.14), - borderColor: AppColors.primaryRedColor.withValues(alpha: 0.01), - textColor: AppColors.caloriesCalculatorColor, - fontSize: 14.f, - fontWeight: FontWeight.w600, - borderRadius: 12.r, - padding: EdgeInsets.symmetric(horizontal: 10.w), - height: 40.h, - iconSize: 14.h, - ), - ), - ] + // if (getInvoicesListResponseModel.isAllowRefund == true) ...[ + // SizedBox(width: 8.w), + // Expanded( + // child: CustomButton( + // text: LocaleKeys.requestRefund.tr(context: context), + // onPressed: () { + // _handleRefundInvoiceTap(context); + // }, + // icon: AppAssets.refundIcon, + // iconColor: AppColors.caloriesCalculatorColor, + // backgroundColor: AppColors.blueColor.withValues(alpha: 0.14), + // borderColor: AppColors.primaryRedColor.withValues(alpha: 0.01), + // textColor: AppColors.caloriesCalculatorColor, + // fontSize: 14.f, + // fontWeight: FontWeight.w600, + // borderRadius: 12.r, + // padding: EdgeInsets.symmetric(horizontal: 10.w), + // height: 40.h, + // iconSize: 14.h, + // ), + // ), + // ] ], ), ], diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 22b9f979..a93f75a1 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -1,5 +1,7 @@ import 'dart:async'; +import 'package:clarity_flutter/clarity_flutter.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_callkit_incoming/entities/call_event.dart'; import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart'; @@ -55,7 +57,13 @@ class _SplashScreenState extends State { await notificationService.initialize(onNotificationClick: (payload) { // Handle notification click here }); + ZoomService().initializeZoomSDK(); + + // if (!kDebugMode) { + // _initializeClarity(); + // } + if (isAppOpenedFromCall) { navigateToTeleConsult(); } else { @@ -76,6 +84,15 @@ class _SplashScreenState extends State { // zoom.initSdk(initConfig); } + void _initializeClarity() { + final config = ClarityConfig( + projectId: "x0qgorlez4", // You can find it on the Settings page of Clarity dashboard. + logLevel: LogLevel.Verbose, // Optional: Set the log level (Verbose, Debug, Info, Warning, Error, None) + ); + + Clarity.initialize(context, config); + } + navigateToTeleConsult() async { String roomID = await Utils.getStringFromPrefs(CacheConst.zoomRoomID); String callTypeID = await Utils.getStringFromPrefs(CacheConst.callTypeID); diff --git a/pubspec.yaml b/pubspec.yaml index 33cbdf4b..59e906b0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -105,6 +105,7 @@ dependencies: in_app_review: ^2.0.11 flutter_paytabs_bridge: ^2.7.13 + clarity_flutter: 1.9.0 dev_dependencies: flutter_test: