-
-
Save dilrajsingh1997/5f955cfc76300025503796e3c82f5542 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
@Composable | |
fun DemoScreen() { | |
val navController = rememberNavController() | |
val graph = remember(navController) { | |
NavigationGraph(navController) | |
} | |
NavHost( | |
navController = navController, | |
startDestination = "home" | |
) { | |
composable( | |
route = "home", | |
arguments = listOf() | |
) { backStackEntry -> | |
Box(modifier = Modifier.fillMaxSize()) { | |
Column( | |
modifier = Modifier.align(Alignment.Center), | |
horizontalAlignment = Alignment.CenterHorizontally | |
) { | |
Text(text = "This is home page", textAlign = TextAlign.Center) | |
Spacer(modifier = Modifier.height(20.dp)) | |
Button(onClick = { graph.openUserPage(UUID.randomUUID().toString(), false) }) { | |
Text(text = "Go to user page", textAlign = TextAlign.Center) | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment