-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add mouse cursor API to widgets (phase 1) #57628
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
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.
This look good, just wanted to consider merging the two MaterialState cursor classes.
|
@HansMuller I made |
|
Thanks, will take a look. I wasn't able to come up with a better name than MaterialStateMouseCursor.clickable. |
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
Description
This PR adds default cursor and/or
mouseCursorproperty to a number of widgets.This PR also adds
MaterialStateMouseCursor, which is a mouse cursor that depends on material states, as well asClickableMouseCursor, which is a material state mouse cursor that isclicknormally butbasicwhen disabled.The complete list of widgets are as follows:
basic)text)text)Open question
ClickableMouseCursor?MaterialStateMouseCursorin a currying-like way so that the states ofInkResponsecan be directly used?Related Issues
Tests
I added the following tests:
mouseCursorpropertyClickableMouseCursor, then the widget displays the correct cursor when disabled.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.