An event is received from native code using EventChannel.
Content is String, and I'd like to show it with SnackBar.
But Scaffold.of returns null. And I found nothing to get BuildContext of Scaffold created by Widget Build(...).
The code is like this:
@override
void initState() {
super.initState();
showMsg.receiveBroadcastStream().listen(
(event) => setState(() {
Scaffold.of(context).showSnackBar(new SnackBar(
content: new Text(event.toString()),
));
}),
onError: (event) => {}
);