DropdownImpl

fun DropdownImpl(item: DropdownItem, optionSize: Int, isSelected: Boolean, index: Int, dropdownColors: DropdownColors = DropdownDefaults.dropdownColors(), enabled: Boolean = item.enabled, dialogMode: Boolean = false, hasSubmenu: Boolean = false, isFirst: Boolean = index == 0, isLast: Boolean = index == optionSize - 1, onSelectedIndexChange: (Int) -> Unit)

The implementation of the dropdown.

Parameters

item

The item of the current option.

optionSize

The size of the options.

isSelected

Whether the option is selected.

index

The index of the current option in the options.

dropdownColors

The DropdownColors used to style the option row.

enabled

Whether the option is clickable. Disabled rows ignore clicks and use the disabled text color.

dialogMode

Whether the item is shown in dialog mode.

hasSubmenu

When true, this row acts as a submenu trigger: a trailing chevron is shown instead of the selection check, and the row's accessibility role becomes Role.Button.

isFirst

Whether this row is the first row of the entire popup. Controls the larger top padding in popup mode. Defaults to index == 0; multi-entry callers should pass the popup-global flag so only the actual first row gets extra padding.

isLast

Whether this row is the last row of the entire popup. Controls the larger bottom padding in popup mode. Defaults to index == optionSize - 1; multi-entry callers should pass the popup-global flag.

onSelectedIndexChange

The callback invoked with index when the option is selected.


fun DropdownImpl(text: String, optionSize: Int, isSelected: Boolean, index: Int, dropdownColors: DropdownColors = DropdownDefaults.dropdownColors(), enabled: Boolean = true, dialogMode: Boolean = false, onSelectedIndexChange: (Int) -> Unit)