StorageAccess class final
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
-
createUploadDescription(
{required String storageId, required String path, UploadOptions options = const UploadOptions()}) → Future< String> -
Creates a new file upload description, that can be passed to the client's
FileUploader. After the file has been uploaded, the verifyUpload 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.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
publicDownloadUrl(
{required String storageId, required String path}) → Future< Uri> -
Gets the public URL for a file, if the
storageIdis a public storage. -
publicDownloadUrls(
{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 publicDownloadUrl via an endpoint for each one.
-
retrieveFile(
{required String storageId, required String path}) → Future< ByteData> - Retrieve a file from cloud storage.
-
statFile(
{required String storageId, required String path}) → Future< FileStat> - Returns metadata and properties for a file in cloud storage.
-
storeFile(
{required String storageId, required String path, required ByteData byteData, StoreFileOptions options = const StoreFileOptions()}) → Future< void> -
Store a file in the cloud storage.
storageIdis typically 'public' or 'private'. The public storage can be accessed through a public URL. The file is stored at thepathrelative to the cloud storage root directory, if a file already exists it will be replaced. -
temporaryDownloadUrl(
{required String storageId, required String path, TemporaryDownloadUrlOptions options = const TemporaryDownloadUrlOptions()}) → Future< Uri> - Creates a temporary download URL for a file in cloud storage.
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyUpload(
{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