Thank You, but how does it work with dynamic data? I don’t know in which places element will take up span of 2.
m
miguelsesma
09/29/2023, 1:03 PM
Try accompanist FlowRow. Perfect for that.
r
Rihards
09/29/2023, 1:07 PM
Thank You! I managed to fix the issue with example that @Rebecca Franks gave!
e
efemoney
09/29/2023, 1:07 PM
> I don’t know in which places element will take up span of 2.You kind of need to know this 🤔
Just saw your follow up comment
r
Rihards
09/29/2023, 1:11 PM
You kind of need to know this 🤔
I see that You already edited Your comment, but if I fetch data from the API where size is returned, then I can’t know that, because elements may change any time.
This one works.
Copy code
items(
elements,
span = { element ->
GridItemSpan(
if (element.size == Size.SMALL) 1 else 2
)
}
) { element ->
...
}