Mask.custom(List<Point<num>> points)

Create a custom mask with a polygonal shape defined by points.

Source

factory Mask.custom(List<Point<num>> points) {
  var graphics = new Graphics();
  points.forEach((p) => graphics.lineTo(p.x, p.y));
  graphics.fillColor(Color.Magenta);
  return new _GraphicsMask(graphics);
}