> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-audit-content-webhooks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Typing Indicators

> Send and receive real-time typing indicators using the CometChat Flutter SDK.

<Accordion title="AI Integration Quick Reference">
  | Field           | Value                                                       |
  | --------------- | ----------------------------------------------------------- |
  | Key Classes     | `TypingIndicator`                                           |
  | Key Methods     | `CometChat.startTyping()`, `CometChat.endTyping()`          |
  | Receiver Types  | `CometChatReceiverType.user`, `CometChatReceiverType.group` |
  | Listener Events | `onTypingStarted`, `onTypingEnded`                          |
  | Prerequisites   | SDK initialized, user logged in                             |

  ```dart theme={null}
  // Start typing indicator to user
  CometChat.startTyping(receiverUid: "UID", receiverType: CometChatReceiverType.user);

  // Start typing indicator to group
  CometChat.startTyping(receiverUid: "GUID", receiverType: CometChatReceiverType.group);

  // Stop typing indicator
  CometChat.endTyping(receiverUid: "UID", receiverType: CometChatReceiverType.user);

  // Listen for typing indicators
  CometChat.addMessageListener("listenerId", MessageListener(
    onTypingStarted: (TypingIndicator typingIndicator) { },
    onTypingEnded: (TypingIndicator typingIndicator) { },
  ));
  ```
</Accordion>

Typing indicators let users know when someone is actively typing a message, creating a more engaging real-time chat experience.

<Note>
  **Available via:** SDK | [REST API](https://api-explorer.cometchat.com) | [UI Kits](/ui-kit/flutter/overview)
</Note>

## Send a Typing Indicator

*In other words, as a sender, how do I let the recipient(s) know that I'm typing?*

### Start Typing

Use `startTyping()` to notify the receiver that the logged-in user has started typing. The receiver will receive this information in the `onTypingStarted()` method of the `MessageListener` class.

<Tabs>
  <Tab title="Start Typing (User)">
    ```dart theme={null}
    CometChat.startTyping(
      receiverUid: "UID",
      receiverType: CometChatReceiverType.user,
    );
    ```
  </Tab>

  <Tab title="Start Typing (Group)">
    ```dart theme={null}
    CometChat.startTyping(
      receiverUid: "GUID",
      receiverType: CometChatReceiverType.group,
    );
    ```
  </Tab>
</Tabs>

`startTyping()` Parameters:

| Parameter      | Type     | Description                                                                              | Required |
| -------------- | -------- | ---------------------------------------------------------------------------------------- | -------- |
| `receiverUid`  | `String` | The `UID` of the user or `GUID` of the group to send the typing indicator to             | Yes      |
| `receiverType` | `String` | The type of the receiver — `CometChatReceiverType.user` or `CometChatReceiverType.group` | Yes      |

`startTyping()` returns `void` — the typing indicator is sent as a fire-and-forget operation.

### Stop Typing

Use `endTyping()` to notify the receiver that the logged-in user has stopped typing. The receiver will receive this information in the `onTypingEnded()` method of the `MessageListener` class.

<Tabs>
  <Tab title="Stop Typing (User)">
    ```dart theme={null}
    CometChat.endTyping(
      receiverUid: "UID",
      receiverType: CometChatReceiverType.user,
    );
    ```
  </Tab>

  <Tab title="Stop Typing (Group)">
    ```dart theme={null}
    CometChat.endTyping(
      receiverUid: "GUID",
      receiverType: CometChatReceiverType.group,
    );
    ```
  </Tab>
</Tabs>

`endTyping()` Parameters:

| Parameter      | Type     | Description                                                                              | Required |
| -------------- | -------- | ---------------------------------------------------------------------------------------- | -------- |
| `receiverUid`  | `String` | The `UID` of the user or `GUID` of the group to send the typing indicator to             | Yes      |
| `receiverType` | `String` | The type of the receiver — `CometChatReceiverType.user` or `CometChatReceiverType.group` | Yes      |

`endTyping()` returns `void` — the typing indicator is sent as a fire-and-forget operation.

<Note>
  Use the `metadata` field of the `TypingIndicator` class to pass additional custom data along with the typing indicators. The metadata field is a `Map<String, String>` and can be set using the `.metadata` property. This data will be received at the receiver end and can be obtained using the same property.
</Note>

## Real-time Typing Indicators

*In other words, as a recipient, how do I know when someone is typing?*

Use `onTypingStarted` and `onTypingEnded` in `MessageListener` to receive [`TypingIndicator`](/sdk/reference/auxiliary#typingindicator) events.

<Warning>
  Always remove listeners when they're no longer needed (e.g., in the `dispose()` method). Failing to remove listeners can cause memory leaks and duplicate event handling.

  ```dart theme={null}
  CometChat.removeMessageListener("listenerId");
  ```
</Warning>

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    class Class_Name  with MessageListener {

    //CometChat.addMessageListener("listenerId", this);
    @override
    void onTypingStarted(TypingIndicator typingIndicator) {
      // TODO: implement onTypingStarted
    }

    @override
    void onTypingEnded(TypingIndicator typingIndicator) {
      // TODO: implement onTypingEnded
    }


    }
    ```
  </Tab>
</Tabs>

The received object is a `TypingIndicator` with the following fields:

| Parameter       | Type                                   | Description                                                                                                                |
| --------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `sender`        | [`User`](/sdk/reference/entities#user) | An object of the `User` class holding all the information related to the sender of the typing indicator.                   |
| `receiverId`    | `String`                               | `UID` of the receiver. This is the ID of the group or the user the typing indicator is being sent to.                      |
| `receiverType`  | `String`                               | Indicates if the typing indicator is to a user or a group — `CometChatReceiverType.user` or `CometChatReceiverType.group`. |
| `metadata`      | `Map<String, String>?`                 | Optional metadata to provide additional data.                                                                              |
| `lastTimestamp` | `DateTime`                             | The timestamp of the last typing indicator event.                                                                          |

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Delivery & Read Receipts" icon="check-double" href="/sdk/flutter/delivery-read-receipts">
    Track message delivery and read status
  </Card>

  <Card title="Transient Messages" icon="bolt" href="/sdk/flutter/transient-messages">
    Send ephemeral real-time messages like live reactions
  </Card>
</CardGroup>
