如何将手势传递给下面的物体?

Bra*_*sen 6 dart flutter

我正在尝试击中最上面可见的物体后面的物体。我试图通过使用 的属性来实现这GestureDetector一点behavior
其代码如下:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new GestureDetector(
      onTap: () => print("Bottom"),
      child: new Container(
        color: Colors.redAccent,
        child: new Center(
          child: new GestureDetector(
            onTap: () => print("Top"),
            behavior: HitTestBehavior.translucent,
            child: new Container(
              width: 200.0,
              height: 200.0,
              color: Colors.blue.withOpacity(0.3),
            ),
          ),
        ),
      ),
    );
  }
} 
Run Code Online (Sandbox Code Playgroud)

不幸的是,这似乎不起作用。只有Top会打印到控制台。文档看起来这是正确的做法,但也许我在这里遗漏了一些东西?

Dan*_*eny 1

\n

我希望底部的一个或两个都接收该onTap事件。

\n
\n\n

如果只获取Bottom事件就可以了,那么只需删除:

\n\n
onTap: () => print("Top"),\n
Run Code Online (Sandbox Code Playgroud)\n\n

对我有用。注释掉该行后,Bottom当我点击内部方块时,它就会打印出来。

\n\n

用这个版本测试过:

\n\n
Dannys-MacBook:flutter danny$ flutter --version\nFlutter 0.4.5-pre.96 \xe2\x80\xa2 channel master \xe2\x80\xa2 https://github.com/DanTup/flutter.git\nFramework \xe2\x80\xa2 revision d79f2ee223 (12 hours ago) \xe2\x80\xa2 2018-05-26 12:29:53 -0700\nEngine \xe2\x80\xa2 revision 1ed25ca7b7\nTools \xe2\x80\xa2 Dart 2.0.0-dev.58.0.flutter-f981f09760\n
Run Code Online (Sandbox Code Playgroud)\n\n

也就是说,删除内部的GestureDetector效果相同,所以我想知道您添加它是否有某种原因?

\n