SetPicker

fun <T> SetPicker(current: T, dataList: List<T>, modifier: Modifier = Modifier, textStyle: TextStyle = LocalTextStyle.current, arrowsColor: Color = MaterialTheme.colorScheme.primary, dataToString: @Composable (T) -> String = { it.toString() }, onStateChanged: (T) -> Unit = {})(source)

A Compose picker component that allows users to select an item from a list by dragging or using arrow buttons.

Parameters

current

The currently selected item

dataList

The list of items to choose from

modifier

The modifier to be applied to the picker

textStyle

The text style for displaying items

arrowsColor

The color of the up/down arrow buttons

dataToString

A composable function to convert items to strings for display. Defaults to Any.toString

onStateChanged

Callback invoked when the selected item changes

Type Parameters

T

The type of items in the list