From ef3df2f4fbcd747024558e8dfc902228c7a59fdd Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Tue, 14 Apr 2015 10:01:44 -0700 Subject: [PATCH] Scrollable should use scrollTo() instead of setting _scrollOffset directly, when starting an animation. I'd missed this case when adding Scrollable.scrollTo() https://codereview.chromium.org/1074033002 R=ianh@google.com Review URL: https://codereview.chromium.org/1082163002 --- framework/components/scrollable.dart | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/framework/components/scrollable.dart b/framework/components/scrollable.dart index 0bbe0e55c4e..dadcf775a67 100644 --- a/framework/components/scrollable.dart +++ b/framework/components/scrollable.dart @@ -69,11 +69,7 @@ abstract class Scrollable extends Component { _simulation = scrollBehavior.release(particle); if (_simulation == null) return; - _simulation.onTick.listen((_) { - setState(() { - _scrollOffset = particle.position; - }); - }); + _simulation.onTick.listen((_) => scrollTo(particle.position)); } Particle _createParticle([double velocity = 0.0]) {