render method

  1. @override
void render(
  1. Canvas canvas,
  2. Paint paint
)
override

Implementation

@override
void render(Canvas canvas, Paint paint) {
  if (points.isNotEmpty) {
    paint.style = PaintingStyle.fill;
    final path = Path()..moveTo(points.first.x, points.first.y);
    for (var i = 1; i < points.length; i++) {
      path.lineTo(points[i].x, points[i].y);
    }
    path.lineTo(points.first.x, points.first.y);

    canvas.drawPath(path, paint);
  }
}