title: The argument type 'Function' can't be assigned to the parameter type 'void Function()?' after null safety
body: <p>I want to achieve to make a drawer with different items on it, so I am creating a separate file for the <code>DrawerItems</code> and the with the constructor, pass the data to the main file. But I get the following error on the <code>onPressed</code> function:</p>
  <pre><code>&quot;The argument type 'Function' can't be assigned to the parameter type 'void Function()'&quot;
  </code></pre>
  <pre><code>class DrawerItem extends StatelessWidget {
      
        final String text;
        final Function onPressed;
      
        const DrawerItem({Key key, this.text, this.onPressed}) : super(key: key);
      
        @override
        Widget build(BuildContext context) {
          return FlatButton(
            child: Text(
              text,
              style: TextStyle(
                fontWeight: FontWeight.w600,
                fontSize: 18.0,
              ),
            ),
            onPressed: onPressed,
          );
        }
      }
  </code></pre>
  <p>Anyone knows why?</p>