AppwriteChatBackend class

A ChatBackend backed by Appwrite TablesDB (message storage), Realtime (subscriptions), and Storage (image uploads).

Each conversation's path (see ChatEntity.path) is used as the Appwrite table id within databaseId; every row in that table is one message, ordered by a timestamp string field (ISO 8601, UTC).

Inheritance

Constructors

AppwriteChatBackend({required String endpoint, required String projectId, required String databaseId, required String bucketId, Client? client})
Creates an AppwriteChatBackend for the given Appwrite project and storage bucket.

Properties

bucketId → String
The Appwrite Storage bucket id used for image attachments.
final
databaseId → String
The Appwrite database id holding one table per conversation.
final
endpoint → String
The Appwrite API endpoint, e.g. https://cloud.appwrite.io/v1.
final
hashCode → int
The hash code for this object.
no setterinherited
projectId → String
The Appwrite project id.
final
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