EntryProviderKt

Added in 1.0.0-alpha04

public final class EntryProviderKt


Summary

Public methods

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

Add an entry provider to the EntryProviderBuilder

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

Add an entry provider to the EntryProviderBuilder

static final @NonNull Function1<@NonNull T, @NonNull NavEntry<@NonNull T>>
<T extends Object> entryProvider(
    @NonNull Function1<@NonNull unknownScreen, @NonNull NavEntry<@NonNull T>> fallback,
    @ExtensionFunctionType @NonNull Function1<@NonNull EntryProviderBuilder<@NonNull T>, Unit> builder
)

Creates an EntryProviderBuilder with the entry providers provided in the builder.

Public methods

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

Add an entry provider to the EntryProviderBuilder

Parameters
<T extends Object>

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 ge 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 T, Unit> content

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

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

Add an entry provider to the EntryProviderBuilder

Parameters
<T extends Object>

the type of the key for this NavEntry

@NonNull T 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 ge 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 T, Unit> content

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

public static final @NonNull Function1<@NonNull T, @NonNull NavEntry<@NonNull T>> <T extends Object> entryProvider(
    @NonNull Function1<@NonNull unknownScreen, @NonNull NavEntry<@NonNull T>> fallback,
    @ExtensionFunctionType @NonNull Function1<@NonNull EntryProviderBuilder<@NonNull T>, Unit> builder
)

Creates an EntryProviderBuilder with the entry providers provided in the builder.

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

@ExtensionFunctionType @NonNull Function1<@NonNull EntryProviderBuilder<@NonNull T>, Unit> builder

the EntryProviderBuilder DSL extension that builds NavEntries for the provider