rows property

Iterable<Iterable<T>> rows

Each row of cells in the grid from top to bottom.

The performance of this getter is heavily based on the grid's internal memory layout. For example, a ListGrid (the default implementation) uses a row-major layout, so this getter is more efficient by design.

See also:

  • columns; for an iterable of columns.
  • indexed; for an iterable of indexed rows (with x, y coordinates).

Implementation

Iterable<Iterable<T>> get rows {
  return Iterable.generate(
    height,
    (y) => Iterable.generate(width, (x) => get(x, y)),
  );
}