Chromium Code Reviews| Index: sky/sdk/lib/widgets/animated_component.dart |
| diff --git a/sky/sdk/lib/widgets/animated_component.dart b/sky/sdk/lib/widgets/animated_component.dart |
| index 025e3a4fb3f2d06c06648a306ab24a115692144b..8a4d92f66d82f381786482a65085281734b65ebb 100644 |
| --- a/sky/sdk/lib/widgets/animated_component.dart |
| +++ b/sky/sdk/lib/widgets/animated_component.dart |
| @@ -4,7 +4,11 @@ |
| import 'dart:async'; |
| +import 'package:vector_math/vector_math.dart'; |
| + |
| import '../animation/animated_value.dart'; |
| +import '../animation/animation_performance.dart'; |
| +import '../animation/curves.dart'; |
| import 'basic.dart'; |
| class _AnimationEntry { |
| @@ -50,3 +54,22 @@ abstract class AnimatedComponent extends Component { |
| } |
| } |
| + |
| +// Types of things that can be animated in a component. Use build() to |
| +// construct the final Widget based on the animation state. |
| +// TODO(mpcomplete): the idea here is to eventually have an AnimatedCollection |
| +// which assembles a container based on a list of animated things. e.g. if you |
| +// want to animate position, opacity, and shadow, you add those animators to an |
| +// AnimatedCollection and just call collection.build() to construct your |
| +// widget. |
|
Hixie
2015/06/30 23:11:56
I don't really understand how this will look.
Matt Perry
2015/07/01 18:17:43
See my reply to abarth's comment in this file. Let
|
| + |
| +class AnimatedPosition extends AnimatedType<Point> { |
| + AnimatedPosition(Point begin, Point end, {Curve curve: linear}) |
| + : super(begin, end, curve: curve); |
| + |
| + Widget build({Widget child}) { |
| + Matrix4 transform = new Matrix4.identity(); |
| + transform.translate(value.x, value.y); |
| + return new Transform(transform: transform, child: child); |
| + } |
| +} |