showSnackBar function

void showSnackBar(
  1. String msg,
  2. BuildContext context
)

Implementation

void showSnackBar(String msg, BuildContext context) {
  final snackBar = SnackBar(
    content: Text(msg),
    duration: Duration(milliseconds: 4000),
  );
  Scaffold.of(context).showSnackBar(snackBar);
}