Chromium Code Reviews| Index: sky/sdk/lib/widgets/animated.dart |
| diff --git a/sky/sdk/lib/widgets/animated.dart b/sky/sdk/lib/widgets/animated.dart |
| index 46c5388eed51a05b120d19f4ad527824d1bfeffa..569bd6e76cdfaec5eb1eb57c1f59d982063a6e94 100644 |
| --- a/sky/sdk/lib/widgets/animated.dart |
| +++ b/sky/sdk/lib/widgets/animated.dart |
| @@ -37,6 +37,33 @@ class PositionAnimation extends AnimatedComponent { |
| } |
| } |
| +class OpacityAnimation extends AnimatedComponent { |
| + OpacityAnimation({ |
| + String key, |
| + this.child, |
| + this.performance, |
| + this.opacity |
| + }) : super(key: key); |
| + |
| + Widget child; |
| + AnimatedType<double> opacity; |
| + AnimationPerformance performance; |
| + |
| + void initState() { |
| + watch(performance); |
|
Matt Perry
2015/07/15 00:27:26
maybe have all of these inherit from a common base
|
| + } |
| + |
| + void syncFields(OpacityAnimation source) { |
| + child = source.child; |
| + opacity = source.opacity; |
| + assert(performance == source.performance); |
| + } |
| + |
| + Widget build() { |
| + return new Opacity(opacity: opacity.value, child: child); |
| + } |
| +} |
| + |
| class ColorAnimation extends AnimatedComponent { |
| ColorAnimation({ |
| String key, |