Package-level declarations

Set of classes and Composables to simplify navigation in a Compose application.

Types

Link copied to clipboard
data class DestinationId<A, R>(name: String)

A destination identifier.

Link copied to clipboard

A navigation view allows navigating between different destinations.

Link copied to clipboard
sealed class NavigationResult<R>

The navigation result.

Link copied to clipboard
interface Navigator

A navigation component that allows navigation between destinations.

Functions

Link copied to clipboard

Helper function to create a DestinationId from a string.

Link copied to clipboard

Helper function to create a DestinationId from a string.

Link copied to clipboard

Helper method for creating inner navigation.

Link copied to clipboard
fun defineDialogDestination(id: DestinationId<*, *>, dialogProperties: DialogProperties = DialogProperties(), content: @Composable () -> Unit): NavigationDestination

Helper method for creating a dialog NavigationDestination.

Link copied to clipboard
fun <A> SavedStateHandle.get(destination: DestinationId<A & Any, *>): A

Returns the argument for the current destination.

Link copied to clipboard
fun <A> SavedStateHandle.getOrNull(destination: DestinationId<A?, *>): A?

Returns the argument for the current destination.

Link copied to clipboard
fun <A> SavedStateHandle.getStateFlow(destination: DestinationId<A, *>, initial: A?): StateFlow<A?>

Returns the argument for the current destination as Flow.

Link copied to clipboard
fun NavigationView(destinations: List<NavigationDestination>, modifier: Modifier = Modifier, enterTransition: @JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }, exitTransition: @JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }, popEnterTransition: @JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition, popExitTransition: @JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition, sizeTransform: @JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?? = null)

A navigation view allows navigating between different destinations.

Link copied to clipboard

Returns current emission as NavigationResult.Success if valid.

Link copied to clipboard
fun NavOptionsBuilder.popUpToDestination(destination: DestinationId<*, *>, popUpToBuilder: PopUpToBuilder.() -> Unit = {})

Pop up to a given destination before navigating. This pops all non-matching destination routes from the back stack until the destination with a matching route is found.

Link copied to clipboard

Pop up to the start destination before navigating. This pops all non-matching destination routes from the back stack until the destination with a matching route is found.

Link copied to clipboard

Helper method for creating inner navigation.