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

# Message List

> Message List — CometChat documentation.

## Overview

`MessageList` is a [Composite Widget](/ui-kit/flutter/v4/components-overview#composite-components) that displays a list of messages and effectively manages real-time operations. It includes various types of messages such as Text Messages, Media Messages, Stickers, and more.

`MessageList` is primarily a list of the base widget [MessageBubble](/ui-kit/flutter/v4/message-bubble). The MessageBubble Widget is utilized to create different types of chat bubbles depending on the message type.

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/b65TU6XS0Ch5jZDL/images/1fa163e4-message_list_overview_cometchat_screens-09e189108592e66be77af15d4111d196.png?fit=max&auto=format&n=b65TU6XS0Ch5jZDL&q=85&s=95df5658c7e810300cfab4530b999b8f" alt="Image" width="4498" height="3120" data-path="images/1fa163e4-message_list_overview_cometchat_screens-09e189108592e66be77af15d4111d196.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/4KToyhf0rhpVFdIy/images/334a033b-message_list_overview_cometchat_screens-a8db4e0b744f641d369f5edbc762fe17.png?fit=max&auto=format&n=4KToyhf0rhpVFdIy&q=85&s=2b6c391a12e8a19bb9412b9db8e84c2f" alt="Image" width="4498" height="3120" data-path="images/334a033b-message_list_overview_cometchat_screens-a8db4e0b744f641d369f5edbc762fe17.png" />
  </Tab>
</Tabs>

## Usage

### Integration

You can launch `CometChatMessageList` directly using `Navigator.push`, or you can define it as a widget within the `build` method of your `State` class.

##### 1. Using Navigator to Launch `CometChatMessageList`

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    Navigator.push(context, MaterialPageRoute(builder: (context) => CometChatMessageList())); // A user or group object is required to launch this widget.
    ```
  </Tab>
</Tabs>

##### 2. Embedding `CometChatMessageList` as a Widget in the build Method

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
    import 'package:flutter/material.dart';

    class MessageList extends StatefulWidget {
      const MessageList({super.key});

      @override
      State<MessageList> createState() => _MessageListState();
    }

    class _MessageListState extends State<MessageList> {

      @override
      Widget build(BuildContext context) {
        return Scaffold(
            body: SafeArea(
                child: CometChatMessageList() // A user or group object is required to launch this widget.
            )
        );
      }
    }
    ```
  </Tab>
</Tabs>

***

### Actions

[Actions](/ui-kit/flutter/v4/components-overview#actions) dictate how a widget functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the widget to fit your specific needs.

##### 1. onThreadRepliesClick

`onThreadRepliesClick` is triggered when you click on the threaded message bubble. The `onThreadRepliesClick` action doesn't have a predefined behavior. You can override this action using the following code snippet.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      onThreadRepliesClick: (message, context, {bubbleView}) {
        // TODO("Not yet implemented")
      },
    )
    ```
  </Tab>
</Tabs>

***

##### 2. onError

You can customize this behavior by using the provided code snippet to override the `onError` and improve error handling.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      onError: (e) {
        // TODO("Not yet implemented")
      },
    )
    ```
  </Tab>
</Tabs>

***

##### 3. onReactionTap

The listener to be set for reacting to a message.Pass a non-null instance of `onReactionTap` to enable it.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      reactionsConfiguration: ReactionsConfiguration(
        onReactionTap: (String? reaction) {
          // TODO("Not yet implemented")
        },
      ),
    )
    ```
  </Tab>
</Tabs>

***

### Filters

You can adjust the `MessagesRequestBuilder` in the MessageList Widget to customize your message list. Numerous options are available to alter the builder to meet your specific needs. For additional details on `MessagesRequestBuilder`, please visit [MessagesRequestBuilder](/sdk/flutter/additional-message-filtering).

In the example below, we are applying a filter to the messages based on a search substring and for a specific user. This means that only messages that contain the search term and are associated with the specified user will be displayed

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      messagesRequestBuilder: MessagesRequestBuilder()
        ..uid = user.uid
        ..searchKeyword = "searchKeyword"
    )
    ```
  </Tab>
</Tabs>

<Note>
  The following parameters in messageRequestBuilder will always be altered inside the message list

  1. UID
  2. GUID
  3. types
  4. categories
</Note>

***

### Events

[Events](/ui-kit/flutter/v4/components-overview#events) are emitted by a `Widget`. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.

The MessageList Widget does not emit any events of its own.

***

## Customization

To fit your app's design requirements, you can customize the appearance of the conversation widget. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.

### Style

Using Style you can customize the look and feel of the widget in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the widget.

##### 1. MessageList Style

You can set the `messageListStyle` to the `CometChatMessageList` Widget to customize the styling.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      messageListStyle: MessageListStyle(
        background: Color(0xFFE4EBF5),
        border: Border.all(width: 3, color: Colors.red),
        borderRadius: 10,
      ),
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/NMYZOZ87vKoeIGQT/images/0afad654-message_list_style_cometchat_screens-64e9ae8c797f812f377b36f95d5df9ee.png?fit=max&auto=format&n=NMYZOZ87vKoeIGQT&q=85&s=8a9958d1da57dff27e1a6cfa3b4b4832" alt="Image" width="4498" height="3120" data-path="images/0afad654-message_list_style_cometchat_screens-64e9ae8c797f812f377b36f95d5df9ee.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/lGTe4SBrdnJKJDoJ/images/6f048ef5-message_list_style_cometchat_screens-dc14442f12ed7ed79c2f63db8fa13237.png?fit=max&auto=format&n=lGTe4SBrdnJKJDoJ&q=85&s=b936e883e778fe12cd0ce0cafd4dea60" alt="Image" width="4498" height="3120" data-path="images/6f048ef5-message_list_style_cometchat_screens-dc14442f12ed7ed79c2f63db8fa13237.png" />
  </Tab>
</Tabs>

List of properties exposed by `CometChatMessageList`

| **Property**          | **Description**                         | **Code**                     |
| --------------------- | --------------------------------------- | ---------------------------- |
| **Background**        | Background inherited from BaseStyles    | `background`                 |
| **Border**            | Border inherited from BaseStyles        | `border`                     |
| **Border Radius**     | Border radius inherited from BaseStyles | `borderRadius`               |
| **Content Padding**   | Padding inside the content area         | `contentPadding`             |
| **Empty Text Style**  | Text style for the empty state message  | `emptyTextStyle: TextStyle?` |
| **Error Text Style**  | Text style for the error state message  | `errorTextStyle: TextStyle?` |
| **Gradient**          | Gradient inherited from BaseStyles      | `gradient`                   |
| **Height**            | Height inherited from BaseStyles        | `height`                     |
| **Loading Icon Tint** | Tint color for the loading icon         | `loadingIconTint: Color?`    |
| **Width**             | Width inherited from BaseStyles         | `width`                      |

***

##### 2. Avatar Style

To apply customized styles to the `Avatar` widget in the `CometChatGroups` widget, you can use the following code snippet. For further insights on `Avatar` Styles [refer](/ui-kit/flutter/v4/avatar)

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      avatarStyle: AvatarStyle(
          border: Border.all(width: 5),
          borderRadius: 20,
          background: Colors.red
      ),
    )
    ```
  </Tab>
</Tabs>

***

### Functionality

These are a set of small functional customizations that allow you to fine-tune the overall experience of the widget. With these, you can change text, set custom icons, and toggle the visibility of UI elements.

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/PArSPrMnmQCdJnO3/images/d4bccee1-message_list_functionality_before_cometchat_screens-9a72ff1ae3210d7243ce21984f0795e1.png?fit=max&auto=format&n=PArSPrMnmQCdJnO3&q=85&s=fcc6c7c1ea9cd9923424a7321ee7ab62" alt="Image" width="4498" height="3120" data-path="images/d4bccee1-message_list_functionality_before_cometchat_screens-9a72ff1ae3210d7243ce21984f0795e1.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/vOzK2L8opJn2Kw6c/images/26be2750-message_list_functionality_before_cometchat_screens-c8712c6a6eb46fb6e377b38b66edb7a0.png?fit=max&auto=format&n=vOzK2L8opJn2Kw6c&q=85&s=74890fca6fa69ee263d05faad7b06b72" alt="Image" width="4498" height="3120" data-path="images/26be2750-message_list_functionality_before_cometchat_screens-c8712c6a6eb46fb6e377b38b66edb7a0.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      readIcon: Icon(Icons.mark_chat_read, color: Colors.white),
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/C_cPQYxvQBDBywyf/images/fb26ffa1-message_list_functionality_after_cometchat_screens-bcacc5943068a6b2a9a17896b3e3b742.png?fit=max&auto=format&n=C_cPQYxvQBDBywyf&q=85&s=c869406af558702fa3b77a1bb755ceb3" alt="Image" width="4498" height="3120" data-path="images/fb26ffa1-message_list_functionality_after_cometchat_screens-bcacc5943068a6b2a9a17896b3e3b742.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/tu3JK9T7iskLt8fa/images/498ff818-message_list_functionality_after_cometchat_screens-85f86f082570ac912fd4d5d805f65634.png?fit=max&auto=format&n=tu3JK9T7iskLt8fa&q=85&s=64cb6eff50d3119a9a4938d4a7e920b6" alt="Image" width="4498" height="3120" data-path="images/498ff818-message_list_functionality_after_cometchat_screens-85f86f082570ac912fd4d5d805f65634.png" />
  </Tab>
</Tabs>

Below is a list of customizations along with corresponding code snippets

| **Property**                         | **Description**                                         | **Code**                            |
| ------------------------------------ | ------------------------------------------------------- | ----------------------------------- |
| **Add Reaction Icon**                | Icon for adding reactions                               | `addReactionIcon`                   |
| **Add Reaction Icon Tap**            | Callback for when the add reaction icon is tapped       | `addReactionIconTap`                |
| **Alignment**                        | Alignment for chat messages, default is standard        | `alignment: ChatAlignment`          |
| **Custom Sound For Message Package** | Custom sound package for messages                       | `customSoundForMessagePackage`      |
| **Custom Sound For Messages**        | Custom sound for messages                               | `customSoundForMessages`            |
| **Date Pattern**                     | Date pattern to be used                                 | `datePattern`                       |
| **Date Separator Pattern**           | Date separator pattern to be used                       | `dateSeparatorPattern`              |
| **Delivered Icon**                   | Icon indicating message delivery                        | `deliveredIcon`                     |
| **Disable Mentions**                 | Whether mentions are disabled                           | `disableMentions`                   |
| **Disable Reactions**                | Whether reactions are disabled                          | `disableReactions`                  |
| **Disable Sound For Messages**       | Whether sound for messages is disabled                  | `disableSoundForMessages`           |
| **Empty State Text**                 | Text to be displayed in empty state                     | `emptyStateText`                    |
| **Error State Text**                 | Text to be displayed in error state                     | `errorStateText`                    |
| **Favorite Reactions**               | List of favorite reactions                              | `favoriteReactions`                 |
| **Group**                            | Group object to be displayed                            | `group`                             |
| **Hide Error**                       | Whether error messages are hidden                       | `hideError`                         |
| **Hide Receipt**                     | Used to toggle visibility of message receipts           | `hideReceipt`                       |
| **Hide Timestamp**                   | Whether message timestamps are hidden                   | `hideTimestamp`                     |
| **New Message Indicator Text**       | Text for the new message indicator                      | `newMessageIndicatorText`           |
| **Read Icon**                        | Icon indicating message read                            | `readIcon`                          |
| **Scroll To Bottom On New Messages** | Whether to scroll to bottom on receiving new messages   | `scrollToBottomOnNewMessages`       |
| **Sent Icon**                        | Icon indicating message sent                            | `sentIcon`                          |
| **Show Avatar**                      | Whether to show avatar, default is true                 | `showAvatar: bool`                  |
| **Theme**                            | Theme to be applied                                     | `theme`                             |
| **Timestamp Alignment**              | Alignment for the message timestamps, default is bottom | `timestampAlignment: TimeAlignment` |
| **User**                             | User object to be displayed                             | `user`                              |
| **Wait Icon**                        | Icon indicating waiting state                           | `waitIcon`                          |

***

### Advance

For advanced-level customization, you can set custom views to the widget. This lets you tailor each aspect of the widget to fit your exact needs and application aesthetics. You can create and define your own widget and then incorporate those into the widget.

#### Template

[CometChatMessageTemplate](/ui-kit/flutter/v4/message-template) is a pre-defined structure for creating message views that can be used as a starting point or blueprint for creating message views often known as message bubbles. For more information, you can refer to [CometChatMessageTemplate](/ui-kit/flutter/v4/message-template).

You can set message Templates to MessageList by using the following code snippet

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      templates: Placeholder(); // Replace this placeholder with your custom widget.
    )
    ```
  </Tab>
