Slider: add themeable mouse cursor v2#96623
Merged
HansMuller merged 2 commits intoflutter:masterfrom Jan 14, 2022
Merged
Conversation
8 tasks
darrenaustin
approved these changes
Jan 14, 2022
Comment on lines
-543
to
-544
| assert(widget.onChangeStart != null); | ||
| widget.onChangeStart!(_lerp(value)); |
Contributor
There was a problem hiding this comment.
Do we know the history of this assert? Is it here just to protect the reference in the call below? If so, yeah it would be good to remove it as you have. But was it actually a requirement of the widget to not have this null (which seems odd)? If so it should be moved to the widget constructor, no? Same for the similar assert in _handleDragEnd.
Contributor
Author
There was a problem hiding this comment.
It was just to defend against an error being introduced in the original code on lines 751,752. No longer needed.
Comment on lines
+706
to
+711
| final Set<MaterialState> states = <MaterialState>{ | ||
| if (!_enabled) MaterialState.disabled, | ||
| if (_hovering) MaterialState.hovered, | ||
| if (_focused) MaterialState.focused, | ||
| if (_dragging) MaterialState.dragged, | ||
| }; |
Contributor
There was a problem hiding this comment.
Nice set up here. I like this pattern.
Comment on lines
-751
to
-752
| onChangeStart: widget.onChangeStart != null ? _handleDragStart : null, | ||
| onChangeEnd: widget.onChangeEnd != null ? _handleDragEnd : null, |
Contributor
There was a problem hiding this comment.
Wow, that seemed like a convoluted way to hook up the callback. Nice cleanup.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jan 18, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jan 18, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jan 18, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Feb 4, 2022
clocksmith
pushed a commit
to clocksmith/flutter
that referenced
this pull request
Mar 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Allow themes to override Slider's mouse cursor.
Partial fix to #88371
This PR is based on #88425 (author: @jpnurmi). It's been extended a little per the review feedback for the PR. PR #88371 wasn't reviewed for months by yours truly, so I'm completing the project here.