RenderTable constructor
Creates a table render object.
columnsmust either be null or non-negative. Ifcolumnsis null, the number of columns will be inferred from length of the first sublist ofchildren.rowsmust either be null or non-negative. Ifrowsis null, the number of rows will be inferred from thechildren. Ifrowsis not null, thenchildrenmust be null.childrenmust either be null or contain lists of all the same length. ifchildrenis not null, thenrowsmust be null.defaultColumnWidthmust not be null.configurationmust not be null (but has a default value).
Implementation
RenderTable({
int columns,
int rows,
Map<int, TableColumnWidth> columnWidths,
TableColumnWidth defaultColumnWidth = const FlexColumnWidth(1.0),
@required TextDirection textDirection,
TableBorder border,
List<Decoration> rowDecorations,
ImageConfiguration configuration = ImageConfiguration.empty,
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(textDirection != null),
assert(configuration != null),
_textDirection = textDirection {
_columns = columns ?? (children != null && children.isNotEmpty ? children.first.length : 0);
_rows = rows ?? 0;
_children = <RenderBox>[]..length = _columns * _rows;
_columnWidths = columnWidths ?? HashMap<int, TableColumnWidth>();
_defaultColumnWidth = defaultColumnWidth;
_border = border;
this.rowDecorations = rowDecorations; // must use setter to initialize box painters array
_configuration = configuration;
_defaultVerticalAlignment = defaultVerticalAlignment;
_textBaseline = textBaseline;
children?.forEach(addRow);
}