Skip to content

Instantly share code, notes, and snippets.

@GMetaxakis
Created May 20, 2022 06:21
Show Gist options
  • Save GMetaxakis/3e54ba74a6ea455787530d1cc80a65fa to your computer and use it in GitHub Desktop.
Save GMetaxakis/3e54ba74a6ea455787530d1cc80a65fa to your computer and use it in GitHub Desktop.
Nav Host
NavHost(navController = navController, startDestination = "profile"){
composable(route="profile") { Profile(navController) }
composable(route="friendslist") { FriendsList(navController) }
composable(route="friendprofile/{profile}", /**/) {
FriendProfile(navController, profile)
}
}
@Composable
fun Profile(navController: NavController){/*...*/}
@Composable
fun FriendsList(navController: NavController){/*...*/}
@Composable
fun FriendProfile(navController: NavController, profile:Profile?){/*...*/}
data class Profile(val firstName:String, val lastName:String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment