StorageAdapter class abstract
Adapter for storage functions.
Switch this adapter when running on various platforms such as local or Firebase.
Allows files to be uploaded from local with upload or uploadWithBytes.
After uploading, use fetchPublicURI or fetchDownloadURI to get the full path on the storage side.
Also, please make it available for download at download.
Please also enable file deletion with delete.
ストレージ機能を利用するためのアダプター。
ローカルやFirebaseなど様々なプラットフォーム上で動かす場合にこのアダプターを切り替えて利用します。
uploadやuploadWithBytesでファイルをローカルからアップロードできるようにします。
アップロード後はfetchPublicURIやfetchDownloadURIでストレージ側のフルパスを取得できるようにしてください。
また、downloadでダウンロードできるようにしてください。
deleteでファイル削除も可能にしてください。
- Annotations
Constructors
- StorageAdapter()
-
Adapter for storage functions.
const
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
-
delete(
String remoteRelativePathOrId) → Future< void> -
Delete files on the remote side in
remoteRelativePathOrId
. -
download(
String remoteRelativePathOrId, [String? localRelativePath]) → Future< LocalFile> -
Download the file on the remote side specified in
remoteRelativePathOrId
tolocalRelativePath
on the local. -
fetchDownloadURI(
String remoteRelativePathOrId) → Future< Uri> - Please make sure you can get the URI to download the file.
-
fetchPublicURI(
String remoteRelativePathOrId) → Future< Uri> -
Please make sure that you can get a publicly available URL. Use this URI when you want to retrieve images, etc. using
Image.network
, etc. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
upload(
String localFullPath, String remoteRelativePathOrId, {String? mimeType}) → Future< RemoteFile> -
Uploads the local file specified in
localFullPath
toremoteRelativePathOrId
, which is the location on the remote side. -
uploadWithBytes(
Uint8List uploadFileByte, String remoteRelativePathOrId, {String? mimeType}) → Future< RemoteFile> -
Uploads the data specified in
uploadFileByte
toremoteRelativePathOrId
, which is the location on the remote side.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- primary → StorageAdapter
-
You can retrieve the StorageAdapter first given by StorageAdapterScope.
no setter