showSnackbar static method

dynamic showSnackbar(
  1. BuildContext context,
  2. dynamic message
)

Implementation

static showSnackbar(BuildContext context, message){
  final snackBar = SnackBar(
    duration: Duration(seconds: 4),
    content: Text(message),
  );
// Find the ScaffoldMessenger in the widget tree
// and use it to show a SnackBar.
  ScaffoldMessenger.of(context).showSnackBar(snackBar);
}