From f3655f346b48fdf830be19c3d09c4f1afb10ce9a Mon Sep 17 00:00:00 2001 From: Hixie Date: Wed, 16 Sep 2015 14:08:52 -0700 Subject: [PATCH] Minor clean up of animation_performance.dart - Reorder the methods so they are closer to run order. - Reindent the code to match style guide. --- .../src/animation/animation_performance.dart | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/flutter/lib/src/animation/animation_performance.dart b/packages/flutter/lib/src/animation/animation_performance.dart index d862f7e1f2..69745e8727 100644 --- a/packages/flutter/lib/src/animation/animation_performance.dart +++ b/packages/flutter/lib/src/animation/animation_performance.dart @@ -115,23 +115,25 @@ class AnimationPerformance { variable.setProgress(_curvedProgress, _curveDirection); } - /// Start running this animation in the given direction - Future play([Direction direction = Direction.forward]) { - _direction = direction; - return resume(); - } - /// Start running this animation forwards (towards the end) Future forward() => play(Direction.forward); /// Start running this animation in reverse (towards the beginning) Future reverse() => play(Direction.reverse); + /// Start running this animation in the given direction + Future play([Direction direction = Direction.forward]) { + _direction = direction; + return resume(); + } + /// Start running this animation in the most recently direction Future resume() { if (attachedForce != null) { - return fling(velocity: _direction == Direction.forward ? 1.0 : -1.0, - force: attachedForce); + return fling( + velocity: _direction == Direction.forward ? 1.0 : -1.0, + force: attachedForce + ); } return _animateTo(_direction == Direction.forward ? 1.0 : 0.0); }