Last active
September 8, 2022 11:00
-
-
Save raamcosta/7f749ce2691074bc842268411a2da227 to your computer and use it in GitHub Desktop.
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
@Destination(start = true) | |
@Composable | |
fun LoginScreen( | |
navigator: DestinationsNavigator | |
) { | |
/*...*/ | |
Button (onClick = { navigator.navigate(HomeScreenDestination) } | |
/*...*/ | |
} | |
@Destination | |
@Composable | |
fun HomeScreen( | |
navigator: DestinationsNavigator | |
) { | |
/*...*/ | |
Button( | |
onClick = { | |
navigator.navigate( | |
ProfileScreenDestination( | |
id = "someId", | |
isEditable = true | |
) | |
) | |
} | |
) { | |
/*...*/ | |
Button(onClick = { navigator.navigate(SearchScreenDestination(query = "query")) }) { | |
/*...*/ | |
} | |
@Destination | |
@Composable | |
fun ProfileScreen( | |
id: String, | |
isEditable: Boolean = false | |
) { /*...*/ } | |
@Destination | |
@Composable | |
fun SearchScreen( | |
query: String? | |
) { /*...*/ } | |
// Navigation.kt file________________________ | |
DestinationsNavHost(navGraph = NavGraphs.root) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a niiiice work, I really like this library