-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Slider paint incorrectly when the track shape is rectangular #64534
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
| theme: ThemeData( | ||
| sliderTheme: const SliderThemeData( | ||
| trackShape: RectangularSliderTrackShape(), | ||
| )), |
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 second ) should at a new line
|
@HansMuller Hi, please review this change at your convenience, thanks very much! |
|
The |
JoseAlba
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.
██╗ ██████╗ ████████╗███╗ ███╗
██║ ██╔════╝ ╚══██╔══╝████╗ ████║
██║ ██║ ███╗ ██║ ██╔████╔██║
██║ ██║ ██║ ██║ ██║╚██╔╝██║
███████╗╚██████╔╝ ██║ ██║ ╚═╝ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
| ]); | ||
| }); | ||
|
|
||
| testWidgets('Slider paint correctly when the track shape is rectangular', (WidgetTester tester) async { |
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.
replace with: Slider track paints correctly when the shape is rectangular
HansMuller
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
| theme: ThemeData( | ||
| sliderTheme: const SliderThemeData( | ||
| trackShape: RectangularSliderTrackShape(), | ||
| ) |
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.
trailing comma here
| final Size thumbSize = sliderTheme.thumbShape.getPreferredSize(isEnabled, isDiscrete); | ||
|
|
||
| final Rect leftTrackSegment = Rect.fromLTRB(trackRect.left + trackRect.height / 2, trackRect.top, thumbCenter.dx - thumbSize.width / 2, trackRect.bottom); | ||
| final Rect leftTrackSegment = Rect.fromLTRB(trackRect.left, trackRect.top, thumbCenter.dx, trackRect.bottom); |
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.
NICE. This is all much more obvious.
Description
This gap was added intended, see #31564, but this process is different from
RoundedRectSliderTrackShape, so I think we should remove it.Related Issues
Fixes #64696
Tests
I added the following tests:
See files.
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.