isValid method

bool isValid(
  1. Vec2 position
)

Returns true if the given position is within the bounds of this 2D array

Implementation

bool isValid(Vec2 position) {
  try {
    _checkIndex(position.x, position.y);
  } on RangeError {
    return false;
  }
  return true;
}