Pablo
02/07/2024, 10:33 AMval imagesList by remember *{* _mutableStateListOf_<ImageModel>()*}* but it gives this error Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
If I replace by remember with = remember the error dissapears and I dont understand why. Also, the guides says by remember is the correct option so I whould like to understand how to be able to use by remember with this list. Another problem I found is that even using = instead of by, I'm not able to init the variable with a list. remember *{* _mutableStateListOf_<ImageModel>(ImageModelProvider.imageModelList)*}* gives this error: Type mismatch. Required: ImageModel Found:List<ImageModel>ephemient
02/07/2024, 10:39 AMMutableState, you can either destructure it to a getter and setter, or operate with its .value getter and .setValue() setter, or use var by delegation to handle that for youephemient
02/07/2024, 10:39 AMSnapshotStateList (returned from mutableStateListOf()), you simply use `.get()`/`.set()` (e.g. [] indexing operators) as normal. so it's =ephemient
02/07/2024, 10:40 AMMutableState<List>, it's a MutableList that allows Compose to observe changesPablo
02/07/2024, 10:44 AMephemient
02/07/2024, 10:56 AMval imagesList = remember { ImageModelProvider.imageModelList.toMutableStateList() }ephemient
02/07/2024, 10:57 AMPablo
02/07/2024, 11:05 AMZach Klippenstein (he/him) [MOD]
02/07/2024, 3:18 PM