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
Shorthand function designed in such a way that it is allowed to return function with type void as mentioned in this article --> So why is returning everything allowed through a shorthand function[()=>] even if the return type is void?
So that you have two approaches in your disposal:
use
onPressed: () => calculate(1, 2),
or
onPressed: (){calculate(1, 2);},