If a GestureDetector is not working on a TextField in Flutter, it’s important to note that TextField itself handles user input gestures, and using a GestureDetector directly on it might not behave as expected. If you require a Gesture Detector on a Text field, use the following code. In this code, the AbsorbPointer ensures that the Gesture Detector’s onTap function works
GestureDetector(
onTap: () {
print("hello now i m working ");
},
child: AbsorbPointer(
child: TextField(
controller: textController,
readOnly: true,
decoration: InputDecoration(
labelText: 'Research Thinker File ',
suffixIcon: Icon(Icons.upload_outlined)),
),
),
),
Conclusion : If the onTap function of the Gesture Detector is not working, then use AbsorbPointer to ensure that the onTap of the Gesture Detector functions properly.