FireStorage class
A class for handling Firebase Storage operations including file upload, download, and metadata retrieval, as well as managing Firebase Storage instances.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → FirebaseStorage
-
final
Methods
-
downloadFile(
{required String firestorePath, String fileName = ''}) → Future< void> -
Downloads a file from Firebase Storage at
firestorePath. The file can be saved under the optional namefileName. -
getDownloadURL(
String filePath) → Future< String> -
Retrieves a download URL for a file located at
filePathin Firebase Storage. -
getFileFromAssets(
String path) → Future< File> - Helper method to get a file from local assets.
-
getFirestoreStorageInstance(
) → FirebaseStorage -
Returns the instance of
firebase_storage.FirebaseStorageused in this class. -
getMetadata(
String filePath) → Future< Map< String, String> ?> -
Retrieves custom metadata for a file located at
filePathin Firebase Storage. -
listAll(
{String filePath = '/'}) → Future< ListResult> -
Lists all items under a specified
filePathin Firebase Storage. -
listMaxItems(
{int max = 10, String filePath = '/'}) → Future< ListResult> -
Lists items with pagination under a specified
filePath, up tomaxitems. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uploadFile(
{String assetPath = '', dynamic metadata, String uploadPath = '/'}) → Future< void> -
Uploads a file from storage to Firebase Storage or optionally from local assets with
assetPathto Firebase Storage atuploadPath. Optional metadata can be provided withmetadata. -
uploadTask(
String uploadPath, File file, {dynamic metadata}) → Future< void> -
uploadTextData(
{required String text, String uploadPath = '/'}) → Future< String> -
Uploads text data
textto Firebase Storage atuploadPathand retrieves it back.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited