TableCellListDelegate constructor
TableCellListDelegate({
- int pinnedColumnCount = 0,
- int pinnedRowCount = 0,
- bool addAutomaticKeepAlives = true,
- required List<
List< cells,TableViewCell> > - required TableSpanBuilder columnBuilder,
- required TableSpanBuilder rowBuilder,
Creates a delegate that supplies children for a TableView.
Implementation
TableCellListDelegate({
int pinnedColumnCount = 0,
int pinnedRowCount = 0,
super.addAutomaticKeepAlives,
required List<List<TableViewCell>> cells,
required TableSpanBuilder columnBuilder,
required TableSpanBuilder rowBuilder,
}) : assert(pinnedColumnCount >= 0),
assert(pinnedRowCount >= 0),
_columnBuilder = columnBuilder,
_rowBuilder = rowBuilder,
_pinnedColumnCount = pinnedColumnCount,
_pinnedRowCount = pinnedRowCount,
super(
children: cells,
// repaintBoundaries handled by TableViewCell
addRepaintBoundaries: false,
) {
// Even if there are merged cells, they should be represented by the same
// child in each cell location. This ensures that no matter which direction
// the merged cell scrolls into view from, we can build the correct child
// without having to explore all possible vicinities of the merged cell
// area. So all arrays of cells should have the same length.
assert(
children.map((List<Widget> array) => array.length).toSet().length == 1,
'Each list of Widgets within cells must be of the same length.',
);
assert(rowCount >= pinnedRowCount);
assert(columnCount >= pinnedColumnCount);
}