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

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

Issue 1233433002: Animate the snack bar in the stocks app. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: renmae 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 | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 839e336369628da0fdff1f04251300f3d17b0dc1..8747283a8f0c7e30ad15d58de17282cbaa3757d0 100644
--- a/sky/sdk/lib/widgets/animated_component.dart
+++ b/sky/sdk/lib/widgets/animated_component.dart
@@ -24,19 +24,20 @@ abstract class AnimatedComponent extends StatefulComponent {
final List<AnimationPerformance> _watchedPerformances = new List<AnimationPerformance>();
void watch(AnimatedValue value) {
- assert(!mounted);
// TODO(ianh): we really should assert that we're not doing this
// in the constructor since doing it there is pointless and
// expensive, since we'll be doing it for every copy of the object
// even though only the first one will use it (since we're
// stateful, the others will all be discarded early).
+ assert(!mounted);
_animatedFields.add(new _AnimationEntry(value));
}
void watchPerformance(AnimationPerformance performance) {
- assert(!mounted);
assert(!_watchedPerformances.contains(performance));
_watchedPerformances.add(performance);
+ if (mounted)
+ performance.addListener(scheduleBuild);
}
void didMount() {
« no previous file with comments | « sky/sdk/example/stocks/lib/stock_home.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698