skip to Main Content

I want to use Get.toNamed from a nested bottom sheet (bottom sheet called from a bottom sheet). However, it is not working. I think it’s because the context is different. If I was using Navigator, Navigator.of(context, rootNavigator: true).pushNamed("/route"); this would work. However, in my case, I must use the GetX router because the given route is taking in arguments from Get.arguments. Is there any workaround to make Get.toNamed work?

2

Answers


  1. Chosen as BEST ANSWER

    I realized that Get.arguments can read arguments even if Navigator was used to come to a route. So I just used Navigator.of(context, rootNavigator: true).pushNamed('/home', arguments: {'tab': 2});


  2. It’s hard to see where the problem is without looking at you code. GetX is just a wrapper around Navigator, so both should work.

    Try

    Get.offAndToNamed<void>()
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search