diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 9f54d058..42c5f052 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -51,8 +51,11 @@ class DoctorView extends StatefulWidget { class _DoctorViewState extends State with AutomaticKeepAliveClientMixin { + late ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); super.build(context); return InkWell( onTap: () { @@ -217,7 +220,7 @@ class _DoctorViewState extends State with AutomaticKeepAliveClientMi } getDoctorsProfile(context, DoctorList docObject, {isAppo, bool isContinueDentalPlan = false}) { - int languageID = context.read().isArabic ? 1 : 2; + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List docProfileList = []; DoctorsListService service = new DoctorsListService(); diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 0ab1e1c6..b670df38 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -322,15 +322,17 @@ class _clinic_listState extends State { String pharmaLiveCareQRCodeValue = widget.pharmacyLiveCareQRCode; Navigator.push( - context, - FadePage( - page: PaymentMethod( + context, + FadePage( + page: PaymentMethod( onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) { setState(() {}); }, patientShare: num.parse(getERAppointmentFeesList.total!), isFromAdvancePayment: widget.isPharmacyLiveCare, - ))).then((value) { + ), + ), + ).then((value) { if (value != null) { selectedPaymentMethod = value[0]; print(value); @@ -413,28 +415,28 @@ class _clinic_listState extends State { service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async { if (res["MessageStatus"] == 1) { await localContext!.read().initiateApplePayWithPayfort( - customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, - // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", - orderDescription: "LiveCare Payment", - orderAmount: double.parse(amount), - merchantReference: transID, - payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", - onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - GifLoaderDialogUtils.hideDialog(localContext!); - AppToast.showErrorToast(message: failureResult.toString()); - }, - onSuccess: (successResult) async { - GifLoaderDialogUtils.hideDialog(localContext!); - log("Payfort: ${successResult.responseMessage}"); - await localContext!.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); - checkPaymentStatus(appo); - }, - projectId: appo.projectID, - serviceTypeEnum: ServiceTypeEnum.appointmentPayment, - ); + customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", + orderDescription: "LiveCare Payment", + orderAmount: double.parse(amount), + merchantReference: transID, + payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", + onFailed: (failureResult) async { + log("failureResult: ${failureResult.toString()}"); + GifLoaderDialogUtils.hideDialog(localContext!); + AppToast.showErrorToast(message: failureResult.toString()); + }, + onSuccess: (successResult) async { + GifLoaderDialogUtils.hideDialog(localContext!); + log("Payfort: ${successResult.responseMessage}"); + await localContext!.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); + checkPaymentStatus(appo); + }, + projectId: appo.projectID, + serviceTypeEnum: ServiceTypeEnum.appointmentPayment, + ); } else { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: "An error occurred while processing your request");