<p dir="auto">I need to detect taps on a TextField. I'm trying to do this with GestureDetector, but it doesn't seem be working:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="GestureDetector(
  behavior: HitTestBehavior.translucent,
  onTap: () {
    print('hi');
  },
  child: TextField(),
),"><pre class="notranslate"><span class="pl-c1">GestureDetector</span>(
  behavior<span class="pl-k">:</span> <span class="pl-c1">HitTestBehavior</span>.translucent,
  onTap<span class="pl-k">:</span> () {
    <span class="pl-en">print</span>(<span class="pl-s">'hi'</span>);
  },
  child<span class="pl-k">:</span> <span class="pl-c1">TextField</span>(),
),</pre></div>
<p dir="auto">Nothing is printed when tapping.</p>
<p dir="auto">Note that I need to perform an action every time the TextField is tapped, <strong>even after it has focus</strong>. Therefore, I don't believe utilizing FocusNode would work.</p>
<h2 dir="auto">Add onTap gesture on a textField</h2>
<p dir="auto">onTap gesture using GestureDetector class is working for every element except for the textField type.<br>
How can i use onTap gesture on textfield element?</p>