dart - 如何滑动到右侧的新页面而不是 flutter 的底部?

标签 dart material-design flutter flutter-layout

将新页面转移到焦点的默认 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/

相关文章:

Flutter MQTT 客户端分离套接字无法同时实现 'Stream<List<int>>' 和 'Stream<Uint8List>'

javascript - 如何创建类似于Google登录表单的表单?

css - AngularJS Material : no scrollbar in custom components

flutter - 如何在两个屏幕之间使用 block 模式

flutter - Flutter location.altitude返回0.0

flutter - 如何在不影响后台内容的情况下弯曲底部导航栏角? flutter

dart - 内置库 'dart:io' 在 Dartium 上不可用

angular - Material Design 2 选项卡底部对齐

flutter - 大量打印是否会使某些 Flutter 代码运行速度变慢?

flutter - 在flutter中使用 `Draggable`时如何设置反馈和指针之间的偏移量?