showConfirmPaymentModal static method
Future<void>
showConfirmPaymentModal(
- BuildContext context,
- double amount,
- Function onContinuePressed
Displays a modal to confirm payment
Implementation
static Future<void> showConfirmPaymentModal(
final BuildContext context,
final double amount,
final Function onContinuePressed) async => showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext buildContext) {
const transactionCurrency = "NGN";
return AlertDialog(
backgroundColor: Colors.white,
content: Container(
margin: const EdgeInsets.fromLTRB(20, 5, 20, 5),
child: Text(
"You will be charged a total of $transactionCurrency "
"$amount. Do you wish to continue? ",
textAlign: TextAlign.center,
style: blackTextStyle.copyWith(
color: hexToColor(paymentBlueBackgroundColor),
fontSize: 18,
letterSpacing: 1.2,
),
),
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text(
"CANCEL",
style: blackTextStyle.copyWith(
color: hexToColor(redColor),
fontSize: 12,
letterSpacing: 1,
),
),
),
TextButton(
onPressed: () => onContinuePressed(),
child: Text(
"CONTINUE",
style: blackTextStyle.copyWith(
color: hexToColor(paymentBlueBackgroundColor),
fontSize: 12,
letterSpacing: 1,
),
),
),
],
);
},
);