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