Update RawScrollbar to support the track#97335
Update RawScrollbar to support the track#97335fluttergithubbot merged 3 commits intoflutter:masterfrom
Conversation
| 'isAlwaysShown is deprecated.' | ||
| ), | ||
| assert( | ||
| !((thumbVisibility == false || isAlwaysShown == false) && trackVisibility == true), |
There was a problem hiding this comment.
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.
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.
That makes sense, thanks for explaining.
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.