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
public val backStack: StateFlow<List<NavBackStackEntry>>
Get the back stack from the state.
Functions
navigate
override fun navigate(
entries: List<NavBackStackEntry>,
navOptions: NavOptions?,
navigatorExtras: Extras?,
)
createDestination
override fun createDestination(): Destination
popBackStack
override fun popBackStack(popUpTo: NavBackStackEntry, savedState: Boolean)
prepareForTransition
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
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
public class Destination(
navigator: ComposeNavigator,
internal val content:
@Composable
AnimatedContentScope.(@JvmSuppressWildcards NavBackStackEntry) -> Unit,
) : NavDestination(navigator)
NavDestination specific to ComposeNavigator