drawRoundRect method

Graphics drawRoundRect(
  1. double x,
  2. double y,
  3. double width,
  4. double height,
  5. double ellipseWidth, [
  6. double? ellipseHeight,
])

Draws a rounded rectangle with the same radius on all corners.

The rectangle starts at position (x, y) and has the given width and height. The ellipseWidth and ellipseHeight parameters specify the x and y radii of the ellipse used to round the corners. If ellipseHeight is not provided, it defaults to ellipseWidth.

Returns the current Graphics instance, allowing for method chaining.

See also:

  • RRect, the underlying class used to draw the rounded rectangle.

Implementation

Graphics drawRoundRect(
  double x,
  double y,
  double width,
  double height,
  double ellipseWidth, [
  double? ellipseHeight,
]) {
  _path!.addRRect(
    RRect.fromLTRBXY(
      x,
      y,
      x + width,
      y + height,
      ellipseWidth,
      ellipseHeight ?? ellipseWidth,
    ),
  );
  return this;
}