@EntryDsl
public final class EntryProviderScope<T extends Object>


The scope for constructing a new NavEntry with Kotlin DSL

Parameters
<T extends Object>

the type of the NavEntry key

Summary

Public constructors

<T extends Object> EntryProviderScope(
    @NonNull Function1<@NonNull unknownScreen, @NonNull NavEntry<@NonNull T>> fallback
)

Public methods

final void
<K extends T> addEntryProvider(
    @NonNull KClass<@NonNull K> clazz,
    @NonNull Function1<@NonNull key, @NonNull Object> clazzContentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Builds a NavEntry for the given clazz that displays content.

final void
<K extends T> addEntryProvider(
    @NonNull K key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Builds a NavEntry for the given key that displays content.

final void
<K extends T> entry(
    @NonNull Function1<@NonNull key, @NonNull Object> clazzContentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Add an entry provider to the EntryProviderScope

final void
<K extends T> entry(
    @NonNull EntryProviderScope<@NonNull T> receiver,
    @NonNull K key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Add an entry provider to the EntryProviderScope

Public constructors

EntryProviderScope

public <T extends Object> EntryProviderScope(
    @NonNull Function1<@NonNull unknownScreen, @NonNull NavEntry<@NonNull T>> fallback
)
Parameters
<T extends Object>

the type of the NavEntry key

@NonNull Function1<@NonNull unknownScreen, @NonNull NavEntry<@NonNull T>> fallback

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

Public methods

addEntryProvider

public final void <K extends T> addEntryProvider(
    @NonNull KClass<@NonNull K> clazz,
    @NonNull Function1<@NonNull key, @NonNull Object> clazzContentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Builds a NavEntry for the given clazz that displays content.

Parameters
<K extends T>

the type of the key for this NavEntry

@NonNull KClass<@NonNull K> clazz

the KClass of the key for this NavEntry

@NonNull Function1<@NonNull key, @NonNull Object> 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.

@NonNull Map<@NonNull String, @NonNull Object> metadata

provides information to the display

@Composable @NonNull Function1<@NonNull K, Unit> content

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

addEntryProvider

public final void <K extends T> addEntryProvider(
    @NonNull K key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Builds a NavEntry for the given key that displays content.

Parameters
<K extends T>

the type of the key for this NavEntry

@NonNull K key

key for this entry

@NonNull Object 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().

@NonNull Map<@NonNull String, @NonNull Object> metadata

provides information to the display

@Composable @NonNull Function1<@NonNull K, Unit> content

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

entry

public final void <K extends T> entry(
    @NonNull Function1<@NonNull key, @NonNull Object> clazzContentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Add an entry provider to the EntryProviderScope

Parameters
<K extends T>

the type of the key for this NavEntry

@NonNull Function1<@NonNull key, @NonNull Object> 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.

@NonNull Map<@NonNull String, @NonNull Object> metadata

provides information to the display

@Composable @NonNull Function1<@NonNull K, Unit> content

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

entry

public final void <K extends T> entry(
    @NonNull EntryProviderScope<@NonNull T> receiver,
    @NonNull K key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull K, Unit> content
)

Add an entry provider to the EntryProviderScope

Parameters
<K extends T>

the type of the key for this NavEntry

@NonNull K key

key for this entry

@NonNull Object 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().

@NonNull Map<@NonNull String, @NonNull Object> metadata

provides information to the display

@Composable @NonNull Function1<@NonNull K, Unit> content

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