paint method

  1. @override
void paint (Canvas canvas, Rect rect, { TextDirection textDirection, BoxShape shape: BoxShape.rectangle, BorderRadius borderRadius })
override

Paints the border within the given Rect on the given Canvas.

This is an extension of the ShapeBorder.paint method. It allows BoxBorder borders to be applied to different BoxShapes and with different borderRadius parameters, without changing the BoxBorder object itself.

The shape argument specifies the BoxShape to draw the border on.

If the shape is specifies a rectangular box shape (BoxShape.rectangle), then the borderRadius argument describes the corners of the rectangle.

The getInnerPath and getOuterPath methods do not know about the shape and borderRadius arguments.

See also:

  • paintBorder, which is used if the border is not uniform.

Implementation

@override
void paint(Canvas canvas, Rect rect, {
  TextDirection textDirection,
  BoxShape shape = BoxShape.rectangle,
  BorderRadius borderRadius,
});