title: How can you call a void function in Flutter without passing a parameter?
body: <p>I'm new to Flutter and am working through the intro course on Udacity. In one of the tasks, I was trying to follow the code and I can't make much sense of it. Here's the code from the solution of the project (I've cut and paste the parts that matter, and also legal disclaimer I do not own any of this code, it's from the sample Flutter Udacity project):</p>
  
  <pre><code>Widget build(BuildContext context) {
      final input = Padding(
        padding: _padding,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
  
            TextField(...),
  
            _createDropdown(_fromValue.name, _updateFromConversion),
          ],
        ),
      );
  }
  
  void _updateFromConversion(dynamic unitName) {
      setState(() {
        _fromValue = _getUnit(unitName);
      });
      if (_inputValue != null) {
        _updateConversion();
      }
    }
  
  Widget _createDropdown(String currentValue, ValueChanged&lt;dynamic&gt; onChanged) {
      return Container(
        margin: EdgeInsets.only(top: 16.0),
        decoration: BoxDecoration(...),
  
        padding: EdgeInsets.symmetric(vertical: 8.0),
        child: Theme(...),
  
          child: DropdownButtonHideUnderline(
            child: ButtonTheme(
              alignedDropdown: true,
              child: DropdownButton(
                value: currentValue,
                items: _unitMenuItems,
                onChanged: onChanged,
                style: Theme.of(context).textTheme.title,
              ),
            ),
          ),
        ),
      );
  }
  </code></pre>
  
  <p>Here's where I'm stuck. _updateFromConversion requires an input parameter unitName. But when they call it, in _createDropdown, they don't pass any. So how does _updateFromConversion know what unitName is? Also, is _updateFromConversion executed before _createDropdown, or is it executed when the "onChanged" property of DropdownButton is set?</p>
  
  <p>Second question: they're passing that function with return type void into _createDropdown, which is expecting ValueChanged. Shouldn't this throw an error?</p>
  
  <p>If someone can explain the flow of this code and what I am missing I would greatly appreciate it.
  Thank you!</p>