File class

The metadata for a file.

Some resource methods (such as files.update) require a fileId. Use the files.list method to retrieve the ID for a file.

Constructors

File({String? alternateLink, bool? appDataContents, bool? canComment, bool? canReadRevisions, FileCapabilities? capabilities, List<ContentRestriction>? contentRestrictions, bool? copyRequiresWriterPermission, bool? copyable, DateTime? createdDate, String? defaultOpenWithLink, String? description, String? downloadUrl, String? driveId, bool? editable, String? embedLink, String? etag, bool? explicitlyTrashed, Map<String, String>? exportLinks, String? fileExtension, String? fileSize, String? folderColorRgb, String? fullFileExtension, bool? hasAugmentedPermissions, bool? hasThumbnail, String? headRevisionId, String? iconLink, String? id, FileImageMediaMetadata? imageMediaMetadata, FileIndexableText? indexableText, bool? isAppAuthorized, String? kind, FileLabelInfo? labelInfo, FileLabels? labels, User? lastModifyingUser, String? lastModifyingUserName, DateTime? lastViewedByMeDate, FileLinkShareMetadata? linkShareMetadata, DateTime? markedViewedByMeDate, String? md5Checksum, String? mimeType, DateTime? modifiedByMeDate, DateTime? modifiedDate, Map<String, String>? openWithLinks, String? originalFilename, bool? ownedByMe, List<String>? ownerNames, List<User>? owners, List<ParentReference>? parents, List<String>? permissionIds, List<Permission>? permissions, List<Property>? properties, String? quotaBytesUsed, String? resourceKey, String? selfLink, String? sha1Checksum, String? sha256Checksum, bool? shareable, bool? shared, DateTime? sharedWithMeDate, User? sharingUser, FileShortcutDetails? shortcutDetails, List<String>? spaces, String? teamDriveId, FileThumbnail? thumbnail, String? thumbnailLink, String? thumbnailVersion, String? title, DateTime? trashedDate, User? trashingUser, Permission? userPermission, String? version, FileVideoMediaMetadata? videoMediaMetadata, String? webContentLink, String? webViewLink, bool? writersCanShare})
File.fromJson(Map json_)

Properties

