ListGrid<T> class
final
A grid whose internal memory layout is a row-major 1-dimenional List.
- Mixed in types
-
- Grid<
T>
- Grid<
Constructors
- ListGrid(int width, int height, T fill)
-
Creates a new grid with the given
width
andheight
.factory - ListGrid.empty()
-
Creates an empty grid with no cells.
factory
-
ListGrid.fromCells(Iterable<
T> cells, {required int width}) -
Creates a new grid from the given
cells
andwidth
.factory -
ListGrid.fromRows(Iterable<
Iterable< rows)T> > -
Creates a new grid from the given
rows
.factory - ListGrid.generate(int width, int height, T generator(int x, int y))
-
Creates a new grid with the given
width
andheight
.factory
Properties
-
cells
→ List<
T> -
Cells in the grid.
final
-
columns
→ Iterable<
Iterable< T> > -
Each column of cells in the grid from left to right.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
Height of the buffer.
no setteroverride
-
indexed
→ Iterable<
(int, int, T)> -
Each cell in the grid with its x and y coordinates.
no setterinherited
-
rows
→ Iterable<
Iterable< T> > -
Each row of cells in the grid from top to bottom.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → int
-
Width of the buffer.
final
Methods
-
area(
[Offset offset = Offset.zero]) → Rect -
Returns the area of the grid as a rectangle with an optional
offset
.inherited -
get(
int x, int y) → T -
Returns the cell at the given
x
andy
coordinates.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
int x, int y, T cell) → void -
Sets the cell at the given
x
andy
coordinates tocell
.override -
subGrid(
Rect bounds) → Grid< T> -
Returns a sub-grid view into this grid within the given
bounds
.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited