<p dir="auto">问题描述：<br>
某个容器中嵌套一个1像素的Stack，这个Stack中有个漂浮的按钮的点击不好用，请问如何解决？<br>
代码如下：</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="new SizedBox(width: 1.0, height: 1.0,
          child: new Stack(overflow: Overflow.visible,
              children: &lt;Widget&gt;[
                new Positioned(child: new InkWell(onTap: () {
                  print('点击了');//此处不执行
                }, child: new Text('按钮')),
                  right: 0.0, top: 16.0,)
              ])),
``’"><pre class="notranslate"><span class="pl-k">new</span> <span class="pl-c1">SizedBox</span>(width<span class="pl-k">:</span> <span class="pl-c1">1.0</span>, height<span class="pl-k">:</span> <span class="pl-c1">1.0</span>,
          child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Stack</span>(overflow<span class="pl-k">:</span> <span class="pl-c1">Overflow</span>.visible,
              children<span class="pl-k">:</span> <span class="pl-k">&lt;</span><span class="pl-c1">Widget</span><span class="pl-k">&gt;</span>[
                <span class="pl-k">new</span> <span class="pl-c1">Positioned</span>(child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">InkWell</span>(onTap<span class="pl-k">:</span> () {
                  <span class="pl-en">print</span>(<span class="pl-s">'点击了'</span>);<span class="pl-c">//此处不执行</span>
                }, child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Text</span>(<span class="pl-s">'按钮'</span>)),
                  right<span class="pl-k">:</span> <span class="pl-c1">0.0</span>, top<span class="pl-k">:</span> <span class="pl-c1">16.0</span>,)
              ])),
``’</pre></div>
<p dir="auto">Internal: b/143100923</p>
<p dir="auto">When a <code class="notranslate">Stack</code> contains <code class="notranslate">MyWidget</code> inside of a <code class="notranslate">Positioned</code>.</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    Stack(
      overflow: Overflow.visible,
      children: [
        Positioned(
        top: -50.0,
        child: MyWidget(),
      )],
    );"><pre class="notranslate">    <span class="pl-c1">Stack</span>(
      overflow<span class="pl-k">:</span> <span class="pl-c1">Overflow</span>.visible,
      children<span class="pl-k">:</span> [
        <span class="pl-c1">Positioned</span>(
        top<span class="pl-k">:</span> <span class="pl-k">-</span><span class="pl-c1">50.0</span>,
        child<span class="pl-k">:</span> <span class="pl-c1">MyWidget</span>(),
      )],
    );</pre></div>
<p dir="auto">Since overflow is <code class="notranslate">Overflow.visible</code>, <code class="notranslate">MyWidget</code> displays outside of the <code class="notranslate">Stack</code>. However, it doesn't accept gestures in the overflowed area. I have no idea if it's easy, difficult or downright impossible to make this change, but I can think of a gazillion use cases for that, which at the moment must be satisfied by using the much more complex Overlay, or some Stack tricks.</p>
<p dir="auto">And in case it's impossible to make this change, then at least the documentation should clearly state that overflowed content can't receive gestures.</p>
<p dir="auto">Also, see: <a href="https://stackoverflow.com/questions/51366761/in-flutter-how-can-a-positioned-widget-feel-taps-outside-of-its-parent-stack-ar" rel="nofollow">https://stackoverflow.com/questions/51366761/in-flutter-how-can-a-positioned-widget-feel-taps-outside-of-its-parent-stack-ar</a></p>