Last active
September 7, 2021 17:33
-
-
Save AfzalivE/06dfcd7de37414a0ecc11254aee64a3f to your computer and use it in GitHub Desktop.
jetpack compose navigation
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
dependencies { | |
// other dependencies | |
implementation "androidx.compose.navigation:navigation:1.0.0-SNAPSHOT" | |
} |
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
allprojects { | |
repositories { | |
// .. existing repositories | |
maven { url = 'https://androidx.dev/snapshots/builds/[buildId]/artifacts/ui/repository' } | |
} | |
} |
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
@Composable | |
fun Profile() { | |
val navController = AmbientNavController.current | |
Column(modifier = Modifier.fillMaxSize().then(Modifier.padding(8.dp))) { | |
Text(text = Screen.Profile.title) | |
Button( | |
onClick = { navController.navigate("Dashboard") }, | |
) { | |
Text("Open Dashboard") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment