Document overlay sizing constraints#186880
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds documentation to clarify how CompositedTransformFollower handles layout constraints and the compositing phase. Feedback suggests improving technical precision regarding the timing of the transform, using brackets for class links per the style guide, and adjusting the recommended wrapping strategy for better hit testing.
50e8105 to
42bb1bb
Compare
|
Updated the docs wording in head 42bb1bb to make the layout/compositing distinction more precise, link Overlay, and recommend loosening constraints around the follower itself. Reran format, targeted analyze, and git diff --check. |
QuncCccccc
left a comment
There was a problem hiding this comment.
LGTM. The doc makes sense to me, but I'm not familiar with CompositedTransformFollower so would like to wait @chunhtai or @victorsanni for another round of review:)
Thanks for your contribution!
|
I looked at #48052 and it doesn't seem to have to do with |
|
I think we should probably add documentation to the Overaly class to explain how it sizes itself (also the class documentation does not seem to mention size-determining child) and what kind of constraints it gives to non- |
42bb1bb to
9c3a503
Compare
|
Moved this guidance to Overlay in 9c3a503, matching the review feedback that the issue is Overlay sizing/constraints rather than CompositedTransformFollower behavior. The PR now documents Overlay sizing, canSizeOverlay, and the tight constraints used for non-positioned overlay entries. Verification rerun: formatter, targeted analyze, and git diff --check pass. |
Fixes #48052.
Issue: The reported behavior comes from
Overlaylayout, not fromCompositedTransformFollower: non-positioned overlay entries are laid out with tight constraints matching the overlay's size, so a fixed-size visual child needs to be positioned or sized inside the entry.Fix:
Overlayclass docs.Overlaychooses its own size for finite constraints, infinite constraints, andOverlayEntry.canSizeOverlay.PositionedandAlign.Tests:
./bin/dart format --output=none --set-exit-if-changed packages/flutter/lib/src/widgets/basic.dart packages/flutter/lib/src/widgets/overlay.dart./bin/flutter analyze packages/flutter/lib/src/widgets/basic.dart packages/flutter/lib/src/widgets/overlay.dartgit diff --checkRisk: Documentation-only. This updates the location and wording of the guidance to match the underlying layout behavior.