This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 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
521521 primary: widget.primary,
522522 physics: widget.physics,
523523 clipBehavior: widget.clipBehavior,
524+ shrinkWrap: widget.shrinkWrap,
524525 slivers: < Widget > [
525526 SliverPadding (
526527 padding: widget.padding ?? EdgeInsets .zero,
Original file line number Diff line number Diff line change @@ -488,6 +488,31 @@ void main() {
488488
489489 expect (tester.widget <CustomScrollView >(find.byType (CustomScrollView )).clipBehavior, clipBehavior);
490490 });
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+ });
491516}
492517
493518
You can’t perform that action at this time.
0 commit comments