Skip to content

Commit b0f5cda

Browse files
Make sure that a GridTileBar doesn't crash in 0x0 environment (flutter#177546)
This is my attempt to handle flutter#6537 for the GridTileBar widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
1 parent 647ce0c commit b0f5cda

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/flutter/test/material/grid_title_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,15 @@ void main() {
4747

4848
expect(find.text('Simple'), findsOneWidget);
4949
});
50+
51+
testWidgets('GridTileBar does not crash at zero area', (WidgetTester tester) async {
52+
await tester.pumpWidget(
53+
const MaterialApp(
54+
home: Center(
55+
child: SizedBox.shrink(child: GridTileBar(title: Text('X'))),
56+
),
57+
),
58+
);
59+
expect(tester.getSize(find.byType(GridTileBar)), Size.zero);
60+
});
5061
}

0 commit comments

Comments
 (0)