projectNameError function
Null when name is a valid project name: not empty and not among
others (the names of the other projects); else why not.
Implementation
String? projectNameError(String name, Iterable<String> others) {
if (name.trim().isEmpty) return 'the name is empty';
if (others.contains(name)) {
return '`$name` is the name of more than one project';
}
return null;
}