Skip to content

Commit 9c056ed

Browse files
Make sure that an ExpandIcon doesn't crash in 0x0 envrionment (flutter#175042)
This is my attempt to handle flutter#6537 for the ExpandIcon widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
1 parent ab47943 commit 9c056ed

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/flutter/test/material/expand_icon_test.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,4 +382,17 @@ void main() {
382382
iconTheme = tester.firstWidget(find.byType(IconTheme).last);
383383
expect(iconTheme.data.color, equals(Colors.cyan));
384384
});
385+
386+
testWidgets('Expand icon does not crash at zero area', (WidgetTester tester) async {
387+
await tester.pumpWidget(
388+
MaterialApp(
389+
home: Scaffold(
390+
body: Center(
391+
child: SizedBox.shrink(child: ExpandIcon(onPressed: (bool value) {})),
392+
),
393+
),
394+
),
395+
);
396+
expect(tester.getSize(find.byType(ExpandIcon)), Size.zero);
397+
});
385398
}

0 commit comments

Comments
 (0)