Mask.custom constructor

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

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

Implementation

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