Skip to content

Commit e17d535

Browse files
authored
Fix AlertDialog.adaptive clipBehavior is non-nullable (#154173)
Fixes flutter/flutter#153983
1 parent 99dc3be commit e17d535

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/flutter/lib/src/material/dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class AlertDialog extends StatelessWidget {
464464
Color? surfaceTintColor,
465465
String? semanticLabel,
466466
EdgeInsets insetPadding,
467-
Clip clipBehavior,
467+
Clip? clipBehavior,
468468
ShapeBorder? shape,
469469
AlignmentGeometry? alignment,
470470
bool scrollable,

packages/flutter/test/material/dialog_test.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2894,6 +2894,12 @@ void main() {
28942894
const SimpleDialog simpleDialog = SimpleDialog();
28952895
expect(simpleDialog.insetPadding, isNull);
28962896
});
2897+
2898+
testWidgets('Can pass a null value to AlertDialog.adaptive clip behavior', (WidgetTester tester) async {
2899+
for (final Clip? clipBehavior in <Clip?>[null, ...Clip.values]) {
2900+
AlertDialog.adaptive(clipBehavior: clipBehavior);
2901+
}
2902+
});
28972903
}
28982904

28992905
class _RestorableDialogTestWidget extends StatelessWidget {

0 commit comments

Comments
 (0)