I have a simple form with a button to calculate the form. I figure it\'s better to hit the button to start the action of calculating and pass the variables to the dumb function
Do you remember the very first line in flutter which is
void main() => runApp(MyApp());
Where =>
represents one line functions or methods
which is key while calling functions with arguments.
Ex:
void display() {
}
we can call the above function by
IconButton(icon: Icon(Icons.add), onPressed: display)
here we can not include ()
with display
But, when there is one or more than one arguments to be passed then it goes like below
void addition(int value1, int value2) {
value1 + value2
}
IconButton(icon: Icon(Icons.add), onPressed: ()=>addition(2, 4))