Shivam Sethi
03/31/2021, 1:58 AMknthmn
03/31/2021, 2:02 AMNavController.currentBackStackEntryAsState() might help. What are you trying to observe?Shivam Sethi
03/31/2021, 2:03 AMIan Lake
03/31/2021, 2:08 AMcurrentBackStackEntryAsState() is for. You can see the example in the docs on how to get the route: https://developer.android.com/jetpack/compose/navigation#bottom-navShivam Sethi
03/31/2021, 2:32 AMTim Malseed
03/31/2021, 2:36 AM@Composable
fun NavHostController.currentRoute(): String? {
val navBackStackEntry by currentBackStackEntryAsState()
return navBackStackEntry?.arguments?.getString(KEY_ROUTE)
}Shivam Sethi
03/31/2021, 2:37 AMIan Lake
03/31/2021, 3:22 AM