-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[two_dimensional_scrollables] Fix TreeView null dereference during paint #9103
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
Collapsing a node when there were other nodes offscreen was causing an unexpected null dereference during painting. This PR fixes the bug and adds a test. The bug was caused by erroneous computation of the max vertical scroll extent. Previously, the code computed this considering only scroll extent in the trailing (down) direction; it may also be the case that there is a larger scroll extent in the leading (up) direction. The miscalculation resulted in subsequent error computing the first visible row as a row that is actually offscreen, and thus does not have a render box. The row render box is asserted to be non-null during painting. Fixes flutter/flutter#149182 and flutter/flutter#164981
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.
Hey @tdenniston welcome! Thank you for finding and fixing this! Just a small nit to resolve the failing test below:
@Piinks Thanks for the fast review! LMK of other changes, or if I need to squash the commits. |
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.
LGTM thank you! This will need a second review, I have reached out to the team to find one. :)
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.
LGTM! Thank you for the fix!
flutter/packages@1f069a7...8d01cd9 2025-04-30 [email protected] [two_dimensional_scrollables] Fix TreeView null dereference during paint (flutter/packages#9103) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@1f069a7...8d01cd9 2025-04-30 [email protected] [two_dimensional_scrollables] Fix TreeView null dereference during paint (flutter/packages#9103) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Collapsing a node when there were other nodes offscreen was causing an unexpected null dereference during painting. This PR fixes the bug and adds a test.
The bug was caused by erroneous computation of the max vertical scroll extent. Previously, the code computed this considering only scroll extent in the trailing (down) direction; it may also be the case that there is a larger scroll extent in the leading (up) direction.
The miscalculation resulted in subsequent error computing the first visible row as a row that is actually offscreen, and thus does not have a render box. The row render box is asserted to be non-null during painting.
Fixes flutter/flutter#149182 and flutter/flutter#164981
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3