I want to display a simple SnackBar inside Flutter\'s stateful widget. My application creates new instance of MaterialApp with a stateful widget ca
**
All the above solutions are amazing but as it's deprecated now you should use it this way.
var snackBar = SnackBar(content: Text('Hello World')); ScaffoldMessenger.of(_scaffoldKey.currentContext) .showSnackBar(snackBar );