How to navigate without context in flutter app?

后端 未结 2 2069
一生所求
一生所求 2020-12-06 04:56

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 c

2条回答
  •  一生所求
    2020-12-06 05:12

    You can use this wonderful plugin: https://pub.dev/packages/get

    Description from the package: A consistent navigation library that lets you navigate between screens, open dialogs, and display snackbars from anywhere in your code without context.

    Get.to(NextScreen()); // look at this simplicity :)
    Get.back(); //  pop()
    Get.off(NextScreen()); // clears the previous routes and opens a new screen.
    

提交回复
热议问题