Package fr.haan.bipak.compose

Types

Link copied to clipboard
data class LazyPagingItems<T : Any>(state: State<PagingData<T>>)

The class responsible for accessing the data from a Flow of PagingData. In order to obtain an instance of LazyPagingItems use the collectAsLazyPagingItems extension method of Flow with PagingData. This instance can be used by the items and itemsIndexed methods inside LazyListScope to display data received from the Flow of PagingData.

Functions

Link copied to clipboard
fun <T : Any> Flow<PagingData<T>>.collectAsLazyPagingItems(): LazyPagingItems<T>

Collects values from this Flow of PagingData and represents them inside a LazyPagingItems instance. The LazyPagingItems instance can be used by the items and itemsIndexed methods from LazyListScope in order to display the data obtained from a Flow of PagingData.

Link copied to clipboard
fun <T : Any> LazyListScope.items(    pagingDataState: LazyPagingItems<T>,     key: (index: Int) -> Any? = null,     itemContent: @Composable LazyItemScope.(value: T?) -> Unit)

Adds the LazyPagingItems and their content to the scope.

Link copied to clipboard
fun <T : Any> LazyListScope.itemsIndexed(    pagingDataState: LazyPagingItems<T>,     key: (index: Int) -> Any? = null,     itemContent: @Composable LazyItemScope.(index: Int, value: T?) -> Unit)

Adds the LazyPagingItems and their content to the scope where the content of an item is aware of its local index.