Does compose navigation support `NavType.StringArr...
# compose
n
Does compose navigation support
NavType.StringArrayType
in routes? If so how should the route look like?
🚫 1
i
You can write your own parsers for any type you want: https://developer.android.com/guide/navigation/navigation-kotlin-dsl#custom-types
but generally, you're misusing routes if you're passing lists of data directly as arguments. It would be helpful if you could explain what you are trying to do to avoid an XY Problem: https://xyproblem.info/
n
Thanks Ian! It's a "compose new message" screen, whose recipients box might be prefilled. We want to pass these optional recipients (e.g. contact ids) to this screen, ideally with the same format used by our server: example.com/newmessage?to=contact1&to=contact2 . A custom type should work though I guess we can't have multiple
to
s in the route.
i
We don't support duplicate query parameters at the moment, but I think that would actually be a pretty solid feature request to automatically support parsing array types if you'd like to file one: https://issuetracker.google.com/issues/new?component=409828&template=1093757
👍 1
n