rectangle method

Drawable rectangle(
  1. double x,
  2. double y,
  3. double width,
  4. double height,
)

Draws a rectangle with the top-left corner at (x, y) with the specified width and height.

Implementation

Drawable rectangle(double x, double y, double width, double height) {
  final List<PointD> points = [
    PointD(x, y),
    PointD(x + width, y),
    PointD(x + width, y + height),
    PointD(x, y + height)
  ];
  final OpSet outline = OpSetBuilder.buildPolygon(points, drawConfig!);
  return _buildDrawable(outline, points);
}