Start native apps faster with the Composables CLI ->
Class

ComposeNavigator

Navigator that navigates through Composables.

Source set: Common
public class ComposeNavigator constructor() : Navigator<Destination>(NAME)

Navigator that navigates through Composables. Every destination using this Navigator must set a valid Composable by setting it directly on an instantiated Destination or calling composable.

Properties

backStack

Source set: Common
public val backStack: StateFlow<List<NavBackStackEntry>>

Get the back stack from the state.

Functions

Source set: Common
override fun navigate(
        entries: List<NavBackStackEntry>,
        navOptions: NavOptions?,
        navigatorExtras: Extras?,
    )

createDestination

Source set: Common
override fun createDestination(): Destination

popBackStack

Source set: Common
override fun popBackStack(popUpTo: NavBackStackEntry, savedState: Boolean)

prepareForTransition

Source set: Common
public fun prepareForTransition(entry: NavBackStackEntry)

Function to prepare the entry for transition.

This should be called when the entry needs to move the androidx.lifecycle.Lifecycle.State in preparation for a transition such as when using predictive back.

onTransitionComplete

Source set: Common
public fun onTransitionComplete(entry: NavBackStackEntry)

Callback to mark a navigation in transition as complete.

This should be called in conjunction with navigate and popBackStack as those calls merely start a transition to the target destination, and requires manually marking the transition as complete by calling this method.

Failing to call this method could result in entries being prevented from reaching their final androidx.lifecycle.Lifecycle.State.

Members

Destination

Source set: Common
public class Destination(
        navigator: ComposeNavigator,
        internal val content:
            @Composable
            AnimatedContentScope.(@JvmSuppressWildcards NavBackStackEntry) -> Unit,
    ) : NavDestination(navigator)

NavDestination specific to ComposeNavigator