Flutter->fluro 路由跳转
Flutter->fluro
1.首页跳转 : 根栈,(ios:根视图)
Application.router
.navigateTo(context, Routes.home, replace: true, clearStack: true);
2.返回到路由列表中的某个页面
Navigator.of(context).popUntil( ModalRoute.withName('/setting'));
3.pop返回页面:
Navigator.of(context).pop();
4.路由跳转:
Application.router.navigateTo(context, Routes.seting,
transition: TransitionType.custom,
transitionDuration:Duration(milliseconds: 500),
transitionBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
return ScaleTransition(
// 从0开始到1
scale: Tween(begin: 0.9,end: 1.0)
.animate(CurvedAnimation(
// 传入设置的动画
parent: animation,
// 设置效果,快进漫出 这里有很多内置的效果
curve: Curves.easeInOutQuint,
)),
child: child,
);
});
5.转场的动画
TransitionType:
native,
nativeModal,
inFromLeft,
inFromRight,
inFromBottom,
fadeIn,
custom, // if using custom then you must also provide a transition
material,
materialFullScreenDialog,
cupertino,
cupertinoFullScreenDialog,
transitionDuration:时间
transitionBuilder:转场动画,自定动画(必须:设置custom转场类型)