title: Flutter - prevent tap/click events from being passed through view hierarchy
body: <p>I'm looking for the best way to <strong>stop tap/click events from being propagated</strong> up the view hierarchy. Suppose we have a simple scenario with a <strong>TextField</strong> decorated with a an 'X' <strong>clear text button</strong>. </p>
  
  <p>When I click the "X" button the click <strong>event</strong> is propagated up to TextField's onPressed().</p>
  
  <pre><code>final _textEditingController = TextEditingController(text: "");
  
  @override
  Widget build(BuildContext context) {
    return TextFormField(
      controller: _textEditingController,
      onTap: onEditTextTapped,
      decoration: InputDecoration(
        suffixIcon: IconButton(
          onPressed: onClearTextClick,
          icon: Icon(
            Icons.clear,
            size: 20.0,
          ),
        ),
      ),
      style: TextStyle(fontWeight: FontWeight.normal, fontSize: 18),
    );
  }
  
  void onEditTextTapped() {
    print('TextField tapped');
  }
  
  void onClearTextClick() {
    print('clear text clicked');
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/AXYRM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AXYRM.png" alt="enter image description here"></a></p>
  
  <p>The result is:</p>
  
  <pre><code>flutter: clear text clicked
  flutter: TextField tapped
  </code></pre>
  
  <p>I need something similar to Android's <code>android:clickable="true"</code> or Flutter's <code>AbsorbPointer</code> that would trap all click events and stop them from being passed through to the view beneath BUT only when I click 'clear text' button. Click event from <code>TextFormField</code> should still trigger <code>onEditTextTapped()</code></p>
  
  <p>Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.5 18F132)</p>