showAlertDialog static method

Future<bool> showAlertDialog(
  1. BuildContext context, {
  2. required AlertType alertType,
  3. String? title,
  4. String? subTitle,
  5. required String okText,
  6. Color? okColor,
  7. String? cancelText,
  8. Color? cancelColor,
})

Implementation

static Future<bool> showAlertDialog(BuildContext context,
    {required AlertType alertType, String? title, String? subTitle, required String okText, Color? okColor, String? cancelText, Color? cancelColor}) async {
  return await showCustomDialog(
      context,
      GeneralDialog(
        title: title,
        subTitle: subTitle,
        yesAction: okText,
        yesColor: okColor,
        cancelAction: cancelText,
        cancelColor: cancelColor,
        icon: Icon(
          alertType == AlertType.success
              ? Icons.check_circle
              : alertType == AlertType.info
                  ? Icons.info_rounded
                  : alertType == AlertType.warning
                      ? Icons.warning_rounded
                      : Icons.error,
          size: 70,
          color: alertType == AlertType.success
              ? PrettyToast.successColor
              : alertType == AlertType.info
                  ? PrettyToast.infoColor
                  : alertType == AlertType.warning
                      ? PrettyToast.warningColor
                      : PrettyToast.errorColor,
        ),
      ));
}