Add a ValueAnimation helper class for AnimationPerfomance.

Used for AnimationPerformance with a single AnimatedValue<T> variable.
This commit is contained in:
Matt Perry
2015-08-13 17:29:32 -04:00
parent 4b462bab5d
commit 82d84c766f
4 changed files with 30 additions and 17 deletions

View File

@@ -38,7 +38,7 @@ class EnsureVisibleApp extends App {
List<CardModel> cardModels;
BlockViewportLayoutState layoutState = new BlockViewportLayoutState();
ScrollListener scrollListener;
AnimationPerformance scrollAnimation;
ValueAnimation<double> scrollAnimation;
void initState() {
List<double> cardHeights = <double>[
@@ -51,7 +51,7 @@ class EnsureVisibleApp extends App {
return new CardModel(i, cardHeights[i], color);
});
scrollAnimation = new AnimationPerformance()
scrollAnimation = new ValueAnimation<double>()
..duration = const Duration(milliseconds: 200)
..variable = new AnimatedValue<double>(0.0, curve: ease);