Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Unified Diff: sky/sdk/lib/widgets/animated_container.dart

Issue 1231933006: Use AnimatedContainer for card_collection.dart. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/sdk/lib/widgets/animated_container.dart
diff --git a/sky/sdk/lib/widgets/animated_container.dart b/sky/sdk/lib/widgets/animated_container.dart
index 016ff675b634f4d1c0a5fd466fb4efb7ce398941..89a5a0cb1941cf62df6a67c969c720a323990f50 100644
--- a/sky/sdk/lib/widgets/animated_container.dart
+++ b/sky/sdk/lib/widgets/animated_container.dart
@@ -15,6 +15,7 @@ import 'basic.dart';
// animated properties. Use syncFields to update the Container's properties,
// which will optionally animate them using an AnimationPerformance.
class AnimatedContainer {
+ AnimatedType<double> opacity;
AnimatedType<Point> position;
AnimatedType<double> shadow;
AnimatedColor backgroundColor;
@@ -28,12 +29,13 @@ class AnimatedContainer {
AnimatedContainer();
- AnimationPerformance createPerformance(AnimatedType variable,
+ AnimationPerformance createPerformance(List<AnimatedType> variables,
{Duration duration}) {
AnimationPerformance performance = new AnimationPerformance()
..duration = duration
- ..variable = variable;
- _variableToPerformance[variable] = performance;
+ ..variable = new AnimatedList(variables);
+ for (AnimatedVariable variable in variables)
+ _variableToPerformance[variable] = performance;
return performance;
}
@@ -53,7 +55,11 @@ class AnimatedContainer {
if (position != null) {
Matrix4 transform = new Matrix4.identity();
transform.translate(position.value.x, position.value.y);
- current = new Transform(transform: transform, child: child);
+ current = new Transform(transform: transform, child: current);
+ }
+
+ if (opacity != null) {
+ current = new Opacity(opacity: opacity.value, child: current);
}
return current;

Powered by Google App Engine
This is Rietveld 408576698