Last active
September 28, 2021 01:01
-
-
Save raamcosta/bf4cb1bcdcb60dca45288986552c3709 to your computer and use it in GitHub Desktop.
Using Compose Destinations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//region Screen Composables | |
@Destination(route = "profile") | |
@Composable | |
fun ProfileScreen( | |
id: String, | |
isEditable: Boolean = false | |
) {/*...*/} | |
@Destination(route = "login", start = true) | |
@Composable | |
fun LoginScreen() {/*...*/} | |
@Destination(route = "main_feed") | |
@Composable | |
fun MainFeedScreen( | |
navigator: DestinationsNavigator | |
) { | |
//... | |
navigator.navigate(ProfileScreenDestination.withArgs(id = $id, isEditable = $isOwnUser)) | |
} | |
@Destination("search") | |
@Composable | |
fun SearchScreen() {/*...*/} | |
//endregion | |
//region NavHost (surely this is not all.. right? 😮) | |
Destinations.NavHost(navController = navController) | |
//endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment