displaySnack function
void
displaySnack(
- BuildContext context, {
- String? text,
- Color? color,
- dynamic onPressed()?,
- Color textColor = Colors.white,
Creates a simple snackbr
Implementation
void displaySnack(BuildContext context,
{String? text,
Color? color,
Function()? onPressed,
Color textColor = Colors.white}) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
elevation: 40,
content: Text(
text!,
textAlign: TextAlign.center,
),
backgroundColor: Colors.red,
duration: Duration(seconds: 2),
));
}