Conversation
A Conversation represents a conversation that is about to be created, fetched, or updated. You can use this object to set up or modify a conversation before showing it. Note: any changes you make here will not be sent to TalkJS immediately. Instead, instantiate a TalkJS UI using widgets such as ChatBox.
NOTE: A Conversation object is created by calling the getConversation method of the Session object.
| sendMessage | Sends a text message in a given conversation. |
A unique identifier for this conversation, such as a channel name or topic ID. Any user with access to this ID can join this conversation. Read about how to choose a good conversation ID for your use case If you want to make a simple one-on-one conversation, consider using oneOnOneId to generate one.
Allows custom conversation metadata to be stored in the form { "name": "string" }
An optional URL to a photo which will be shown as the photo for the conversation.
An optional conversation subject which will be displayed in the chat header.
Messages which are sent at the beginning of a chat. In this case the messages will appear as system messages.
A set containing the participants for this conversation.
Future<void> sendMessage(String text, {SendMessageOptions? options});
Sends a text message in a given conversation.
Parameters
The message body that is to be sent.
Custom metadata that is stored with the message.
Returns
Future<void>
This represents a participant of the conversation.
| constructor | Sets a participant of the conversation. |
Participant(User user, {ParticipantAccess? access, bool? notify});
Sets a participant of the conversation.
NOTE: All the parameters passed to the constructor are also available as read-only properties of the constructed object.
Parameters
A User object that identifies the person who is a participant of the conversation.
Specifies the participant's access permission for a conversation.
BREAKING CHANGE: Before Flutter SDK version 0.4.0 this property was of type bool?
Specifies the participants's notification settings.
Sets custom metadata that is stored with the message.
| constructor | Sets custom metadata that is stored with the message. |
SendMessageOptions({required Map<String, String?> custom});
Sets custom metadata that is stored with the message.
NOTE: All the parameters passed to the constructor are also available as read-only properties of the constructed object.
Parameters
Custom metadata that is stored with the message.
Set any property to null to delete the existing value (if any). When omitted, the existing value remains unchanged.