NavHost

@Composable
fun NavHost(startRoute: NavRoot, destinations: ImmutableSet<NavDestination<*>>, modifier: Modifier = Modifier, deepLinkHandlers: ImmutableSet<DeepLinkHandler> = persistentSetOf(), deepLinkPrefixes: ImmutableSet<DeepLinkHandler.Prefix> = persistentSetOf(), destinationChangedCallback: (NavRoot, BaseRoute) -> Unit? = null)

Create a new NavHost containing all given destinations. startRoute will be used as the start destination of the graph. Use HostNavigator and DestinationNavigator to change what is shown in NavHost.

To support deep links a set of DeepLinkHandlers can be passed in optionally. These will be used to build the correct back stack when the current Activity was launched with an ACTION_VIEW Intent that contains an url in it's data. deepLinkPrefixes can be used to provide a default set of url patterns that should be matched by any DeepLinkHandler that doesn't provide its own DeepLinkHandler.prefixes.

The destinationChangedCallback can be used to be notified when the current destination changes. Note that this will not be invoked when navigating to a com.freeletics.khonshu.navigation.activity.ActivityRoute.


@Composable
fun NavHost(navigator: HostNavigator, modifier: Modifier = Modifier, destinationChangedCallback: (NavRoot, BaseRoute) -> Unit? = null)

Create a new NavHost with the given HostNavigator. The start NavRoot, available destinations and deep link handling are all dependent on the navigator. For more see rememberHostNavigator.

The destinationChangedCallback can be used to be notified when the current destination changes. Note that this will not be invoked when navigating to a com.freeletics.khonshu.navigation.activity.ActivityRoute.