Change cursor when hovering on DropdownButton - #80567
Merged
fluttergithubbot merged 2 commits intoMay 14, 2021
Merged
Conversation
Contributor
Implement functionality to change the mouse cursor to a clickable cursor when hovering on the DropdownButton, similar to the IconButton and TextField widgets. flutter#77136
Add one test that verifies cursor behavior when hovering over the DropdownButton widget, both when enabled and disabled. flutter#77136
jushutch
force-pushed
the
77136-dropdown-button-cursor
branch
from
April 21, 2021 21:49
ea9331c to
d33c5de
Compare
dkwingsmt
approved these changes
Apr 28, 2021
dkwingsmt
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for the change!
royarg02
reviewed
May 13, 2021
| await gesture.moveTo(offDropdownButton); | ||
| expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); | ||
|
|
||
| // Test that mouse cursor doesn't change when button is disabled |
Contributor
There was a problem hiding this comment.
It would be better to split this test into a separate one. See https://github.com/flutter/flutter/wiki/Writing-Effective-Tests#one-behavior-per-test.
Contributor
Author
There was a problem hiding this comment.
Okay sounds good, thanks for the feedback!
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.
Implement functionality to change the mouse cursor when hovering over a DropdownButton widget. Currently there is no cursor change, which is unlike the current HTML standard and the standard across similar widgets, such as the IconButton widget. Added a MouseRegion with a default clickable cursor, inspired by the IconButton widget implementation. The changes are minimal and lightweight by only implementing a default cursor, and they can be easily extended in the future.
Also added a DropdownButton test in
dropdown_test.dartto test that the mouse cursor changes appropriately when the button is both enabled and disabled.This PR addresses issue #77136.
Pre-launch Checklist
///).