-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Make sure that a MenuAnchor doesn't crash in 0x0 environment #176302
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
Make sure that a MenuAnchor doesn't crash in 0x0 environment #176302
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 adds a new widget test for MenuAnchor to ensure it does not crash when placed in a zero-sized environment, such as a SizedBox.shrink. The test verifies that the MenuAnchor widget correctly handles being laid out with zero area by asserting its size is Size.zero.
|
Since |
0ca9be5 to
efbb457
Compare
dkwingsmt
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.
LGTM.
(I don't know why the unit tests keep failing. They don't fail on my computer. Let me retry them again.)
2c913fa to
0a30f06
Compare
| }); | ||
|
|
||
| testWidgets('MenuAnchor does not crash at zero area', (WidgetTester tester) async { | ||
| final Size temp = tester.view.physicalSize; |
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.
Instead of creating a new local variable, you can just add this one-liner instead:
addTearDown(tester.view.reset);
|
Ohhhh right, we haven't reverted the view size after setting it. |
…#176302) This is my attempt to handle flutter#6537 for the MenuAnchor widget. --------- Co-authored-by: Tong Mu <[email protected]>
This is my attempt to handle #6537 for the MenuAnchor widget.