drawRoundRectComplex method

Graphics drawRoundRectComplex(
  1. double x,
  2. double y,
  3. double width,
  4. double height, [
  5. double topLeftRadius = 0,
  6. double topRightRadius = 0,
  7. double bottomLeftRadius = 0,
  8. double bottomRightRadius = 0,
])

Draws a rounded rectangle with different corner radii.

The rectangle starts at position (x, y) and has the given width and height. The corner radii can be specified for each corner using the respective parameters.

Returns the current Graphics instance, allowing for method chaining.

See also:

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

Implementation

Graphics drawRoundRectComplex(
  double x,
  double y,
  double width,
  double height, [
  double topLeftRadius = 0,
  double topRightRadius = 0,
  double bottomLeftRadius = 0,
  double bottomRightRadius = 0,
]) {
  _path!.addRRect(
    RRect.fromLTRBAndCorners(
      x,
      y,
      x + width,
      y + height,
      topLeft: Radius.circular(topLeftRadius),
      topRight: Radius.circular(topRightRadius),
      bottomLeft: Radius.circular(bottomLeftRadius),
      bottomRight: Radius.circular(bottomRightRadius),
    ),
  );
  return this;
}