Fix a [_ViewportElement] RenderObjectChild update bug#96377
Fix a [_ViewportElement] RenderObjectChild update bug#96377fluttergithubbot merged 3 commits intoflutter:masterfrom
Conversation
| } | ||
| } | ||
|
|
||
| // `moveRenderObjectChild` only happens during [update] stage. |
There was a problem hiding this comment.
Seems an invalid comment that's indicating the wrong method and didn't start with ///?
There was a problem hiding this comment.
Just comment that why not override moveRenderObjectChild
There was a problem hiding this comment.
Could it say it? It wasn't immediately clear for me either
For example
// We don't override `moveRenderObjectChild` here, because it only happens
// during [update] stage.
There was a problem hiding this comment.
Or: Do override moveRenderObjectChild, which just calls super and has an assert that _doingMountOrUpdate is true to show & proof that the comment is true.
There was a problem hiding this comment.
Or: Do override moveRenderObjectChild, which just calls super and has an assert that _doingMountOrUpdate is true to show & proof that the comment is true.
Done and add a test to test it.
| } | ||
| } | ||
|
|
||
| // `moveRenderObjectChild` only happens during [update] stage. |
There was a problem hiding this comment.
Or: Do override moveRenderObjectChild, which just calls super and has an assert that _doingMountOrUpdate is true to show & proof that the comment is true.
Fixes #96024
Fixes #55170
Fixes #25861
The
RenderViewportkeep a child RO by 'center', it will be updated in [_ViewportElement.mount] or [Update].But sometimes the child RO will be changed without [_ViewportElement] change when only the subtree of
Viewportis dirty.In that case, we should also update the center RO.
Similar to the root cause of this issue, it has a similar solution.