Asad Mukhtar
09/23/2022, 11:36 AMAsad Mukhtar
09/23/2022, 11:37 AMviewModel.listOfRoundFlights.observeAsState()
.value?.let{
// some compose function
}
Adam Powell
09/23/2022, 1:50 PMAdam Powell
09/23/2022, 1:52 PMmutableStateListOf
for your listOfRoundFlights
in your ViewModel and you can modify the list directly and compose will notice and respond to the modificationsAsad Mukhtar
09/23/2022, 1:57 PMprivate val _listOfRoundFlights =
MutableStateFlow<List<Pair<Pair<Int, Int>, Pair<OutboundX, OutboundX>>>>(listOf())
val listOfRoundFlights: StateFlow<List<Pair<Pair<Int, Int>, Pair<OutboundX, OutboundX>>>> =
_listOfRoundFlights
But same problem again.Adam Powell
09/23/2022, 3:17 PMPair<Pair<Int, Int>, Pair<OutboundX, OutboundX>>
is quite hard to read or make sense of 🙂Adam Powell
09/23/2022, 3:18 PMChris Fillmore
09/23/2022, 8:49 PM_listOfRoundFlights.update {
it.toMutableList().apply {
// modify your list here
}
}
Something like the above should do