toPaint method

Paint toPaint(
  1. Rect rect
)

Create a Paint object that, if used to stroke a line, will draw the line in this border's style.

The offset property is not reflected in the Paint; consumers must implement that directly by inflating or deflating their region appropriately.

Not all borders use this method to paint their border sides. For example, non-uniform rectangular Borders have beveled edges and so paint their border sides as filled shapes rather than using a stroke.

Implementation

Paint toPaint(Rect rect) {
  return Paint()
    ..color = effectiveColor
    ..shader = gradient?.createShader(rect);
}