Skip to content

OverlayPortal.overlayChildLayoutBuilder#164034

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

OverlayPortal.overlayChildLayoutBuilder#164034
auto-submit[bot] merged 40 commits intoflutter:masterfrom
LongCatIsLooong:OverlayPortal-paint-transform-builder

Conversation

@LongCatIsLooong
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong commented Feb 24, 2025

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 24, 2025
auto-submit bot pushed a commit that referenced this pull request Apr 25, 2025
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

#167247
We identified a breaking change in beta, this change un-breaks it.

### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples

Restore RenderConstrainedLayoutBuilder with default layoutInfo implementation to undo a breaking change.

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

A class was renamed, which left developers with a "class not found" error as their only guide.

### Workaround:
Is there a workaround for this issue?

Nope.

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

Classes that mixin RenderConstrainedLayoutBuilder are no longer broken and the code can compile.
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