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

Unified Diff: sky/sdk/example/widgets/card_collection.dart

Issue 1226263003: Break dependency of AnimationPerformance on AnimatedValue (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add missing tick 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/example/widgets/card_collection.dart
diff --git a/sky/sdk/example/widgets/card_collection.dart b/sky/sdk/example/widgets/card_collection.dart
index 13330e022f93f199cd5c37290893e795af9ac246..9d0971590c0e804d6e23937c2b549eb753c26e62 100644
--- a/sky/sdk/example/widgets/card_collection.dart
+++ b/sky/sdk/example/widgets/card_collection.dart
@@ -29,8 +29,8 @@ class CardCollectionApp extends App {
CardCollectionApp() {
_activeCardAnimation = new AnimationPerformance()
..variable = new AnimatedType(0.0, 1.0)
- ..duration = new Duration(milliseconds: _kCardDismissFadeoutMS);
- _activeCardAnimation.timeline.onValueChanged.listen(_handleAnimationProgressChanged);
+ ..duration = new Duration(milliseconds: _kCardDismissFadeoutMS)
+ ..addListener(_handleAnimationProgressChanged);
}
int _activeCardIndex = -1;
@@ -46,7 +46,7 @@ class CardCollectionApp extends App {
return _activeCardAnimation.progress * _activeCardDragX.sign * _activeCardWidth * _kDismissCardThreshold;
}
- void _handleAnimationProgressChanged(_) {
+ void _handleAnimationProgressChanged() {
setState(() {
if (_activeCardAnimation.isCompleted && !_activeCardDragUnderway)
_dismissedCardIndices.add(_activeCardIndex);

Powered by Google App Engine
This is Rietveld 408576698