Grid<T>.view constructor
Creates a sub-grid view into this grid within the given bounds
.
The bounds must be within the grid's area.
Implementation
factory Grid.view(Grid<T> grid, Rect bounds) {
final area = grid.area();
if (!area.containsRect(bounds)) {
throw ArgumentError.value(
bounds,
'bounds',
"Must be within the grid's area: $area",
);
}
return _SubGrid(grid, bounds);
}