FirebaseService class

Service that handles all Firebase Firestore and Storage operations.

Requires Firebase to be initialized by the host app before use. Uses FirebaseAuth to identify the current user.

Constructors

FirebaseService({required CloudMediaConfig config})
Creates a FirebaseService with the given config.

Properties

config CloudMediaConfig
The configuration for this service.
final
currentUser → User?
The currently authenticated Firebase user, or null if not signed in.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteMedia(String mediaId) Future<void>
Soft-delete a media item by setting deletedAt timestamp.
downloadMedia(String mediaId) Future<String>
Download a media item to the device's temp directory.
getMedia(String mediaId) Future<CloudMediaItem>
Fetch a single media item by mediaId.
getUserMedia() Future<List<CloudMediaItem>>
Alias for listMedia with no filters.
initialize() Future<void>
Initialize Firebase instances. Must be called before any other method.
listMedia({CloudMediaType? type, int limit = 50, int offset = 0, DateTime? startDate, DateTime? endDate, String? searchQuery}) Future<List<CloudMediaItem>>
List media for the current user with optional filters.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restoreMedia(String mediaId) Future<void>
Restore a soft-deleted media item.
shareMedia(CloudMediaItem media) Future<void>
Share a media item using the platform share sheet.
toString() String
A string representation of this object.
inherited
watchMedia(String mediaId) Stream<CloudMediaItem>
Watch real-time updates for a media item.

Operators

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