directoryPath property
String
get
directoryPath
Retrieves the directory path from the current stack trace.
This method extracts the file path and determines its parent directory.
Throws:
- FileNotFoundException if no file path is found in the stack trace.
Returns: A string representing the extracted directory path.
Implementation
String get directoryPath {
final filePath = this.filePath;
final separator = isWindows ? '\\' : '/';
return filePath.substring(0, filePath.lastIndexOf(separator));
}