addPolygon method Null safety

void addPolygon (
  1. List<Offset> points,
  2. bool close

Adds a new sub-path with a sequence of line segments that connect the given points.

If close is true, a final line segment will be added that connects the last point to the first point.

The points argument is interpreted as offsets from the origin.


void addPolygon(List<Offset> points, bool close) {
  assert(points != null); // ignore: unnecessary_null_comparison
  _addPolygon(_encodePointList(points), close);