Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Displaying game data in infinite list
@Composable
fun GameListing(
games: Flow<PagingData<GameResultsEntity>>
) {
val lazyGameItems = games.collectAsLazyPagingItems()
LazyVerticalGrid(
cells = GridCells.Fixed(2),
content = {
items(lazyGameItems.itemCount) { index ->
lazyGameItems[index]?.let {
Text(
modifier = Modifier.fillMaxWidth(),
text = it.name,
color = Color.Black
)
}
}
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment