isValidDirectory static method

bool isValidDirectory(
  1. String path
)

Checks if the given path is a valid directory.

Returns true if the directory exists, otherwise false.

Example:

bool isValid = PathUtils.isValidDirectory('/path/to/directory');

Implementation

static bool isValidDirectory(String path) {
  final directory = Directory(path);
  return directory.existsSync();
}