mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
b659d5fec6
commit
f8e4e0e73a
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user