toPaint method

Paint toPaint([
  1. Paint? paint
])

Gets Paint object from this stroke style.

If paint set, the result will be applied to it.

Implementation

Paint toPaint([Paint? paint]) => (paint ?? Paint())
  // This setting is a must, or the Canvas.drawPath will not render the stoke.
  ..style = PaintingStyle.stroke
  ..color = color
  ..strokeWidth = width;