The previous version of flutter was rotated along the middle of the Y axis, but now it is rotated along the left side, I want to know how to achieve the middle rotation.
flutter version:2.0.5
_rotateController = AnimationController(duration: Duration(milliseconds: 300), vsync: this); _rotateAnimation = Tween(begin: 0.0, end: 1.0).animate(_animationController) Transform( transform: Matrix4.rotationY(_rotateAnimation.value * 2 * pi), child: InkWell( onTap: () { _rotateAnimation.value == 0 ? _rotateController.forward() : _rotateController.reverse(); }, child: Container( decoration: BoxDecoration( color: Colors.green, borderRadius: BorderRadius.circular(30)), width: 50, height: 100, child: Text('aaa${_rotateAnimation.value}'), ) ), ),
Anonymous Asked question May 13, 2021
Recent Comments