RenderTable({int columns, int rows, Map<int, TableColumnWidth> columnWidths, TableColumnWidth defaultColumnWidth: const FlexColumnWidth(1.0), TableBorder border, List<Decoration> rowDecorations, ImageConfiguration configuration: ImageConfiguration.empty, Decoration defaultRowDecoration, TableCellVerticalAlignment defaultVerticalAlignment: TableCellVerticalAlignment.top, TextBaseline textBaseline, List<List<RenderBox>> children })

Creates a table render object.

  • columns must either be null or non-negative. If columns is null, the number of columns will be inferred from length of the first sublist of children.
  • rows must either be null or non-negative. If rows is null, the number of rows will be inferred from the children. If rows is not null, then children must be null.
  • children must either be null or contain lists of all the same length. if children is not null, then rows must be null.
  • defaultColumnWidth must not be null.
  • configuration must not be null (but has a default value).

Source

RenderTable({
  int columns,
  int rows,
  Map<int, TableColumnWidth> columnWidths,
  TableColumnWidth defaultColumnWidth: const FlexColumnWidth(1.0),
  TableBorder border,
  List<Decoration> rowDecorations,
  ImageConfiguration configuration: ImageConfiguration.empty,
  Decoration defaultRowDecoration,
  TableCellVerticalAlignment defaultVerticalAlignment: TableCellVerticalAlignment.top,
  TextBaseline textBaseline,
  List<List<RenderBox>> children
}) {
  assert(columns == null || columns >= 0);
  assert(rows == null || rows >= 0);
  assert(rows == null || children == null);
  assert(defaultColumnWidth != null);
  assert(configuration != null);
  _columns = columns ?? (children != null && children.isNotEmpty ? children.first.length : 0);
  _rows = rows ?? 0;
  _children = new List<RenderBox>()..length = _columns * _rows;
  _columnWidths = columnWidths ?? new HashMap<int, TableColumnWidth>();
  _defaultColumnWidth = defaultColumnWidth;
  _border = border;
  this.rowDecorations = rowDecorations; // must use setter to initialize box painters array
  _configuration = configuration;
  _defaultVerticalAlignment = defaultVerticalAlignment;
  _textBaseline = textBaseline;
  if (children != null) {
    for (List<RenderBox> row in children)
      addRow(row);
  }
}