@@ -913,6 +913,67 @@ void main() {
913913
914914 }, variant: TargetPlatformVariant .all ());
915915
916+ testWidgets ('ListView of license entries is primary' , (WidgetTester tester) async {
917+ // Regression test for https://github.com/flutter/flutter/issues/120710
918+ LicenseRegistry .addLicense (() {
919+ return Stream <LicenseEntry >.fromIterable (< LicenseEntry > [
920+ LicenseEntryWithLineBreaks (
921+ < String > ['AAA' ],
922+ // Add enough content to scroll
923+ List <String >.generate (500 , (int index) => 'BBBB' ).join ('\n ' ),
924+ ),
925+ ]);
926+ });
927+
928+ await tester.pumpWidget (
929+ MaterialApp (
930+ title: 'Flutter Code Sample' ,
931+ home: Scaffold (
932+ body: Builder (
933+ builder: (BuildContext context) => TextButton (
934+ child: const Text ('Show License Page' ),
935+ onPressed: () {
936+ showLicensePage (context: context);
937+ },
938+ ),
939+ ),
940+ ),
941+ )
942+ );
943+ await tester.pumpAndSettle ();
944+
945+ expect (find.text ('Show License Page' ), findsOneWidget);
946+ await tester.tap (find.text ('Show License Page' ));
947+ await tester.pumpAndSettle ();
948+
949+ // Check for packages.
950+ expect (find.text ('AAA' ), findsOneWidget);
951+ // Check license is displayed after entering into license page for 'AAA'.
952+ await tester.tap (find.text ('AAA' ));
953+ await tester.pumpAndSettle ();
954+
955+ // The inherited ScrollBehavior should not apply Scrollbars since they are
956+ // already built in to the widget.
957+ switch (debugDefaultTargetPlatformOverride) {
958+ case TargetPlatform .android:
959+ case TargetPlatform .fuchsia:
960+ case TargetPlatform .linux:
961+ case TargetPlatform .macOS:
962+ case TargetPlatform .windows:
963+ expect (find.byType (CupertinoScrollbar ), findsNothing);
964+ break ;
965+ case TargetPlatform .iOS:
966+ expect (find.byType (CupertinoScrollbar ), findsOneWidget);
967+ break ;
968+ case null :
969+ break ;
970+ }
971+ expect (find.byType (Scrollbar ), findsOneWidget);
972+ expect (find.byType (RawScrollbar ), findsNothing);
973+ await tester.drag (find.byType (ListView ), const Offset (0.0 , 20.0 ));
974+ await tester.pumpAndSettle (); // No exception triggered.
975+ }, variant: TargetPlatformVariant .all ());
976+
916977 testWidgets ('LicensePage padding' , (WidgetTester tester) async {
917978 const FlutterLogo logo = FlutterLogo ();
918979
0 commit comments