inset method

Rect inset({
  1. int top = 0,
  2. int right = 0,
  3. int bottom = 0,
  4. int left = 0,
})

Implementation

Rect inset({int top = 0, int right = 0, int bottom = 0, int left = 0}) {
  final w = width - left - right;
  final h = height - top - bottom;

  if (w <= 0 || h <= 0) return Rect(x + left, y + top, 0, 0);
  return Rect(x + left, y + top, w, h);
}