Код: Выделить всё
@Serializable
sealed class Screen {
@Serializable
data object Home : Screen()
@Serializable
data class Profile(val name: String) : Screen()
}
// error
val currentNavBackStackEntry: NavBackStackEntry? by navController.currentBackStackEntryAsState()
val currentScreen: Screen = currentNavBackStackEntry?.toRoute() ?: Screen.Home
Подробнее здесь: https://stackoverflow.com/questions/786 ... ck-compose
Мобильная версия