createProjectFile static method
Finds the class name from a className
from a String
and returns a TaycanProjectFile object with the name and the path.
Implementation
static TaycanProjectFile createProjectFile(String className,
{Pattern prefix = ""}) {
String name = className.replaceAll(prefix, "");
String? creationPath;
if (name.contains('/')) {
List<String> pathSegments = Uri.parse(name).pathSegments.toList();
name = pathSegments.removeLast();
creationPath = pathSegments.join('/');
}
return TaycanProjectFile(name, creationPath: creationPath);
}