Flutter 中 PageView 的默认曲线行为是什么?

pso*_*pso 6 flutter flutter-animation

所述PageControllerPageView具有如下功能animateToPage,其允许定义页面滑动时的曲线效应。

Future<void> animateToPage(
    int page, {
    @required Duration duration,
    @required Curve curve,
  })
Run Code Online (Sandbox Code Playgroud)

我需要将它的行为与 PageView 的默认滑动过渡的行为相匹配。

有什么帮助吗?

Oma*_*att 2

正如 @pskink 在评论中提到的,默认PageView过渡动画依赖于用户手势所应用的物理原理。根据用户的滑动,然后将其转换为页面的过渡动画。

另一方面,PageController依赖animateToPage于持续时间设置和曲线。要模拟平滑的滑动,您可以Curves.ease按照前面提到的方式使用。