If i pass boolean inside compose navigation route ...
# compose
i
If i pass boolean inside compose navigation route like url encoded param (ex:
login?authorized=true
) then later when i extract it from navigation arguments (Bundle) it appear there as
String
but not an as
Boolean
. It is a bug or feature? How can i pass
Boolean
between nav destinations without converting?
k
did you specify the argument type while defining the route. ref here https://developer.android.com/jetpack/compose/navigation#nav-with-args
Copy code
arguments = listOf(navArgument("authorized") { type = NavType.BooleanType })
☝️ 2
341 Views