showError static method
void
showError(
- String message, {
- SnackBarAction? action,
- EdgeInsetsGeometry? margin,
- SnackBarBehavior? behavior,
- ShapeBorder? shape,
- DismissDirection dismissDirection = DismissDirection.down,
Implementation
static void showError(
String message, {
SnackBarAction? action,
EdgeInsetsGeometry? margin,
SnackBarBehavior? behavior,
ShapeBorder? shape,
DismissDirection dismissDirection = DismissDirection.down,
}) {
if (scaffoldMessengerKey.currentState?.mounted == true) {
scaffoldMessengerKey.currentState?.showSnackBar(
SnackBar(
backgroundColor: Colors.red,
shape: shape,
margin: margin,
behavior: behavior,
dismissDirection: dismissDirection,
content: Text(message),
action: action ??
const SnackBarAction(
label: 'Dismiss',
onPressed: DjangoflowAppSnackbar.dismiss,
textColor: Colors.white,
),
duration: const Duration(seconds: 15),
),
);
}
}