</Tabs>

**Example**

Here is the complete example for reference:

<Tabs>
  <Tab title="Dart">
    ```dart getTemplate() theme={null}
    List<CometChatMessageTemplate> getTemplate() {
      // Creating a text template
      CometChatMessageTemplate textTemplate = ChatConfigurator.getDataSource().getTextMessageTemplate(cometChatTheme);
      textTemplate.contentView = (BaseMessage baseMessage, BuildContext buildContext, BubbleAlignment alignment, {AdditionalConfigurations? additionalConfigurations}) {
        return Padding(
          padding: const EdgeInsets.all(8.0),
          child: Text(
            (baseMessage as TextMessage).text,
            style: TextStyle(
              color: alignment == BubbleAlignment.left ? Colors.deepPurple : Colors.yellow,
              fontSize: 14,
              fontWeight: FontWeight.bold,
              fontFamily: "PlaywritePL"
            ),
          ),
        );
      };

      // Creating an audio template
      CometChatMessageTemplate audioTemplate = ChatConfigurator.getDataSource().getAudioMessageTemplate(cometChatTheme);

      // Creating a custom message template
      CometChatMessageTemplate customMessageTemplate = CometChatMessageTemplate(
        type: 'custom_template',
        category: 'custom_category',
        bubbleView: (message, context, alignment) => const Text('this is a custom message template'),
      );

      // custom list of templates
      List<CometChatMessageTemplate> messageTypes = [
        textTemplate,
        audioTemplate,
        customMessageTemplate
      ];

      return messageTypes;
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      templates: getTemplate(),
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/0Dzaagp0tKHyO4xb/images/50ecaf18-message_list_template_cometchat_screens-ccc43daa9e5eb7548207eeed5d647749.png?fit=max&auto=format&n=0Dzaagp0tKHyO4xb&q=85&s=8a2289ef30a3945138b19b4f69541772" alt="Image" width="4498" height="3120" data-path="images/50ecaf18-message_list_template_cometchat_screens-ccc43daa9e5eb7548207eeed5d647749.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/0Dzaagp0tKHyO4xb/images/5036c31b-message_list_template_cometchat_screens-99b7ffddbb7ab979bca23fade52a1503.png?fit=max&auto=format&n=0Dzaagp0tKHyO4xb&q=85&s=b9f402346902e02acc1a8dee565be0c5" alt="Image" width="4498" height="3120" data-path="images/5036c31b-message_list_template_cometchat_screens-99b7ffddbb7ab979bca23fade52a1503.png" />
  </Tab>
</Tabs>

***

#### DateSeparatorPattern

You can modify the date pattern of the message list date separator to your requirement using `setDateSeparatorPattern()`. This method accepts a function with a return type String. Inside the function, you can create your own pattern and return it as a String.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      dateSeparatorPattern: (DateTime dateTime) {
        return ""; //Replace this empty string with your custom date time pattern.
      },
    )
    ```
  </Tab>
