-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add IconThemeData adjustment to ListTile trailing element #11858
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
…istent with leading element)
|
This will need a test. |
| alignment: FractionalOffset.centerRight, | ||
| child: trailing, | ||
| children.add(IconTheme.merge( | ||
| data: new IconThemeData(color: _iconColor(theme, tileTheme)), |
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.
Might be worth factoring out new IconThemeData(color: _iconColor(theme, tileTheme)), into a value that you use for leading and trailing (which would only be initialized if either is non-null, obviously).
|
This seems pretty good, thanks for the contribution! Just needs a test to make sure we don't accidentally revert the behaviour at some point. |
| IconThemeData iconThemeData; | ||
| if (leading != null || trailing != null) { | ||
| iconThemeData = new IconThemeData(color: _iconColor(theme, tileTheme)); | ||
| } |
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.
nit: our style guide says to avoid the braces for one-line if statements.
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.
looks like you missed this one
|
The test looks great, if you could rebase (looks like there's a conflict) and fix the trivial style nit, I can land it for you! Thanks again! |
|
I think I've taken care of the mentioned issues, let me know if there's anything additional that needs to be done here. |
|
Thanks! |
|
This caused a regression, see #12221. |
It was incorrectly added in #11858
This makes the leading and trailing Widgets behave the same way. What I changed in this PR is closely based on the existing code for the leading element.
Currently, they render differently, as you can see in these two screenshots:

