shape property Null safety

ShapeBorder shape
final

The shape to fill the color, gradient, and image into and to cast as the shadows.

Shapes can be stacked (using the + operator). The color, gradient, and image are drawn into the inner-most shape specified.

The shape property specifies the outline (border) of the decoration. The shape must not be null.

Directionality-dependent shapes

Some ShapeBorder subclasses are sensitive to the TextDirection. The direction that is provided to the border (e.g. for its ShapeBorder.paint method) is the one specified in the ImageConfiguration (ImageConfiguration.textDirection) provided to the BoxPainter (via its [BoxPainter.paint method). The BoxPainter is obtained when createBoxPainter is called.

When a ShapeDecoration is used with a Container widget or a DecoratedBox widget (which is what Container uses), the TextDirection specified in the ImageConfiguration is obtained from the ambient Directionality, using createLocalImageConfiguration.

Implementation

final ShapeBorder shape;