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

Unified Diff: sky/sdk/lib/animation/animation_performance.dart

Issue 1223073002: AnimatedContainer: generalized Container widget that handles animating values (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/animation/animation_performance.dart
diff --git a/sky/sdk/lib/animation/animation_performance.dart b/sky/sdk/lib/animation/animation_performance.dart
index f4179e95ac770b515ba3487261be9e1cefff3b19..e03278ff427a36a22ab238ac272ee3a33c29acfb 100644
--- a/sky/sdk/lib/animation/animation_performance.dart
+++ b/sky/sdk/lib/animation/animation_performance.dart
@@ -13,16 +13,18 @@ abstract class AnimatedVariable {
class AnimatedType<T extends dynamic> extends AnimatedVariable {
T value;
- final T begin, end;
+ T begin, end;
final Curve curve;
- AnimatedType(this.begin, this.end, {this.curve: linear}) {
+ AnimatedType(this.begin, {this.end, this.curve: linear}) {
value = begin;
}
void setFraction(double t) {
- // TODO(mpcomplete): Reverse the timeline and curve.
- value = begin + (end - begin) * curve.transform(t);
+ if (end != null) {
+ // TODO(mpcomplete): Reverse the timeline and curve.
+ value = begin + (end - begin) * curve.transform(t);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698