[英]Showing the InkWell splash only on pressed widget when it's inside another InkWell widget
I have a container widget which is wrapped inside InkWell
widget for the tap sound, tooltip and splash effect purposes, inside it there's another InkWell
widget for the same purposes but for a different OnTap
action. 我有一个容器部件被包裹在里面
InkWell
部件的踢踏声,提示和飞溅效果的目的,它里面还有另外一个InkWell
为同一目的,但对于不同的部件OnTap
的动作。
When i long press the outside container it shows the splash on everything (which is understandable, but when i press the internal widget it shows the splash on the outer widget as well, which gives the illusion it's the same widget. 当我长按外部容器时,它在所有内容上都显示了飞溅(这是可以理解的,但是当我按下内部小部件时,它也在外部小部件上也显示了飞溅,这给人的错觉是相同的小部件。
The different InkWell
widgets DO act like different widgets, the OnTap
and OnLongPress
act as they should, my problem is the splash animation. 不同的
InkWell
部件不要像不同的部件,该OnTap
和OnLongPress
的行为,因为他们应该,我的问题是飞溅的动画。
I included a GIF to explain it better , how can i prevent the splash on the outer container when user presses the internal one? 我提供了一个GIF来更好地解释它 ,当用户按下内部容器时,如何防止飞溅在外部容器上?
https://github.com/flutter/flutter/issues/14417 https://github.com/flutter/flutter/issues/14417
What's going on here is that both ink wells are fighting for the pointer in the arena, and during the fight they show their reactions.
这里发生的是,两个墨水井都在争夺舞台上的指针,并在战斗中表现出自己的反应。 When one wins, the other will get canceled.
当一个获胜时,另一个将被取消。
We don't have an easy way today for the outer InkWell to know that it's fighting with another InkWell for the same gesture.
对于今天的外部InkWell,我们今天没有一个简单的方法来知道它正在与另一个InkWell争夺相同的手势。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.