InkWell和GestureDetector,如何使它们工作?

编程入门 行业动态 更新时间:2024-10-19 18:26:20
本文介绍了InkWell和GestureDetector,如何使它们工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用GestureDetector进行onTapDown回调,但是还具有不错的InkWell飞溅效果.

I'd like to use a GestureDetector for it's onTapDown callback but also have a nice InkWell splash effect.

可以同时使用这两个吗?

Is it possible to use these two together?

推荐答案

如果您要无条件处理指针向下事件而没有手势消除歧义,您可以将InkWell设为侦听器的子级,并设置onPointerDown处理程序.

If you want to unconditionally handle the pointer down event with no gesture disambiguation, you can make the InkWell a child of a Listener, and set the onPointerDown handler.

例如:

new Listener( onPointerDown: (e) { print('onPointerDown'); }, child: new InkWell( child: new Text('Tap me'), onTap: () { print('onTap'); } ), ),

向InkWell添加onTapDown处理程序可能很有意义.

It might make sense to add an onTapDown handler to InkWell.

更多推荐

InkWell和GestureDetector,如何使它们工作?

本文发布于:2023-11-25 15:25:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630291.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:使它   工作   InkWell   GestureDetector

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!