https://kotlinlang.org logo
Title
s

Sean Proctor

05/09/2023, 10:40 PM
I'm trying to migrate
Table
to recent versions of Compose. It uses
ParentData
which no longer exists to associate metadata (the row index) with rows. Is there an obvious replacement that I'm missing?
For context, an example looks something like:
Table(columns = 3) {
    tableRow {
        Text("one")
        Text("two")
        Text("three")
    }
    tableRow {
        Text("four")
        Text("five")
        Text("six")
    }
}
I'm looking for a way to set
parentData
on the
Text
composables. I guess I could change the API a bit and do:
Table(columns = 3) {
    row {
        cell {
            Text("one")
        }
        cell {
            Text("two")
        }
        ...
    }
}
I have a really rough version done. https://github.com/sproctor/compose-data-table