diff --git a/lib/src/Grid.dart b/lib/src/Grid.dart index 04d8d3c..b009a99 100644 --- a/lib/src/Grid.dart +++ b/lib/src/Grid.dart @@ -21,6 +21,12 @@ class Grid extends DelegatingList { height = h, super(l); + /// Return element at coordinate position + /// + /// Returns the corresponding element after checking the parameters + /// for the correct constraints along the width and height of the grid. + /// Throws [RangeError] if outside of constraints. Preferred method + /// to access elements via coordinates. E get(int x, int y) { int i = toIndex(x, y); if (i >= length || x > width - 1) throw RangeError.index(i, this);