The parameter can't have a value of 'null' because of its type in Dart

Wait 5 sec.

Dart functionI have the following Dart function and I am now using null safety:void calculate({int factor}) { // ...}The analyzer complains that:The parameter 'factor' can't have a value of 'null' because of its type, and no non-null default value is provided.Flutter widgetThis is also the case for my StatelessWidget in Flutter:class Foo extends StatelessWidget { const Foo({Key key}): super(key: key); // ...}I get the following error:The parameter 'key' can't have a value of 'null' because of its type, and no non-null default value is provided.How can I resolve this issue?