Minor clean up of animation_performance.dart
- Reorder the methods so they are closer to run order. - Reindent the code to match style guide.
This commit is contained in:
parent
ebf71f59d6
commit
f3655f346b
@ -115,23 +115,25 @@ class AnimationPerformance {
|
|||||||
variable.setProgress(_curvedProgress, _curveDirection);
|
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)
|
/// Start running this animation forwards (towards the end)
|
||||||
Future forward() => play(Direction.forward);
|
Future forward() => play(Direction.forward);
|
||||||
|
|
||||||
/// Start running this animation in reverse (towards the beginning)
|
/// Start running this animation in reverse (towards the beginning)
|
||||||
Future reverse() => play(Direction.reverse);
|
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
|
/// Start running this animation in the most recently direction
|
||||||
Future resume() {
|
Future resume() {
|
||||||
if (attachedForce != null) {
|
if (attachedForce != null) {
|
||||||
return fling(velocity: _direction == Direction.forward ? 1.0 : -1.0,
|
return fling(
|
||||||
force: attachedForce);
|
velocity: _direction == Direction.forward ? 1.0 : -1.0,
|
||||||
|
force: attachedForce
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return _animateTo(_direction == Direction.forward ? 1.0 : 0.0);
|
return _animateTo(_direction == Direction.forward ? 1.0 : 0.0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user