September 2019
Beginner
512 pages
12h 52m
English
To create a scale animation and have a better effect than changing the scale attribute directly, we can use the AnimationController class again:

This time, to build our RaisedButton widget with a scale, we define a Transform widget with the well-known Transform.scale constructor:
_scaleAnimationButton() { return Transform.scale( scale: _scale, child: RaisedButton( child: Text("Scaled button"), onPressed: () { if (_animation.status == AnimationStatus.completed) { _animation.reverse(); } else if (_animation.status == AnimationStatus.dismissed) { _animation.forward(); } }, ), ); }
Notice that, now, we use a _scale property in ...
Read now
Unlock full access