The scope for constructing a new NavEntry with Kotlin DSL

Parameters
<T : Any>

the type of the NavEntry key

Summary

Public constructors

<T : Any> EntryProviderScope(fallback: (unknownScreen) -> NavEntry<T>)
Cmn

Public functions

Unit
<K : T> addEntryProvider(
    clazz: KClass<K>,
    clazzContentKey: (key) -> Any,
    metadata: Map<StringAny>,
    content: @Composable (K) -> Unit
)

Builds a NavEntry for the given clazz that displays content.

Cmn
Unit
<K : T> addEntryProvider(
    key: K,
    contentKey: Any,
    metadata: Map<StringAny>,
    content: @Composable (K) -> Unit
)

Builds a NavEntry for the given key that displays content.

Cmn
inline Unit
<K : T> entry(
    noinline clazzContentKey: (key) -> Any,
    metadata: Map<StringAny>,
    noinline content: @Composable (K) -> Unit
)

Add an entry provider to the EntryProviderScope

Cmn
Unit
<K : T> EntryProviderScope<T>.entry(
    key: K,
    contentKey: Any,
    metadata: Map<StringAny>,
    content: @Composable (K) -> Unit
)

Add an entry provider to the EntryProviderScope

Cmn

Public constructors

EntryProviderScope

<T : Any> EntryProviderScope(fallback: (unknownScreen) -> NavEntry<T>)
Parameters
<T : Any>

the type of the NavEntry key

fallback: (unknownScreen) -> NavEntry<T>

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

Public functions

addEntryProvider

fun <K : T> addEntryProvider(
    clazz: KClass<K>,
    clazzContentKey: (key) -> Any = { defaultContentKey(it) },
    metadata: Map<StringAny> = emptyMap(),
    content: @Composable (K) -> Unit
): Unit

Builds a NavEntry for the given clazz that displays content.

Parameters
<K : T>

the type of the key for this NavEntry

clazz: KClass<K>

the KClass of the key for this NavEntry

clazzContentKey: (key) -> Any = { defaultContentKey(it) }

A factory of unique, stable ids that uniquely identifies the content of this NavEntry. To maximize stability, it should be derived from the factory's provided key. The resulting key must be saveable (i.e. on Android, it should be saveable via Android). The generated key will be stored in NavEntry.contentKey.

metadata: Map<StringAny> = emptyMap()

provides information to the display

content: @Composable (K) -> Unit

content for this entry to be displayed when this entry is active

addEntryProvider

fun <K : T> addEntryProvider(
    key: K,
    contentKey: Any = defaultContentKey(key),
    metadata: Map<StringAny> = emptyMap(),
    content: @Composable (K) -> Unit
): Unit

Builds a NavEntry for the given key that displays content.

Parameters
<K : T>

the type of the key for this NavEntry

key: K

key for this entry

contentKey: Any = defaultContentKey(key)

A unique, stable id that uniquely identifies the content of this NavEntry. To maximize stability, it should be derived from the key. The contentKey type must be saveable (i.e. on Android, it should be saveable via Android). Defaults to key.toString().

metadata: Map<StringAny> = emptyMap()

provides information to the display

content: @Composable (K) -> Unit

content for this entry to be displayed when this entry is active

entry

inline fun <K : T> entry(
    noinline clazzContentKey: (key) -> Any = { defaultContentKey(it) },
    metadata: Map<StringAny> = emptyMap(),
    noinline content: @Composable (K) -> Unit
): Unit

Add an entry provider to the EntryProviderScope

Parameters
<K : T>

the type of the key for this NavEntry

noinline clazzContentKey: (key) -> Any = { defaultContentKey(it) }

A factory of unique, stable ids that uniquely identifies the content of this NavEntry. To maximize stability, it should be derived from the factory's provided key. The resulting key must be saveable (i.e. on Android, it should be saveable via Android). The generated key will be stored in NavEntry.contentKey.

metadata: Map<StringAny> = emptyMap()

provides information to the display

noinline content: @Composable (K) -> Unit

content for this entry to be displayed when this entry is active

fun <K : T> EntryProviderScope<T>.entry(
    key: K,
    contentKey: Any = defaultContentKey(key),
    metadata: Map<StringAny> = emptyMap(),
    content: @Composable (K) -> Unit
): Unit

Add an entry provider to the EntryProviderScope

Parameters
<K : T>

the type of the key for this NavEntry

key: K

key for this entry

contentKey: Any = defaultContentKey(key)

A unique, stable id that uniquely identifies the content of this NavEntry. To maximize stability, it should be derived from the key. The contentKey type must be saveable (i.e. on Android, it should be saveable via Android). Defaults to key.toString().

metadata: Map<StringAny> = emptyMap()

provides information to the display

content: @Composable (K) -> Unit

content for this entry to be displayed when this entry is active