2

I use FlowRow in the accompanist project to auto wrap my text items to next line. It works as intended. However, when I have a large dataset (which I already load with paging), I don't find an api like LazyColumn to load and build the items as needed, if I loop through the pager flow, it tries to load to build everything at once. Any adice please?

lazyPagingItems = pager.flow.collectAsLazyPagingItems()

FlowRow(
 ) {
    val items = lazyPagingItems
    for (index in 1..items.itemCount-1) {
        Text(
            text = word,
            maxLines = 1
        )
    }
}
LXJ
  • 1,180
  • 6
  • 18

1 Answers1

-1

Little late to the party. But it seems you could use LazyVerticalGrid or LazyHorizontalGrid in adaptive mode like below.

LazyVerticalGrid(
    columns = GridCells.Adaptive(/* item min size */)
) {
    // Items
}
Jason
  • 649
  • 5
  • 10