</Tabs>

**Example**

Here is the complete example for reference:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      dateSeparatorPattern: (DateTime dateTime) {
        return DateFormat("dd/MM/yyyy").format(dateTime);
      },
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/tu3JK9T7iskLt8fa/images/49078272-message_list_date_time_separator_cometchat_screens-d90f711f80300c16d7f229543e3b7b23.png?fit=max&auto=format&n=tu3JK9T7iskLt8fa&q=85&s=3f720133e617c3a138b0d704f0933083" alt="Image" width="4498" height="3120" data-path="images/49078272-message_list_date_time_separator_cometchat_screens-d90f711f80300c16d7f229543e3b7b23.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/DH2AGzRSUCG5tT9H/images/b552b788-message_list_date_time_separator_cometchat_screens-dad8d61b105cdb2a5b3a9e5401c1a51c.png?fit=max&auto=format&n=DH2AGzRSUCG5tT9H&q=85&s=a22fc0c0fb401c14dd8656e4532b6bf7" alt="Image" width="4498" height="3120" data-path="images/b552b788-message_list_date_time_separator_cometchat_screens-dad8d61b105cdb2a5b3a9e5401c1a51c.png" />
  </Tab>
</Tabs>

***

#### SetDatePattern

You can modify the date pattern to your requirement using .setDatePattern. This method accepts a function with a return type String. Inside the function, you can create your own pattern and return it as a String.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      datePattern: (message) {
        return DateFormat('YOUR_PATTERN').format(message.sentAt!);
      },
    )
    ```
  </Tab>
</Tabs>

**Example**

Here is the complete example for reference:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      datePattern: (message) {
        return DateFormat('EEE, M/d/y').format(message.sentAt!);
      },
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/BGGsH7Ab8hL_D05g/images/7502494d-message_list_date_time_pattern_cometchat_screens-e29fe0e35e14bba04954bb7702abbdeb.png?fit=max&auto=format&n=BGGsH7Ab8hL_D05g&q=85&s=24ebe08e1ff500c00961f2703b695059" alt="Image" width="4498" height="3120" data-path="images/7502494d-message_list_date_time_pattern_cometchat_screens-e29fe0e35e14bba04954bb7702abbdeb.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/4KToyhf0rhpVFdIy/images/36b9b0ae-message_list_date_time_pattern_cometchat_screens-601f4e68966053f11c3682665b8d3cb2.png?fit=max&auto=format&n=4KToyhf0rhpVFdIy&q=85&s=88bafddc7d9e92443295e9095d10260a" alt="Image" width="4498" height="3120" data-path="images/36b9b0ae-message_list_date_time_pattern_cometchat_screens-601f4e68966053f11c3682665b8d3cb2.png" />
  </Tab>
</Tabs>

***

#### ErrorStateView

You can set a custom `ErrorStateView` using `errorStateView` to match the error UI of your app.

<Tabs>
  <Tab title="Dart">
    ```dart widget theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      errorStateView: (context) {
        return Placeholder(); // Replace this placeholder with your custom widget.
      },
    )
    ```
  </Tab>
</Tabs>

Here is the complete example for reference:

**Example**

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      errorStateView: (context) {
        return Container(
          width: MediaQuery.of(context).size.width,
          child: Center(
            child: const Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Spacer(),
                Icon(Icons.error_outline, color: Colors.red, size: 100,),
                SizedBox(height: 20,),
                Text("Your Custom Error Message"),
                Spacer(),
              ],
            ),
          ),
        );
      },
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/C_cPQYxvQBDBywyf/images/f34f9754-message_list_set_error_state_cometchat_screens-2c4e50cfb3ecb1fb8ed85cce7e75730c.png?fit=max&auto=format&n=C_cPQYxvQBDBywyf&q=85&s=392a5b1a5f4e3f65460202c22b53685a" alt="Image" width="4498" height="3120" data-path="images/f34f9754-message_list_set_error_state_cometchat_screens-2c4e50cfb3ecb1fb8ed85cce7e75730c.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/GDJ11KCyKQ4fI4Ns/images/aa7efa76-message_list_set_error_state_cometchat_screens-77c9346ac27442095f30df7dc24e07b0.png?fit=max&auto=format&n=GDJ11KCyKQ4fI4Ns&q=85&s=2642a21083bc4e3de60035538c55538d" alt="Image" width="4498" height="3120" data-path="images/aa7efa76-message_list_set_error_state_cometchat_screens-77c9346ac27442095f30df7dc24e07b0.png" />
  </Tab>
</Tabs>

***

#### LoadingStateView

You can set a custom loader widget using `loadingStateView` to match the loading UI of your app.

<Tabs>
  <Tab title="Dart">
    ```dart widget theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      loadingStateView: (context) {
        return Placeholder(); // Replace this placeholder with your custom widget.
      },
    )
    ```
  </Tab>
</Tabs>

Here is the complete example for reference:

**Example**

<Tabs>
  <Tab title="Dart">
    ```dart main.dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      loadingStateView: (context) {
        return Container(
          width: MediaQuery.of(context).size.width,
          child: Center(
              child: CircularProgressIndicator()
          ),
        ); // Replaced the placeholder with a custom widget.
      },
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/UfmwHah38AQUh8_c/images/9c6dcd4e-message_list_set_loading_state_cometchat_screens-e631823f2e616e48776bf42aa05d96b6.png?fit=max&auto=format&n=UfmwHah38AQUh8_c&q=85&s=be185b26402c58aa6cc920a383d2beaa" alt="Image" width="4498" height="3120" data-path="images/9c6dcd4e-message_list_set_loading_state_cometchat_screens-e631823f2e616e48776bf42aa05d96b6.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/PArSPrMnmQCdJnO3/images/d3ffa4f7-message_list_set_loading_state_cometchat_screens-5fa8132cc921f8987e7d6ae63565de1b.png?fit=max&auto=format&n=PArSPrMnmQCdJnO3&q=85&s=6a42d8370b49ae359241b14d1a8dd63a" alt="Image" width="4498" height="3120" data-path="images/d3ffa4f7-message_list_set_loading_state_cometchat_screens-5fa8132cc921f8987e7d6ae63565de1b.png" />
  </Tab>
