From f8e4e0e73a7d63ad0de3bb9688239641fdd9bb98 Mon Sep 17 00:00:00 2001 From: Ahmed Mohamed Sameh Date: Tue, 6 Jan 2026 03:21:18 +0200 Subject: [PATCH] =?UTF-8?q?Make=20sure=20that=20a=20DraggableScrollableShe?= =?UTF-8?q?et=20doesn't=20crash=20in=200x0=20enviro=E2=80=A6=20(#180433)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the DraggableScrollableSheet widget. Co-authored-by: Tong Mu --- .../draggable_scrollable_sheet.0_test.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/examples/api/test/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0_test.dart b/examples/api/test/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0_test.dart index 7bbe03c7d1d..192a65ecd4d 100644 --- a/examples/api/test/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0_test.dart +++ b/examples/api/test/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0_test.dart @@ -162,4 +162,20 @@ void main() { }, variant: TargetPlatformVariant.desktop(), ); + + testWidgets('DraggableScrollableSheet does not crash at zero area', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: SizedBox.shrink( + child: DraggableScrollableSheet(builder: (_, _) => Text('X')), + ), + ), + ), + ); + expect(tester.getSize(find.byType(DraggableScrollableSheet)), Size.zero); + }); }