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