Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振:;为什么';t`Matrix4.旋转Y`沿Y轴旋转?_Flutter - Fatal编程技术网

Flutter 颤振:;为什么';t`Matrix4.旋转Y`沿Y轴旋转?

Flutter 颤振:;为什么';t`Matrix4.旋转Y`沿Y轴旋转?,flutter,Flutter,以前版本的颤振是沿着Y轴的中间旋转的,但现在它是沿着左侧旋转的,我想知道如何实现中间旋转 颤振版本:2.0.5 _rotateController=AnimationController(持续时间:持续时间(毫秒:300),vsync:this); _rotateAnimation=Tween(开始:0.0,结束:1.0)。设置动画(\u animationController) 转化( 变换:矩阵4.rotationY(_rotateAnimation.value*2*pi), 孩子:Ink

以前版本的颤振是沿着Y轴的中间旋转的,但现在它是沿着左侧旋转的,我想知道如何实现中间旋转

颤振版本:2.0.5


_rotateController=AnimationController(持续时间:持续时间(毫秒:300),vsync:this);
_rotateAnimation=Tween(开始:0.0,结束:1.0)。设置动画(\u animationController)
转化(
变换:矩阵4.rotationY(_rotateAnimation.value*2*pi),
孩子:InkWell(
onTap:(){
_rotateAnimation.value==0
?_rotateController.forward()
:_rotateController.reverse();
},
子:容器(
装饰:盒子装饰(
颜色:Colors.green,borderRadius:borderRadius.circular(30)),
宽度:50,
身高:100,
子:文本('aaa${u rotateAnimation.value}'),
)
),
),
答案是:

 alignment: Alignment.center,
像这样:

变换(
变换:矩阵4.rotationY(_rotateAnimation.value*2*pi),
对齐:对齐.center,
孩子:。。。