| Index: sky/sdk/lib/widgets/animation_builder.dart
|
| diff --git a/sky/sdk/lib/widgets/animated_container.dart b/sky/sdk/lib/widgets/animation_builder.dart
|
| similarity index 86%
|
| copy from sky/sdk/lib/widgets/animated_container.dart
|
| copy to sky/sdk/lib/widgets/animation_builder.dart
|
| index 89a5a0cb1941cf62df6a67c969c720a323990f50..bbb61d6fd648d3c418107c75d1517d925d874e2a 100644
|
| --- a/sky/sdk/lib/widgets/animated_container.dart
|
| +++ b/sky/sdk/lib/widgets/animation_builder.dart
|
| @@ -14,20 +14,20 @@ import 'basic.dart';
|
| // This class builds a Container object from a collection of optionally-
|
| // animated properties. Use syncFields to update the Container's properties,
|
| // which will optionally animate them using an AnimationPerformance.
|
| -class AnimatedContainer {
|
| +class AnimationBuilder {
|
| AnimatedType<double> opacity;
|
| AnimatedType<Point> position;
|
| AnimatedType<double> shadow;
|
| AnimatedColor backgroundColor;
|
|
|
| - // These don't animate, but are used to build the Container anyway.
|
| + // These don't animate, but are used to build the AnimationBuilder anyway.
|
| double borderRadius;
|
| Shape shape;
|
|
|
| Map<AnimatedVariable, AnimationPerformance> _variableToPerformance =
|
| new Map<AnimatedVariable, AnimationPerformance>();
|
|
|
| - AnimatedContainer();
|
| + AnimationBuilder();
|
|
|
| AnimationPerformance createPerformance(List<AnimatedType> variables,
|
| {Duration duration}) {
|
| @@ -65,16 +65,17 @@ class AnimatedContainer {
|
| return current;
|
| }
|
|
|
| - void syncFields(AnimatedContainer source) {
|
| - _syncField(position, source.position);
|
| - _syncField(shadow, source.shadow);
|
| - _syncField(backgroundColor, source.backgroundColor);
|
| -
|
| - borderRadius = source.borderRadius;
|
| - shape = source.shape;
|
| + void updateFields({ AnimatedType<double> shadow,
|
| + AnimatedColor backgroundColor,
|
| + double borderRadius,
|
| + Shape shape }) {
|
| + _updateField(this.shadow, shadow);
|
| + _updateField(this.backgroundColor, backgroundColor);
|
| + this.borderRadius = borderRadius;
|
| + this.shape = shape;
|
| }
|
|
|
| - void _syncField(AnimatedType variable, AnimatedType sourceVariable) {
|
| + void _updateField(AnimatedType variable, AnimatedType sourceVariable) {
|
| if (variable == null)
|
| return; // TODO(mpcomplete): Should we handle transition from null?
|
|
|
|
|