CometChatConversations
is a Widget, That shows all conversations related to the currently logged-in user,
CometChatConversations
is a widget, it can be initiated either by tapping a button or through the trigger of any event. It offers multiple parameters and methods for tailoring its user interface.
You can launch CometChatConversations
directly using Navigator.push
, or you can define it as a widget within the build
method of your State
class.
CometChatConversations
CometChatConversations
as a Widget in the build MethodonItemTap
is triggered when you click on a ListItem of the CometChatConversations
widget. This onItemTap
method proves beneficial when a user intends to customize the click behavior in CometChatConversations.
onBack
method becomes valuable when a user needs to override the action triggered upon pressing the back button in CometChatConversations.
onSelection
feature enables selection with modes: SelectionMode.single
and SelectionMode.multiple
.
The onSelection
event is triggered upon the completion of a selection in onSelection
. This returns the selected conversations list when the callback is triggered. It can be executed with any button or action.
ConversationsRequestBuilder
in the CometChatConversations
widget to filter the conversation list. You can modify the builder as per your specific requirements with multiple options available to know more refer to ConversationsRequestBuilder.
Property | Description | Code |
---|---|---|
Build | Builds and returns an ConversationsRequest object. | build(): ConversationsRequest |
Conversation Type | Type of the conversation. | conversationType: String? |
Limit | Number of results to limit the query. | limit: int? |
Tags | Tags for filtering. | tags: List<String>? |
With Tags | Flag to include tags. | withTags: bool? |
With User And Group Tags | Flag to include user and group tags. | withUserAndGroupTags: bool? |
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.
ccConversationDeleted
will be emitted when the user deletes a conversation
ConversationsStyle
to the CometChatConversations
Widget to customize the styling.
Property | Description | Code |
---|---|---|
Back Icon Tint | Used to set the color of the back icon in the app bar. | backIconTint: Color |
Background | Used to set background color. | background: Color |
Border | Used to set border. | border: BoxBorder |
Border Radius | Used to set border radius. | borderRadius: double |
Empty Text Style | Used to set the style of the response text shown when fetching the list of conversations is empty. | emptyTextStyle: TextStyle |
Error Text Style | Used to set the style of the response text shown when an error occurs while fetching conversations. | errorTextStyle: TextStyle |
Gradient | Used to set a gradient background. | gradient: Gradient |
Height | Used to set height. | height: double |
Last Message Style | Used to customize the appearance of the last message in the conversation item’s subtitle. | lastMessageStyle: TextStyle |
Loading Icon Tint | Used to set the color of the loading icon shown during conversations fetching. | loadingIconTint: Color |
Online Status Color | Used to set the color of the status indicator if a user is online. | onlineStatusColor: Color |
Password Group Icon Background | Used to set the color of the icon shown as a status indicator if the group is password protected. | passwordGroupIconBackground: Color |
Private Group Icon Background | Used to set the color of the icon shown as a status indicator if the group is private. | privateGroupIconBackground: Color |
Separator Color | Used to set the color of the divider separating conversation items. | separatorColor: Color |
Thread Indicator Style | Used to customize the appearance of the subtitle if the last message was made inside a thread. | threadIndicatorStyle: TextStyle |
Title Style | Used to set the style of the title in the app bar. | titleStyle: TextStyle |
Typing Indicator Style | Used to customize the appearance of the response text when participants are typing in a conversation. | typingIndicatorStyle: TextStyle |
Width | Used to set width. | width: double |
Avatar
widget in the CometChatConversations
Widget, you can use the following code snippet. For more information, visit Avatar Styles.
StatusIndicator
widget in the CometChatConversations
Widget, you can use the following code snippet. For more information, visit Indicator Styles.
Date
widget in the Conversations
Widget, you can use the following code snippet. For more information, visit Date Styles.
Badge
widget in the Conversations
Widget, you can use the following code snippet. For more information, visit Badge Styles
List Item
widget in the Conversations
Widget, you can use the following code snippet. For more information, visit List Item Styles.
CometChatConversations
Property | Description | Code |
---|---|---|
Activate Selection | Used to specify if the listed conversations can be selected, selection can be activated on tap or on long press | activateSelection: ActivateSelection |
AppBar Options | Used to set the options available in the app bar | appBarOptions: List<Widget> |
Back Button | Used to set back button located in the app bar | backButton: Widget |
Controller | Used to programmatically update the scroll physics of list containing the conversations | controller: ScrollController |
Date Pattern | Used to display a custom string instead of the timestamp show at the tail of the conversation item | datePattern: String Function(Conversation conversation) |
Disable Mentions | Disables mentions formatter if true | disableMentions: bool |
Disable Typing | If true stops indicating if a participant in a conversation is typing | disableTyping: bool |
Empty State Text | Used to set a custom text response when fetching the conversations has returned an empty list | emptyStateText: String |
Error State Text | Used to set a custom text response when some error occurs on fetching the list of conversations | errorStateText: String |
Hide Appbar | Toggle visibility for app bar | hideAppbar: bool |
Hide Error | Used to hide error on fetching conversations | hideError: bool |
Hide Receipt | Used to toggle visibility of message receipts shown in the subtitle of the conversation | hideReceipt: bool |
Hide Search | Used to toggle visibility for search box | hideSearch: bool |
Hide Separator | Used to hide the divider separating the conversation items | hideSeparator: bool |
Hide Section Separator | Used to hide the text separating grouped conversation items | hideSectionSeparator: bool |
Private Group Icon | Used to set icon shown in place of status indicator if the conversation is taking place in a private group | privateGroupIcon: Widget |
Protected Group Icon | Used to set icon shown in place of status indicator if the conversation is taking place in a password protected group | protectedGroupIcon: Widget |
Search Box Icon | Used to set search Icon in the search field | searchBoxIcon: Widget |
Search Placeholder | Used to set placeholder text for the search field | searchPlaceholder: String |
Selection Icon | Change selection icon | selectionIcon: Widget |
Sent Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is sent | sentIcon: Widget |
Show Back Button | Used to toggle visibility for back button | showBackButton: bool |
Theme | Used to set custom theme | theme: CometChatTheme |
Title | Used to set the title in the app bar | title: String |
Typing Indicator Text | Used to customize the text response shown in the subtitle of the conversation item if a participant of a conversation is typing | typingIndicatorText: String |
CometChatConversations
Widget.
CometChatConversations
widget.
datePattern
. 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.
EmptyStateView
using emptyStateView
to match the empty UI of your app.
ErrorStateView
using errorStateView
to match the error view of your app.