Docs: provide Guidance for SingleChildRenderObjectWidget implementations (#49993)
This commit is contained in:
parent
3e1a124e0e
commit
e300c1a45a
@ -2897,7 +2897,11 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
|
|
||||||
/// Generic mixin for render objects with one child.
|
/// 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 {
|
mixin RenderObjectWithChildMixin<ChildType extends RenderObject> on RenderObject {
|
||||||
|
|
||||||
/// Checks whether the given render object has the correct [runtimeType] to be
|
/// 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);
|
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
|
/// that have a single child slot. (This superclass only provides the storage
|
||||||
/// for that child, it doesn't actually provide the updating logic.)
|
/// 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 class SingleChildRenderObjectWidget extends RenderObjectWidget {
|
||||||
/// Abstract const constructor. This constructor enables subclasses to provide
|
/// Abstract const constructor. This constructor enables subclasses to provide
|
||||||
/// const constructors so that they can be used in const expressions.
|
/// const constructors so that they can be used in const expressions.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user