Make sure that a DraggableScrollableSheet doesn't crash in 0x0 enviro… (#180433)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
DraggableScrollableSheet widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2026-01-06 03:21:18 +02:00 committed by GitHub
parent b659d5fec6
commit f8e4e0e73a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
});
}