listItems

@Composable
fun <T> MaterialDialogScope.listItems(modifier: Modifier = Modifier, list: List<T>, closeOnClick: Boolean = true, onClick: (index: Int, T) -> Unit = { _, _ -> }, isEnabled: (index: Int) -> Boolean = { _ -> true }, item: @Composable (index: Int, T) -> Unit)

Adds a selectable list with custom items to the dialog

Parameters

list

list of given generic type

onClick

callback with the index and item when a list object is clicked

isEnabled

a function to check if the item at a given index is enabled/clickable

item

a composable function which takes an object of given generic type


@Composable
fun MaterialDialogScope.listItems(list: List<String>, closeOnClick: Boolean = true, onClick: (index: Int, item: String) -> Unit = { _, _ -> })

Adds a selectable plain text list to the dialog

Parameters

list

the strings to be displayed in the list

onClick

callback with the index and string of an item when it is clicked