File tree 2 files changed +10
-1
lines changed
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 {
629
629
630
630
@override
631
631
BouncingScrollPhysics applyTo (ScrollPhysics ? ancestor) {
632
- return BouncingScrollPhysics (parent: buildParent (ancestor));
632
+ return BouncingScrollPhysics (
633
+ parent: buildParent (ancestor),
634
+ decelerationRate: decelerationRate
635
+ );
633
636
}
634
637
635
638
/// 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() {
65
65
const ScrollPhysics never = NeverScrollableScrollPhysics ();
66
66
const ScrollPhysics always = AlwaysScrollableScrollPhysics ();
67
67
const ScrollPhysics page = PageScrollPhysics ();
68
+ const ScrollPhysics bounceDesktop = BouncingScrollPhysics (decelerationRate: ScrollDecelerationRate .fast);
68
69
69
70
String types (ScrollPhysics ? value) => value! .parent == null ? '${value .runtimeType }' : '${value .runtimeType } ${types (value .parent )}' ;
70
71
@@ -92,6 +93,11 @@ void main() {
92
93
types (page.applyTo (bounce.applyTo (clamp.applyTo (never.applyTo (always))))),
93
94
'PageScrollPhysics BouncingScrollPhysics ClampingScrollPhysics NeverScrollableScrollPhysics AlwaysScrollableScrollPhysics' ,
94
95
);
96
+
97
+ expect (
98
+ bounceDesktop.applyTo (always),
99
+ (BouncingScrollPhysics x) => x.decelerationRate == ScrollDecelerationRate .fast
100
+ );
95
101
});
96
102
97
103
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