Flutter 开发实战

235课时
2.1K学过
8分

课程评价 (0)

请对课程作出评价:
0/300

学员评价

暂无精选评价
1分钟

11 Simulation-2

这里需要着重提及的就是,为什么 BouncingScrollPhysics 会自动回弹呢?

其实也是 BouncingScrollSimulation 的功劳,因为 BouncingScrollSimulation 构建时,会传递有 leadingExtent:position.minScrollExtenttrailingExtent: position.maxScrollExtent 两个参数,在 underscroll 和 overscroll 的情况下,会利用 ScrollSpringSimulation 实现弹性的回滚到 leadingExtenttrailingExtent 的动画,从而达到如下图的效果:

img