@@ -592,6 +592,19 @@ FlutterError
592592 tester.widget <Scrollable >(find.byType (Scrollable )).physics,
593593 isA <AlwaysScrollableScrollPhysics >(),
594594 );
595+ expect (tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent, isNull);
596+
597+ await tester.pumpWidget (
598+ Directionality (
599+ textDirection: .ltr,
600+ child: ListView (physics: const .alwaysScrollable (parent: ClampingScrollPhysics ())),
601+ ),
602+ );
603+
604+ expect (
605+ tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent,
606+ isA <ClampingScrollPhysics >(),
607+ );
595608 });
596609
597610 testWidgets ('ScrollPhysics supports shorthands for BouncingScrollPhysics' , (
@@ -608,6 +621,19 @@ FlutterError
608621 tester.widget <Scrollable >(find.byType (Scrollable )).physics,
609622 isA <BouncingScrollPhysics >(),
610623 );
624+ expect (tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent, isNull);
625+
626+ await tester.pumpWidget (
627+ Directionality (
628+ textDirection: .ltr,
629+ child: ListView (physics: const .bouncing (parent: ClampingScrollPhysics ())),
630+ ),
631+ );
632+
633+ expect (
634+ tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent,
635+ isA <ClampingScrollPhysics >(),
636+ );
611637 });
612638
613639 testWidgets ('ScrollPhysics supports shorthands for ClampingScrollPhysics' , (
@@ -624,6 +650,19 @@ FlutterError
624650 tester.widget <Scrollable >(find.byType (Scrollable )).physics,
625651 isA <ClampingScrollPhysics >(),
626652 );
653+ expect (tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent, isNull);
654+
655+ await tester.pumpWidget (
656+ Directionality (
657+ textDirection: .ltr,
658+ child: ListView (physics: const .clamping (parent: ClampingScrollPhysics ())),
659+ ),
660+ );
661+
662+ expect (
663+ tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent,
664+ isA <ClampingScrollPhysics >(),
665+ );
627666 });
628667
629668 testWidgets ('ScrollPhysics supports shorthands for NeverScrollableScrollPhysics' , (
@@ -640,6 +679,19 @@ FlutterError
640679 tester.widget <Scrollable >(find.byType (Scrollable )).physics,
641680 isA <NeverScrollableScrollPhysics >(),
642681 );
682+ expect (tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent, isNull);
683+
684+ await tester.pumpWidget (
685+ Directionality (
686+ textDirection: .ltr,
687+ child: ListView (physics: const .neverScrollable (parent: ClampingScrollPhysics ())),
688+ ),
689+ );
690+
691+ expect (
692+ tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent,
693+ isA <ClampingScrollPhysics >(),
694+ );
643695 });
644696
645697 testWidgets ('ScrollPhysics supports shorthands for PageScrollPhysics' , (
@@ -653,6 +705,19 @@ FlutterError
653705 );
654706
655707 expect (tester.widget <Scrollable >(find.byType (Scrollable )).physics, isA <PageScrollPhysics >());
708+ expect (tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent, isNull);
709+
710+ await tester.pumpWidget (
711+ Directionality (
712+ textDirection: .ltr,
713+ child: ListView (physics: const .page (parent: ClampingScrollPhysics ())),
714+ ),
715+ );
716+
717+ expect (
718+ tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent,
719+ isA <ClampingScrollPhysics >(),
720+ );
656721 });
657722
658723 testWidgets ('ScrollPhysics supports shorthands for RangeMaintainingScrollPhysics' , (
@@ -669,6 +734,19 @@ FlutterError
669734 tester.widget <Scrollable >(find.byType (Scrollable )).physics,
670735 isA <RangeMaintainingScrollPhysics >(),
671736 );
737+ expect (tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent, isNull);
738+
739+ await tester.pumpWidget (
740+ Directionality (
741+ textDirection: .ltr,
742+ child: ListView (physics: const .rangeMaintaining (parent: ClampingScrollPhysics ())),
743+ ),
744+ );
745+
746+ expect (
747+ tester.widget <Scrollable >(find.byType (Scrollable )).physics? .parent,
748+ isA <ClampingScrollPhysics >(),
749+ );
672750 });
673751}
674752
0 commit comments