Composable Function

rememberListState

Creates a ListState that is remembered across compositions.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

rememberListState

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