Unverified Commit e300c1a4 authored by creativecreatorormaybenot's avatar creativecreatorormaybenot Committed by GitHub

Docs: provide Guidance for SingleChildRenderObjectWidget implementations (#49993)

parent 3e1a124e
......@@ -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<ChildType extends RenderObject> on RenderObject {
/// Checks whether the given render object has the correct [runtimeType] to be
......
......@@ -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.
......
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