@@ -645,50 +645,13 @@ void main() {
645
645
expect(counters[4], 2);
646
646
});
647
647
648
- testWidgets('GridView does not report visual overflow unnecessarily', (WidgetTester tester) async {
649
- await tester.pumpWidget(
650
- Directionality(
651
- textDirection: TextDirection.ltr,
652
- child: GridView(
653
- gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
654
- children: <Widget>[
655
- Container(height: 200.0),
656
- ],
657
- ),
658
- ),
659
- );
660
-
661
- // 1st, check that the render object has received the default clip behavior.
662
- final RenderViewport renderObject = tester.allRenderObjects.whereType<RenderViewport>().first;
663
- expect(renderObject.clipBehavior, equals(Clip.hardEdge));
664
-
665
- // The context will get Clip.none because there is no actual visual overflow.
666
- final TestClipPaintingContext context = TestClipPaintingContext();
667
- renderObject.paint(context, Offset.zero);
668
- expect(context.clipBehavior, equals(Clip.none));
669
- });
670
-
671
648
testWidgets('GridView respects clipBehavior', (WidgetTester tester) async {
672
649
await tester.pumpWidget(
673
650
Directionality(
674
651
textDirection: TextDirection.ltr,
675
652
child: GridView(
676
653
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
677
- children: <Widget>[
678
- Container(height: 2000.0),
679
- Container(height: 2000.0),
680
- Container(height: 2000.0),
681
- Container(height: 2000.0),
682
- Container(height: 2000.0),
683
- Container(height: 2000.0),
684
- Container(height: 2000.0),
685
- Container(height: 2000.0),
686
- Container(height: 2000.0),
687
- Container(height: 2000.0),
688
- Container(height: 2000.0),
689
- Container(height: 2000.0),
690
- Container(height: 2000.0),
691
- ],
654
+ children: <Widget>[Container(height: 2000.0)],
692
655
),
693
656
),
694
657
);
@@ -709,21 +672,7 @@ void main() {
709
672
child: GridView(
710
673
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
711
674
clipBehavior: Clip.antiAlias,
712
- children: <Widget>[
713
- Container(height: 2000.0),
714
- Container(height: 2000.0),
715
- Container(height: 2000.0),
716
- Container(height: 2000.0),
717
- Container(height: 2000.0),
718
- Container(height: 2000.0),
719
- Container(height: 2000.0),
720
- Container(height: 2000.0),
721
- Container(height: 2000.0),
722
- Container(height: 2000.0),
723
- Container(height: 2000.0),
724
- Container(height: 2000.0),
725
- Container(height: 2000.0),
726
- ],
675
+ children: <Widget>[Container(height: 2000.0)],
727
676
),
728
677
),
729
678
);
0 commit comments