showTSnackBar function
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 onVisible()?,
- 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,
),
);
}