title: Flutter + FCM: Cant change UI in onMessage method
body: <p>I use Firebase FCM in Flutter to inform the App when a message is received. The initState method of my widget (which returns a Scaffold) looks like this:</p>
  <pre><code>@override
  void initState() {
  super.initState();
  
  FcmService(_fcm).saveDeviceToken();
  
  _fcm.configure(
    onMessage: (Map&lt;String, dynamic&gt; message) async {
      print('Notification received');
  
      final snackbar = SnackBar(
        content: Text(message['notification']['title']),
        action: SnackBarAction(
          label: 'Go',
          onPressed: () =&gt; null,
        ),
      );
      Scaffold.of(context).showSnackBar(snackbar);
    },
  );
  }
  </code></pre>
  <p>When a message is sent to the device, the print is executed, so everything should work fine, but the SnackBar doesn't show up. I also tried showing an AlertDialog or just using setState and changing a variable displayed on a label to test whether this is a SnackBar exclusive thing, but it isn't. Nothing changed, although the method is executed.</p>