Hi, when using the new compose navigation apis for...
# android
a
Hi, when using the new compose navigation apis for type safe navigation how do you get the current route?
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentDestination = navBackStackEntry?.destination
val isTopLevelDestination = currentDestination?.route == OrdersRoute
Copy code
@Serializable
object OrdersRoute
i
val isTopLevelDestination = currentDestination.hasRoute<OrdersRoute>()
2
a
Thanks Ian :)