title: What is the logic behind, what onPressed takes in Flutter?
body: <pre><code>    void moveToReg()
      {
        //it is a function
      }
  
    onPressed: moveToReg  //It works 
    onPressed: moveToReg(); //It gives an error 
  </code></pre>
  
  <blockquote>
    <p>I am an absolute beginner and I want to ask why onPressed takes function without Parentheses ? </p>
  </blockquote>