rememberListState

@Composable
fun rememberListState(initialSelectedIndices: Set<Int> = emptySet()): ListState

Creates and remembers a ListState starting on initialSelectedIndices.

A later change to initialSelectedIndices neither recreates the state nor moves the selection; select afterwards through the returned state's ListState.selectedIndices.

Parameters

initialSelectedIndices

the rows selected until the caller or the user moves the selection.