-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Revert "ListTile Material Ripple and Shape Patch (#74373)" #76134
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
This reverts commit 422916d because it causes unexpected changes in the rendering of the background of a ListTile.
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
@gspencergoog Can you post the snippet of code that created the ListTiles with that background? |
@NWalker1208 Unfortunately, I can't share the code, partly because it's hugely complicated, but also because the customer's code is proprietary (Google's). I'm trying to build a test case, but so far I am failing to get it to reproduce. |
@gspencergoog I assume that the grey background on the first image is intentional. Otherwise, I feel like the second image actually looks better. Could you explain how their code tries to give the ListTile a grey background? For example, do they set the color property of the tile, or does a descendant of the ListTile paint the color? Also, thanks for your patience. I didn’t think this contribution would be so troublesome, but maybe that's why nobody has fixed this issue before. Hopefully we can figure this out. |
Yes, the grey background is set on the In looking at the widget tree, it looks like this may have to do with interactions with scrollable areas. If I replace the In a diff of the two widget trees, this line (all from
When run with your change, changes to:
Which I think is mostly expected. I think the problem has to do with how golden tests capture things, and in order to find the golden image, it needs a widget to start with, and if that widget contains a repaint boundary, it uses that repaint boundary, and if it doesn't, it uses an ancestor with a repaint boundary. Since you added in an Here's a ZIP file with a sample app that shows the problem (you'll need to run " |
@gspencergoog So I believe this issue with the test is being caused because the background created by the Ink widget isn't actually painted by the Ink widget, but by it's nearest Material widget ancestor. The golden test only captures what's rendered on the nearest RepaintBoundary. When the tile is in a ListView, the Material widget has a few RepaintBoundaries between it and the ListTile. Before my change, the ListTile painted its own background, so it was captured by the test. Since my change causes the Material widget to render the background, the golden test fails because it doesn't see past the nearest RepaintBoundary. One way to fix this would be to replace the Ink widget with a Material widget, so that it renders all InkFeatures by itself. This would satisfy the test, but it would be less efficient, especially in situations where there are many ListTiles. The alternative, like you mentioned, is to try to change the test, but I think that would have to happen on your end. What would you recommend? |
@NWalker1208 I think you have it figured out. I don't think replacing the I think I'll try and change the test, since it's likely that the actual app is rendering properly, it's just being captured differently now. Obviously, I'd have to verify that first. I'll see if can create a new PR (with your changes) and try to land it simultaneously with changes to the internal test (we have a mechanism for that). (It may be a few days, I've been busy...) |
@gspencergoog Sounds like a plan. Let me know if you run into any new issues. |
This reverts commit 422916d because it causes unexpected changes in the rendering of the background of a
ListTile
.The left side is before the change, and the right side is after (and the pink part is the diff).
Notice that the light grey background disappears.
/cc @NWalker1208