FireStorage class

A class for handling Firebase Storage operations including file upload, download, and metadata retrieval, as well as managing Firebase Storage instances.

Constructors

FireStorage()

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 name fileName.
getDownloadURL(String filePath) → Future<String>
Retrieves a download URL for a file located at filePath in Firebase Storage.
getFileFromAssets(String path) → Future<File>
Helper method to get a file from local assets.
getFirestoreStorageInstance() → FirebaseStorage
Returns the instance of firebase_storage.FirebaseStorage used in this class.
getMetadata(String filePath) → Future<Map<String, String>?>
Retrieves custom metadata for a file located at filePath in Firebase Storage.
listAll({String filePath = '/'}) → Future<ListResult>
Lists all items under a specified filePath in Firebase Storage.
listMaxItems({int max = 10, String filePath = '/'}) → Future<ListResult>
Lists items with pagination under a specified filePath, up to max items.
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 assetPath to Firebase Storage at uploadPath. Optional metadata can be provided with metadata.
uploadTask(String uploadPath, File file, {dynamic metadata}) → Future<void>
uploadTextData({required String text, String uploadPath = '/'}) → Future<String>
Uploads text data text to Firebase Storage at uploadPath and retrieves it back.

Operators

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