navigation-compose-typed
navigation-compose-typed copied to clipboard
feature: NavDestination.hasRoute<T>(), NavHostController.popBackStack<T> and remove createRoutePattern
This is not a request for navigation-compose-types to support navigation-compose:2.8.0. Rather, it’s the opposite—having the API in place before supporting navigation-compose:2.8.0 would make transitioning between navigation-compose:2.8.0 and navigation-compose-types easier.
I have tested navigation-compose:2.8.0, but I found some inconveniences, so I plan to return to navigation-compose-types.
- if (currentDestination?.destination?.hierarchy?.any { it.hasRoute<NavItem.A>() } == true) {
+ if (currentDestination?.destination?.hierarchy?.any { it.route == createRoutePattern<NavItem.A>() } == true) {
- navController.popBackStack<NavItem.ProductRaffle>(
+ navController.popBackStack(
+ route = createRoutePattern<NavItem.ProductRaffle>(),
- startDestination = NavItem.Start,
+ startDestination = createRoutePattern<NavItem.Start>(),