showSnackBar method
void
showSnackBar({})
showSnackBar shows a snackbar message.
backgroundColor
is green by default.
foregroundColor
is white by default.
Implementation
void showSnackBar(
{required String message,
Color backgroundColor = Colors.green,
Color foregroundColor = Colors.white,
Duration displayDuration = const Duration(seconds: 4),
bool showCloseIcon = true}) {
ScaffoldMessenger.of(this).showSnackBar(SnackBar(
content: Text(message, style: TextStyle(color: foregroundColor)),
backgroundColor: backgroundColor,
duration: displayDuration,
showCloseIcon: showCloseIcon,
closeIconColor: foregroundColor,
));
}