paint method Null safety

  1. @override
void paint(
  1. Canvas canvas,
  2. Rect rect,
  3. {TextDirection? textDirection,
  4. BoxShape shape = BoxShape.rectangle,
  5. BorderRadius? borderRadius}

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.


void paint(
  Canvas canvas,
  Rect rect, {
  TextDirection? textDirection,
  BoxShape shape = BoxShape.rectangle,
  BorderRadius? borderRadius,