This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
FWIW, this problem also exists in the legacy Flutter gallery.
I'm missing some context here to really understand why this is the right fix. In particular, why do certain scrollables need to set primary or not, when it used to "just work" that they didn't.
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.
Yeah, I need to track that down too.
Vertical scrollables automatically attach to the primary scroll controller if they aren't given a scroll controller. The auto-scrollbar stuff is new, and the gallery will need to be updated for it. It 'just worked' before because there wasn't a widget in the tree enforcing that a certain scroll controller only has one position attached. Since the ScrollBehavior on desktop is adding scrollbars now, the gallery crashes because the when the user tries to interact with the scrollbar, the scrollbar tries to use the scroll controller to change the position. Since more than one position is attached, it breaks.
There is a migration guide here: https://flutter.dev/docs/release/breaking-changes/default-desktop-scrollbars
I am also updating the assertion in the framework because I do think it is a little too aggressive right now.