File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -629,7 +629,10 @@ class BouncingScrollPhysics extends ScrollPhysics {
629629
630630 @override
631631 BouncingScrollPhysics applyTo (ScrollPhysics ? ancestor) {
632- return BouncingScrollPhysics (parent: buildParent (ancestor));
632+ return BouncingScrollPhysics (
633+ parent: buildParent (ancestor),
634+ decelerationRate: decelerationRate
635+ );
633636 }
634637
635638 /// The multiple applied to overscroll to make it appear that scrolling past
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ void main() {
6565 const ScrollPhysics never = NeverScrollableScrollPhysics ();
6666 const ScrollPhysics always = AlwaysScrollableScrollPhysics ();
6767 const ScrollPhysics page = PageScrollPhysics ();
68+ const ScrollPhysics bounceDesktop = BouncingScrollPhysics (decelerationRate: ScrollDecelerationRate .fast);
6869
6970 String types (ScrollPhysics ? value) => value! .parent == null ? '${value .runtimeType }' : '${value .runtimeType } ${types (value .parent )}' ;
7071
@@ -92,6 +93,11 @@ void main() {
9293 types (page.applyTo (bounce.applyTo (clamp.applyTo (never.applyTo (always))))),
9394 'PageScrollPhysics BouncingScrollPhysics ClampingScrollPhysics NeverScrollableScrollPhysics AlwaysScrollableScrollPhysics' ,
9495 );
96+
97+ expect (
98+ bounceDesktop.applyTo (always),
99+ (BouncingScrollPhysics x) => x.decelerationRate == ScrollDecelerationRate .fast
100+ );
95101 });
96102
97103 test ("ScrollPhysics scrolling subclasses - Creating the simulation doesn't alter the velocity for time 0" , () {
You can’t perform that action at this time.
0 commit comments