SwipeDismissableNavHost

fun SwipeDismissableNavHost(navController: NavHostController, startDestination: Any, modifier: Modifier = Modifier, userSwipeEnabled: Boolean = true, state: SwipeDismissableNavHostState = rememberSwipeDismissableNavHostState(), route: KClass<*>? = null, builder: NavGraphBuilder.() -> Unit)

Provides a place in the Compose hierarchy for self-contained navigation to occur, with backwards navigation provided by a swipe gesture.

This implements type safe navigation for Wear.

Once this is called, any Composable within the given NavGraphBuilder can be navigated to from the provided navController.

The builder passed into this method is remembered. This means that for this NavHost, the contents of the builder cannot be changed.

Content is displayed within a BasicSwipeToDismissBox, showing the current navigation level. During a swipe-to-dismiss gesture, the previous navigation level (if any) is shown in the background. BackgroundScrimColor and ContentScrimColor of it are taken from LocalSwipeToDismissBackgroundScrimColor and LocalSwipeToDismissContentScrimColor.

Parameters

navController

the navController for this host

startDestination

the route from a an Object for the start destination

modifier

The modifier to be applied to the layout.

route

the route from a KClass for the graph

builder

the builder used to construct the graph