Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Unified Diff: sky/framework/components/scrollable.dart

Issue 1074033002: Added Scrollable.scrollTo() (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/scrollable.dart
diff --git a/sky/framework/components/scrollable.dart b/sky/framework/components/scrollable.dart
index 86b774b4376cddfa98591143a0b3daa7034f5b87..0bbe0e55c4eb6ae20fc64300f935a4befd7c2448 100644
--- a/sky/framework/components/scrollable.dart
+++ b/sky/framework/components/scrollable.dart
@@ -43,8 +43,7 @@ abstract class Scrollable extends Component {
);
}
- bool scrollBy(double scrollDelta) {
- var newScrollOffset = scrollBehavior.applyCurve(_scrollOffset, scrollDelta);
+ bool scrollTo(double newScrollOffset) {
if (newScrollOffset == _scrollOffset)
return false;
setState(() {
@@ -53,6 +52,11 @@ abstract class Scrollable extends Component {
return true;
}
+ bool scrollBy(double scrollDelta) {
+ var newScrollOffset = scrollBehavior.applyCurve(_scrollOffset, scrollDelta);
+ return scrollTo(newScrollOffset);
+ }
+
void _stopSimulation() {
if (_simulation == null)
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698