showSnackBar static method
void
showSnackBar({})
Implementation
static void showSnackBar(
{required BuildContext context,
required dynamic content,
int seconds = 5,
Color? backgroundColor,
double? borderRadius = 5,
double? fontSize = 12,
double? elevation = 5,
double? allPadding = 10}) {
ScaffoldMessenger.maybeOf(context)?.showSnackBar(SnackBar(
content: Text("$content",
softWrap: true,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w600,
color: Theme.of(context).primaryColor,
fontSize: fontSize?.spMin)),
behavior: SnackBarBehavior.floating,
padding: fontSize?.spMin.padding,
elevation: elevation?.spMin,
key: UniqueKey(),
clipBehavior: Clip.antiAliasWithSaveLayer,
duration: Duration(seconds: seconds),
backgroundColor: backgroundColor ?? Theme.of(context).primaryColorLight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius?.spMin ?? 0)),
));
}