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 { ...@@ -53,6 +53,11 @@ abstract class RenderAbstractViewport extends RenderObject {
/// Returns the offset that would be needed to reveal the `target` /// Returns the offset that would be needed to reveal the `target`
/// [RenderObject]. /// [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 /// The optional `rect` parameter describes which area of that `target` object
/// should be revealed in the viewport. If `rect` is null, the entire /// should be revealed in the viewport. If `rect` is null, the entire
/// `target` [RenderObject] (as defined by its [RenderObject.paintBounds]) /// `target` [RenderObject] (as defined by its [RenderObject.paintBounds])
......
...@@ -3326,6 +3326,15 @@ abstract class Element extends DiagnosticableTree implements BuildContext { ...@@ -3326,6 +3326,15 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
/// | :-----------------: | :--------------------- | :---------------------- | /// | :-----------------: | :--------------------- | :---------------------- |
/// | **child == null** | Returns null. | Returns new [Element]. | /// | **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]. | /// | **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 @protected
Element? updateChild(Element? child, Widget? newWidget, dynamic newSlot) { Element? updateChild(Element? child, Widget? newWidget, dynamic newSlot) {
if (newWidget == null) { if (newWidget == null) {
...@@ -5336,10 +5345,10 @@ class InheritedElement extends ProxyElement { ...@@ -5336,10 +5345,10 @@ class InheritedElement extends ProxyElement {
/// class FooElement extends RenderObjectElement { /// class FooElement extends RenderObjectElement {
/// ///
/// @override /// @override
/// Foo get widget => super.widget; /// Foo get widget => super.widget as Foo;
/// ///
/// @override /// @override
/// RenderFoo get renderObject => super.renderObject; /// RenderFoo get renderObject => super.renderObject as RenderFoo;
/// ///
/// // ... /// // ...
/// } /// }
...@@ -5397,13 +5406,13 @@ class InheritedElement extends ProxyElement { ...@@ -5397,13 +5406,13 @@ class InheritedElement extends ProxyElement {
/// ///
/// #### Dynamically determining the children during layout /// #### Dynamically determining the children during layout
/// ///
/// If the widgets are to be generated at layout time, then generating them when /// If the widgets are to be generated at layout time, then generating them in
/// the [update] method won't work: layout of this element's render object /// the [mount] and [update] methods won't work: layout of this element's render
/// hasn't started yet at that point. Instead, the [update] method can mark the /// object hasn't started yet at that point. Instead, the [update] method can
/// render object as needing layout (see [RenderObject.markNeedsLayout]), and /// mark the render object as needing layout (see
/// then the render object's [RenderObject.performLayout] method can call back /// [RenderObject.markNeedsLayout]), and then the render object's
/// to the element to have it generate the widgets and call [updateChild] /// [RenderObject.performLayout] method can call back to the element to have it
/// accordingly. /// generate the widgets and call [updateChild] accordingly.
/// ///
/// For a render object to call an element during layout, it must use /// For a render object to call an element during layout, it must use
/// [RenderObject.invokeLayoutCallback]. For an element to call [updateChild] /// [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