Pablo
07/18/2024, 4:12 PMStylianos Gakis
07/18/2024, 4:30 PMenum class Screen {
One, Two, Three
}
fun App() {
var screen by remember { mutableStateOf(Screen.One) }
Surface(Modifier.fillMaxSize()) {
when(screen) {
One -> ScreenOne(navigateToTwo = { screen = Screen.Two })
Two -> ScreenTwo(navigateToThree = { screen = Screen.Three })
Three -> ScreenThree()
}
}
}
and as you change your state, a different screen will show. You don't need a navigation library just for this. But for a real project, some sort of navigation library is probably a good idea. androidx.navigation is just one of the options, but there are more.Pablo
07/18/2024, 4:47 PM