showSnackBar method
void
showSnackBar(
- BuildContext context, {
- Duration duration = const Duration(milliseconds: 500),
- TextStyle? style,
- Color? backgroundColor,
- TextDirection? direction,
Implementation
void showSnackBar(
BuildContext context, {
Duration duration = const Duration(milliseconds: 500),
TextStyle? style,
Color? backgroundColor,
TextDirection? direction,
}) {
try {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: backgroundColor ?? Colors.white,
content: Text(
this,
textDirection: direction,
style: style ?? const TextStyle(color: Colors.white),
),
duration: duration,
),
);
} catch (e) {
Logger('SnackBar').severe(e);
}
}