Move Scaffold over to using AnimationController

Also, clean up the class hierarchy for AnimationController now that
we've renamed progress to value. That means everything in the hierarchy
now has a value, include Watchable. This patch renames Watchable to
Animated<T>, which lets us use that type almost everywhere.

I've added some ducktape to modal bottom sheets to avoid having to
refactor all of Navigator to use AnimationController. I'll remove the
ducktape in the next patch.
This commit is contained in:
Adam Barth
2016-01-19 16:48:45 -08:00
parent 386b27755d
commit 0b098ee2e5
15 changed files with 282 additions and 232 deletions

View File

@@ -33,14 +33,14 @@ class CardTransition extends StatelessComponent {
});
final Widget child;
final Animation animation;
final Animated<double> animation;
final Evaluatable<double> x;
final Evaluatable<double> opacity;
final Evaluatable<double> scale;
Widget build(BuildContext context) {
return new AnimationWatchingBuilder(
watchable: animation,
return new AnimatedBuilder(
animation: animation,
builder: (BuildContext context) {
double currentScale = scale.evaluate(animation);
Matrix4 transform = new Matrix4.identity()
@@ -62,7 +62,7 @@ class SmoothBlockState extends State<SmoothBlock> {
double _height = 100.0;
Widget _handleEnter(Animation animation, Widget child) {
Widget _handleEnter(Animated<double> animation, Widget child) {
return new CardTransition(
x: new Tween<double>(begin: -200.0, end: 0.0),
opacity: new Tween<double>(begin: 0.0, end: 1.0),
@@ -72,7 +72,7 @@ class SmoothBlockState extends State<SmoothBlock> {
);
}
Widget _handleExit(Animation animation, Widget child) {
Widget _handleExit(Animated<double> animation, Widget child) {
return new CardTransition(
x: new Tween<double>(begin: 0.0, end: 200.0),
opacity: new Tween<double>(begin: 1.0, end: 0.0),