0xf1f1
03/10/2024, 7:44 PMProfileScreen(onNavigateToFriends = { navController.navigate("friendsList") })
Sean Proctor
03/10/2024, 8:52 PMSean Proctor
03/10/2024, 8:56 PM@Composable
fun ProfileScreen(navigate: (NavigationDestination) -> Unit) { ... }
sealed interface NavigationDestination {
data object FriendsList : NavigationDestination
...
}
ProfileScreen(
navigate = { destination ->
when (destination) {
FriendsList -> navController.navigate("friendsList")
...
}
}
)
0xf1f1
03/10/2024, 9:04 PMProfileScreen(myViewModel::onClick)
Sean Proctor
03/10/2024, 9:06 PMSean Proctor
03/10/2024, 9:07 PMSean Proctor
03/10/2024, 9:09 PMSean Proctor
03/10/2024, 9:11 PMStylianos Gakis
03/10/2024, 11:56 PM