ListGrid<T> constructor

ListGrid<T>(
  1. int width,
  2. int height,
  3. T fill
)

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);
}