0

How do I reflect changes in some values ​​in the List to LazyColumn in real time?

val postDataList = postViewModel.postDataList.collectAsLazyPagingItems()

LazyColumn(
        modifier = Modifier
            .background(CustomColor.BackGround)
            .fillMaxWidth(),
        state = postScrollState
    ) {
        itemsIndexed(postDataList.itemSnapshotList.items) { _, post ->
            Post(viewModel, userData, post)
        }
    }
4
  • 1
    kindly provide more details on what problem you are facing . Please provide a minimal reproducible example. You should also read How to Ask and edit your question to improve it. Commented May 6, 2024 at 3:48
  • 1
    usually devs put model object 's list , and uses the size of the list for items() , later you can use the {it -> } it to modify the data inside list. Commented May 6, 2024 at 3:51
  • Can you please provide some code related to the lazy column? Commented May 6, 2024 at 6:48
  • I uploaded an example code Commented May 6, 2024 at 15:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.