Hello guys!.. I need your help. I need to pass par...
# android
a
Hello guys!.. I need your help. I need to pass parameter to the composable inside sealed class. Below is the screenshot where there is RecommendedScreen(models = ) composable that needs a parameter. Can you guys tell how to do that?.
z
I would expect that to work, what’s the error?
a
No! that composable needs a parameter. The problem is I don't know how to do that
I have a view model with the list of models, I can't instantiate that view model in that file. Is there a way to pass it in TabItem sealed class and pass it in RecommendedScreen composable?..
k
But then it would be a different object for every model, no?
a
The parameter is the list of object below
k
Right, and that would make your
Recommended
object no longer a unique object if it can get an one of these three models.
Or is this list fixed?
a
This is the composable implementation
k
Is this list of models to
RecommendedScreen
a fixed list, or can it change at runtime?
a
It can change at time because that list is from firebase firestore
q
if list can change at run time, don't use object for Recommended. Change it to class and pass that list as argument