Unverified Commit e12d31ad authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Document stack's clipping behaviour better (#130749)

Fixes https://github.com/flutter/flutter/issues/40216
parent e276629f
...@@ -435,7 +435,16 @@ class RenderStack extends RenderBox ...@@ -435,7 +435,16 @@ class RenderStack extends RenderBox
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.hardEdge], and must not be null. /// 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].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
......
...@@ -3914,6 +3914,15 @@ class Stack extends MultiChildRenderObjectWidget { ...@@ -3914,6 +3914,15 @@ class Stack extends MultiChildRenderObjectWidget {
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// 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 [ClipRect] widget.
///
/// Defaults to [Clip.hardEdge]. /// Defaults to [Clip.hardEdge].
final Clip clipBehavior; final Clip clipBehavior;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment