| Index: sky/framework/animation/generators.dart
|
| diff --git a/sky/framework/animation/generators.dart b/sky/framework/animation/generators.dart
|
| index 3f05eee382ca642938843d913cb117b992e7cd11..7dab878a1b1ddf46b66a645b6768f679a6ce388f 100644
|
| --- a/sky/framework/animation/generators.dart
|
| +++ b/sky/framework/animation/generators.dart
|
| @@ -68,6 +68,7 @@ class AnimationGenerator extends Generator {
|
| FrameGenerator _generator;
|
| Stream<double> _stream;
|
| bool _done = false;
|
| + double _lastTime;
|
|
|
| AnimationGenerator({
|
| this.initialDelay: 0.0,
|
| @@ -87,13 +88,20 @@ class AnimationGenerator extends Generator {
|
| startTime = timeStamp;
|
|
|
| double t = (timeStamp - (startTime + initialDelay)) / duration;
|
| - return math.max(0.0, math.min(t, 1.0));
|
| + _lastTime = math.max(0.0, math.min(t, 1.0));
|
| + return _lastTime;
|
| })
|
| .takeWhile(_checkForCompletion)
|
| .where((t) => t >= 0.0)
|
| .map(_transform);
|
| }
|
|
|
| + double get remainingTime {
|
| + if (_lastTime == null)
|
| + return duration;
|
| + return duration - _lastTime;
|
| + }
|
| +
|
| void cancel() {
|
| _generator.cancel();
|
| }
|
|
|