StorageService class
StorageService is responsible for managing file uploads and retrievals to Firebase Storage and Firestore.
Constructors
Properties
- controller → ProfileController
-
final
- firestore → FirebaseFirestore
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → Reference
-
final
- userRepository → UserRepository
-
final
Methods
-
deleteProfilePicture(
String userId) → Future< void> - Deletes a user's profile picture @param userId The ID of the user whose profile picture is to be deleted @throws Exception if the deletion fails
-
getProfilePicture(
{String? userEmail}) → Future< ImageProvider< Object> > - Retrieves the public URL of a user's profile picture @param userEmail The email of the user whose profile picture is to be retrieved @return A Future that resolves to an ImageProvider for the profile picture @throws Exception if the user document is not found or if the profile picture path is invalid
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uploadFile(
{required XFile? file, required String storagePath, String contentType = 'image/jpeg', Map< String, String> ? customMetadata}) → Future<UploadTask?> - Uploads a file to Firebase Storage @param file The file to be uploaded @param storagePath The path in the storage bucket where the file will be stored @param contentType The content type of the file (default is 'image/jpeg') @param customMetadata Optional custom metadata to be associated with the file @return A Future that resolves to an UploadTask if the upload is successful, or null if no file was selected
-
uploadProfilePicture(
XFile imageFile) → Future< void> - Uploads a profile picture for a user @param imageFile The image file to be uploaded @throws Exception if the user ID is null or if the upload fails
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited