渐变转场动画效果
Navigator.of(context).push(PageRouteBuilder(
transitionDuration: Duration(seconds: 5),
pageBuilder: (context,animation1,animation2){
return FadeTransition(
opacity: animation1,
child: DetailPage(),
);
}
));
modal跳转
如果是通过pushNamed方式跳转,则需要在onGenerateRoute里面返回动画转场效果代码
弹出的方式跳转,本质上也是push
Navigator.of(context).push(MaterialPageRoute(
builder: (context){
return DetailPage();
},
fullscreenDialog: true;
));