DialogInputNumber

fun <T : Number> DialogInputNumber(state: DialogState, value: MutableState<T>, label: String = "", inputPlaceholder: String = "", singleLine: Boolean = false, maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE, minLines: Int = 1, enabled: Boolean = true, clearable: Boolean = true, prefix: String = "", suffix: String = "", validator: DialogInputValidator = DialogInputNumber.rememberDefaultValidator(value.value), textStyle: TextStyle = LocalTextStyle.current, requestFocus: Boolean = false, selectionState: DialogInput.SelectionState = DialogInput.SelectionState.Default, onValueStateChanged: (valid: Boolean, value: T?) -> Unit = { _, _ -> }, 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 an input field that only allows numeric characters and validates that the input holds a valid value for the desired data type

 

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

Parameters

value

the selected number

label

the optional label of the input field

inputPlaceholder

a placeholder if the input is empty

singleLine

if true, the input field will only allow a single line

maxLines

the max lines for the input field

minLines

the min lines for the input field

enabled

if true, the input field is enabled

clearable

if true, the input field can be cleared by a trailing clear icon

prefix

the prefix for the input field

suffix

the prefix for the input field

textStyle

the TextStyle for the input field

validator
requestFocus

if true, the input field will request the focus when the dialog si shown (and open the keyboard)

selectionState

if initial selection state (DialogInput.SelectionState) of the input field

onValueStateChanged

an optional callback that will be called whenever the value of the input field changes