Future<bool> isDirectory(String path)

Checks if type(path) returns FileSystemEntityType.DIRECTORY.

Source

static Future<bool> isDirectory(String path) => _getTypeAsync(path, true)
    .then((type) => (type == FileSystemEntityType.DIRECTORY._type));