GridPad constructor
GridPad({
- Key? key,
- required GridPadCells gridPadCells,
- required List<
Widget> children, - GridPadPlacementPolicy placementPolicy = GridPadPlacementPolicy.defaultPolicy,
Implementation
GridPad({
super.key,
required this.gridPadCells,
required List<Widget> children,
this.placementPolicy = GridPadPlacementPolicy.defaultPolicy,
}) : _placementStrategy = GridPlacementStrategy(
gridPadCells,
placementPolicy,
) {
for (var contentCell in children) {
final Cell cell;
if (contentCell is Cell) {
cell = contentCell;
} else {
cell = Cell.implicit(child: contentCell);
}
if (cell._implicitly) {
_placementStrategy.placeImplicitly(
rowSpan: cell.rowSpan,
columnSpan: cell.columnSpan,
content: cell.child,
);
} else {
_placementStrategy.placeExplicitly(
row: cell.row,
column: cell.column,
rowSpan: cell.rowSpan,
columnSpan: cell.columnSpan,
content: cell.child,
);
}
}
_content.addAll(_placementStrategy.content);
}