Android
public sealed interface StackScope
Receiver scope used by VerticalStack that defines a DSL for adding items to the stack.
Functions
item
public fun item(key: Any? = null, content: @Composable StackItemScope.() -> Unit)
Adds a single item.
Parameters
| key | a stable and unique key representing the item. 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. |
| content | the content of the item |
items
public fun items(
count: Int,
key: ((index: Int) -> Any)? = null,
itemContent: @Composable StackItemScope.(Int) -> Unit,
)
Adds a count of items.
Parameters
| count | the item count |
| 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. |
| itemContent | the content displayed by a single item |