successDialog static method

Future<void> successDialog({
  1. dynamic context,
  2. dynamic productName,
})

Implementation

static Future<void> successDialog({context, productName}) async {
  return showDialog(
      barrierDismissible: false,
      context: context,
      builder: (context) {
        return AlertDialog(
          elevation: 0,
          contentPadding: const EdgeInsets.all(0),
          backgroundColor: Colors.transparent,
          content: Card(
            color: WHITE,
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(10)),
            child: SizedBox(
              width: double.maxFinite,
              child: Wrap(
                children: <Widget>[
                  Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 15.0),
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.stretch,
                      children: <Widget>[
                        verticalSpace(),
                        Center(
                            child: Container(
                                decoration: const BoxDecoration(
                                    color: FILL_GREEN,
                                    shape: BoxShape.circle),
                                child: Padding(
                                  padding: const EdgeInsets.all(8.0),
                                  child: Image.asset(checkOut,
                                      height: 55,
                                      width: 55,
                                      package: 'mca_flutter_sdk'),
                                ))),
                        verticalSpace(),
                        const Center(
                          child: Text(
                            'Purchase Successful',
                            style: TextStyle(
                                fontWeight: FontWeight.w700, fontSize: 21),
                          ),
                        ),
                        verticalSpace(),
                        Text(
                            'You have just purchased \n$productName,\nKindly Check your email\nto complete your activation',
                            textAlign: TextAlign.center,
                            style: const TextStyle(fontSize: 14)),
                        verticalSpace(),
                        Padding(
                          padding: const EdgeInsets.all(35.0),
                          child: successButton(
                              text: 'Done',
                              onTap: () {
                                Navigator.pop(context);
                                Navigator.pop(context);
                              }),
                        ),
                        smallVerticalSpace(),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
        );
      });
}