Composable Function

rememberListState

Creates a ListState that is remembered across compositions.

rememberListState

Source set: Android
@Composable
public fun rememberListState(
    initialFirstVisibleItemIndex: Int = 0,
    initialFirstVisibleItemScrollOffset: Int = 0,
): ListState

Creates a ListState that is remembered across compositions.

Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.

Parameters

initialFirstVisibleItemIndex the initial value for ListState.firstVisibleItemIndex
initialFirstVisibleItemScrollOffset the initial value for ListState.firstVisibleItemScrollOffset

Last updated: