Index: sky/sdk/lib/framework/components2/animated_component.dart |
diff --git a/sky/sdk/lib/framework/components2/animated_component.dart b/sky/sdk/lib/framework/components2/animated_component.dart |
deleted file mode 100644 |
index 9a02fd531dddd9e5b4ea10c6fea0e09382df625e..0000000000000000000000000000000000000000 |
--- a/sky/sdk/lib/framework/components2/animated_component.dart |
+++ /dev/null |
@@ -1,51 +0,0 @@ |
-// Copyright 2015 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-import '../animation/animated_value.dart'; |
-import '../fn2.dart'; |
-import 'dart:async'; |
- |
-typedef void SetterFunction(double value); |
- |
-class _AnimationEntry { |
- _AnimationEntry(this.value, this.setter); |
- final AnimatedValue value; |
- final SetterFunction setter; |
- StreamSubscription<double> subscription; |
-} |
- |
-abstract class AnimatedComponent extends Component { |
- |
- AnimatedComponent({ Object key }) : super(key: key, stateful: true); |
- |
- void syncFields(AnimatedComponent source) { } |
- |
- List<_AnimationEntry> _animatedFields = new List<_AnimationEntry>(); |
- |
- animate(AnimatedValue value, SetterFunction setter) { |
- assert(!mounted); |
- setter(value.value); |
- _animatedFields.add(new _AnimationEntry(value, setter)); |
- } |
- |
- void didMount() { |
- for (_AnimationEntry entry in _animatedFields) { |
- entry.subscription = entry.value.onValueChanged.listen((_) { |
- entry.setter(entry.value.value); |
- scheduleBuild(); |
- }); |
- } |
- super.didMount(); |
- } |
- |
- void didUnmount() { |
- for (_AnimationEntry entry in _animatedFields) { |
- assert(entry.subscription != null); |
- entry.subscription.cancel(); |
- entry.subscription = null; |
- } |
- super.didUnmount(); |
- } |
- |
-} |