Skip to content

Commit d3bfac3

Browse files
ahmedsameha1mboetger
authored andcommitted
Make sure that an AlertDialog doesn't crash in 0x0 environment (flutter#174091)
This is my attempt to handle flutter#6537 for the AlertDialog UI control.
1 parent 5eb726d commit d3bfac3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/flutter/test/material/dialog_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,6 +3021,17 @@ void main() {
30213021
expect(find.byType(BackButton), findsNothing);
30223022
expect(find.byType(CloseButton), findsOneWidget);
30233023
});
3024+
3025+
testWidgets('AlertDialog does not crash at zero area', (WidgetTester tester) async {
3026+
await tester.pumpWidget(
3027+
const MaterialApp(
3028+
home: Center(
3029+
child: SizedBox.shrink(child: AlertDialog(content: Text('X'))),
3030+
),
3031+
),
3032+
);
3033+
expect(tester.getSize(find.byType(AlertDialog)).isEmpty, isTrue);
3034+
});
30243035
}
30253036

30263037
@pragma('vm:entry-point')

0 commit comments

Comments
 (0)