Fix AboutListTile having an empty icon placeholder when no icon set. (#43422)

This commit is contained in:
Alex Fourman
2019-11-09 05:33:44 +02:00
committed by Shi-Hao Hong
parent 8ad7456cd4
commit 924ab725d9
2 changed files with 21 additions and 1 deletions

View File

@@ -112,7 +112,7 @@ class AboutListTile extends StatelessWidget {
/// values default to the empty string.
const AboutListTile({
Key key,
this.icon = const Icon(null),
this.icon,
this.child,
this.applicationName,
this.applicationVersion,

View File

@@ -449,6 +449,26 @@ void main() {
expect(rootObserver.dialogCount, 0);
expect(nestedObserver.dialogCount, 1);
});
testWidgets("AboutListTile's child should not be offset when the icon is not specified.", (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: AboutListTile(
child: Text('About'),
),
),
),
);
expect(
find.descendant(
of: find.byType(AboutListTile),
matching: find.byType(Icon),
),
findsNothing,
);
});
}
class FakeLicenseEntry extends LicenseEntry {