-
Notifications
You must be signed in to change notification settings - Fork 29.7k
ListTile fix MinIntrinsicHeight calculation #179515
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
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.
Code Review
This pull request fixes an issue in ListTile where computeMinIntrinsicHeight did not account for vertical padding. The change correctly adds this padding. A regression test is also included to prevent this issue from recurring. My review includes suggestions to simplify the implementation in list_tile.dart for better readability and to clean up unused parameters in the new test file.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Piinks
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 LGTM! Thank you for contributing! 💙
| final double titleMinHeight = title.getMinIntrinsicHeight(width); | ||
| final double? subtitleMinHeight = subtitle?.getMinIntrinsicHeight(width); | ||
|
|
||
| const topAndBottomPaddingMultiplier = 2; |
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: I don't know that this variable needs to be defined, it seems obvious to me that padding will need to be applied both above and below the title + subtitle block.
|
Took a look at the google testing failures, there were two failures. One seemed trivial to me, just a slight leading icon vertical position change. The other one was a little less so, it wrapped a ListTile inside a SingleChildScrollView inside an IntrinsicHeight. Before this PR the ListTile scrolled but with this PR it is fully extended. Both changes LGTM. |
|
I just wanted to confirm, but does it require any action on my side?
|
computeMinIntrinsicHeightwas not taking into consideration the vertical padding.Fix: #179377
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.