drawPath static method

CustomPaint drawPath(
  1. Path path, {
  2. Paint? pathPaint,
})

Return a CustomPaint widget with the current CustomPainter

Implementation

static CustomPaint drawPath(Path path, {Paint? pathPaint}) {
  if (pathPaint != null) {
    return CustomPaint(
      painter: SolidCropPathPainter(path, pathPaint),
    );
  } else {
    return CustomPaint(
      painter: SolidCropPathPainter(
        path,
        Paint()
          ..color = Colors.white
          ..strokeWidth = _strokeWidth
          ..style = PaintingStyle.stroke
          ..strokeJoin = StrokeJoin.round,
      ),
    );
  }
}