Generalize AnimatedWidget to work with any Listenable (#8469)

This commit is contained in:
Adam Barth
2017-02-28 16:40:41 -08:00
committed by GitHub
parent 18ad3eb557
commit ecb6efa926
6 changed files with 65 additions and 49 deletions

View File

@@ -154,8 +154,10 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
// We want to have the newly animating (fading in) views on top.
transitions.sort((FadeTransition a, FadeTransition b) {
double aValue = a.animation.value;
double bValue = b.animation.value;
final Animation<double> aAnimation = a.listenable;
final Animation<double> bAnimation = b.listenable;
final double aValue = aAnimation.value;
final double bValue = bAnimation.value;
return aValue.compareTo(bValue);
});