showTSnackBar function

void showTSnackBar(
  1. BuildContext context,
  2. String message, {
  3. Color? color,
  4. bool? showCloseIcon,
  5. SnackBarAction? action,
  6. DismissDirection? dismissDirection,
  7. Color? closeIconColor,
  8. Color? backgroundColor,
  9. double? elevation,
  10. EdgeInsetsGeometry? margin,
  11. EdgeInsetsGeometry? padding,
  12. double? width,
  13. ShapeBorder? shape,
  14. HitTestBehavior? hitTestBehavior,
  15. SnackBarBehavior? behavior,
  16. double? actionOverflowThreshold,
  17. Duration duration = const Duration(milliseconds: 4000),
  18. bool? persist,
  19. Animation<double>? animation,
  20. void onVisible()?,
  21. Clip clipBehavior = Clip.hardEdge,
})

Implementation

void showTSnackBar(
  BuildContext context,
  String message, {
  Color? color,
  bool? showCloseIcon,
  SnackBarAction? action,
  DismissDirection? dismissDirection,
  Color? closeIconColor,
  Color? backgroundColor,
  double? elevation,
  EdgeInsetsGeometry? margin,
  EdgeInsetsGeometry? padding,
  double? width,
  ShapeBorder? shape,
  HitTestBehavior? hitTestBehavior,
  SnackBarBehavior? behavior,
  double? actionOverflowThreshold,
  Duration duration = const Duration(milliseconds: 4000),
  bool? persist,
  Animation<double>? animation,
  void Function()? onVisible,
  Clip clipBehavior = Clip.hardEdge,
}) {
  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(
      content: Text(message, style: TextStyle(color: color)),
      showCloseIcon: showCloseIcon,
      action: action,
      dismissDirection: dismissDirection,
      closeIconColor: closeIconColor,
      backgroundColor: backgroundColor,
      elevation: elevation,
      margin: margin,
      padding: padding,
      width: width,
      shape: shape,
      hitTestBehavior: hitTestBehavior,
      behavior: behavior,
      actionOverflowThreshold: actionOverflowThreshold,
      duration: duration,
      persist: persist,
      animation: animation,
      onVisible: onVisible,
      clipBehavior: clipBehavior,
    ),
  );
}