Make sure that a MenuAnchor doesn't crash in 0x0 environment#176302
Make sure that a MenuAnchor doesn't crash in 0x0 environment#176302auto-submit[bot] merged 7 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
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.
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.
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.