diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index a5f8443..76e10ea 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1578,5 +1578,8 @@ "insuranceInActiveContactSupport": "لديك تأمين ساري المفعول، ولكنه غير مُفعّل حاليًا في مجموعة حبيب الطبية. يُرجى التواصل مع خدمة عملاء مجموعة حبيب الطبية.", "updateAppNow": "تحديث التطبيق الآن", "Dr": "الدكتور.", - "reschedulingAppo": "إعادة جدولة الموعد، يرجى الانتظار..." + "reschedulingAppo": "إعادة جدولة الموعد، يرجى الانتظار...", + "invalidEligibility": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة.", + "invalidInsurance": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح.", + "continueCash": "تواصل نقدا" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 677927c..bf73d6d 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1569,5 +1569,8 @@ "insuranceInActiveContactSupport": "You have a valid insurance but it is currently inactive in HMG. Please contact HMG customer support to activate it.", "updateAppNow": "Update App Now", "Dr": "Dr.", - "reschedulingAppo": "Rescheduling Appointment, Please wait..." + "reschedulingAppo": "Rescheduling Appointment, Please wait...", + "invalidEligibility": "You cannot make online payment because you are not eligible to use the provided service.", + "invalidInsurance": "You cannot make online payment because you do not have a valid insurance.", + "continueCash": "Continue as cash" } diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 470a938..970b1e4 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -195,7 +195,7 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 2007395; + // body['PatientID'] = 4773715; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; // body['SessionID'] = "45786230487560q"; diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index d436370..671312d 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -436,8 +436,8 @@ class Utils { backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, textColor: AppColors.whiteColor, - icon: AppAssets.cancel, - iconColor: AppColors.whiteColor, + // icon: AppAssets.cancel, + // iconColor: AppColors.whiteColor, ), ), SizedBox(width: 8.h), @@ -452,7 +452,7 @@ class Utils { backgroundColor: AppColors.bgGreenColor, borderColor: AppColors.bgGreenColor, textColor: Colors.white, - icon: AppAssets.confirm, + // icon: AppAssets.confirm, ), ), ], diff --git a/lib/features/immediate_livecare/immediate_livecare_view_model.dart b/lib/features/immediate_livecare/immediate_livecare_view_model.dart index ffa0b00..90bf9a0 100644 --- a/lib/features/immediate_livecare/immediate_livecare_view_model.dart +++ b/lib/features/immediate_livecare/immediate_livecare_view_model.dart @@ -1,16 +1,26 @@ import 'dart:async'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.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/app_state.dart'; import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/dependencies.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/features/immediate_livecare/immediate_livecare_repo.dart'; import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_clinics_response_model.dart'; import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_fees_response_model.dart'; import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_patient_livecare_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; +import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; +import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; +import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import '../../services/navigation_service.dart'; @@ -42,6 +52,9 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { late ValueNotifier durationNotifier; late Timer timer; + bool isShowNotEligibleDialog = false; + String notEligibleErrorMsg = ""; + initImmediateLiveCare() { _appState = getIt(); immediateLiveCareClinicsList = []; @@ -102,8 +115,80 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); } else if (apiResponse.messageStatus == 1) { liveCareImmediateAppointmentFeesList = apiResponse.data!; + + if ((liveCareImmediateAppointmentFeesList.isCash!)) { + isShowNotEligibleDialog = false; + } else { + if (liveCareImmediateAppointmentFeesList.isInsured! && liveCareImmediateAppointmentFeesList.isEligible!) { + isShowNotEligibleDialog = false; + } else { + if (liveCareImmediateAppointmentFeesList.isInsured! && liveCareImmediateAppointmentFeesList.isEligible!) { + isShowNotEligibleDialog = true; + notEligibleErrorMsg = LocaleKeys.invalidEligibility.tr(context: GetIt.instance().navigatorKey.currentContext!); + } else { + isShowNotEligibleDialog = true; + notEligibleErrorMsg = LocaleKeys.invalidInsurance.tr(context: GetIt.instance().navigatorKey.currentContext!); + } + } + } + + if (isShowNotEligibleDialog) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight(GetIt.instance().navigatorKey.currentContext!, + child: Padding( + padding: EdgeInsets.only( + left: 24.w, + top: 24.h, + right: 24.w, + bottom: 12.h, + ), + child: Utils.getWarningWidget( + loadingText: notEligibleErrorMsg, + confirmText: LocaleKeys.updateInsuranceInfo.tr(context: GetIt.instance().navigatorKey.currentContext!), + cancelText: LocaleKeys.continueCash.tr(context: GetIt.instance().navigatorKey.currentContext!), + isShowActionButtons: true, + onCancelTap: () { + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + LoaderBottomSheet.showLoader(); + myAppointmentsViewModel.convertPatientToCash( + projectID: ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat ? 15 : 12, + onSuccess: (val) { + LoaderBottomSheet.hideLoader(); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingFeesPleaseWait.tr()); + getLiveCareImmediateAppointmentFees(); + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight( + title: LocaleKeys.notice.tr(context: GetIt.instance().navigatorKey.currentContext!), + GetIt.instance().navigatorKey.currentContext!, + child: Utils.getErrorWidget(loadingText: err.toString()), + callBackFunc: () { + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + }, + isFullScreen: false, + isCloseButtonVisible: true, + ); + }); + }, + onConfirmTap: () async { + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + Navigator.push( + GetIt.instance().navigatorKey.currentContext!, + CustomPageRoute( + page: InsuranceHomePage(), + ), + ); + }), + ), callBackFunc: () { + // Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + }, isFullScreen: false, isCloseButtonVisible: false, isDismissible: false); + } + notifyListeners(); - if (onSuccess != null) { + if (onSuccess != null && !isShowNotEligibleDialog) { onSuccess(apiResponse); } } diff --git a/lib/features/my_appointments/my_appointments_repo.dart b/lib/features/my_appointments/my_appointments_repo.dart index ce9e877..0c76c9f 100644 --- a/lib/features/my_appointments/my_appointments_repo.dart +++ b/lib/features/my_appointments/my_appointments_repo.dart @@ -73,6 +73,8 @@ abstract class MyAppointmentsRepo { Future>> sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName); Future>>> getPatientAppointmentQueueDetails({required int appointmentNo, required int patientID}); + + Future>> convertPatientToCash({required int projectID}); } class MyAppointmentsRepoImp implements MyAppointmentsRepo { @@ -957,4 +959,36 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo { } } + @override + Future> convertPatientToCash({required int projectID}) async { + Map request; + + request = {"ProjectID": projectID}; + + try { + GenericApiModel? apiResponse; + Failure? failure; + await apiClient.post(CONVERT_PATIENT_TO_CASH, onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + final list = (response['MessageStatus'] == 1); + + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: null, + data: list, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, body: request); + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } } \ No newline at end of file diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart index ce2b7b9..03fbc61 100644 --- a/lib/features/my_appointments/my_appointments_view_model.dart +++ b/lib/features/my_appointments/my_appointments_view_model.dart @@ -1,6 +1,9 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:get_it/get_it.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.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/features/my_appointments/models/appointemnet_filters.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ask_doctor_request_type_response_model.dart'; @@ -10,7 +13,13 @@ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_queue_details_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_type.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; +import 'package:hmg_patient_app_new/services/navigation_service.dart'; +import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; +import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; +import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; class MyAppointmentsViewModel extends ChangeNotifier { int selectedTabIndex = 0; @@ -73,6 +82,9 @@ class MyAppointmentsViewModel extends ChangeNotifier { GetTamaraInstallmentsDetailsResponseModel? getTamaraInstallmentsDetailsResponseModel; bool isTamaraDetailsLoading = false; + bool isShowNotEligibleDialog = false; + String notEligibleErrorMsg = ""; + MyAppointmentsViewModel({required this.myAppointmentsRepo, required this.errorHandlerService, required this.appState}); void onTabChange(int index) { @@ -141,6 +153,7 @@ class MyAppointmentsViewModel extends ChangeNotifier { isTamaraDetailsLoading = true; isAppointmentPatientShareLoading = true; isEyeMeasurementsAppointmentsLoading = true; + isShowNotEligibleDialog = false; notifyListeners(); } @@ -349,7 +362,99 @@ class MyAppointmentsViewModel extends ChangeNotifier { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); } else if (apiResponse.messageStatus == 1) { patientAppointmentShareResponseModel = apiResponse.data!; + + if ((patientAppointmentShareResponseModel!.isCash!)) { + isShowNotEligibleDialog = false; + } else { + if (patientAppointmentShareResponseModel!.isInsured! && patientAppointmentShareResponseModel!.isEligible!) { + isShowNotEligibleDialog = false; + } else { + if (patientAppointmentShareResponseModel!.isInsured! && patientAppointmentShareResponseModel!.isEligible!) { + isShowNotEligibleDialog = true; + notEligibleErrorMsg = LocaleKeys.invalidEligibility.tr(context: GetIt.instance().navigatorKey.currentContext!); + } else { + isShowNotEligibleDialog = true; + notEligibleErrorMsg = LocaleKeys.invalidInsurance.tr(context: GetIt.instance().navigatorKey.currentContext!); + } + } + } isAppointmentPatientShareLoading = false; + + if (isShowNotEligibleDialog) { + showCommonBottomSheetWithoutHeight(GetIt.instance().navigatorKey.currentContext!, + child: Padding( + padding: EdgeInsets.only( + left: 24.w, + top: 24.h, + right: 24.w, + bottom: 12.h, + ), + child: Utils.getWarningWidget( + loadingText: notEligibleErrorMsg, + confirmText: LocaleKeys.updateInsuranceInfo.tr(context: GetIt.instance().navigatorKey.currentContext!), + cancelText: LocaleKeys.continueCash.tr(context: GetIt.instance().navigatorKey.currentContext!), + isShowActionButtons: true, + onCancelTap: () { + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + LoaderBottomSheet.showLoader(); + convertPatientToCash( + projectID: projectID, + onSuccess: (val) { + LoaderBottomSheet.hideLoader(); + setIsPatientAppointmentShareLoading(true); + getPatientShareAppointment(projectID, clinicID, appointmentNo, isLiveCareAppointment); + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight( + title: LocaleKeys.notice.tr(context: GetIt.instance().navigatorKey.currentContext!), + GetIt.instance().navigatorKey.currentContext!, + child: Utils.getErrorWidget(loadingText: err.toString()), + callBackFunc: () { + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + }, + isFullScreen: false, + isCloseButtonVisible: true, + ); + }); + }, + onConfirmTap: () async { + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + Navigator.push( + GetIt.instance().navigatorKey.currentContext!, + CustomPageRoute( + page: InsuranceHomePage(), + ), + ); + }), + ), callBackFunc: () { + // Navigator.pop(GetIt.instance().navigatorKey.currentContext!); + }, isFullScreen: false, isCloseButtonVisible: false, isDismissible: false); + } + + notifyListeners(); + if (onSuccess != null) { + onSuccess(apiResponse); + } + } + }, + ); + } + + Future convertPatientToCash({required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async { + final result = await myAppointmentsRepo.convertPatientToCash(projectID: projectID); + + result.fold( + // (failure) async => await errorHandlerService.handleError(failure: failure), + (failure) async { + onError!(failure.message); + }, + (apiResponse) { + if (apiResponse.messageStatus == 2) { + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); diff --git a/lib/features/radiology/radiology_repo.dart b/lib/features/radiology/radiology_repo.dart index 2af3e0f..5847718 100644 --- a/lib/features/radiology/radiology_repo.dart +++ b/lib/features/radiology/radiology_repo.dart @@ -121,7 +121,7 @@ class RadiologyRepoImp implements RadiologyRepo { Map mapDevice = { "InvoiceNo": Utils.isVidaPlusProject(patientRadiologyResponseModel.projectID!) ? 0 : patientRadiologyResponseModel.invoiceNo, "InvoiceNo_VP": Utils.isVidaPlusProject(patientRadiologyResponseModel.projectID!) ? patientRadiologyResponseModel.invoiceNo : 0, - "LineItemNo": patientRadiologyResponseModel.invoiceLineItemNo, + // "LineItemNo": patientRadiologyResponseModel.invoiceLineItemNo, "InvoiceLineItemNo": patientRadiologyResponseModel.invoiceLineItemNo, "ProjectID": patientRadiologyResponseModel.projectID!, "InvoiceType": patientRadiologyResponseModel.invoiceType!, diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 9e74c1e..3940f9e 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1570,5 +1570,8 @@ abstract class LocaleKeys { static const updateAppNow = 'updateAppNow'; static const Dr = 'Dr'; static const reschedulingAppo = 'reschedulingAppo'; + static const invalidEligibility = 'invalidEligibility'; + static const invalidInsurance = 'invalidInsurance'; + static const continueCash = 'continueCash'; } diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index 18c95bb..dee1328 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -112,9 +112,9 @@ class _AppointmentDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppointmentDoctorCard( - renderWidgetForERDisplay: ((widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) || - (widget.patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) || - !Utils.isClinicAllowedForRebook(widget.patientAppointmentHistoryResponseModel.clinicID)), + // renderWidgetForERDisplay: ((widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) || + renderWidgetForERDisplay: + ((widget.patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) || !Utils.isClinicAllowedForRebook(widget.patientAppointmentHistoryResponseModel.clinicID)), patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, onAskDoctorTap: () async { LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingDoctorAvailability.tr(context: context)); diff --git a/lib/presentation/appointments/widgets/appointment_doctor_card.dart b/lib/presentation/appointments/widgets/appointment_doctor_card.dart index 7e43069..9e56053 100644 --- a/lib/presentation/appointments/widgets/appointment_doctor_card.dart +++ b/lib/presentation/appointments/widgets/appointment_doctor_card.dart @@ -183,7 +183,7 @@ class AppointmentDoctorCard extends StatelessWidget { ) : SizedBox.shrink(); } else { - return patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false + return patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? CustomButton( text: LocaleKeys.cancel.tr(), onPressed: () { diff --git a/lib/presentation/book_appointment/review_appointment_page.dart b/lib/presentation/book_appointment/review_appointment_page.dart index d89d1f2..035eb22 100644 --- a/lib/presentation/book_appointment/review_appointment_page.dart +++ b/lib/presentation/book_appointment/review_appointment_page.dart @@ -11,6 +11,7 @@ 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/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart'; @@ -241,11 +242,16 @@ class _ReviewAppointmentPageState extends State { LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingAppointmentShare.tr(context: context)); await bookAppointmentsViewModel.getWalkInPatientShareAppointment(onSuccess: (val) { LoaderBottomSheet.hideLoader(); - Navigator.of(context).push( - CustomPageRoute( - page: WaitingAppointmentPaymentPage(), - ), - ); + if (bookAppointmentsViewModel.patientWalkInAppointmentShareResponseModel!.patientShareWithTax != 0 || + bookAppointmentsViewModel.patientWalkInAppointmentShareResponseModel!.patientShareWithTax != 0.0) { + Navigator.of(context).push( + CustomPageRoute( + page: WaitingAppointmentPaymentPage(), + ), + ); + } else { + initiateBookAppointmentForWalkInNoPatientShare(); + } }, onError: (err) { LoaderBottomSheet.hideLoader(); showCommonBottomSheetWithoutHeight( @@ -258,6 +264,49 @@ class _ReviewAppointmentPageState extends State { }); } + void initiateBookAppointmentForWalkInNoPatientShare() async { + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.bookingWaitingAppointment.tr(context: context)); + await bookAppointmentsViewModel.insertSpecificAppointmentForWalkIn(onSuccess: (val) async { + String appointmentNo = val.data['AppointmentNo'].toString(); + LoaderBottomSheet.hideLoader(); + sendCheckInRequest(bookAppointmentsViewModel.waitingAppointmentNFCCode, appointmentNo, context); + }); + } + + void sendCheckInRequest(String scannedCode, String appointmentNo, BuildContext context) async { + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.processingCheckIn.tr(context: context)); + PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel = PatientAppointmentHistoryResponseModel( + appointmentNo: appointmentNo, + clinicID: bookAppointmentsViewModel.selectedDoctor.clinicID, + projectID: bookAppointmentsViewModel.selectedDoctor.projectID, + ); + await myAppointmentsViewModel.sendCheckInNfcRequest( + patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, + scannedCode: scannedCode, + checkInType: 2, + onSuccess: (apiResponse) { + LoaderBottomSheet.hideLoader(); + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); + myAppointmentsViewModel.getPatientAppointments(true, false); + showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.success.tr(context: context), child: Utils.getSuccessWidget(loadingText: apiResponse.data["SuccessMsg"]), callBackFunc: () { + Navigator.of(context).pop(); + Navigator.pushAndRemoveUntil( + context, + CustomPageRoute( + page: LandingNavigation(), + ), + (r) => false); + }, isFullScreen: false); + }, + onError: (error) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.error.tr(context: context), child: Utils.getErrorWidget(loadingText: error), callBackFunc: () { + Navigator.of(context).pop(); + }, isFullScreen: false); + }, + ); + } + void initiateBookAppointment() async { LoadingUtils.showFullScreenLoader(barrierDismissible: true, isSuccessDialog: false, loadingText: LocaleKeys.bookingYourAppointment.tr(context: context)); myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); 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 ca60e9e..bb347e5 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 @@ -640,6 +640,8 @@ class _WaitingAppointmentPaymentPageState extends State