Skip to content

Commit 5e348fd

Browse files
authored
Make sure that a Scaffold doesn't crash in 0x0 environment (flutter#177722)
This is my attempt to handle flutter#6537 for the Scaffold widget.
1 parent dc7da2b commit 5e348fd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/flutter/test/material/scaffold_test.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,6 +3676,19 @@ void main() {
36763676

36773677
expect(find.byType(BottomAppBar), findsOneWidget);
36783678
});
3679+
3680+
testWidgets('Scaffold does not crash at zero area', (WidgetTester tester) async {
3681+
await tester.pumpWidget(
3682+
MaterialApp(
3683+
home: Center(
3684+
child: SizedBox.shrink(
3685+
child: Scaffold(appBar: AppBar(), body: const SizedBox.shrink()),
3686+
),
3687+
),
3688+
),
3689+
);
3690+
expect(tester.getSize(find.byType(Scaffold)), Size.zero);
3691+
});
36793692
}
36803693

36813694
class _GeometryListener extends StatefulWidget {

0 commit comments

Comments
 (0)