showError static method

void showError(
  1. BuildContext context, {
  2. String? message,
  3. bool forbidClick = false,
  4. double? iconSize,
  5. Color? iconColor,
  6. Color? textColor,
  7. double? fontSize,
  8. VoidCallback? onHide,
})

Implementation

static void showError(
  BuildContext context, {

  /// Message of the toast
  String? message,

  /// Whether to forbid click
  bool forbidClick = false,

  /// Size of the icon
  double? iconSize,

  /// Color of the icon
  Color? iconColor,

  /// Text color of the toast
  Color? textColor,

  /// Font size of the toast
  double? fontSize,
  VoidCallback? onHide,
}) {
  show(
    context,
    message: message,
    position: BetterToastPosition.center,
    forbidClick: forbidClick,
    width: 120.bw,
    height: 120.bw,
    icon: Icon(
      Icons.error,
      color: iconColor ?? Colors.white,
      size: iconSize ?? 40.bw,
    ),
    textColor: textColor,
    onHide: onHide,
  );
}