warning static method

void warning(
  1. BuildContext context, {
  2. required String message,
  3. int duration = 2,
  4. ToastPosition position = ToastPosition.bottom,
  5. ToastAlignment alignment = ToastAlignment.center,
  6. ToastStyle style = ToastStyle.simple,
  7. TextStyle? textStyle,
  8. TextAlign textAlign = TextAlign.left,
  9. bool onClose = false,
  10. Curve animationCurve = Curves.easeInOut,
})

Displays a warning toast message.

(Same parameters as success)

Implementation

static void warning(
  BuildContext context, {
  required String message,
  int duration = 2,
  ToastPosition position = ToastPosition.bottom,
  ToastAlignment alignment = ToastAlignment.center,
  ToastStyle style = ToastStyle.simple,
  TextStyle? textStyle,
  TextAlign textAlign = TextAlign.left,
  bool onClose = false,
  Curve animationCurve = Curves.easeInOut,
}) {
  _showToast(
    context,
    animationCurve: animationCurve,
    message: message,
    type: ToastType.warning,
    duration: duration,
    position: position,
    alignment: alignment,
    style: style,
    textStyle: textStyle,
    textAlign: textAlign,
    onClose: onClose,
  );
}