composable is there a way to somehow group the `measurables`/`placeables` by some property of my data model?
I’m trying to create a custom layout composable which places its children according to some property of the data model from which the children themselves are created.
But from within the
Layout()
block the children are exposed as `measurable`/`placeable` so there is no visibility into their props.
Is there a way to pass any property from my data model or from the child composables into their respective measurables/placeables? Or any other way to achieve this (e.g. meta-data or anything else)?
✅ 1
a
Albert Chang
03/22/2022, 2:51 PM
You can use
Modifier.layoutId()
or
ParentDataModifier
.
➕ 1
j
julioromano
03/22/2022, 2:56 PM
Can I pass any object into
Modifier.layoutId()
? I mean it’s not stuff that must be able to go in bundles/parcelables? Can I just pass in there a reference to a huge data class?
julioromano
03/22/2022, 2:59 PM
By “Using
ParentDataModifier
” do you mean to create my own modifier instead of using