showTSnackBarError function

void showTSnackBarError(
  1. BuildContext context,
  2. String message, {
  3. bool? showCloseIcon,
  4. SnackBarAction? action,
  5. DismissDirection? dismissDirection,
  6. Color? closeIconColor,
})

Implementation

void showTSnackBarError(
  BuildContext context,
  String message, {
  bool? showCloseIcon,
  SnackBarAction? action,
  DismissDirection? dismissDirection,
  Color? closeIconColor,
}) {
  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(
      content: Text(message, style: TextStyle(color: Colors.white)),
      showCloseIcon: showCloseIcon,
      action: action,
      dismissDirection: dismissDirection,
      closeIconColor: closeIconColor,
      backgroundColor: Colors.red,
    ),
  );
}