bool isDirectorySync(String path)

Synchronously checks if typeSync(path) returns FileSystemEntityType.DIRECTORY.

Source

static bool isDirectorySync(String path) =>
    (_getTypeSync(path, true) == FileSystemEntityType.DIRECTORY._type);