关闭 - 是否可以在不到 1 秒的时间内播放 nextPage() 动画?
Closed - Is it possible to have nextPage() animation in less than 1 second?
我正在创建一个 PageView 部分,它有大约 5 - 10 个 children。我试图制作按钮来控制页面流。但是我发现动画的时长有点别扭
IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded),
onPressed: () {
pageController.previousPage(
duration: Duration(seconds:1),
curve: Curves.easeIn
);
}
)
Duration class 的最小单位是秒,我发现 1 秒对我来说还是太长了。
有什么办法可以进一步缩短动画的时长吗?谢谢
编辑:
在 flutter 中,它实际上有一个更小的单位,称为 milliSeconds。
可以这么说
pageController.previousPage(
duration: Duration(milliseconds: 200),
curve: Curves.easeIn
);
现在转到下一页需要 0.2 秒
我正在创建一个 PageView 部分,它有大约 5 - 10 个 children。我试图制作按钮来控制页面流。但是我发现动画的时长有点别扭
IconButton(
icon: const Icon(Icons.arrow_back_ios_new_rounded),
onPressed: () {
pageController.previousPage(
duration: Duration(seconds:1),
curve: Curves.easeIn
);
}
)
Duration class 的最小单位是秒,我发现 1 秒对我来说还是太长了。 有什么办法可以进一步缩短动画的时长吗?谢谢
编辑: 在 flutter 中,它实际上有一个更小的单位,称为 milliSeconds。
可以这么说
pageController.previousPage(
duration: Duration(milliseconds: 200),
curve: Curves.easeIn
);
现在转到下一页需要 0.2 秒