ChatEntity class

Describes a single chat conversation: who is in it, which ChatBackend stores it, and how it should behave.

Constructors

ChatEntity({required PeerUser mainUser, required Map<String, PeerUser> peers, required ChatBackend backend, required String path, required String? title, required dynamic onMessageSent(String message, ChatEntity chatEntity), bool supportMedia = false})
Creates a ChatEntity describing a chat conversation.

Properties

backend ChatBackend
The backend used to load, send, and stream this chat's messages, e.g. FirestoreChatBackend(), AppwriteChatBackend(...), or SupabaseChatBackend(...).
final
hashCode int
The hash code for this object.
no setterinherited
mainUser PeerUser
The user viewing the chat on this device.
final
onMessageSent → dynamic Function(String message, ChatEntity chatEntity)
Called with the sent message text and this ChatEntity whenever a message is successfully sent, e.g. to trigger a push notification.
final
path String
Identifies where this chat's messages live, in whatever form backend expects (a Firestore collection path, an Appwrite table id, or a Supabase table name).
final
peers Map<String, PeerUser>
The other participants in the chat, keyed by user id.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportMedia bool
Whether the chat UI shows controls for sending image attachments.
getter/setter pair
title String?
The title displayed on the chat page's app bar.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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