Make sure that a Divider doesn't crash in 0x0 environment (#174709)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-10-08 22:20:10 +03:00 committed by GitHub
parent 6e5d0079d5
commit 112f859bfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -224,6 +224,15 @@ void main() {
expect(() => Divider.createBorderSide(null), isNot(throwsNoSuchMethodError));
});
testWidgets('Divider does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Center(child: SizedBox.shrink(child: Divider())),
),
);
expect(tester.getSize(find.byType(Divider)), Size.zero);
});
testWidgets('VerticalDivider does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(