showPaymentWarningDialog method
Implementation
Future<void> showPaymentWarningDialog(BuildContext context, {DateTime? expiryDate}) async {
if (!isAgreedTerms.value) {
return CustomFlashWidget.showFlashMessage(
type: FlashType.error,
title: "Important",
message:
"Please review and accept our terms and conditions to access our services. Failure to do so will prevent you from proceeding",
);
}
if (!isAgreedPayment.value) {
return CustomFlashWidget.showFlashMessage(
type: FlashType.error,
title: "Important",
message:
"Please review and accept our terms and conditions to access our services. Failure to do so will prevent you from proceeding",
);
}
//Todo: later
// if (!isAgreedExclusive.value) {
// return CustomFlashWidget.showFlashMessage(
// type: FlashType.error,
// title: "Important",
// message:
// "Please review and accept our terms and conditions to access our services. Failure to do so will prevent you from proceeding",
// );
// }
if (!isAgreedExclusivePlus.value && !paymentDetails.value.isNonDiscounted) {
return CustomFlashWidget.showFlashMessage(
type: FlashType.error,
title: "Important",
message:
"Please review and accept our terms and conditions to access our services. Failure to do so will prevent you from proceeding",
);
}
// if (selectedWalletType.value == '') {
// return DefaultSnackbar.show(
// "Important", "Please select wallet type from mentioned wallets");
// }
if (!paymentDetails.value.isNonDiscounted) {
ImportantPaymentDialog.show(
onAgree: () async {
closeDialog();
paymentType.value = PaymentType.flightBooking;
if (expiryDate != null) {
paymentExpireStartDate.value = expiryDate;
}
if (selectedPaymentMethod.value == PaymentMethod.cryptoCurrency) {
getAllCryptoCurrencies();
} else {
initiateCardPayment();
}
},
);
} else {
paymentType.value = PaymentType.flightBooking;
if (selectedPaymentMethod.value == PaymentMethod.cryptoCurrency) {
getAllCryptoCurrencies();
} else {
initiateCardPayment();
}
}
}