setChildren method

void setChildren (List<List<RenderBox>> cells)

Replaces the children of this table with the given cells.

Implementation

void setChildren(List<List<RenderBox>> cells) {
  // TODO(ianh): Make this smarter, like setFlatChildren
  if (cells == null) {
    setFlatChildren(0, null);
    return;
  }
  for (RenderBox oldChild in _children) {
    if (oldChild != null)
      dropChild(oldChild);
  }
  _children.clear();
  _columns = cells.isNotEmpty ? cells.first.length : 0;
  _rows = 0;
  cells.forEach(addRow);
  assert(_children.length == rows * columns);
}