validateFilename method
Check if the extracted filename
from the --name argument matches
dart coding standards
Implementation
void validateFilename(final bool verbose, final String filename) {
final RegExp filenameRegex = RegExp('[a-z_]');
final bool matches = filenameRegex.hasMatch(filename);
VerboseLogger.logValidatingFilename(verbose);
if (!matches) {
throw ArgumentError(
'The filename can only consist of alphabetical characters and underscores.');
}
}