DialogList

fun <T> DialogList(state: DialogState, items: List<T>, itemIdProvider: (item: T) -> Int, itemContents: DialogList.ItemContents<T>, selectionMode: DialogList.SelectionMode<T>, divider: Boolean = false, description: String = "", filter: DialogList.Filter<T>? = null, title: @Composable () -> Unit? = null, icon: @Composable () -> Unit? = null, style: ComposeDialogStyle = DialogDefaults.defaultDialogStyle(), buttons: DialogButtons = DialogDefaults.buttons(), options: DialogOptions = DialogDefaults.options(), onEvent: (event: DialogEvent) -> Unit = {})

Shows a dialog with a list and an optional filter option

consider the overload with a lambda for the items parameter if items should be loaded lazily

 

Basic Parameters: all params not described here are derived from Dialog, check it out for more details

Parameters

items

the list items

itemIdProvider

the items to id lambda that is used to store selected item ids

itemContents

the DialogList.ItemContents holding composables to customise the rendering of the list items - use DialogList.ItemDefaultContent or DialogList.ItemContents if you want to completely customise the items

selectionMode
divider

if true, a divider is shown between the list items

description

a custom text that will be shown as description at the top of the dialog

filter

the DialogList.Filter - if it is null, filtering is disabled


fun <T> DialogList(state: DialogState, itemsLoader: suspend () -> List<T>, itemIdProvider: (item: T) -> Int, itemContents: DialogList.ItemContents<T>, selectionMode: DialogList.SelectionMode<T>, itemSaver: Saver<MutableState<List<T>>, out Any>? = null, loadingIndicator: @Composable () -> Unit = { Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.Center) { CircularProgressIndicator() } }, divider: Boolean = false, description: String = "", filter: DialogList.Filter<T>? = null, title: @Composable () -> Unit? = null, icon: @Composable () -> Unit? = null, style: ComposeDialogStyle = DialogDefaults.defaultDialogStyle(), buttons: DialogButtons = DialogDefaults.buttons(), options: DialogOptions = DialogDefaults.options(), onEvent: (event: DialogEvent) -> Unit = {})

Shows a dialog with a list and an optional filter option

consider the overload with a list if the items are just a simple list of items

 

Basic Parameters: all params not described here are derived from Dialog, check it out for more details

Parameters

itemsLoader

the lambda that will return the items for this dialog

itemIdProvider

the items to id lambda that is used to store selected item ids

itemContents

the DialogList.ItemContents holding composables to customise the rendering of the list items - use DialogList.ItemDefaultContent or DialogList.ItemContents if you want to completely customise the items

selectionMode
itemSaver

the saver for the list items - if no itemSaver is provided, data won't be remembered as saveable and will be reloaded on recomposition (e.g. screen rotation)

loadingIndicator

the composable that will be shown while items are loaded

divider

if true, a divider is shown between the list items

description

a custom text that will be shown as description at the top of the dialog

filter

the DialogList.Filter - if it is null, filtering is disabled