I have a Widget tree like:
- App Body
- Column of Widgets
- A Widget with a Table
- Each TableRow has a TableCell
- And in a TableCell there is a Widget that spans over multiple Rows and Columns of the table (like a number circled with a huge circle, also multiple numbers can have these circles).
- Each TableRow has a TableCell
- A Widget with a Table
- Column of Widgets
The table has variable alignment based on the data in the table. All the circles need to be on top of all the cells. And each circle has a shadow. Ideally a circle would not cast a shadow on another circle.
The issue is, with placing the "circle" in a TableCell, it is covered by the next cell/row. In html I would use z-index which looks like it is not present in Flutter. Is there another option how to do that, other than constructing another stacked layer of invisible table just to get the position of the circles right?
The final result should look something like this:
Thank you!
2
Answers
I ended up creating a concept of layers. Basically rendering the same table on 2 layers. The base layer is the table without circles, the second layer is the same table with the circles and the cells rendered as transparent. This way, the "circle" layer positions the circles correctly but everything that could cover the circles is transparent.
I recommend that you create a Custom Table Cell which would have a boolean to add or not a circle to the cell and I will add this CustomTableCell to the TableRow() of the Table like these: