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

Make sure that a SubmenuButton doesn't crash in 0x0 environment#176535

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
ahmedsameha1 wants to merge1 commit intoflutter:master
base:master
Choose a base branch
Loading
fromahmedsameha1:handle#6537-SubmenuButton

Conversation

ahmedsameha1
Copy link
Contributor

This is my attempt to handle#6537 for the SubmenuButton widget.

@github-actionsgithub-actionsbot added frameworkflutter/packages/flutter repository. See also f: labels. f: material designflutter/packages/flutter/material repository. labelsOct 5, 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 adds a regression test to ensure thatSubmenuButton does not crash when placed in a zero-sized environment. The test case is well-structured and minimal, effectively reproducing the scenario described in the associated issue. My only suggestion is to add a comment referencing the issue number to improve code maintainability.

expect(tester.getRect(findMenuPanels()).width,800.0- reservedPadding.horizontal);
});

testWidgets('SubmenuButton does not crash at zero area', (WidgetTester tester)async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

medium

To improve long-term maintainability and provide context for this test, it would be beneficial to add a comment referencing the GitHub issue it addresses. This is a common practice in the Flutter repository.1

Suggested change
testWidgets('SubmenuButton does not crash at zero area', (WidgetTester tester)async {
// Regression test for https://github.com/flutter/flutter/issues/6537
testWidgets('SubmenuButton does not crash at zero area', (WidgetTester tester)async {

Style Guide References

Footnotes

  1. Documentation should be useful and explain the 'why' and the 'how'. While this applies to public APIs, the principle of documenting the 'why' is also valuable for tests, especially regression tests.

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.

1 participant
@ahmedsameha1

[8]ページ先頭

©2009-2025 Movatter.jp