columns property

Iterable<Iterable<T>> columns

Each column of cells in the grid from left to right.

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 less efficient than rows.

See also:

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

Implementation

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