-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Reland ensure visible fix for nested viewports #67773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… Scrollable nested (flutter#65226)" (flutter#66918)" This reverts commit e8812c4.
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// The optional `targetRenderObject` parameter is used to determine which area | ||
| /// of that object should be as visible as possible. If `targetRenderObject` is null, | ||
| /// the entire [RenderObject] (as defined by its [RenderObject.paintBounds]) | ||
| /// will be as visible as possible. If `targetRenderObject` is provided it should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// will be as visible as possible. If `targetRenderObject` is provided it should be | |
| /// will be as visible as possible. If `targetRenderObject` is provided, it should be |
Also should be? Or must? It would be nice to enforce that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing to must.
|
|
||
| Rect? targetRect; | ||
| if (targetRenderObject != null && targetRenderObject != object) { | ||
| targetRect = MatrixUtils.transformRect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add an assert to make sure that targetRenderObject is a descendant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getTransformTo asserts it.
|
This pull request is not suitable for automatic merging in its current state.
|
|
Internal failure appears to be a flake. Looking into it. |
|
Yup, flake. |
|
Does |
|
Hmm. Probably. It might be ok because tabview uses pageview under the hood. Will have to check. |

This relands #65226, which was reverted in #66918 because it caused regressions in google3 for tests involving page views that used ensureVisible.
A test was added in #67021 which covers it.
The changes between this and the original change are in b840a8a, which does the following:
targetRenderObject == renderObjectensureVisiblein_PagePositionto discard thetargetRendreObject. As explained in the comment, this prevents further attempts to "center" the target render object, which could result in changing which page is used.@xu-baolin
Fixes #65100