title: Make Function parameter optional in custom widget flutter
body: <p>I try to create some custom widgets with some parameters in the constructor. This widget has some optional and required parameters.</p>
  <p>how can make <code>Function</code> type parameter optional in my <code>Widget</code>.</p>
  <pre><code>class TextInputWithIcon extends StatefulWidget {
    final String iconPath;
    final String placeHolder;
    final Function(bool) onFocusChange;
    const TextInputWithIcon(
        {Key key,
        @required this.iconPath,
        this.placeHolder = &quot;&quot;,
        this.onFocusChange})
        : super(key: key);
  
    @override
    _TextInputWithIconState createState() =&gt; _TextInputWithIconState();
  }
  
  class _TextInputWithIconState extends State&lt;TextInputWithIcon&gt; {
  @override
    Widget build(BuildContext context) {
      return MY_WIDGET;
     }
  }
  </code></pre>