Make sure that a Draggable doesn't crash in 0x0 environment#180380
Make sure that a Draggable doesn't crash in 0x0 environment#180380auto-submit[bot] merged 2 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a widget test to ensure that Draggable widgets do not crash when placed in a zero-sized area. The test correctly sets up the scenario, but it does not trigger a drag gesture, which is necessary to reproduce the crash described in the associated issue. I've suggested an addition to the test to initiate a drag gesture, which will properly verify the fix.
| ), | ||
| ), | ||
| ); | ||
| expect(tester.getSize(find.byType(Draggable<bool>)), Size.zero); |
There was a problem hiding this comment.
The test sets up the zero-sized Draggable correctly, but it doesn't attempt to drag it. The crash described in issue #6537 occurs when a drag is initiated. To properly test the fix, we should simulate a drag gesture on the Draggable.
expect(tester.getSize(find.byType(Draggable<bool>)), Size.zero);
// Start a drag gesture to ensure it doesn't crash.
final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Draggable<bool>)));
await gesture.up();There was a problem hiding this comment.
I think this isn't true and the test is fine as-is, right?
| ), | ||
| ), | ||
| ); | ||
| expect(tester.getSize(find.byType(Draggable<bool>)), Size.zero); |
There was a problem hiding this comment.
I think this isn't true and the test is fine as-is, right?
This is my attempt to handle #6537 for the Draggable widget.