Forum Discussion

Papes96's avatar
Papes96
Copper Contributor
Apr 08, 2023

is TwoPaneBackStackEntry composable list of routes incompatible with arguments / URI Routes?

Hello,

I am doing some tests on the SDK and have encountered a roadblock. Currently, my application uses route arguments to find item details. However, upon navigating to them, the following exception is returned:

java.lang.IllegalArgumentException: Invalid route item/4, not present in list of routes [home?, items?, item/{itemId}, ...]

 
I am unsure if this is a problem stemming from the fact that listOf[Routes] cannot take into account those values or if it is an error on my end. Could you please clarify?

Thank you for all your hard work!

6 Replies

  • Hi tscholze and Papes96, thanks for your questions.

    Unfortunately, you're right that the current implementation does not support arguments in the list of routes. While we work on a fix for this, I hope you can continue to use the original TwoPaneLayout composable to provide more flexibility.

     

    Sorry for the inconvenience and thanks for providing feedback!

    • tscholze's avatar
      tscholze
      Iron Contributor

      khalper Thanks for the tip!

       

      Do you have any rough ETA on which the "new approach" will support parameters? šŸ™‚

      • khalper's avatar
        khalper
        Icon for Microsoft rankMicrosoft
        tscholze I unfortunately don't have an ETA at the moment, but I will make sure to reply to this thread with any updates/release information! Thanks for your patience šŸ™‚
  • tscholze's avatar
    tscholze
    Iron Contributor

    Papes96 khalper it seems that I may hit the same road block?

     

    Code

    https://github.com/tscholze/kotlin-kmm-kennzeichner/blob/t.scholze/8-dual-screen-support/app/androidApp/src/main/java/io/github/tscholze/kennzeichner/android/composables/screens/NavigationContainer.kt#L12

     

    Stack trace

    ā€ƒ

    • Papes96's avatar
      Papes96
      Copper Contributor
      I tried a lot of things but I think it may be a limitation of the library given how it handles the routes as a list.

      For now I continued using the library using the twopane composable (without nav), this allows some flexibility in other places where I was sure the twopanenav wouldn't work out.

      It would be nice to find a fix/workaround for this anyways.

Resources