okay, how can I get current String “route” from this State holder so I can perform some logic ?
t
Tim Malseed
03/31/2021, 2:36 AM
Copy code
@Composable
fun NavHostController.currentRoute(): String? {
val navBackStackEntry by currentBackStackEntryAsState()
return navBackStackEntry?.arguments?.getString(KEY_ROUTE)
}
😄 1
s
Shivam Sethi
03/31/2021, 2:37 AM
awesome, thanks
i
Ian Lake
03/31/2021, 3:22 AM
Yep, those are the two lines in that link I put above