diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index db80b276f7..b56ea757dc 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -2897,7 +2897,11 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im /// Generic mixin for render objects with one child. /// -/// Provides a child model for a render object subclass that has a unique child. +/// Provides a child model for a render object subclass that has +/// a unique child, which is accessible via the [child] getter. +/// +/// This mixin is typically used to implement render objects created +/// in a [SingleChildRenderObjectWidget]. mixin RenderObjectWithChildMixin on RenderObject { /// Checks whether the given render object has the correct [runtimeType] to be diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 3bfd59382f..f1a35c8784 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -1782,9 +1782,14 @@ abstract class LeafRenderObjectWidget extends RenderObjectWidget { LeafRenderObjectElement createElement() => LeafRenderObjectElement(this); } -/// A superclass for RenderObjectWidgets that configure RenderObject subclasses +/// A superclass for [RenderObjectWidget]s that configure [RenderObject] subclasses /// that have a single child slot. (This superclass only provides the storage /// for that child, it doesn't actually provide the updating logic.) +/// +/// Typically, the render object assigned to this widget will make use of +/// [RenderObjectWithChildMixin] to implement a single-child model. The mixin +/// exposes a [RenderObjectWithChildMixin.child] property that allows +/// retrieving the render object belonging to the [child] widget. abstract class SingleChildRenderObjectWidget extends RenderObjectWidget { /// Abstract const constructor. This constructor enables subclasses to provide /// const constructors so that they can be used in const expressions.