containsXY method

bool containsXY(
  1. num x,
  2. num y
)

Returns true if this rectangle contains the coordinates x,y.

Implementation

bool containsXY(num x, num y) {
  final mx = this.x;
  final my = this.y;
  var w = width;
  var h = height;
  return w > 0 && h > 0 && x >= mx && x < (mx + w) && y >= my && y < (my + h);
}