title: How to navigate without context in flutter app?
body: <p>I have an app that recieves push notification using OneSignal. I have made a notification opened handler that should open specific screen on click of the notification. How can i navigate to a screen without context. or how can I open specific screen on app startup. My code:</p>
  
  <pre><code>OneSignal.shared.setNotificationOpenedHandler((notification) {
    var notify = notification.notification.payload.additionalData;
    if (notify["type"] == "message") {
      Navigator.of(context).push(
        MaterialPageRoute(
          builder: (context) =&gt; DM(user: notify['id']),
        ),
      );
    }
    if (notify["type"] == "user") {
      Navigator.of(context).push(
        MaterialPageRoute(
          builder: (context) =&gt; Profileo(notify["id"]),
        ),
      );
    }
    if (notify["type"] == "post") {
      Navigator.of(context).push(
        MaterialPageRoute(
          builder: (context) =&gt; ViewPost(notify["id"]),
        ),
      );
    }
  });
  </code></pre>
  
  <p>I am able to achieve this when the app is opened for the first time but It only opens the homepage If i close the app and even if I re-open it. I guess that is because the context is changed.</p>
  
  <p>Please Help!!</p>