What is the difference between calling the function without parentheses and with parentheses on onPressed or Ontap?
I just know that void function can\'t be called with
Using parenthesis means you are giving the function an empty set of parameters to run. Using parenthesis with function name will execute the function if the function requires 0 parameters.
On the other hand, Without parameters means you are just mentioning that function. Like,
8;//Here I'm just mentioning 8. It's useless
Example:
void fun(){
print('Func is running!');
}
void main(){
func();//Here i wanna execute 'func'
Function a = func;//Here i wanna assign 'func' to a
}
Output:
Func is executing