Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

flutter使用按dp偏移的相对定位动画应该用什么组件?

现在用的是Transform(transform: Matrix4.translationValues),但是不会自动响应动画值,需要手动监听动画值变化或者套AnimatedBuilder,只好自己封装了一下。看文档官方是有一套可以自动响应动画值的Transition系列组件的,但是里面没有能按dp偏移的组件,SlideTransition只能按子元素大小的倍数偏移。感觉这种基础的东西官方应该会有组件,是我没找到吗,还是说没有?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

隐式动画AnimatedPositioned配合状态管理或者setState应该可以满足你的需要。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...