drawRect method

Graphics drawRect(
  1. double x,
  2. double y,
  3. double width,
  4. double height,
)

Draws a rectangle using the specified coordinates and dimensions.

The rectangle is drawn starting from the top-left point (x, y) and with the specified width and height.

Returns the current Graphics instance, allowing for method chaining.

Implementation

Graphics drawRect(double x, double y, double width, double height) {
  _path!.addRect(
    Rect.fromLTWH(x, y, width, height),
  );
  return this;
}