deflateRect method

Rect deflateRect (Rect rect)

Returns a new rect that is smaller than the given rect in each direction by the amount of inset in each direction. Specifically, the left edge of the rect is moved right by left, the top edge of the rect is moved down by top, the right edge of the rect is moved left by right, and the bottom edge of the rect is moved up by bottom.

If the argument's Rect.size is smaller than collapsedSize, then the resulting rectangle will have negative dimensions.

See also:

Implementation

Rect deflateRect(Rect rect) {
  return Rect.fromLTRB(rect.left + left, rect.top + top, rect.right - right, rect.bottom - bottom);
}