rememberPickerState

Functions summary

PickerState
@Composable
rememberPickerState(
    initialNumberOfOptions: @IntRange(from = 1) Int,
    initiallySelectedIndex: @IntRange(from = 0) Int,
    shouldRepeatOptions: Boolean
)

Creates a PickerState that is remembered across compositions.

Functions

rememberPickerState

@Composable
fun rememberPickerState(
    initialNumberOfOptions: @IntRange(from = 1) Int,
    initiallySelectedIndex: @IntRange(from = 0) Int = 0,
    shouldRepeatOptions: Boolean = true
): PickerState

Creates a PickerState that is remembered across compositions.

Parameters
initialNumberOfOptions: @IntRange(from = 1) Int

the number of options.

initiallySelectedIndex: @IntRange(from = 0) Int = 0

the index of the option to show in the center at the start, zero-based.

shouldRepeatOptions: Boolean = true

if true (the default), the options will be repeated.