Reputation: 717
Why my mutableStateOf of mutableList not updating?
val checkedList by remember {
mutableStateOf(MutableList(list.size) { false })
Upvotes: 1
Views: 588
Reputation: 11
I would suggest you to use
val checkedList by remember { mutableStateListOf<Boolean> { false })
.
This helps you better with update operations with view model flows and better code readability
Source with example : https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#mutableStateListOf()
Upvotes: 1