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
477a54c3
Commit
477a54c3
authored
Oct 12, 2015
by
Collin Jackson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow derived classes of Scrollable to listen for scroll events
parent
90971695
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+7
-2
No files found.
packages/flutter/lib/src/widgets/scrollable.dart
View file @
477a54c3
...
...
@@ -166,8 +166,7 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
setState
(()
{
_scrollOffset
=
newScrollOffset
;
});
if
(
config
.
onScroll
!=
null
)
config
.
onScroll
(
_scrollOffset
);
dispatchOnScroll
();
}
Future
scrollTo
(
double
newScrollOffset
,
{
Duration
duration
,
Curve
curve:
ease
})
{
...
...
@@ -200,6 +199,12 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
return
_startToEndAnimation
();
}
// Derived classes can override this method and call super.dispatchOnScroll()
void
dispatchOnScroll
()
{
if
(
config
.
onScroll
!=
null
)
config
.
onScroll
(
_scrollOffset
);
}
double
_scrollVelocity
(
ui
.
Offset
velocity
)
{
double
scrollVelocity
=
config
.
scrollDirection
==
ScrollDirection
.
horizontal
?
-
velocity
.
dx
...
...
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