Skip to content

Commit 485a2cd

Browse files
authored
Make sure that an AboutDialog doesn't crash in 0x0 environment (flutter#172444)
This is my attempt to handle flutter#6537 for the AboutDialog UI control.
1 parent b9477bd commit 485a2cd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/flutter/test/material/about_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,20 @@ void main() {
18881888
final ThemeData licensePageTheme = Theme.of(tester.element(find.text('Powered by Flutter')));
18891889
expect(theme.colorScheme.primary, licensePageTheme.colorScheme.primary);
18901890
});
1891+
1892+
testWidgets('AboutDialog renders at zero area', (WidgetTester tester) async {
1893+
await tester.pumpWidget(
1894+
const MaterialApp(
1895+
home: Center(
1896+
child: SizedBox.shrink(
1897+
child: Scaffold(body: AboutDialog(children: <Widget>[Text('X')])),
1898+
),
1899+
),
1900+
),
1901+
);
1902+
final Finder xText = find.text('X');
1903+
expect(tester.getSize(xText).isEmpty, isTrue);
1904+
});
18911905
}
18921906

18931907
class FakeLicenseEntry extends LicenseEntry {

0 commit comments

Comments
 (0)