-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update RawScrollbar to support the track #97335
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
| 'isAlwaysShown is deprecated.' | ||
| ), | ||
| assert( | ||
| !((thumbVisibility == false || isAlwaysShown == false) && trackVisibility == true), |
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 assertion is a bit unfriendly. In this case, don't draw the track and documentation of this behavior. What do you think?
At the same time, the Scrollbar widget does not assert this, right?
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 scrollbar widget does not assert this, but the _MaterialScrollbar and CupertinoScrollbar pass these values to the super class RawScrollbar, so they still get the assertion.
Here, where the user explicitly says 'show me the track, don't show me the thumb' I think it is reasonable to assert.
When ScrollbarThemeData.trackVisibility (MaterialStateProperty) is used, and the value changes based on different state combinations, it does not assert and just assumes that if the thumb is not visible then the track should not 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.
That makes sense, thanks for explaining.
xu-baolin
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.
LGTM
Last of several scrollbar clean up PRs to prepare for desktop scrollbars.
Original PR was #96935, but it was becoming too large
Fixes #96936
This PR adds track features as part of the RawScrollbar base class. This will make it easier for subclasses to have a track. It also ensures that if a track is visible, the scrollbar thumb is visible too.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.