ListGrid<T> constructor
Creates a new grid with the given width
and height
.
The grid is filled with fill
by default.
The width
and height
must be non-negative.
Implementation
factory ListGrid(int width, int height, T fill) {
RangeError.checkNotNegative(width, 'width');
RangeError.checkNotNegative(height, 'height');
return ListGrid._(List.filled(width * height, fill), width);
}