</Tabs>

***

#### EmptyStateView

You can set a custom `EmptyStateView` using `emptyStateView` to match the error widget of your app.

<Tabs>
  <Tab title="Dart">
    ```dart widget theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      emptyStateView: (context) {
        return Placeholder(); // Replace this placeholder with your custom widget.
      },
    )
    ```
  </Tab>
</Tabs>

Here is the complete example for reference:

**Example**

<Tabs>
  <Tab title="Dart">
    ```dart main.dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      emptyStateView: (context) {
        return Container(
          width: MediaQuery.of(context).size.width,
          child: Center(
              child: const Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Spacer(),
                  Icon(Icons.sms_failed_outlined, color: Colors.red, size: 100,),
                  SizedBox(height: 20,),
                  Text("Your Custom Message"),
                  Spacer(),
                ],
              )
          ),
        ); // Replaced the placeholder with a custom widget.
      },
    )
    ```
  </Tab>
</Tabs>

***

#### TextFormatters

Assigns the list of text formatters. If the provided list is not null, it sets the list. Otherwise, it assigns the default text formatters retrieved from the data source. To configure the existing Mentions look and feel check out [MentionsFormatter Guide](/ui-kit/flutter/v4/mentions-formatter-guide)

Here is the complete example for reference:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
      user: user, // A user or group object is required to launch this widget.
      textFormatters: [
        CometChatMentionsFormatter(
          messageBubbleTextStyle: (theme, alignment,{forConversation = false}) =>
              TextStyle(
                  color: alignment==BubbleAlignment.left? Colors.orange : Colors.pink,
                  fontSize: 14,
                  fontWeight: FontWeight.bold
              ),
        )
      ],
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/tu3JK9T7iskLt8fa/images/4f7deff0-message_list_text_formatters_cometchat_screens-61f2654dc93a96113d6beb7e6f82b7ef.png?fit=max&auto=format&n=tu3JK9T7iskLt8fa&q=85&s=2b143fb92c4ed949ab67da8834db114a" alt="Image" width="4498" height="3120" data-path="images/4f7deff0-message_list_text_formatters_cometchat_screens-61f2654dc93a96113d6beb7e6f82b7ef.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/axXRyft3PU-ANo3t/images/866ade02-message_list_text_formatters_cometchat_screens-2fe19a88680b93e9e089e9e4b9471143.png?fit=max&auto=format&n=axXRyft3PU-ANo3t&q=85&s=9321d75ee67fb10c3c06646a81ee8ddd" alt="Image" width="4498" height="3120" data-path="images/866ade02-message_list_text_formatters_cometchat_screens-2fe19a88680b93e9e089e9e4b9471143.png" />
  </Tab>
