showSA static method

dynamic showSA(
  1. BuildContext context,
  2. String msg,
  3. Function onConfirm
)

Implementation

static showSA(BuildContext context, String msg, Function onConfirm) {
  SweetAlert.show(context,
      title: msg,
      style: SweetAlertStyle.confirm,
      showCancelButton: true, onPress: (bool isConfirm) {
    if (isConfirm) {
      //SweetAlert.show(context, style: SweetAlertStyle.success, title: "Success");
      // return false to keep dialog
      return onConfirm(isConfirm);
    }
    return onConfirm(isConfirm);
  });
}