brabo-hi
01/27/2022, 11:27 PM<https://developer.android.com/guide/navigation/navigation-pass-data#supported_argument_types>
navigation can accept a nullable string as parameter. Should we ignore the null argument ?brabo-hi
01/27/2022, 11:28 PMcomposable(route = "person/{id}") {
val id = it.arguments?.getString("id") // here i am getting the word `null` as as string instead of String? = null
}
navController.navigate("person/${null}")
Ian Lake
01/27/2022, 11:31 PMperson/null
, you will get the ID of null
, just like you said it should be; there's no string interpretation being done for path parameters (which are always required parameters). Optional arguments are in the form of query parameters (where what you'd navigate to is person
, which would match a route of `person?id={id}`: https://developer.android.com/jetpack/compose/navigation#optional-argsbrabo-hi
01/27/2022, 11:36 PMIan Lake
01/27/2022, 11:44 PM