Hi! Is there any way I can use `LazyVerticalGrid` ...
# compose
r
Hi! Is there any way I can use
LazyVerticalGrid
so that I can have two type of column element widths?
1
Grid is not static and depends on data I receive.
r
r
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
Try accompanist FlowRow. Perfect for that.
r
Thank You! I managed to fix the issue with example that @Rebecca Franks gave!
e
> 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
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 ->
    ...
}
👍 1