title: Flutter : trigger a change of screen on a websocket message
body: <p><br>
  I'm currently working on a flutter app with a websocket.
  I want to change the current screen with a <code>Navigator.pushNamed(context, '/path')</code> in the method that is triggered by the websocket on a new message. The problem is that I don't have any <code>context</code> in this method.</p>
  
  <p>So how to change the current screen from this method ?<br>
  I dont know if I'm thinking in the wrong way or if I just don't understand something.</p>
  
  <p>Here is the method that is triggered on a new websocket message, his class is not a widget. This object is contained in every screen I create but his variable <code>_parent</code> is always set to match the active screen.</p>
  
  <pre><code>   onMessageReceived(data) {
          print("new message: " + data + " !");
          data = jsonDecode(data);
          data.forEach((key, value) {
            switch (key) {
              case "state":
                _parent.newState(value);
                break;
            }
        });
    }
  </code></pre>
  
  <p>Here is the method of the widget:</p>
  
  <pre><code>  newState(state){
      if(state == "start"){
        Navigator.pushNamed(, "/path");
      }
    }
  </code></pre>
  
  <p>Thanks in advance</p>