title: How to refactor gesture detector in flutter?
body: <p>Code before putting in function was working properly, but cause I am going to use it a lot I wanted to refactor it. After pressing the text doesn't give any result. I have done the same with TextFormField and it worked out.</p>
  
  <pre><code>    Row(mainAxisAlignment: MainAxisAlignment.start, children: &lt;Widget&gt;[
        GestureDetector(
          child: Text(data, style: TextStyle(color: Colors.grey, fontSize: 16)),
          onTap: () =&gt; onTap,
        )
      ]);
  
  
  gestureTextDetector("Hello", ()=&gt; Navigator.push(context, MaterialPageRoute(builder: (context) =&gt; LoginForm()))),```
  </code></pre>