How to correctly store a list in a mutablestate remember variable? I tried with
val 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>