ChatBackend class abstract
Pluggable storage/realtime backend for InappChat.
Implementations translate between the chat UI's needs (load history, stream new messages, send a message, upload an image) and a specific provider's SDK (Cloud Firestore, Appwrite, or Supabase).
Each conversation's path (see ChatEntity.path) identifies where its
messages live, in whatever form the concrete backend expects (e.g. a
Firestore collection path, or an Appwrite/Supabase table/collection id).
- Implementers
Constructors
- ChatBackend()
-
Const constructor for subclasses.
const
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. -
fetchMessages(
String path) → Future< List< ChatBackendMessage> > -
Fetches all existing messages for the conversation at
path, ordered oldest first. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendMessage(
String path, ChatMessage message) → Future< void> -
Persists
messagefor the conversation atpath. -
subscribeToNewMessages(
String path) → Stream< ChatBackendMessage> -
Subscribes to newly created messages for the conversation at
path. -
toString(
) → String -
A string representation of this object.
inherited
-
uploadImage(
String filePath, String fileName) → Future< String> -
Uploads
filePathas a chat image attachment and returns its public URL.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited