RadioSheetBuilder

constructor(title: String = "请选择", items: Set<T>, itemText: (T) -> String = { it.toString() }, selectedItem: T = items.first(), showButton: Boolean = true, cancelText: String = "取消", confirmText: String = "确定", onCancelClick: suspend CoroutineScope.() -> Boolean = { true }, onConfirmClick: suspend CoroutineScope.(T) -> Boolean = { true })

Parameters

title

标题文字,默认 "请选择"

items

选项数据集合,要求非空

itemText

选项文本转换函数,默认调用 toString()

selectedItem

当前选中的项,默认为第一项

showButton

是否显示确定和取消按钮,默认 true

cancelText

取消按钮文字,默认 "取消"

confirmText

确定按钮文字,默认 "确定"

onCancelClick

取消按钮点击回调,返回 true 则自动关闭弹窗

onConfirmClick

确定按钮点击回调,参数为选中的项,返回 true 则自动关闭弹窗

Type Parameters

T

选项数据类型