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

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: remove unused import 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/BUILD.gn ('k') | sky/sdk/lib/animation/animation_performance.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1a53d3386180c6c254917a1ae08eada94f960cb9 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);
@@ -101,7 +101,7 @@ class CardCollectionApp extends App {
if (distance > 0.0) {
double duration = 150.0 * distance / velocityX.abs();
_activeCardDragX = velocityX.sign;
- _activeCardAnimation.timeline.animateTo(1.0, duration);
+ _activeCardAnimation.timeline.animateTo(1.0, duration: duration);
}
}
}
« no previous file with comments | « sky/sdk/BUILD.gn ('k') | sky/sdk/lib/animation/animation_performance.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698