drawArea method
Implementation
void drawArea(Canvas canvas, Paint paint, List<Offset> p1List, List<Offset> p2List, bool first) {
if (_notDraw()) {
return;
}
Path path;
bool smooth = border != null && border!.smooth;
if (first) {
Line line = Line(p1List, smoothRatio: smooth ? 0.2 : null);
path = line.path(false);
for (int i = p2List.length - 1; i >= 0; i--) {
var element = p2List[i];
path.lineTo(element.dx, element.dy);
}
path.close();
} else {
if (smooth) {
path = Line.smoothArea(p1List, p2List, ratio: 0.2);
} else {
Line line = Line(p1List);
path = line.path(false);
for (int i = p2List.length - 1; i >= 0; i--) {
var element = p2List[i];
path.lineTo(element.dx, element.dy);
}
path.close();
}
}
fillPaint(paint, path.getBounds());
paint.style = PaintingStyle.fill;
canvas.drawPath(path, paint);
List<Offset> list = [...p1List];
list.addAll(p2List.reversed);
border?.drawPolygon(canvas, paint, list, close: true);
}