preferPaintInterior property

  1. @override
bool preferPaintInterior
override

Reports whether paintInterior is implemented.

Classes such as ShapeDecoration prefer to use paintInterior if this getter returns true. This is intended to enable faster painting; instead of computing a shape using getOuterPath and then drawing it using Canvas.drawPath, the path can be drawn directly to the Canvas using dedicated methods such as Canvas.drawRect or Canvas.drawCircle.

By default, this getter returns false.

Subclasses that implement paintInterior should override this to return true. Subclasses should only override paintInterior if doing so enables faster rendering than is possible with Canvas.drawPath (so, in particular, subclasses should not call Canvas.drawPath in paintInterior).

See also:

  • paintInterior, whose API documentation has an example implementation.

Implementation

@override
bool get preferPaintInterior => true;