flutter show alert dialog without context code example
Example: flutter display alert dialog after server error
Provider.of<NewsProvider>(context, listen: false)
.fetchAndSetNewsList()
.catchError((error) => showDialog(context: context, builder: (context) {
return new SimpleDialog(
children: <Widget>[
new Center(child: new Container(child: new Text('foo')))
]);
}))