Skip to content

Conversation

@tdenniston
Copy link
Contributor

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

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. 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

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
@tdenniston tdenniston requested a review from Piinks as a code owner April 17, 2025 00:22
Copy link
Contributor

@Piinks Piinks left a 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:

@tdenniston
Copy link
Contributor Author

@Piinks Thanks for the fast review! LMK of other changes, or if I need to squash the commits.

@Piinks Piinks self-requested a review April 30, 2025 02:32
Copy link
Contributor

@Piinks Piinks left a 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. :)

Copy link

@MitchellGoodwin MitchellGoodwin left a 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!

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 30, 2025
@auto-submit auto-submit bot merged commit 8d01cd9 into flutter:main Apr 30, 2025
82 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 30, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Apr 30, 2025
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
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Apr 30, 2025
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
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
…int (flutter#9103)

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

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…int (flutter#9103)

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

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Ortes pushed a commit to Ortes/packages that referenced this pull request Jun 25, 2025
…int (flutter#9103)

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

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
romanejaquez pushed a commit to romanejaquez/flutter that referenced this pull request Aug 14, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[two_dimensional_scrollables] TreeView Widget blanks when closing last parent

3 participants