createFromListIndex

Creates a [FillableData] instance from an [Int].

createFromListIndex

Function

Common
expect fun FillableData.Companion.createFromListIndex(listIndexValue: Int): FillableData?

Creates a FillableData instance from an Int.

This function is used to wrap an integer value for autofill purposes, such as the selected index in a dropdown menu or spinner.

Parameters

listIndexValueThe integer data to be used for autofill, representing the index of the selected item in a list.

Returns

A FillableData object containing the integer data, or null if the platform does not support autofill.
Android
actual fun FillableData.Companion.createFromListIndex(listIndexValue: Int): FillableData?

Creates a FillableData instance from an Int.

This function is used to wrap an integer value for autofill purposes, such as the selected index in a dropdown menu or spinner. On Android, it creates an AutofillValue that represents a list selection.

Parameters

listIndexValueThe integer data to be used for autofill, representing the index of the selected item in a list.

Returns

A FillableData object containing the integer data, or null if the platform version is lower than Build.VERSION_CODES.O.