0

I want to initialize a list from a specific index in lazy column.

For example: I have a list of 10 items. I want the list to load from 5. index when first loaded.

The method I'm using now is to scroll to the 5th index after loading the list. But instead I want to initialize the list directly from an index I want. Is it possible?

Emre Memil
  • 233
  • 3
  • 5

1 Answers1

0

you can use itemsIndexed() extension and filter the list

LazyColumn() {
    itemsIndexed(viewModel.list) { index, item ->
        if(index >5){
           // your composable here
        }
    }
}
Nikhil Dupally
  • 753
  • 1
  • 4
  • 12