我得到一个黑屏'PageRouteBuilder',我不知道为什么。我希望有人能给我点线索
Navigator.of(context).push(
PageRouteBuilder(pageBuilder: (context, animation, secondAnimation) {
return TestPage();
}, transitionsBuilder: (context, animation, secondAnimation, child) {
return AnimatedBuilder(
animation: _animationController,
builder: (context, child) {
return Transform(
alignment: FractionalOffset.center,
transform: Matrix4.identity()
..setEntry(3, 2, 0.002)
..rotateY(3.14 * _animation.value),
child: child,
);
});
}));
1条答案
按热度按时间kcwpcxri1#
Transform小部件从AnimatedBuilder获取子级,但它没有子级。只需将transitionsBuilder的子参数传递给AnimatedBuilder构造函数或重命名AnimatedBuilder的子参数。