showErrorToast static method

Future<void> showErrorToast(
  1. BuildContext context, {
  2. String? message,
  3. Widget? child,
  4. bool isClosable = false,
  5. double expandedHeight = 100,
  6. Color? backgroundColor,
  7. Color? shadowColor,
  8. Curve? slideCurve,
  9. Curve positionCurve = Curves.elasticOut,
  10. ToastLength length = ToastLength.short,
  11. DismissDirection dismissDirection = DismissDirection.down,
})

Implementation

static Future<void> showErrorToast(
  BuildContext context, {
  String? message,
  Widget? child,
  bool isClosable = false,
  double expandedHeight = 100,
  Color? backgroundColor,
  Color? shadowColor,
  Curve? slideCurve,
  Curve positionCurve = Curves.elasticOut,
  ToastLength length = ToastLength.short,
  DismissDirection dismissDirection = DismissDirection.down,
}) async {
  _showToast(
    context,
    message: message,
    messageStyle: const TextStyle(
      color: Colors.white,
    ),
    isClosable: isClosable,
    expandedHeight: expandedHeight,
    backgroundColor: backgroundColor ?? Colors.red,
    shadowColor: shadowColor ?? Colors.red.shade500,
    positionCurve: positionCurve,
    length: length,
    dismissDirection: dismissDirection,
    leading: const Icon(
      Icons.error,
      color: Colors.white,
    ),
    child: child,
  );
}