wideMiddleRect property Null safety

Rect wideMiddleRect

The biggest rectangle that is entirely inside the rounded rectangle and has the full width of the rounded rectangle. If the rounded rectangle does not have an axis-aligned intersection of its left and right side, the resulting Rect will have negative width or height.

Implementation

Rect get wideMiddleRect {
  final double topRadius = math.max(tlRadiusY, trRadiusY);
  final double bottomRadius = math.max(brRadiusY, blRadiusY);
  return Rect.fromLTRB(
    left,
    top + topRadius,
    right,
    bottom - bottomRadius
  );
}