Commit 70053fff authored by Ian Hickson's avatar Ian Hickson

Handle tables that don't have decorations.

parent 19e624cc
...@@ -891,6 +891,7 @@ class RenderTable extends RenderBox { ...@@ -891,6 +891,7 @@ 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;
if (_rowDecorations[y] != null) {
_rowDecorationPainters[y] ??= _rowDecorations[y].createBoxPainter(); _rowDecorationPainters[y] ??= _rowDecorations[y].createBoxPainter();
_rowDecorationPainters[y].paint(canvas, new Rect.fromLTRB( _rowDecorationPainters[y].paint(canvas, new Rect.fromLTRB(
offset.dx, offset.dx,
...@@ -900,6 +901,7 @@ class RenderTable extends RenderBox { ...@@ -900,6 +901,7 @@ class RenderTable extends RenderBox {
)); ));
} }
} }
}
for (int index = 0; index < _children.length; index += 1) { for (int index = 0; index < _children.length; index += 1) {
RenderBox child = _children[index]; RenderBox child = _children[index];
if (child != null) { if (child != null) {
......
...@@ -47,7 +47,9 @@ class Table extends RenderObjectWidget { ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment