-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Fix remaining iconbuttontheme overrides in listtile #169029
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
base: master
Are you sure you want to change the base?
Fix remaining iconbuttontheme overrides in listtile #169029
Conversation
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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.
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.
Oh I see why the overlayColor and mouseCursor don't work. Nice catch!
For mouseCursor, I think the problem is located in the IconButton.styleFrom()
in icon_button.dart
. In the method, we should check whether both disabledMouseCursor
and enabledMouseCursor
are null; if yes, then we should just assign null
to mouseCursor
; otherwise, keep the original implementation.
styleFrom(
...
mouseCursor: disabledMouseCursor == null && enabledMouseCursor == null
? null
: WidgetStateProperty<MouseCursor?>.fromMap(
<WidgetStatesConstraint, MouseCursor?>{
WidgetState.disabled: disabledMouseCursor,
WidgetState.any: enabledMouseCursor,
},
),
...
);
For the overlayColor, styleFrom
will generate overlayColor for IconButton based on the foreground color. So the IconButtonTheme overlayColor can never successfully merge into IconButton.styleFrom()
. Nice catch!
f14f1d8
to
756008f
Compare
5ee5a1e
to
9c15bc2
Compare
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:) Thank you for the fix!
Fix remaining outstanding IconButtonTheme overrides: overlayColor and mouseCursor.
Issue: #167727
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.