FirestoreChatBackend class

A ChatBackend backed by Cloud Firestore for message storage and Firebase Storage for image uploads.

Messages for a conversation at path are stored in the <path>/Activity subcollection, ordered by a timestamp server timestamp field.

Inheritance

Constructors

FirestoreChatBackend({FirebaseFirestore? firestore, FirebaseStorage? storage})
Creates a FirestoreChatBackend using the default FirebaseFirestore and FirebaseStorage instances, or the ones supplied.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose(String path) → void
Releases any resources (subscriptions, clients) held for path.
override
fetchMessages(String path) Future<List<ChatBackendMessage>>
Fetches all existing messages for the conversation at path, ordered oldest first.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendMessage(String path, ChatMessage message) Future<void>
Persists message for the conversation at path.
override
subscribeToNewMessages(String path) Stream<ChatBackendMessage>
Subscribes to newly created messages for the conversation at path.
override
toString() String
A string representation of this object.
inherited
uploadImage(String filePath, String fileName) Future<String>
Uploads filePath as a chat image attachment and returns its public URL.
override

Operators

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