Skip to content

Instantly share code, notes, and snippets.

@sasssass
Created June 17, 2024 09:28
Show Gist options
  • Save sasssass/54ef0d50dafcabf180d247ccc66d3761 to your computer and use it in GitHub Desktop.
Save sasssass/54ef0d50dafcabf180d247ccc66d3761 to your computer and use it in GitHub Desktop.
ScreenWithOptionalArguments.kt
@NavigationNode(route = "screen_with_optional_arguments", args = arrayOf("id", "name"),
optionalArgs = arrayOf("age","nickName")
)
@Composable
fun ScreenWithOptionalArguments(
id: String,
name: String,
nickName: String?,
age: String?
) {
Column(modifier = Modifier.fillMaxSize()) {
Text(text = "OK, you're $name with id as $name, your nick name is ${nickName?:"Undefined"}, and your age is ${age?:"Undefined"}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment