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
d19e86f0
Commit
d19e86f0
authored
Sep 25, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge d8ea1b194b446f555402770acd8ac6b217becb7c to fn3
parent
75061728
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
scrollable.dart
packages/flutter/lib/src/fn3/scrollable.dart
+10
-6
No files found.
packages/flutter/lib/src/fn3/scrollable.dart
View file @
d19e86f0
...
...
@@ -158,6 +158,14 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
return
scrollTo
(
newScrollOffset
,
duration:
duration
,
curve:
curve
);
}
void
fling
(
Offset
velocity
)
{
if
(
velocity
!=
Offset
.
zero
)
{
_startToEndAnimation
(
velocity:
_scrollVelocity
(
velocity
));
}
else
if
(!
_toEndAnimation
.
isAnimating
&&
(
_toOffsetAnimation
==
null
||
!
_toOffsetAnimation
.
isAnimating
))
{
settleScrollOffset
();
}
}
void
settleScrollOffset
()
{
_startToEndAnimation
();
}
...
...
@@ -180,11 +188,7 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
}
void
_handleDragEnd
(
Offset
velocity
)
{
if
(
velocity
!=
Offset
.
zero
)
{
_startToEndAnimation
(
velocity:
_scrollVelocity
(
velocity
));
}
else
if
(!
_toEndAnimation
.
isAnimating
&&
(
_toOffsetAnimation
==
null
||
!
_toOffsetAnimation
.
isAnimating
))
{
settleScrollOffset
();
}
fling
(
velocity
);
}
final
List
<
ScrollListener
>
_listeners
=
new
List
<
ScrollListener
>();
...
...
@@ -520,7 +524,7 @@ class PageableListState<T> extends ScrollableListState<T, PageableList<T>> {
.
clamp
(
scrollBehavior
.
minScrollOffset
,
scrollBehavior
.
maxScrollOffset
);
}
void
_handleDragEnd
(
sky
.
Offset
velocity
)
{
void
fling
(
sky
.
Offset
velocity
)
{
double
scrollVelocity
=
_scrollVelocity
(
velocity
);
double
newScrollOffset
=
_snapScrollOffset
(
scrollOffset
+
scrollVelocity
.
sign
*
config
.
itemExtent
)
.
clamp
(
_snapScrollOffset
(
scrollOffset
-
config
.
itemExtent
/
2.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