FirebaseStorageUploader class final

MediaUploader implementation backed by Firebase Cloud Storage.

Inject a custom fb.FirebaseStorage instance in tests.

final uploader = FirebaseStorageUploader();
final task = uploader.upload(
  file: photo,
  remotePath: 'avatars/user_123.jpg',
);
task.progress.listen((p) => print('${(p * 100).toStringAsFixed(0)}%'));
final url = await task.downloadUrl;
Implemented types

Constructors

FirebaseStorageUploader({FirebaseStorage? storage})
Creates a FirebaseStorageUploader.

Properties

hashCode int
The hash code for this object.
no setterinherited
providerId String
Machine-readable identifier for this backend, e.g. 'firebase_storage'.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String remotePath) Future<void>
Deletes the file at remotePath from the backend.
override
getDownloadUrl(String remotePath) Future<String>
Returns a public download URL for the file at remotePath.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
upload({required MediaFile file, required String remotePath, Map<String, String>? metadata}) UploadTask
Starts an upload of file to remotePath on the backend.
override

Operators

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