showConfirmPaymentModal static method
Displays a modal to confirm payment
Implementation
static Future<void> showConfirmPaymentModal(
final BuildContext context,
final String? currency,
final String amount,
final TextStyle textStyle,
final Color? dialogBackgroundColor,
final TextStyle modalCancelTextStyle,
final TextStyle modalContinueTextStyle,
final Function onContinuePressed,
) async {
return showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext buildContext) {
final transactionCurrency = currency ?? "USD";
return AlertDialog(
backgroundColor: dialogBackgroundColor,
content: Container(
margin: 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: textStyle,
// style: TextStyle(
// color: Colors.black,
// fontSize: 18,
// letterSpacing: 1.2,
// ),
),
),
actions: [
TextButton(
onPressed: () => {Navigator.of(context).pop()},
child: Text(
"CANCEL",
style: modalCancelTextStyle,
),
),
TextButton(
onPressed: () => onContinuePressed(),
child: Text(
"CONTINUE",
style: modalContinueTextStyle,
),
),
],
);
},
);
}