| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'timeline.dart'; | 5 import 'package:sky/animation/timeline.dart'; |
| 6 import 'curves.dart'; | 6 import 'package:sky/animation/curves.dart'; |
| 7 | 7 |
| 8 abstract class AnimatedVariable { | 8 abstract class AnimatedVariable { |
| 9 void setFraction(double t); | 9 void setFraction(double t); |
| 10 } | 10 } |
| 11 | 11 |
| 12 class AnimatedType<T extends dynamic> extends AnimatedVariable { | 12 class AnimatedType<T extends dynamic> extends AnimatedVariable { |
| 13 AnimatedType(this.begin, {this.end, this.curve: linear}) { | 13 AnimatedType(this.begin, {this.end, this.curve: linear}) { |
| 14 value = begin; | 14 value = begin; |
| 15 } | 15 } |
| 16 | 16 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 timeline.stop(); | 111 timeline.stop(); |
| 112 if (remainingDistance != 0.0) | 112 if (remainingDistance != 0.0) |
| 113 timeline.animateTo(target, duration: remainingDistance * duration.inMillis
econds); | 113 timeline.animateTo(target, duration: remainingDistance * duration.inMillis
econds); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void _tick(double t) { | 116 void _tick(double t) { |
| 117 variable.setFraction(t); | 117 variable.setFraction(t); |
| 118 _notifyListeners(); | 118 _notifyListeners(); |
| 119 } | 119 } |
| 120 } | 120 } |
| OLD | NEW |