showConfirmation static method

void showConfirmation(
  1. BuildContext context, {
  2. String? title,
  3. bool showClose = false,
  4. dynamic content,
  5. dynamic cancel = 'Cancel',
  6. dynamic confirm = 'Confirm',
  7. Color? cancelBgColor,
  8. Color? confirmBgColor,
  9. Color? cancelTextColor,
  10. Color? confirmTextColor,
  11. VoidCallback? onCancelPress,
  12. VoidCallback? onConfirmPress,
  13. bool barrierDismissible = true,
})

Implementation

static void showConfirmation(
  BuildContext context, {
  String? title,
  bool showClose = false,
  dynamic content,
  dynamic cancel = 'Cancel',
  dynamic confirm = 'Confirm',
  Color? cancelBgColor,
  Color? confirmBgColor,
  Color? cancelTextColor,
  Color? confirmTextColor,
  VoidCallback? onCancelPress,
  VoidCallback? onConfirmPress,
  bool barrierDismissible = true,
}) {
  showDialog(
      context: context,
      barrierDismissible: barrierDismissible,
      builder: (context) {
        return WillPopScope(
          onWillPop: () async => barrierDismissible,
          child: AlertDialog(
            contentPadding: EdgeInsets.zero,
            content: _VxDialog(
              title: title,
              showClose: showClose,
              content: content,
              cancel: cancel,
              confirm: confirm,
              cancelBgColor: cancelBgColor,
              confirmBgColor: confirmBgColor,
              cancelOnPress: onCancelPress,
              confirmOnPress: onConfirmPress,
            ),
            shape: RoundedRectangleBorder(borderRadius: _borderRadius),
          ),
        );
      });
}