</Tabs>

***

## Configuration

[Configurations](/ui-kit/flutter/v4/components-overview#configurations) offer the ability to customize the properties of each widget within a Composite Widget.

### MessageInformation

From the MessageList, you can navigate to the [MesssageInformation](/ui-kit/flutter/v4/message-information) widget as shown in the image.

If you wish to modify the properties of the [MesssageInformation](/ui-kit/flutter/v4/message-information) Widget, you can use the `MessageInformationConfiguration` object.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
        user: user, // A user or group object is required to launch this widget.
        messageInformationConfiguration: MessageInformationConfiguration()
    )
    ```
  </Tab>
</Tabs>

Example

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CometChatMessageList(
        user: user, // A user or group object is required to launch this widget.
        messageInformationConfiguration: MessageInformationConfiguration(
            title: "Your Custom Title",
            messageInformationStyle: MessageInformationStyle(
              background: Color(0xFFE4EBF5),
              border: Border.all(width: 1, color: Colors.red),
              titleStyle: TextStyle(color: Colors.red, fontFamily: "PlaywritePL"),
            )
        )
    )
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/4KToyhf0rhpVFdIy/images/34e49d3d-message_list_message_info_configuration_cometchat_screens-ecea082ba26254b2930eeaf2cb292489.png?fit=max&auto=format&n=4KToyhf0rhpVFdIy&q=85&s=5c6b8b8972841581f377b00af7fd38d5" alt="Image" width="4498" height="3120" data-path="images/34e49d3d-message_list_message_info_configuration_cometchat_screens-ecea082ba26254b2930eeaf2cb292489.png" />
  </Tab>

  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-mechanical-fixes/C9xVaODhNGfTgkE6/images/10ce86c6-message_list_message_info_configuration_cometchat_screens-68cf05d8ceb9eee7e4387ce95b7cdd0d.png?fit=max&auto=format&n=C9xVaODhNGfTgkE6&q=85&s=57f06654fb81b93253a247e8af535030" alt="Image" width="4498" height="3120" data-path="images/10ce86c6-message_list_message_info_configuration_cometchat_screens-68cf05d8ceb9eee7e4387ce95b7cdd0d.png" />
  </Tab>
</Tabs>

***
