showSnackBar static method
void
showSnackBar({
- required BuildContext context,
- required String message,
- Duration? duration,
- Color? backgroundColor,
- SnackBarBehavior behavior = SnackBarBehavior.floating,
Show Snackbar
Implementation
static void showSnackBar(
{required BuildContext context,
required String message,
Duration? duration,
Color? backgroundColor,
SnackBarBehavior behavior = SnackBarBehavior.floating}) {
if (duration == null) duration = Duration(seconds: 2);
if (backgroundColor == null) {
backgroundColor = theme()!.secondaryHeaderColor;
}
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(message),
backgroundColor: backgroundColor,
behavior: behavior,
duration: duration,
));
}