merge-update-with-lab-changes
haroon amjad 2 years ago
parent 11a43eb0ae
commit 5e8fe20f52

@ -51,8 +51,11 @@ class DoctorView extends StatefulWidget {
class _DoctorViewState extends State<DoctorView> with AutomaticKeepAliveClientMixin { class _DoctorViewState extends State<DoctorView> with AutomaticKeepAliveClientMixin {
late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
super.build(context); super.build(context);
return InkWell( return InkWell(
onTap: () { onTap: () {
@ -217,7 +220,7 @@ class _DoctorViewState extends State<DoctorView> with AutomaticKeepAliveClientMi
} }
getDoctorsProfile(context, DoctorList docObject, {isAppo, bool isContinueDentalPlan = false}) { getDoctorsProfile(context, DoctorList docObject, {isAppo, bool isContinueDentalPlan = false}) {
int languageID = context.read<ProjectViewModel>().isArabic ? 1 : 2; int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = []; List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();

@ -322,15 +322,17 @@ class _clinic_listState extends State<ClinicList> {
String pharmaLiveCareQRCodeValue = widget.pharmacyLiveCareQRCode; String pharmaLiveCareQRCodeValue = widget.pharmacyLiveCareQRCode;
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: PaymentMethod( page: PaymentMethod(
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {}); setState(() {});
}, },
patientShare: num.parse(getERAppointmentFeesList.total!), patientShare: num.parse(getERAppointmentFeesList.total!),
isFromAdvancePayment: widget.isPharmacyLiveCare, isFromAdvancePayment: widget.isPharmacyLiveCare,
))).then((value) { ),
),
).then((value) {
if (value != null) { if (value != null) {
selectedPaymentMethod = value[0]; selectedPaymentMethod = value[0];
print(value); print(value);
@ -413,28 +415,28 @@ class _clinic_listState extends State<ClinicList> {
service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async { service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async {
if (res["MessageStatus"] == 1) { if (res["MessageStatus"] == 1) {
await localContext!.read<PayfortViewModel>().initiateApplePayWithPayfort( await localContext!.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "LiveCare Payment", orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount), orderAmount: double.parse(amount),
merchantReference: transID, merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async { onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}"); log("failureResult: ${failureResult.toString()}");
GifLoaderDialogUtils.hideDialog(localContext!); GifLoaderDialogUtils.hideDialog(localContext!);
AppToast.showErrorToast(message: failureResult.toString()); AppToast.showErrorToast(message: failureResult.toString());
}, },
onSuccess: (successResult) async { onSuccess: (successResult) async {
GifLoaderDialogUtils.hideDialog(localContext!); GifLoaderDialogUtils.hideDialog(localContext!);
log("Payfort: ${successResult.responseMessage}"); log("Payfort: ${successResult.responseMessage}");
await localContext!.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); await localContext!.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo); checkPaymentStatus(appo);
}, },
projectId: appo.projectID, projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment, serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
); );
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request"); AppToast.showErrorToast(message: "An error occurred while processing your request");

Loading…
Cancel
Save