title: Dart: Function with String as Parameter as a Parameter in Callback
body: <p>I'm learning Flutter right now, trying to code a simple calculator. I am building rows using this code:</p>
  
  <pre><code>Row(    // creates row
  mainAxisAlignment: MainAxisAlignment.spaceEvenly, //row is spaced evenly
  children: &lt;Widget&gt;[
     _button("4", _number("4")), //calls _button widget passing String 4 and function _number, which passes string 4 also
     _button("5", _number("5")), //button with value 5
     _button("6", _number("6")), //button with value 6
     _button("-", _min("null")) //button for subtraction
    ],
  ),
  </code></pre>
  
  <p>my _button widget looks like this:</p>
  
  <pre><code>Widget _button(String number, Function() f(String number)){ //parameters: the button value as String and the function with the value as String
    return MaterialButton(
      height: buttonHeight,
      minWidth: buttonHeight,
      child: Text(number,
          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 48.0)),
      textColor: Colors.black,
      color: Colors.grey[100],
      onPressed: f,  //function is called
    );
  }
  </code></pre>
  
  <p>Now I want to pass the String number to the Function f, so when the function _number is called, it takes the String number and pastes it onto the display:</p>
  
  <pre><code>void _number(String number){
    setState(() {
     display=display + number ;
    });
  }
  </code></pre>
  
  <p>It does not work, I tried to solve it, but was not successful. Does anyone have an idea?</p>
  
  <p>Thanks!</p>