Skip to content

Commit 0c33218

Browse files
ahmedsameha1SydneyBao
authored andcommitted
Make sure that a CircleAvatar doesn't crash in 0x0 environment (flutter#173498)
This is my attempt to handle flutter#6537 for the CircleAvatar UI control.
1 parent c8999bf commit 0c33218

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/flutter/test/material/circle_avatar_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ void main() {
316316
expect(paragraph.text.style!.color, equals(theme.primaryTextTheme.titleLarge!.color));
317317
});
318318
});
319+
320+
testWidgets('CircleAvatar renders at zero area', (WidgetTester tester) async {
321+
await tester.pumpWidget(
322+
const MaterialApp(
323+
home: SizedBox.shrink(child: CircleAvatar(child: Text('X'))),
324+
),
325+
);
326+
});
319327
}
320328

321329
Widget wrap({required Widget child}) {

0 commit comments

Comments
 (0)