Getting "None of the following candidates is applicable" when trying to use LiveData list in itemsIndexed in LazyColumn
Relvant code in ViewModel:
val allFoods: LiveData> = repository.allFoods.asLiveData()
and MainActivity:
val foods = foodViewModel.allFoods.observeAsState(listOf())
LazyColumn(modifier = Modifier.fillMaxSize()) {
itemsIndexed(foods) // "None of the following candidates is applicable"
}
I've tried using "items" and manually importing:
import androidx.compose.foundation.lazy.items
...but it would not pick up the import at all.
How do I fix this?