how to open particular screen on clicking on push notification for flutter

前端 未结 6 1877
我寻月下人不归
我寻月下人不归 2020-12-02 07:14

I am trying to achieve open specific screen on clicking push notification and my payload looks like this:

 var payload = {
        notification: {
                  


        
6条回答
  •  失恋的感觉
    2020-12-02 07:48

        onLaunch: (Map message) {
          print("I am here onLaunch");
          print(message);
          Navigator.push(
           context,
           MaterialPageRoute(
            builder: (context) => ScreenA()
           )
          );
        },
        onResume: (Map message) {
          print("I am here onResume");
          print(message);
          Navigator.push(
           context,
           MaterialPageRoute(
            builder: (context) => ScreenA()
           )
          );
        },
    

    try this

提交回复
热议问题