showConfirmPaymentModal static method

Future<void> showConfirmPaymentModal(
  1. BuildContext context,
  2. String? currency,
  3. String amount,
  4. TextStyle textStyle,
  5. Color? dialogBackgroundColor,
  6. TextStyle modalCancelTextStyle,
  7. TextStyle modalContinueTextStyle,
  8. Function onContinuePressed,
)

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,
            ),
          ),
        ],
      );
    },
  );
}