'Flutter onResume for FCM keep showing after onLaunch already show the pop up

So I have the below code working perfectly but my major issue is if I get routed from the notification to the app to view the content of the notification and I successfully view the content and try to refresh the app page the notification kept showing after I already view the content. Can anyone help with to let the app know I already view the content with onResume or onLaunch or onMessage?


@override
  void initState() {
    // TODO: implement initState
    super.initState();

    _firebaseMessaging.configure(
      onMessage: (message) async{
        setState(() {
          messageTitle = message["notification"]["title"];
          notificationAlert = "New Notification Alert";
        });

      },
      onResume: (message) async{
        setState(() {
          messageTitle = message["data"]["title"];
          notificationAlert = "Application opened from Notification";
        });

      },   onLaunch: (message) async{
        setState(() {
          messageTitle = message["data"]["title"];
          notificationAlert = "Application opened from Notification";
        });

      },
    );
  }



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source