Make sure that a GridPaper doesn't crash in 0x0 environment (#180906)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2026-01-22 00:44:06 +02:00 committed by GitHub
parent a5f4d392a5
commit 3f9dff2a8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,4 +14,14 @@ void main() {
final List<Layer> layers2 = tester.layers;
expect(layers1, equals(layers2));
});
testWidgets('GridPaper does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: Center(child: SizedBox.shrink(child: GridPaper())),
),
);
expect(tester.getSize(find.byType(GridPaper)), Size.zero);
});
}