From 924ab725d9f9c7beb12cd0860de9e17f8df8e60e Mon Sep 17 00:00:00 2001 From: Alex Fourman <5362998+fourman-alex@users.noreply.github.com> Date: Sat, 9 Nov 2019 05:33:44 +0200 Subject: [PATCH] Fix AboutListTile having an empty icon placeholder when no icon set. (#43422) --- packages/flutter/lib/src/material/about.dart | 2 +- .../flutter/test/material/about_test.dart | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index 4091177c8d..6559a07d83 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -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, diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart index 976c2c4996..afa2804016 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -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 {