containsRect method

bool containsRect(
  1. Rect other
)

Returns true if other is contained within this rectangle, including being equivalent to this rectangle. That is, other's top, right, bottom, and left must be equal to or inside this rectangle.

Implementation

bool containsRect(Rect other) {
  if (other.top >= top &&
      other.right <= right &&
      other.bottom <= bottom &&
      other.left >= left) {
    return true;
  } else {
    return false;
  }
}