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

Minor documentation fixes (#70501)

parent 613a9598
......@@ -53,6 +53,11 @@ abstract class RenderAbstractViewport extends RenderObject {
/// Returns the offset that would be needed to reveal the `target`
/// [RenderObject].
///
/// This is used by [RenderViewportBase.showInViewport], which is
/// itself used by [RenderObject.showOnScreen] for
/// [RenderViewportBase], which is in turn used by the semantics
/// system to implement scrolling for accessibility tools.
///
/// The optional `rect` parameter describes which area of that `target` object
/// should be revealed in the viewport. If `rect` is null, the entire
/// `target` [RenderObject] (as defined by its [RenderObject.paintBounds])
......
......@@ -3326,6 +3326,15 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
/// | :-----------------: | :--------------------- | :---------------------- |
/// | **child == null** | Returns null. | Returns new [Element]. |
/// | **child != null** | Old child is removed, returns null. | Old child updated if possible, returns child or new [Element]. |
///
/// The `newSlot` argument is used only if `newWidget` is not null. If `child`
/// is null (or if the old child cannot be updated), then the `newSlot` is
/// given to the new [Element] that is created for the child, via
/// [inflateWidget]. If `child` is not null (and the old child _can_ be
/// updated), then the `newSlot` is given to [updateSlotForChild] to update
/// its slot, in case it has moved around since it was last built.
///
/// See the [RenderObjectElement] documentation for more information on slots.
@protected
Element? updateChild(Element? child, Widget? newWidget, dynamic newSlot) {
if (newWidget == null) {
......@@ -5336,10 +5345,10 @@ class InheritedElement extends ProxyElement {
/// class FooElement extends RenderObjectElement {
///
/// @override
/// Foo get widget => super.widget;
/// Foo get widget => super.widget as Foo;
///
/// @override
/// RenderFoo get renderObject => super.renderObject;
/// RenderFoo get renderObject => super.renderObject as RenderFoo;
///
/// // ...
/// }
......@@ -5397,13 +5406,13 @@ class InheritedElement extends ProxyElement {
///
/// #### Dynamically determining the children during layout
///
/// If the widgets are to be generated at layout time, then generating them when
/// the [update] method won't work: layout of this element's render object
/// hasn't started yet at that point. Instead, the [update] method can mark the
/// render object as needing layout (see [RenderObject.markNeedsLayout]), and
/// then the render object's [RenderObject.performLayout] method can call back
/// to the element to have it generate the widgets and call [updateChild]
/// accordingly.
/// If the widgets are to be generated at layout time, then generating them in
/// the [mount] and [update] methods won't work: layout of this element's render
/// object hasn't started yet at that point. Instead, the [update] method can
/// mark the render object as needing layout (see
/// [RenderObject.markNeedsLayout]), and then the render object's
/// [RenderObject.performLayout] method can call back to the element to have it
/// generate the widgets and call [updateChild] accordingly.
///
/// For a render object to call an element during layout, it must use
/// [RenderObject.invokeLayoutCallback]. For an element to call [updateChild]
......
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