在Flutter中使用路线在两个页面之间导航时,如何从iOS重新创建modalTransitionStyle = .crossDissolve
。
答案 0 :(得分:1)
在这里,您可以更改transitionDuration:
Navigator.of(context).push(
PageRouteBuilder<Null>(
pageBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return AnimatedBuilder(
animation: animation,
builder: (BuildContext context, Widget child) {
return Opacity(
opacity: animation.value,
child: YourWidgetPage(),
);
});
},
transitionDuration: Duration(milliseconds: 600)),
);