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 parentheses on onPressed.
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
),
_incrementCounter
has void return type
void _incrementCounter() {
setState(() {
_counter++;
});
}
But I didn't find any proper documentation.