polyPath function
Connects pts in order and closes the contour when close is true.
Implementation
Path polyPath(Iterable<Offset> pts, {bool close = true}) {
final p = Path();
var first = true;
for (final o in pts) {
first ? p.moveTo(o.dx, o.dy) : p.lineTo(o.dx, o.dy);
first = false;
}
if (close) p.close();
return p;
}