int columns

The number of vertical alignment lines in this table.

Changing the number of columns will remove any children that no longer fit in the table.

Changing the number of columns is an expensive operation because the table needs to rearranage its internal representation.

Source

int get columns => _columns;
void columns=(int value)

Source

set columns(int value) {
  assert(value != null);
  assert(value >= 0);
  if (value == columns)
    return;
  int oldColumns = columns;
  List<RenderBox> oldChildren = _children;
  _columns = value;
  _children = new List<RenderBox>()..length = columns * rows;
  int columnsToCopy = math.min(columns, oldColumns);
  for (int y = 0; y < rows; y += 1) {
    for (int x = 0; x < columnsToCopy; x += 1)
      _children[x + y * columns] = oldChildren[x + y * oldColumns];
  }
  if (oldColumns > columns) {
    for (int y = 0; y < rows; y += 1) {
      for (int x = columns; x < oldColumns; x += 1) {
        int xy = x + y * oldColumns;
        if (oldChildren[xy] != null)
          dropChild(oldChildren[xy]);
      }
    }
  }
  markNeedsLayout();
}