TickerMode 官方描述:which can be used to disable animations in a subtree.
可用于禁用子树中的动画
所以作用是控制子控件是否显示动画
Offstage:用来控制子控件是否显示,根据offstage,true 隐藏,false显示
Offstage(
offstage: _indexNum != index,
child: TickerMode(
enabled: _indexNum == index,
child: widgetList[index],
),
);
另外,当Offstage不可见的时候,如果child有动画,应该手动停掉,Offstage并不会停掉动画。
Flutter组件之TickerMode and Offstage
最新推荐文章于 2024-05-27 23:31:42 发布