showSnackBar function

void showSnackBar(
  1. BuildContext context,
  2. String message, {
  3. Duration duration = defaultSnackBarDuration,
  4. Color? bgColor,
})

Implementation

void showSnackBar(BuildContext context, String message,
    {Duration duration = defaultSnackBarDuration, Color? bgColor}) {
  ScaffoldMessenger.of(context).showSnackBar(SnackBar(
      content: Text(message),
      backgroundColor: bgColor ?? const Color(0xffAD69F1),
      duration: duration));
}