StackScopeKt

Added in 1.0.0-alpha01

public final class StackScopeKt


Summary

Public methods

static final void
<T extends Object> items(
    @NonNull StackScope receiver,
    @NonNull List<@NonNull T> items,
    Function1<@NonNull item, @NonNull Object> key,
    @Composable @NonNull Function2<@NonNull StackItemScope, @NonNull item, Unit> itemContent
)

Adds a list of items.

Public methods

public static final void <T extends Object> items(
    @NonNull StackScope receiver,
    @NonNull List<@NonNull T> items,
    Function1<@NonNull item, @NonNull Object> key,
    @Composable @NonNull Function2<@NonNull StackItemScope, @NonNull item, Unit> itemContent
)

Adds a list of items.

Parameters
@NonNull List<@NonNull T> items

the list of item data

Function1<@NonNull item, @NonNull Object> key

a factory of stable and unique keys representing the items. If a key is specified, the scroll position will be maintained based on the key. If items are added/removed before the current visible item, the item with the given key will be kept as the first visible one. If null is passed, the position in the stack will represent the key.

@Composable @NonNull Function2<@NonNull StackItemScope, @NonNull item, Unit> itemContent

the content displayed by a single item