This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,7 @@ abstract class _AnimatedScrollViewState<T extends _AnimatedScrollView> extends S
521
521
primary: widget.primary,
522
522
physics: widget.physics,
523
523
clipBehavior: widget.clipBehavior,
524
+ shrinkWrap: widget.shrinkWrap,
524
525
slivers: < Widget > [
525
526
SliverPadding (
526
527
padding: widget.padding ?? EdgeInsets .zero,
Original file line number Diff line number Diff line change @@ -488,6 +488,31 @@ void main() {
488
488
489
489
expect (tester.widget <CustomScrollView >(find.byType (CustomScrollView )).clipBehavior, clipBehavior);
490
490
});
491
+
492
+ testWidgets ('AnimatedList.shrinkwrap is forwarded to its inner CustomScrollView' , (WidgetTester tester) async {
493
+ // Regression test for https://github.com/flutter/flutter/issues/115040
494
+ final ScrollController controller = ScrollController ();
495
+ await tester.pumpWidget (
496
+ Directionality (
497
+ textDirection: TextDirection .ltr,
498
+ child: AnimatedList (
499
+ controller: controller,
500
+ initialItemCount: 2 ,
501
+ shrinkWrap: true ,
502
+ itemBuilder: (BuildContext context, int index, Animation <double > _) {
503
+ return SizedBox (
504
+ height: 100.0 ,
505
+ child: Center (
506
+ child: Text ('Item $index ' ),
507
+ ),
508
+ );
509
+ },
510
+ ),
511
+ ),
512
+ );
513
+
514
+ expect (tester.widget <CustomScrollView >(find.byType (CustomScrollView )).shrinkWrap, true );
515
+ });
491
516
}
492
517
493
518
You can’t perform that action at this time.
0 commit comments