What is the best way to use LazyColumn with itemsIndexed in PagingData this is deprecated deprecated code:
val list = (state as State.Success).data.collectAsLazyPagingItems()
LazyColumn(
modifier = Modifier
.padding(top = 50.dp)
.border(4.dp, MaterialTheme.colors.primary)
.padding(padding)
) {
itemsIndexed(list) {
}
}
How would the new code look?
[SOLVED]
list = (stateRefreshs as State.Success).data.collectAsLazyPagingItems()
LazyColumn(/*contentPadding = PaddingValues(horizontal = 16.dp, vertical = 8.dp),*/
modifier = Modifier.fillMaxSize()
) {
items(
count = list.itemCount,
key = list.itemKey(),
contentType = list.itemContentType()
)
{ index ->
val item = list[index]
}
}