title: How to push open a page from a notification flutter
body: <p>I have my method that loads firebase cloud messaging and listens for incoming messages as follows.</p>
  <pre><code>void loadFCM() async {
      if (!kIsWeb) {
        channel = const AndroidNotificationChannel(
          'high_importance_channel', // id
          'High Importance Notifications', // title
          importance: Importance.high,
          enableVibration: true,
        );
  
    flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
  
    /// Create an Android Notification Channel.
    ///
    /// We use this channel in the `AndroidManifest.xml` file to override the
    /// default FCM channel to enable heads up notifications.
    await flutterLocalNotificationsPlugin
        .resolvePlatformSpecificImplementation&lt;
            AndroidFlutterLocalNotificationsPlugin&gt;()
        ?.createNotificationChannel(channel);
  
    /// Update the iOS foreground notification presentation options to allow
    /// heads up notifications.
    await FirebaseMessaging.instance
        .setForegroundNotificationPresentationOptions(
      alert: true,
      badge: true,
      sound: true,
    );
  }
  }
  
  
  
  void listenFCM() async {
      FirebaseMessaging.onMessage.listen((RemoteMessage message) {
        RemoteNotification? notification = message.notification;
        AndroidNotification? android = message.notification?.android;
        if (notification != null &amp;&amp; android != null &amp;&amp; !kIsWeb) {
          flutterLocalNotificationsPlugin.show(
            notification.hashCode,
            notification.title,
            notification.body,
            NotificationDetails(
              android: AndroidNotificationDetails(
                channel.id,
                channel.name,
                icon: 'launch_background',
              ),
            ),
          );
  if (message.data['screen'] == 'chat') {
            Navigator.of(context).push(
              MaterialPageRoute(
                builder: (context) =&gt; ChatScreen(
                  uid: message.data['uid'],
                ),
              ),
            );
          }
        }
      });
    }
  </code></pre>
  <p>As seen I'm storing the screen I want in the data of the screen I want when I send the message and have code in the listenFCM function to attempt to change the screen but it wont work, I receive the notification but dont change screen. I'm currently using this method to send a message to a specific user</p>
  <pre><code>void sendPushMessage(String token, String body, String title) async {
      try {
        await http.post(
          Uri.parse('https://fcm.googleapis.com/fcm/send'),
          headers: &lt;String, String&gt;{
            'Content-Type': 'application/json',
            'Authorization': 'key=${api}',
          },
          body: jsonEncode(
            &lt;String, dynamic&gt;{
              'notification': &lt;String, dynamic&gt;{'body': body, 'title': title},
              'priority': 'high',
              'data': &lt;String, dynamic&gt;{
                'click_action': 'FLUTTER_NOTIFICATION_CLICK',
                'id': '1',
                'status': 'done'
                'screen': 'chat'
              },
              &quot;to&quot;: token,
            },
          ),
        );
      } catch (e) {
        print(&quot;error push notification&quot;);
      }
    }
  </code></pre>
  <p>Im trying to modify it so I can send a push notification they open a chat page. it would be a chat(userid) sort of thing but I dont want to send the chatId in the body of the notification or anything so how can I have my app push open my chat page when tapped from app close/open etc, Thanks for reading!</p>