I am trying to call
Scaffold.of(context).showSnackBar(SnackBar( content: Text(\"Snack text\"), ));
inside onPressed of fl
onPressed
fl
Add a Globalkey of the Scaffold state and use that to display snack bar as below,
GlobalKey scaffoldState; Scaffold { key: scaffoldState, .... scaffoldState.currentState.showSnackBar(new SnackBar(content: new Text('Hello!')));