@@ -881,6 +881,82 @@ void main() {
881881 expect (find.byType (RawScrollbar ), findsNothing);
882882
883883 }, variant: TargetPlatformVariant .all ());
884+
885+ testWidgets ('LicensePage padding' , (WidgetTester tester) async {
886+ const FlutterLogo logo = FlutterLogo ();
887+
888+ await tester.pumpWidget (
889+ const MaterialApp (
890+ title: 'Pirate app' ,
891+ home: Center (
892+ child: LicensePage (
893+ applicationName: 'LicensePage test app' ,
894+ applicationIcon: logo,
895+ applicationVersion: '0.1.2' ,
896+ applicationLegalese: 'I am the very model of a modern major general.' ,
897+ ),
898+ ),
899+ ),
900+ );
901+
902+ final Finder appName = find.text ('LicensePage test app' );
903+ final Finder appIcon = find.byType (FlutterLogo );
904+ final Finder appVersion = find.text ('0.1.2' );
905+ final Finder appLegalese = find.text ('I am the very model of a modern major general.' );
906+ final Finder appPowered = find.text ('Powered by Flutter' );
907+
908+ expect (appName, findsOneWidget);
909+ expect (appIcon, findsOneWidget);
910+ expect (appVersion, findsOneWidget);
911+ expect (appLegalese, findsOneWidget);
912+ expect (appPowered, findsOneWidget);
913+
914+ // Bottom padding is applied to the app version and app legalese text.
915+ final double appNameBottomPadding = tester.getTopLeft (appIcon).dy - tester.getBottomLeft (appName).dy;
916+ expect (appNameBottomPadding, 0.0 );
917+
918+ final double appIconBottomPadding = tester.getTopLeft (appVersion).dy - tester.getBottomLeft (appIcon).dy;
919+ expect (appIconBottomPadding, 0.0 );
920+
921+ final double appVersionBottomPadding = tester.getTopLeft (appLegalese).dy - tester.getBottomLeft (appVersion).dy;
922+ expect (appVersionBottomPadding, 18.0 );
923+
924+ final double appLegaleseBottomPadding = tester.getTopLeft (appPowered).dy - tester.getBottomLeft (appLegalese).dy;
925+ expect (appLegaleseBottomPadding, 18.0 );
926+ });
927+
928+ testWidgets ('LicensePage has no extra padding between app icon and app powered text' , (WidgetTester tester) async {
929+ // This is a regression test for https://github.com/flutter/flutter/issues/99559
930+
931+ const FlutterLogo logo = FlutterLogo ();
932+
933+ await tester.pumpWidget (
934+ const MaterialApp (
935+ title: 'Pirate app' ,
936+ home: Center (
937+ child: LicensePage (
938+ applicationIcon: logo,
939+ ),
940+ ),
941+ ),
942+ );
943+
944+ final Finder appName = find.text ('LicensePage test app' );
945+ final Finder appIcon = find.byType (FlutterLogo );
946+ final Finder appVersion = find.text ('0.1.2' );
947+ final Finder appLegalese = find.text ('I am the very model of a modern major general.' );
948+ final Finder appPowered = find.text ('Powered by Flutter' );
949+
950+ expect (appName, findsNothing);
951+ expect (appIcon, findsOneWidget);
952+ expect (appVersion, findsNothing);
953+ expect (appLegalese, findsNothing);
954+ expect (appPowered, findsOneWidget);
955+
956+ // Padding between app icon and app powered text.
957+ final double appIconBottomPadding = tester.getTopLeft (appPowered).dy - tester.getBottomLeft (appIcon).dy;
958+ expect (appIconBottomPadding, 18.0 );
959+ });
884960}
885961
886962class FakeLicenseEntry extends LicenseEntry {
0 commit comments