September 2019
Beginner
512 pages
12h 52m
English
Using AnimatedWidget in our case would require us to simply modify our ButtonTransition widget. However, as you remember, there is a concept behind this. To follow this, we need to extend the AnimatedWidget class and transform our widget into an animated button in its build() method.
We start by defining our new AnimatedWidget based widget:
class AnimatedButton extends AnimatedWidget { final RaisedButton button; const AnimatedButton({ Key key, @required Listenable animation, this.button, }) : super( key: key, listenable: animation, ); @override Widget build(BuildContext context) { Animation<ButtonTransformation> animation = listenable; return Transform( transform: Matrix4.translationValues( animation.value.offset.dx, ...Read now
Unlock full access