Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[material/dropdown_menu.dart] Refactor _RenderDropdownMenuBody.computeDryLayout#176503

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
davidhicks980 wants to merge3 commits intoflutter:master
base:master
Choose a base branch
Loading
fromdavidhicks980:dropdown-dry-layout

Conversation

davidhicks980
Copy link
Contributor

@davidhicks980davidhicks980 commentedOct 4, 2025
edited
Loading

_RenderDropdownMenuBody.computeDryLayout accesses this.constraints, but it should only access the constraints parameter passed into computeDryLayout. This PR removes this.constraints access.

image

Also, I removed a line in which the child's offset is being set in computeDryLayout. This appears to be an error:
image

Finally, I'm curious whether there is a reason why only the first child is being used to set the height?

Resolves#176494

Blocking#176494

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel onDiscord.

Note: The Flutter team is currently trialing the use ofGemini Code Assist for GitHub. Comments from thegemini-code-assist bot 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.

@github-actionsgithub-actionsbot added frameworkflutter/packages/flutter repository. See also f: labels. f: material designflutter/packages/flutter/material repository. labelsOct 4, 2025
Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a 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 correctly refactors_RenderDropdownMenuBody.computeDryLayout to use theconstraints parameter instead ofthis.constraints, adhering to the framework's layout principles. It also removes a side effect withincomputeDryLayout by no longer setting the child's offset, and simplifies the loop logic. A regression test has been added to ensurecomputeDryLayout can be called during another render object's layout phase without causing an assertion failure. The changes are sound and improve the correctness and robustness of theDropdownMenu widget's layout logic.

@davidhicks980davidhicks980 changed the title[material/dropdown_menu.dart] Remove this.constraints access from _RenderDropdownMenuBody.computeDryLayout[material/dropdown_menu.dart] Refactor _RenderDropdownMenuBody.computeDryLayoutOct 4, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[material/dropdown_menu.dart] Dropdown body render object accesses this.constraints from computeDryLayout
1 participant
@davidhicks980

[8]ページ先頭

©2009-2025 Movatter.jp