error static method

void error(
  1. BuildContext context, {
  2. required String message,
  3. Duration duration = const Duration(seconds: 4),
  4. bool top = false,
  5. int maxLines = 4,
  6. double? iconSize,
  7. TextStyle? textStyle,
  8. Color? backgroundColor,
  9. Color? textColor,
  10. Color? shadowColor,
})

Helper for an ERROR toast.

Implementation

static void error(
  BuildContext context, {
  required String message,
  Duration duration = const Duration(seconds: 4),
  bool top = false,
  int maxLines = 4,
  double? iconSize,
  TextStyle? textStyle,
  Color? backgroundColor,
  Color? textColor,
  Color? shadowColor,
}) {
  show(
    context,
    message: message,
    icon: Icons.error_outline,
    backgroundColor: backgroundColor ?? Colors.red.shade700,
    textColor: textColor ?? Colors.white,
    duration: duration,
    top: top,
    maxLines: maxLines,
    iconSize: iconSize,
    textStyle: textStyle,
    shadowColor: shadowColor ?? Colors.red.shade900,
    elevation: 6.0,
  );
}