snackbar static method
dynamic
snackbar(})
Show a snackbar
Implementation
static snackbar(
BuildContext context,
String message, {
bool? showCloseIcon,
int? seconds,
TextStyle? textStyle,
int maxLines = 2,
TextAlign textAlign = TextAlign.center,
Color? backgroundColor,
Color? closeIconColor,
}) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
behavior: SnackBarBehavior.floating,
backgroundColor: backgroundColor,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
elevation: 0,
content: Text(
message,
textAlign: textAlign,
maxLines: maxLines,
style: textStyle,
),
showCloseIcon: showCloseIcon ?? true,
closeIconColor: closeIconColor,
duration: Duration(seconds: seconds ?? 4),
),
);
}