clipBehavior property

Clip clipBehavior

The content will be clipped (or not) according to this option.

See the enum Clip for details of all possible options and their common use cases.

Stacks only clip children whose geometry overflow the stack. A child that paints outside its bounds (e.g. a box with a shadow) will not be clipped, regardless of the value of this property. Similarly, a child that itself has a descendant that overflows the stack will not be clipped, as only the geometry of the stack's direct children are considered.

To clip children whose geometry does not overflow the stack, consider using a RenderClipRect render object.

Defaults to Clip.hardEdge.

Implementation

Clip get clipBehavior => _clipBehavior;
void clipBehavior=(Clip value)

Implementation

set clipBehavior(Clip value) {
  if (value != _clipBehavior) {
    _clipBehavior = value;
    markNeedsPaint();
    markNeedsSemanticsUpdate();
  }
}