最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to make Listener behavior parameter work as documented in Flutter? - Stack Overflow

programmeradmin1浏览0评论

In HitTestBehavior Flutter docs we can see that:

opaque → Opaque targets can be hit by hit tests, causing them to both receive events within their bounds and prevent targets visually behind them from also receiving events.

translucent → Translucent targets both receive events within their bounds and permit targets visually behind them to also receive events.

but that is not what my tests show.

When placing Listeners as children of a Listener the top Listeners behave as translucent no matter its set behavior both for onPointerDown and onPointerUp events. The blue square is set to opaque and the red one is set to translucent.

When placing Listeners as Stack children the last Listeners behave as opaque no matter its set behavior both for onPointerDown and onPointerUp events. Again the blue square is set to opaque and the red one is set to translucent.

No matter how I place the Listeners, they seem to never behave as documented.

How to make Listener behavior parameter work as documented in Flutter?

Or is it a bug?

发布评论

评论列表(0)

  1. 暂无评论