paintLine static method
void
paintLine(})
绘制线段
Implementation
static void paintLine(
Canvas canvas,
double startX,
double endX, {
Offset center = const Offset(0, 0),
Color color = Colors.red,
double rotateAngle = 0,
double strokeWidth = 1,
}) {
canvas.save();
canvas.translate(center.dx, center.dy);
canvas.rotate(rotateAngle * rad);
canvas.drawLine(
Offset(startX, 0),
Offset(endX, 0),
Paint()
..color = color
..strokeCap = StrokeCap.round
..style = PaintingStyle.stroke
..strokeWidth = strokeWidth);
canvas.restore();
}