StorageAccess class

Collects methods for accessing cloud storage.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createDirectFileUploadDescription({required String storageId, required String path}) Future<String?>
Creates a new file upload description, that can be passed to the client's FileUploader. After the file has been uploaded, the verifyDirectFileUpload method should be called, or the file may be deleted.
deleteFile({required String storageId, required String path}) Future<void>
Deletes a file from cloud storage.
fileExists({required String storageId, required String path}) Future<bool>
Checks if a file exists in cloud storage.
getPublicUrl({required String storageId, required String path}) Future<Uri?>
Gets the public URL for a file, if the storageId is a public storage.
getPublicUrls({required String storageId, required List<String> paths}) Future<List<Uri?>>
Bulk lookup of a list of public links to files given a list of paths in the storage. If any given file isn't public or if no such file exists, null is stored at the corresponding position in the output list. Saves on server roundtrips if a large number of public URLs must be fetched, relative to calling getPublicUrl via an endpoint for each one.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retrieveFile({required String storageId, required String path}) Future<ByteData?>
Retrieve a file from cloud storage.
storeFile({required String storageId, required String path, required ByteData byteData, DateTime? expiration}) Future<void>
Store a file in the cloud storage. storageId is typically 'public' or 'private'. The public storage can be accessed through a public URL. The file is stored at the path relative to the cloud storage root directory, if a file already exists it will be replaced.
toString() String
A string representation of this object.
inherited
verifyDirectFileUpload({required String storageId, required String path}) Future<bool>
Call this method after a file has been uploaded. It will return true if the file was successfully uploaded.

Operators

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