input

@Composable
fun MaterialDialogScope.input(label: String, hint: String = "", prefill: String = "", waitForPositiveButton: Boolean = true, visualTransformation: VisualTransformation = VisualTransformation.None, keyboardOptions: KeyboardOptions = KeyboardOptions(), keyboardActions: KeyboardActions = KeyboardActions(), errorMessage: String = "", focusRequester: FocusRequester = FocusRequester.Default, focusOnShow: Boolean = false, isTextValid: (String) -> Boolean = { true }, onInput: (String) -> Unit = {})

Adds an input field with the given parameters to the dialog

Parameters

label

string to be shown in the input field before selection eg. Username

hint

hint to be shown in the input field when it is selected but empty eg. Joe

prefill

string to be input into the text field by default

waitForPositiveButton

if true the onInput callback will only be called when the positive button is pressed, otherwise it will be called when the input value is changed

visualTransformation

a visual transformation of the content of the text field

keyboardOptions

software keyboard options which can be used to customize parts of the keyboard

errorMessage

a message to be shown to the user when the input is not valid

focusRequester

a FocusRequester which can be used to control the focus state of the text field

focusOnShow

if set to true this will auto focus the text field when the input field is shown

isTextValid

a function which is called to check if the user input is valid

onInput

a function which is called with the user input. The timing of this call is dictated by waitForPositiveButton