Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/flutter/test/widgets/flutter_logo_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,14 @@ void main() {

await expectLater(find.byKey(logo), matchesGoldenFile('flutter_logo.png'));
});

testWidgets('FlutterLogo does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: Center(child: SizedBox.shrink(child: FlutterLogo())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Center widget is redundant here. SizedBox.shrink() already constrains its child to a 0x0 size, so the Center widget has no effect on the layout of the FlutterLogo. Removing it will make the test's widget tree more minimal and focused on the specific scenario being tested.

        child: SizedBox.shrink(child: FlutterLogo()),

),
);
expect(tester.getSize(find.byType(FlutterLogo)), Size.zero);
});
}