帮帮我!我想静音和取消静音按钮与洛蒂动画。但这个mute.json的json动画都有。所以我需要一个点击播放洛蒂半动画这样。当点击x1c 0d1x和
@override
void initState() {
super.initState();
_controller = AnimationController(vsync: this)
..value = 0.5
..addListener(() {
setState(() {
// Rebuild the widget at each frame to update the "progress" label.
});
});
}
Column(
children[
Lottie.asset(
controller: _controller,
'assets/mute.json',
animate: true,
onLoaded: (composition) {
setState(() {
_controller.duration = composition.duration;
});
},
),
],
),
1条答案
按热度按时间gtlvzcf81#
在控制器上使用animateTo方法。