Handle tables that don't have decorations.
This commit is contained in:
parent
19e624ccfe
commit
70053fff07
@ -891,13 +891,15 @@ class RenderTable extends RenderBox {
|
|||||||
for (int y = 0; y < rows; y += 1) {
|
for (int y = 0; y < rows; y += 1) {
|
||||||
if (_rowDecorations.length <= y)
|
if (_rowDecorations.length <= y)
|
||||||
break;
|
break;
|
||||||
_rowDecorationPainters[y] ??= _rowDecorations[y].createBoxPainter();
|
if (_rowDecorations[y] != null) {
|
||||||
_rowDecorationPainters[y].paint(canvas, new Rect.fromLTRB(
|
_rowDecorationPainters[y] ??= _rowDecorations[y].createBoxPainter();
|
||||||
offset.dx,
|
_rowDecorationPainters[y].paint(canvas, new Rect.fromLTRB(
|
||||||
offset.dy + _rowTops[y],
|
offset.dx,
|
||||||
offset.dx + size.width,
|
offset.dy + _rowTops[y],
|
||||||
offset.dy + _rowTops[y+1]
|
offset.dx + size.width,
|
||||||
));
|
offset.dy + _rowTops[y+1]
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int index = 0; index < _children.length; index += 1) {
|
for (int index = 0; index < _children.length; index += 1) {
|
||||||
|
@ -47,7 +47,9 @@ class Table extends RenderObjectWidget {
|
|||||||
this.defaultVerticalAlignment: TableCellVerticalAlignment.top,
|
this.defaultVerticalAlignment: TableCellVerticalAlignment.top,
|
||||||
this.textBaseline
|
this.textBaseline
|
||||||
}) : children = children,
|
}) : children = children,
|
||||||
_rowDecorations = children.map/*<Decoration>*/((TableRow row) => row.decoration).toList(),
|
_rowDecorations = children.any((TableRow row) => row.decoration != null)
|
||||||
|
? children.map/*<Decoration>*/((TableRow row) => row.decoration).toList()
|
||||||
|
: null,
|
||||||
super(key: key) {
|
super(key: key) {
|
||||||
assert(children != null);
|
assert(children != null);
|
||||||
assert(defaultColumnWidth != null);
|
assert(defaultColumnWidth != null);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user