Package-level declarations

Types

Link copied to clipboard
annotation class EntryDsl
Link copied to clipboard
class EntryProviderScope<T : Any>(fallback: (unknownScreen: T) -> NavEntry<T>)

The scope for constructing a new NavEntry with Kotlin DSL

Link copied to clipboard
annotation class MetadataDsl
Link copied to clipboard

Scope provided to the metadata dsl builder.

Link copied to clipboard

A mutable back stack of NavKey elements that integrates with Compose state.

Link copied to clipboard
class NavEntry<T : Any>(key: T, val contentKey: Any = defaultContentKey(key), val metadata: Map<String, Any> = emptyMap(), content: @Composable (T) -> Unit)

Entry maintains and stores the key and the content represented by that key. Entries should be created as part of a reference/androidx/navigation/NavDisplay.

Link copied to clipboard
open class NavEntryDecorator<T : Any>(onPop: (key: Any) -> Unit = {}, decorate: @Composable (entry: NavEntry<T>) -> Unit)

Decorate the NavEntrys that are integrated with a rememberDecoratedNavEntries.

Link copied to clipboard
interface NavKey

Marker interface for keys.

Link copied to clipboard
interface NavMetadataKey<T : Any>

The base Key to be associated with value of type T.

Link copied to clipboard

Wraps the content of a NavEntry with a SaveableStateHolder.SaveableStateProvider to ensure that calls to rememberSaveable within the content work properly and that state can be saved. Also provides the content of a NavEntry with a SavedStateRegistryOwner which can be accessed in the content with LocalSavedStateRegistryOwner.

Functions

Link copied to clipboard
operator fun <T : Any> Map<String, Any>.contains(key: NavMetadataKey<T>): Boolean

Checks if the metadata contains a given key.

Link copied to clipboard
inline fun <T : Any> entryProvider(noinline fallback: (unknownScreen: T) -> NavEntry<T> = { throw IllegalStateException("Unknown screen $it") }, builder: EntryProviderScope<T>.() -> Unit): (T) -> NavEntry<T>

Provides a EntryProviderScope to build an entryProvider that provides NavEntries.

Link copied to clipboard
operator fun <T : Any> Map<String, Any>.get(key: NavMetadataKey<T>): T?

Returns the metadata value for a given NavMetadataKey.

Link copied to clipboard
inline fun metadata(builder: MetadataScope.() -> Unit): Map<String, Any>

Provides a MetadataScope to build a Map of metadata.

Link copied to clipboard

Decorates the entries with the entryDecorators and returns the list of decorated NavEntries.

fun <T : Any> rememberDecoratedNavEntries(backStack: List<T>, entryDecorators: List<@JvmSuppressWildcards NavEntryDecorator<T>> = listOf(), entryProvider: (key: T) -> NavEntry<T>): List<NavEntry<T>>

Remembers and returns a list of NavEntry decorated with the list of entryDecorators

Link copied to clipboard

Provides a NavBackStack that is automatically remembered in the Compose hierarchy across process death and configuration changes.

Provides a NavBackStack that is automatically remembered in the Compose hierarchy across process death and configuration changes.

Returns a SaveableStateHolderNavEntryDecorator that is remembered across recompositions.