将新页面转移到焦点的默认 flutter 动画是从底部向上滑动。如何更改此行为并从右侧或左侧滑入新页面?
Navigator.push(
context,
new PageRouteBuilder(
pageBuilder: (BuildContext context, _, __) {
return new SearchView();
}
)
);
最佳答案
查看 CupertinoPageRoute :
A modal route that replaces the entire screen with an iOS transition.
The page slides in from the right and exits in reverse. The page also shifts to the left in parallax when another page enters to cover it.
The page slides in from the bottom and exits in reverse with no parallax effect for fullscreen dialogs.
flutter gallery 中有一个演示示例应用:
Navigator.of(context, rootNavigator: true).push(
new CupertinoPageRoute<bool>(
fullscreenDialog: true,
builder: (BuildContext context) => new Tab3Dialog(),
),
);
关于dart - 如何滑动到右侧的新页面而不是 flutter 的底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50704515/