Make sure that a CupertinoListSection doesn't crash in 0x0 environment (#179068)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
CupertinoListSection widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-12-10 02:26:59 +02:00 committed by GitHub
parent 4e113f9420
commit 5266539cfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -258,4 +258,15 @@ void main() {
offsetMoreOrLessEquals(const Offset(margin, 41 + margin), epsilon: 1),
);
});
testWidgets('CupertinoListSection does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const CupertinoApp(
home: Center(
child: SizedBox.shrink(child: CupertinoListSection(header: Text('X'))),
),
),
);
expect(tester.getSize(find.byType(CupertinoListSection)), Size.zero);
});
}