toPagerState

@JvmName(name = "toPagerStateVisible")
fun <Key : Any, PageItem> Pageable<Key, PageItem>.toPagerState(key: (PageItem) -> Any, initialPage: Int = 0, @FloatRange(from = -0.5, to = 0.5) initialPageOffsetFraction: Float = 0.0f, coroutineContext: CoroutineContext = EmptyCoroutineContext): PageablePagerComposeState<PageItem>

Binds a Pageable to a Compose Pager (e.g., HorizontalPager or VerticalPager).

Each item in the pageable becomes a single pager page. Fetches are triggered as pages become visible.


@JvmName(name = "toPagerStateVisibleDeprecated")
fun <Key : Any, PageItem> Pageable<Key, PageItem>.toPagerState(key: (PageItem) -> Any, anchored: Boolean, initialPage: Int = 0, @FloatRange(from = -0.5, to = 0.5) initialPageOffsetFraction: Float = 0.0f, coroutineContext: CoroutineContext = EmptyCoroutineContext): PageablePagerComposeState<PageItem>

Deprecated

The usage of `anchored = true` is discouraged because the loading of pages will not adapt to the amount of visible pages on screen

Replace with

toPagerState(state, key)

Binds a Pageable to a Compose Pager (e.g., HorizontalPager or VerticalPager).

Each item in the pageable becomes a single pager page. Fetches are triggered as pages become visible.