Flutter 中 Container 添加点击事件
可以,可以使用 'GestureDetector' 组件来添加点击事件,代码如下:
GestureDetector(
onTap: () {
// 点击事件处理逻辑
},
child: Container(
// 点击动画
child: RiveAnimation.asset(
'assets/birds.riv',
animations: const [
'Fly2',
],
),
),
)
原文地址: https://www.cveoy.top/t/topic/ob8L 著作权归作者所有。请勿转载和采集!