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
c3510b7d
Commit
c3510b7d
authored
Sep 29, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Scrollbehavior release() to createFlingScrollSimulation()
parent
7385641f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
scroll_behavior.dart
packages/flutter/lib/src/animation/scroll_behavior.dart
+5
-5
scrollable.dart
packages/flutter/lib/src/fn3/scrollable.dart
+2
-2
tabs.dart
packages/flutter/lib/src/widgets/tabs.dart
+1
-1
No files found.
packages/flutter/lib/src/animation/scroll_behavior.dart
View file @
c3510b7d
...
...
@@ -14,7 +14,7 @@ const double _kScrollDrag = 0.025;
abstract
class
ScrollBehavior
{
/// Called when a drag gesture ends. Returns a simulation that
/// propels the scrollOffset.
Simulation
release
(
double
position
,
double
velocity
)
=>
null
;
Simulation
createFlingScrollSimulation
(
double
position
,
double
velocity
)
=>
null
;
/// Called when a drag gesture ends and toSnapOffset is specified.
/// Returns an animation that ends at the snap offset.
...
...
@@ -83,7 +83,7 @@ class UnboundedBehavior extends ExtentScrollBehavior {
UnboundedBehavior
({
double
contentExtent:
0.0
,
double
containerExtent:
0.0
})
:
super
(
contentExtent:
contentExtent
,
containerExtent:
containerExtent
);
Simulation
release
(
double
position
,
double
velocity
)
{
Simulation
createFlingScrollSimulation
(
double
position
,
double
velocity
)
{
double
velocityPerSecond
=
velocity
*
1000.0
;
return
new
BoundedFrictionSimulation
(
_kScrollDrag
,
position
,
velocityPerSecond
,
double
.
NEGATIVE_INFINITY
,
double
.
INFINITY
...
...
@@ -133,7 +133,7 @@ class OverscrollBehavior extends BoundedBehavior {
OverscrollBehavior
({
double
contentExtent:
0.0
,
double
containerExtent:
0.0
})
:
super
(
contentExtent:
contentExtent
,
containerExtent:
containerExtent
);
Simulation
release
(
double
position
,
double
velocity
)
{
Simulation
createFlingScrollSimulation
(
double
position
,
double
velocity
)
{
return
_createFlingScrollSimulation
(
position
,
velocity
,
minScrollOffset
,
maxScrollOffset
);
}
...
...
@@ -162,9 +162,9 @@ class OverscrollBehavior extends BoundedBehavior {
class
OverscrollWhenScrollableBehavior
extends
OverscrollBehavior
{
bool
get
isScrollable
=>
contentExtent
>
containerExtent
;
Simulation
release
(
double
position
,
double
velocity
)
{
Simulation
createFlingScrollSimulation
(
double
position
,
double
velocity
)
{
if
(
isScrollable
||
position
<
minScrollOffset
||
position
>
maxScrollOffset
)
return
super
.
release
(
position
,
velocity
);
return
super
.
createFlingScrollSimulation
(
position
,
velocity
);
return
null
;
}
...
...
packages/flutter/lib/src/fn3/scrollable.dart
View file @
c3510b7d
...
...
@@ -137,7 +137,7 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
_stopAnimations
();
if
(
velocity
!=
null
&&
config
.
snapOffsetCallback
!=
null
&&
_scrollOffsetIsInBounds
(
scrollOffset
))
{
Simulation
simulation
=
scrollBehavior
.
release
(
scrollOffset
,
velocity
);
Simulation
simulation
=
scrollBehavior
.
createFlingScrollSimulation
(
scrollOffset
,
velocity
);
if
(
simulation
==
null
)
return
;
double
endScrollOffset
=
simulation
.
x
(
double
.
INFINITY
);
...
...
@@ -152,7 +152,7 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
}
}
Simulation
simulation
=
scrollBehavior
.
release
(
scrollOffset
,
velocity
??
0.0
);
Simulation
simulation
=
scrollBehavior
.
createFlingScrollSimulation
(
scrollOffset
,
velocity
??
0.0
);
if
(
simulation
==
null
)
return
;
_toEndAnimation
.
start
(
simulation
);
...
...
packages/flutter/lib/src/widgets/tabs.dart
View file @
c3510b7d
...
...
@@ -367,7 +367,7 @@ class _TabsScrollBehavior extends BoundedBehavior {
bool
isScrollable
=
true
;
Simulation
release
(
double
position
,
double
velocity
)
{
Simulation
createFlingScrollSimulation
(
double
position
,
double
velocity
)
{
if
(!
isScrollable
)
return
null
;
...
...
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