Snack function

dynamic Snack(
  1. String msg,
  2. BuildContext ctx,
  3. Color color
)

Implementation

Snack(String msg, BuildContext ctx, Color color) {
  var snackBar = SnackBar(
      backgroundColor: color,
      content: Text(
        msg,
        textAlign: TextAlign.center,
      ));
  ScaffoldMessenger.of(ctx).showSnackBar(snackBar);
}