androidx.navigation3.runtime

Interfaces

NavKey

Marker interface for keys.

Cmn
NavMetadataKey

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

Cmn

Classes

EntryProviderScope

The scope for constructing a new NavEntry with Kotlin DSL

Cmn
MetadataScope

Scope provided to the metadata dsl builder.

Cmn
NavBackStack

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

Cmn
NavEntry

Entry maintains and stores the key and the content represented by that key.

Cmn
NavEntryDecorator

Decorate the NavEntrys that are integrated with a rememberDecoratedNavEntries.

Cmn
SaveableStateHolderNavEntryDecorator

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.

Cmn

Annotations

Composables

rememberDecoratedNavEntries

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

Cmn
rememberNavBackStack
Cmn
android
rememberSaveableStateHolderNavEntryDecorator

Returns a SaveableStateHolderNavEntryDecorator that is remembered across recompositions.

Cmn

Top-level functions summary

inline (T) -> NavEntry<T>
<T : Any> entryProvider(
    noinline fallback: (unknownScreen) -> NavEntry<T>,
    builder: EntryProviderScope<T>.() -> Unit
)

Provides a EntryProviderScope to build an entryProvider that provides NavEntries.

Cmn
inline Map<StringAny>
metadata(builder: MetadataScope.() -> Unit)

Provides a MetadataScope to build a Map of metadata.

Cmn

Extension functions summary

operator Boolean
<T : Any> Map<StringAny>.contains(key: NavMetadataKey<T>)

Checks if the metadata contains a given key.

Cmn
operator T?
<T : Any> Map<StringAny>.get(key: NavMetadataKey<T>)

Returns the metadata value for a given NavMetadataKey.

Cmn

Top-level functions

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

Provides a EntryProviderScope to build an entryProvider that provides NavEntries.

Parameters
<T : Any>

the type of the NavEntry key

noinline fallback: (unknownScreen) -> NavEntry<T> = { throw IllegalStateException("Unknown screen $it") }

the fallback NavEntry when the provider cannot find an entry associated with a given key on the backStack

builder: EntryProviderScope<T>.() -> Unit

the DSL extension that provides a EntryProviderScope to build an entryProvider that provides NavEntries.

Returns
(T) -> NavEntry<T>

an entryProvider that provides the NavEntry associated with a given key

inline fun metadata(builder: MetadataScope.() -> Unit): Map<StringAny>

Provides a MetadataScope to build a Map of metadata.

Parameters
builder: MetadataScope.() -> Unit

the DSL extension that provides a MetadataScope to build a Map of metadata

Extension functions

operator fun <T : Any> Map<StringAny>.contains(key: NavMetadataKey<T>): Boolean

Checks if the metadata contains a given key.

T the value type.

Parameters
key: NavMetadataKey<T>

the key to check for

operator fun <T : Any> Map<StringAny>.get(key: NavMetadataKey<T>): T?

Returns the metadata value for a given NavMetadataKey.

T the value type.

Parameters
key: NavMetadataKey<T>

the key associated with the value