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

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

Issue 1228803008: Convert Dismissable over to using animated subcomponents (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
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/dismissable.dart » ('j') | sky/sdk/lib/widgets/dismissable.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/dismissable.dart » ('j') | sky/sdk/lib/widgets/dismissable.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698