Skip to content

Instantly share code, notes, and snippets.

@raamcosta
Last active September 28, 2021 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raamcosta/49351957bda331b47fb43a1f6f53b1e2 to your computer and use it in GitHub Desktop.
Save raamcosta/49351957bda331b47fb43a1f6f53b1e2 to your computer and use it in GitHub Desktop.
Compose destinations approach - navigation
@Destination(route = "main_feed")
@Composable
fun MainFeedScreen(
//1. add an argument of type `DestinationsNavigator` (or `NavController`)
navigator: DestinationsNavigator
) {
//2. use the "withArgs" function on the generated Destination to safely create a route to navigate to
navigator.navigate(ProfileScreenDestination.withArgs(id = $id, isEditable = $isOwnUser))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment