addEntryProvider

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

Builds a NavEntry for the given key that displays content.

Parameters

key

key for this entry

contentKey

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

provides information to the display

content

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

Type Parameters

K

the type of the key for this NavEntry


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

Builds a NavEntry for the given key that displays content.

Parameters

key

key for this entry

contentKey

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

lambda that takes the key and provides a map of additional info

content

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

Type Parameters

K

the type of the key for this NavEntry


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

Builds a NavEntry for the given clazz that displays content.

Parameters

clazz

the KClass of the key for this NavEntry

clazzContentKey

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

provides information to the display

content

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

Type Parameters

K

the type of the key for this NavEntry


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

Builds a NavEntry for the given clazz that displays content.

Parameters

clazz

the KClass of the key for this NavEntry

clazzContentKey

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

lambda that takes the key and provides a map of additional info

content

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

Type Parameters

K

the type of the key for this NavEntry