---
url: https://talkjs.com/docs/UI_Components/Flutter/Conversation
---

# Conversation

Set up, update, and send messages in a conversation.

Ask a question Copy for LLM [View as Markdown](/docs/UI_Components/Flutter/Conversation.md)

## class 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](/docs/UI_Components/Flutter/Widgets/Chatbox/#Chatbox).

**NOTE**: A [Conversation](/docs/UI_Components/Flutter/Conversation/#Conversation) object is created by calling the [getConversation](/docs/UI_Components/Flutter/Session/#Session__getConversation) method of the [Session](/docs/UI_Components/Flutter/Session/#Session) object.

### Properties

##### id

: String

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](/docs/Concepts/Conversations/) If you want to make a simple one-on-one conversation, consider using [oneOnOneId](/docs/UI_Components/Flutter/Talk_Object/#Talk_oneOnOneId) to generate one.

##### custom

: Map<String, String?>?

Allows custom conversation metadata to be stored in the form `{ "name": "string" }`

##### photoUrl

: String?

An optional URL to a photo which will be shown as the photo for the conversation.

##### subject

: String?

An optional conversation subject which will be displayed in the chat header.

##### welcomeMessages

: List<String>?

Messages which are sent at the beginning of a chat.
In this case the messages will appear as system messages.

##### participants

: Set< [Participant](/docs/UI_Components/Flutter/Conversation/#Participant) >

A set containing the [participants](/docs/UI_Components/Flutter/Conversation/#Participant) for this conversation.

### Methods

### sendMessage

```dart
Future<void> sendMessage(String text, {SendMessageOptions? options});
```

Sends a text message in a given conversation.

#### Parameters

##### text

: String

The message body that is to be sent.

##### options (optional)

: [SendMessageOptions](#SendMessageOptions)?

Custom metadata that is stored with the message.

#### Returns

`Future<void>`

## class Participant

This represents a participant of the conversation.

### Constructor

```dart
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

##### user

: [User](/docs/UI_Components/Flutter/User/#User)

A [User](/docs/UI_Components/Flutter/User/#User) object that identifies the person who is a participant of the conversation.

##### access (optional)

: [ParticipantAccess](/docs/UI_Components/Flutter/Other_Interfaces/#ParticipantAccess)?

Specifies the participant's access permission for a conversation.

##### notify (optional)

: [ParticipantNotification](/docs/UI_Components/Flutter/Other_Interfaces/#ParticipantNotification)?

**BREAKING CHANGE**: Before Flutter SDK version `0.4.0` this property was of type `bool?`

Specifies the participants's notification settings.

## class SendMessageOptions

Sets custom metadata that is stored with the message.

### Constructor

```dart
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

: Map<String, String?>

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.