Hello, that may sound silly, but is this "detail f...
# compose-desktop
n
Hello, that may sound silly, but is this "detail folder" widget existing in Compose Desktop ? Like, a "super LazyList with headers" composable where I can dynamically tell the number of "headers" (in my example : "Nom", "Modifié le", etc), and then set its data (and each data to put in each column). I can't find the name of this widget, or if it exists anyway.
k
Grid / table. There’s been plenty of people asking for such a thing, some attempts at writing such a thing, but nothing concrete at the moment.
👍 1
n
Thanks, I'll start with an ugly header + items with the same
.weight
between the headers and data then 😄
m
I needed something similar for a project I'm working on, and I ended up rolling my own. Basically, I made a wrapper for LazyColumn, and also made a "GridRow" composable with a custom layout. I used parent data modifiers to specify the "column ID" of children
Modifier.columnId(id: Any)
. The first "item" is considered the header, and the first item's GridRow just observes the widths of any children with the columnId modifier. The remaining items (if they have a GridRow) apply the observed widths from the header item. I had to do some weird stuff with
compositionLocalOf
to communicate the widths to the child GridRow instances, which I'm not sure is going to be performant. It's quite janky and not nearly ready for anything besides my narrow use-case, but it does get the job done (unfortunately, no, I can't share the code, but maybe someday I can make an open-source-able version).
z
There's also this library that adds tables to compose: https://github.com/oleksandrbalan/lazytable