Make sure that a GridTileBar doesn't crash in 0x0 environment (#177546)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-11-02 22:25:57 +02:00 committed by GitHub
parent 647ce0c00a
commit b0f5cda78e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,4 +47,15 @@ void main() {
expect(find.text('Simple'), findsOneWidget);
});
testWidgets('GridTileBar does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Center(
child: SizedBox.shrink(child: GridTileBar(title: Text('X'))),
),
),
);
expect(tester.getSize(find.byType(GridTileBar)), Size.zero);
});
}