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