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:

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));
}