A link for opening the file in a relevant Google editor or viewer.
getter/setter pair
appDataContents bool?
Whether this file is in the Application Data folder.
getter/setter pair
canComment bool?
Deprecated: Use capabilities/canComment instead.
getter/setter pair
canReadRevisions bool?
Deprecated: Use capabilities/canReadRevisions instead.
getter/setter pair
capabilities FileCapabilities?
Capabilities the current user has on this file.
getter/setter pair
contentRestrictions List<ContentRestriction>?
Restrictions for accessing the content of the file.
getter/setter pair
copyable bool?
Deprecated: Use capabilities/canCopy instead.
getter/setter pair
copyRequiresWriterPermission bool?
Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
getter/setter pair
createdDate DateTime?
Create time for this file (formatted RFC 3339 timestamp).
getter/setter pair
A link to open this file with the user's default app for this file.
getter/setter pair
description String?
A short description of the file.
getter/setter pair
downloadUrl String?
Short lived download URL for the file.
getter/setter pair
driveId String?
ID of the shared drive the file resides in.
getter/setter pair
editable bool?
Deprecated: Use capabilities/canEdit instead.
getter/setter pair
A link for embedding the file.
getter/setter pair
etag String?
ETag of the file.
getter/setter pair
explicitlyTrashed bool?
Whether this file has been explicitly trashed, as opposed to recursively trashed.
getter/setter pair
Links for exporting Docs Editors files to specific formats.
getter/setter pair
fileExtension String?
The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed.
getter/setter pair
fileSize String?
Size in bytes of blobs and first party editor files.
getter/setter pair
folderColorRgb String?
Folder color as an RGB hex string if the file is a folder or a shortcut to a folder.
getter/setter pair
fullFileExtension String?
The full file extension; extracted from the title.
getter/setter pair
hasAugmentedPermissions bool?
Whether there are permissions directly on this file.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasThumbnail bool?
Whether this file has a thumbnail.
getter/setter pair
headRevisionId String?
The ID of the file's head revision.
getter/setter pair
A link to the file's icon.
getter/setter pair
id String?
The ID of the file.
getter/setter pair
imageMediaMetadata FileImageMediaMetadata?
Metadata about image media.
getter/setter pair
indexableText FileIndexableText?
Indexable text attributes for the file (can only be written)
getter/setter pair
isAppAuthorized bool?
Whether the file was created or opened by the requesting app.
getter/setter pair
kind String?
The type of file.
getter/setter pair
labelInfo FileLabelInfo?
An overview of the labels on the file.
getter/setter pair
labels FileLabels?
A group of labels for the file.
getter/setter pair
lastModifyingUser User?
The last user to modify this file.
getter/setter pair
lastModifyingUserName String?
Name of the last user to modify this file.
getter/setter pair
lastViewedByMeDate DateTime?
Last time this file was viewed by the user (formatted RFC 3339 timestamp).
getter/setter pair
linkShareMetadata FileLinkShareMetadata?
Contains details about the link URLs that clients are using to refer to this item.
getter/setter pair
markedViewedByMeDate DateTime?
Deprecated.
getter/setter pair
md5Checksum String?
An MD5 checksum for the content of this file.
getter/setter pair
mimeType String?
The MIME type of the file.
getter/setter pair
modifiedByMeDate DateTime?
Last time this file was modified by the user (formatted RFC 3339 timestamp).
getter/setter pair
modifiedDate DateTime?
Last time this file was modified by anyone (formatted RFC 3339 timestamp).
getter/setter pair
A map of the id of each of the user's apps to a link to open this file with that app.
getter/setter pair
originalFilename String?
The original filename of the uploaded content if available, or else the original value of the title field.
getter/setter pair
ownedByMe bool?
Whether the file is owned by the current user.
getter/setter pair
ownerNames List<String>?
Name(s) of the owner(s) of this file.
getter/setter pair
owners List<User>?
The owner of this file.
getter/setter pair
parents List<ParentReference>?
Collection of parent folders which contain this file.
getter/setter pair
permissionIds List<String>?
List of permission IDs for users with access to this file.
getter/setter pair
permissions List<Permission>?
The list of permissions for users with access to this file.
getter/setter pair
properties List<Property>?
The list of properties.
getter/setter pair
quotaBytesUsed String?
The number of quota bytes used by this file.
getter/setter pair
resourceKey String?
A key needed to access the item via a shared link.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
A link back to this file.
getter/setter pair
sha1Checksum String?
The SHA1 checksum associated with this file, if available.
getter/setter pair
sha256Checksum String?
The SHA256 checksum associated with this file, if available.
getter/setter pair
shareable bool?
Deprecated: Use capabilities/canShare instead.
getter/setter pair
shared bool?
Whether the file has been shared.
getter/setter pair
sharedWithMeDate DateTime?
Time at which this file was shared with the user (formatted RFC 3339 timestamp).
getter/setter pair
sharingUser User?
User that shared the item with the current user, if available.
getter/setter pair
shortcutDetails FileShortcutDetails?
Shortcut file details.
getter/setter pair
spaces List<String>?
The list of spaces which contain the file.
getter/setter pair
teamDriveId String?
Deprecated: Use driveId instead.
getter/setter pair
thumbnail FileThumbnail?
A thumbnail for the file.
getter/setter pair
A short-lived link to the file's thumbnail, if available.
getter/setter pair
thumbnailVersion String?
The thumbnail version for use in thumbnail cache invalidation.
getter/setter pair
title String?
The title of this file.
getter/setter pair
trashedDate DateTime?
The time that the item was trashed (formatted RFC 3339 timestamp).
getter/setter pair
trashingUser User?
If the file has been explicitly trashed, the user who trashed it.
getter/setter pair
userPermission Permission?
The permissions for the authenticated user on this file.
getter/setter pair
version String?
A monotonically increasing version number for the file.
getter/setter pair
videoMediaMetadata FileVideoMediaMetadata?
Metadata about video media.
getter/setter pair
A link for downloading the content of the file in a browser using cookie based authentication.
getter/setter pair
A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
getter/setter pair
writersCanShare bool?
Whether writers can share the document with other users.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited