From 559da1fd76ae7af505d8e5b03e98f1fc551f76c3 Mon Sep 17 00:00:00 2001 From: Ahmed Mohamed Sameh Date: Wed, 20 Aug 2025 21:42:39 +0300 Subject: [PATCH] Make sure that a CircleAvatar doesn't crash in 0x0 environment (#173498) This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the CircleAvatar UI control. --- packages/flutter/test/material/circle_avatar_test.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/flutter/test/material/circle_avatar_test.dart b/packages/flutter/test/material/circle_avatar_test.dart index 900219445db..5fc2715686e 100644 --- a/packages/flutter/test/material/circle_avatar_test.dart +++ b/packages/flutter/test/material/circle_avatar_test.dart @@ -316,6 +316,14 @@ void main() { expect(paragraph.text.style!.color, equals(theme.primaryTextTheme.titleLarge!.color)); }); }); + + testWidgets('CircleAvatar renders at zero area', (WidgetTester tester) async { + await tester.pumpWidget( + const MaterialApp( + home: SizedBox.shrink(child: CircleAvatar(child: Text('X'))), + ), + ); + }); } Widget wrap({required Widget child}) {