Skip to content

OverlayPortal.overlayChildLayoutBuilder - #164034

Merged
auto-submit[bot] merged 40 commits into
flutter:masterfrom
LongCatIsLooong:OverlayPortal-paint-transform-builder
Mar 14, 2025
Merged

auto-submit[bot] merged 40 commits into
flutter:masterfrom
LongCatIsLooong:OverlayPortal-paint-transform-builder

Conversation

@LongCatIsLooong

@LongCatIsLooong LongCatIsLooong commented Feb 24, 2025 •

Copy link
Copy Markdown
Contributor

This API allows the widget tree of an OverlayPortal.overlayChild to depend on various layout information (e.g. the incoming constraints, or the size of a RenderObject) from another child subtree of Overlay that does layout before the overlayChild.

Most RenderObject subclasses can only access its child's or children's layout info, but not the layout info of its other descendants because of the "relayout boundary" optimization. Such locality makes the layout dependencies easier to reason about but it also makes it difficult to implement certain common UI patterns (see the examples in the description of the previous PR)

The API is currently only available on OverlayPortal as it is the only Overlay API (AFAIK) that guarantees every render object in a "path" within the render tree has finished doing layout.

TODO: polish the API docs and code comments
TODO: more tests?

TODO: markNeedsLayout should not imply markNeedsPaint in this case (or in layout builders in general).

part1: #163575
diff this ... part1 LongCatIsLooong/flutter@OverlayPortal-always-add-to-dirty-list...LongCatIsLooong:flutter:OverlayPortal-paint-transform-builder

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Such that nobody `implements` it. Currently it has private
APIs used by the `RenderObject` class (e.g., the dirty lists).
If someone were to implement a `PipelineOwner` outside of
object.dart, they will get a runtime crash since they won't be
able to provide those private APIs and RenderObjects actually
expect those APIs to exist.
This allows `overlyChild` to inspect the layout of the regular
child (for example, computing the size and the paint transform from the
Overlay to the regular child in `overlayChild`'s performLayout method).
…ongCatIsLooong/flutter into OverlayPortal-always-add-to-dirty-list
@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Feb 24, 2025
@LongCatIsLooong LongCatIsLooong changed the title OverlayPortal.overlayChildLayoutBuilder (placeholder name) OverlayPortal.overlayChildLayoutBuilder Feb 28, 2025
@LongCatIsLooong
LongCatIsLooong marked this pull request as ready for review February 28, 2025 21:57
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 27, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 28, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants