isValidPath static method

bool isValidPath(
  1. String? path
)

Returns true if the given path exists

If the path parameter is null, the method returns false

Implementation

static bool isValidPath(String? path) {
  if (path == null) return false;

  final directory = Directory(path);
  return directory.existsSync();
}