Hi im trying out the new safe args in Navigation C...
# compose-android
s
Hi im trying out the new safe args in Navigation Compose and this is my destination hierarchy:
Copy code
@Serializable
open class Destination

sealed class ProfileDestination: Destination() {
    @Serializable
    data object ProfileGraph: ProfileDestination()

    @Serializable
    data object ProfilePage: ProfileDestination()
}
With this setup im using bottomBar and here is the BottomNavItem:
Copy code
sealed class BottomNavItem(val route: Destination)
Im trying to show bottom bar only in specific destinations and i was using this before the migration:
@Composable get() = bottomBarItems.any { it.route == currentDestination?.route ?: String.EMPTY }
but now with safe args, this obviously does not work. So is there any suggestions to show bottom bar in specific destinations in new type safe navigation compose ? Thanks in advance Edit: I tried this and some similar variations but they did not work:
Copy code
val shouldShowBottomBar: Boolean
    @Composable get() =
        bottomBarItems.any {
            it.route == navController.currentBackStackEntryAsState().value?.toRoute<Destination>()
        }
1
s
Ahh yess definitely. Thank you very much.