showSnackBar method

void showSnackBar(
  1. String message,
  2. BuildContext context,
  3. Color color, {
  4. Color? textColor,
})

Implementation

void showSnackBar(String message, BuildContext context, Color color,
    {Color? textColor}) {
  final snackBar = SnackBar(
      content: Text(
        message,
        style: Theme.of(context).textTheme.bodyText1!.copyWith(
            fontSize: 20, fontWeight: FontWeight.bold, color: textColor),
        textAlign: TextAlign.center,
      ),
      backgroundColor: color);
  ScaffoldMessenger.of(context).showSnackBar(snackBar);
}