drawPoly method
Draws a complex polygon from a List of points
that contains the vertices
of the polygon Is similar to use moveTo and lineTo methods but in one
command. closePolygon
will close the shape, defaults to true
.
The method returns this, which allows for method chaining.
See also:
- Path.addPolygon, the method used to draw the polygon.
Implementation
Graphics drawPoly(List<GPoint> points, [bool closePolygon = true]) {
final len = points.length;
final list = List<Offset>.filled(len, Offset.zero);
for (var i = 0; i < len; ++i) {
list[i] = points[i].toNative();
}
_path!.addPolygon(list, closePolygon);
return this;
}