I am novice in programming. My question why this function is called without tap when I use arguments?
String _gesture = 'No Gesture Detected';
_printgesture(var gestureName) {
setState(() {
_gesture = gestureName;
print("PRINTGESTURE FUNCTION CALLED");
});
}
InkWell(
onTap: _printgesture('Tap Detected'),
// onTap: () {
// _printgesture('Tap Detected');
// },
child: Icon(Icons.dangerous_rounded, size: 300),
),
I wrote it inside anonymous function, it worked though, but still I want to understand why it runs automatically.