Hi, I want to make a list of unique items in my li...
# compose
k
Hi, I want to make a list of unique items in my list in jetpack compose. So I am trying to use MutableSet in my project. I know that mutableStateListOf is using for list in jetpack compose. I have another reason to use of mutableStateListOf in my project. So is there is way we can use of
MutableSet
with
mutableStateListOf
?
Copy code
val list by lazy { mutableStateListOf<ScanResult>() }
Many Thanks
z
lists and sets are different data types, so in general you can’t force one to be another
there’s no
mutableStateSetOf
, but there is
mutableStateMapOf
which you can treat like a set by storing
Unit
or
null
as the values
k
Okk perfect thanks for detail explain
z