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
892063ac
Commit
892063ac
authored
Mar 12, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[rename fixit] createFlingScrollSimulation -> createScrollSimulation
Fixes #2233
parent
726eff49
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+1
-1
scroll_behavior.dart
packages/flutter/lib/src/widgets/scroll_behavior.dart
+7
-7
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-1
No files found.
packages/flutter/lib/src/material/tabs.dart
View file @
892063ac
...
...
@@ -374,7 +374,7 @@ class _TabsScrollBehavior extends BoundedBehavior {
bool
isScrollable
=
true
;
Simulation
create
Fling
ScrollSimulation
(
double
position
,
double
velocity
)
{
Simulation
createScrollSimulation
(
double
position
,
double
velocity
)
{
if
(!
isScrollable
)
return
null
;
...
...
packages/flutter/lib/src/widgets/scroll_behavior.dart
View file @
892063ac
...
...
@@ -19,7 +19,7 @@ abstract class ScrollBehavior<T, U> {
/// This function is called when a drag gesture ends.
///
/// Returns null if the behavior is to do nothing.
Simulation
create
Fling
ScrollSimulation
(
T
position
,
U
velocity
)
=>
null
;
Simulation
createScrollSimulation
(
T
position
,
U
velocity
)
=>
null
;
/// Returns an animation that ends at the snap offset.
///
...
...
@@ -129,7 +129,7 @@ class BoundedBehavior extends ExtentScrollBehavior {
}
}
Simulation
_create
Fling
ScrollSimulation
(
double
position
,
double
velocity
,
double
minScrollOffset
,
double
maxScrollOffset
)
{
Simulation
_createScrollSimulation
(
double
position
,
double
velocity
,
double
minScrollOffset
,
double
maxScrollOffset
)
{
final
double
startVelocity
=
velocity
*
_kSecondsPerMillisecond
;
final
SpringDescription
spring
=
new
SpringDescription
.
withDampingRatio
(
mass:
1.0
,
springConstant:
170.0
,
ratio:
1.1
);
return
new
ScrollSimulation
(
position
,
startVelocity
,
minScrollOffset
,
maxScrollOffset
,
spring
,
_kScrollDrag
);
...
...
@@ -145,7 +145,7 @@ class UnboundedBehavior extends ExtentScrollBehavior {
UnboundedBehavior
({
double
contentExtent:
0.0
,
double
containerExtent:
0.0
})
:
super
(
contentExtent:
contentExtent
,
containerExtent:
containerExtent
);
Simulation
create
Fling
ScrollSimulation
(
double
position
,
double
velocity
)
{
Simulation
createScrollSimulation
(
double
position
,
double
velocity
)
{
double
velocityPerSecond
=
velocity
*
1000.0
;
return
new
BoundedFrictionSimulation
(
_kScrollDrag
,
position
,
velocityPerSecond
,
double
.
NEGATIVE_INFINITY
,
double
.
INFINITY
...
...
@@ -169,8 +169,8 @@ class OverscrollBehavior extends BoundedBehavior {
OverscrollBehavior
({
double
contentExtent:
0.0
,
double
containerExtent:
0.0
,
double
minScrollOffset:
0.0
})
:
super
(
contentExtent:
contentExtent
,
containerExtent:
containerExtent
,
minScrollOffset:
minScrollOffset
);
Simulation
create
Fling
ScrollSimulation
(
double
position
,
double
velocity
)
{
return
_create
Fling
ScrollSimulation
(
position
,
velocity
,
minScrollOffset
,
maxScrollOffset
);
Simulation
createScrollSimulation
(
double
position
,
double
velocity
)
{
return
_createScrollSimulation
(
position
,
velocity
,
minScrollOffset
,
maxScrollOffset
);
}
Simulation
createSnapScrollSimulation
(
double
startOffset
,
double
endOffset
,
double
startVelocity
,
double
endVelocity
)
{
...
...
@@ -201,9 +201,9 @@ class OverscrollWhenScrollableBehavior extends OverscrollBehavior {
bool
get
isScrollable
=>
contentExtent
>
containerExtent
;
Simulation
create
Fling
ScrollSimulation
(
double
position
,
double
velocity
)
{
Simulation
createScrollSimulation
(
double
position
,
double
velocity
)
{
if
(
isScrollable
||
position
<
minScrollOffset
||
position
>
maxScrollOffset
)
return
super
.
create
Fling
ScrollSimulation
(
position
,
velocity
);
return
super
.
createScrollSimulation
(
position
,
velocity
);
return
null
;
}
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
892063ac
...
...
@@ -439,7 +439,7 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
}
Simulation
_createFlingSimulation
(
double
scrollVelocity
)
{
final
Simulation
simulation
=
scrollBehavior
.
create
Fling
ScrollSimulation
(
scrollOffset
,
scrollVelocity
);
final
Simulation
simulation
=
scrollBehavior
.
createScrollSimulation
(
scrollOffset
,
scrollVelocity
);
if
(
simulation
!=
null
)
{
final
double
endVelocity
=
pixelOffsetToScrollOffset
(
kPixelScrollTolerance
.
velocity
).
abs
()
*
(
scrollVelocity
<
0.0
?
-
1.0
:
1.0
);
final
double
endDistance
=
pixelOffsetToScrollOffset
(
kPixelScrollTolerance
.
distance
).
abs
();
...
...
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