Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3fe77942
Unverified
Commit
3fe77942
authored
Nov 22, 2022
by
Callum Moffat
Committed by
GitHub
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BouncingScrollPhysics should propagate decelerationRate. (#115797)
parent
0d7a3b7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
scroll_physics.dart
packages/flutter/lib/src/widgets/scroll_physics.dart
+4
-1
scroll_physics_test.dart
packages/flutter/test/widgets/scroll_physics_test.dart
+6
-0
No files found.
packages/flutter/lib/src/widgets/scroll_physics.dart
View file @
3fe77942
...
...
@@ -629,7 +629,10 @@ class BouncingScrollPhysics extends ScrollPhysics {
@override
BouncingScrollPhysics
applyTo
(
ScrollPhysics
?
ancestor
)
{
return
BouncingScrollPhysics
(
parent:
buildParent
(
ancestor
));
return
BouncingScrollPhysics
(
parent:
buildParent
(
ancestor
),
decelerationRate:
decelerationRate
);
}
/// The multiple applied to overscroll to make it appear that scrolling past
...
...
packages/flutter/test/widgets/scroll_physics_test.dart
View file @
3fe77942
...
...
@@ -65,6 +65,7 @@ void main() {
const
ScrollPhysics
never
=
NeverScrollableScrollPhysics
();
const
ScrollPhysics
always
=
AlwaysScrollableScrollPhysics
();
const
ScrollPhysics
page
=
PageScrollPhysics
();
const
ScrollPhysics
bounceDesktop
=
BouncingScrollPhysics
(
decelerationRate:
ScrollDecelerationRate
.
fast
);
String
types
(
ScrollPhysics
?
value
)
=>
value
!.
parent
==
null
?
'
${value.runtimeType}
'
:
'
${value.runtimeType}
${types(value.parent)}
'
;
...
...
@@ -92,6 +93,11 @@ void main() {
types
(
page
.
applyTo
(
bounce
.
applyTo
(
clamp
.
applyTo
(
never
.
applyTo
(
always
))))),
'PageScrollPhysics BouncingScrollPhysics ClampingScrollPhysics NeverScrollableScrollPhysics AlwaysScrollableScrollPhysics'
,
);
expect
(
bounceDesktop
.
applyTo
(
always
),
(
BouncingScrollPhysics
x
)
=>
x
.
decelerationRate
==
ScrollDecelerationRate
.
fast
);
});
test
(
"ScrollPhysics scrolling subclasses - Creating the simulation doesn't alter the velocity for time 0"
,
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment