polyPath function

Path polyPath(
  1. Iterable<Offset> pts, {
  2. bool close = true,
})

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;
}