Overview
CometChatGroupsWithMessages
is a Composite Widget encapsulating functionalities from the Groups and Messages widgets. Serving as a versatile wrapper, it seamlessly integrates with CometChatMessages
, enabling users to open the module by clicking on any group within the list. This widget inherits the behavior of Groups, fostering consistency and familiarity in user interactions.
- Android
- iOS

Widgets | Description |
---|---|
Groups | The Groups widget is designed to display a list of Groups . This essentially represents the recent conversation history. |
Messages | The Messages widget is designed to manage the messaging interaction for Group's conversations. |
Usage
Integration
AsCometChatGroupsWithMessages
is a widget, it can be effortlessly added directly in response to a button click or any event. Leveraging all the customizable properties and methods inherited from Groups, this widget offers seamless integration and extensive customization capabilities. This makes it a versatile solution for enhancing user interaction within your application.
You can launch CometChatGroupsWithMessages
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 CometChatGroupsWithMessages
- Dart
2. Embedding CometChatGroupsWithMessages
as a Widget in the build Method
- Dart
Actions
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. onItemTap
This method proves valuable when users seek to override onItemTap functionality withinCometChatGroupsWithMessages
, empowering them with greater control and customization options.
The onItemTap
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
- Dart
2. onBack
Enhance your application’s functionality by leveraging theonBack
feature. This capability allows you to customize the behavior associated with navigating back within your app. Utilize the provided code snippet to override default behaviors and tailor the user experience according to your specific requirements.
- Dart
3. onError
You can customize this behavior by using the provided code snippet to override theonError
and improve error handling.
- Dart
4. onItemLongPress
This method becomes invaluable when users seek to override long-click functionality withinCometChatGroupsWithMessages
, offering them enhanced control and flexibility in their interactions.
The onItemLongPress
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
- Dart
Filters
Filters allow you to customize the data displayed in a list within a widget. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK. While theCometChatGroupsWithMessages
widget does not have filters, its widgets do, For more detail on individual filters of its widget refer to Groups Filters and Messages Filters.
By utilizing the Configurations object of its widgets, you can apply filters.
In the following example, we are applying a filter to the Group List based on only joined groups and setting the limit to 3 using the groupsRequestBuilder
.
- Dart
Events
Events are emitted by awidget
. 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 CometChatGroupsWithMessages
does not produce any events but its subwidget does.
Customization
To fit your app’s design requirements, you have the ability to customize the appearance of theCometChatGroupsWithMessages
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. CometChatGroupsWithMessages Style 🛑
You can set thegroupsWithMessagesStyle
to the CometChatGroupsWithMessages
Widget to customize the styling.
- Dart
- Android
- iOS

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.CometChatGroupsWithMessages
widget does not have any available functionality. You can use Functional customisation its Widgets. For more details on individual widget functionalities, you can refer Groups Functionalities and Messages functionalities.
Advanced
For advanced-level customization, you can set custom widget 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.CometChatGroupsWithMessages
widget does not have any advanced-level customization . You can use Advanced customisation its Widgets. For more details on individual widget functionalities, you can refer Groups Advanced and Messages Advanced.
CometChatGroupsWithMessages
uses advanced-level customization of both Groups & Messages widgets to achieve its default behavior.
1. SubtitleView
You can customize the subtitle widget for eachCometChatGroupsWithMessages
item to meet your requirements
- Dart
- Android
- iOS

2. AppBarOptions
You can set the Custom AppBarOptions to theCometChatGroupsWithMessages
widget.
- Dart
- Android
- iOS

Configurations
Configurations offer the ability to customize the properties of each widget within a Composite widget. CometChatGroupsWithMessages hasGroups
and Messages
widget. Hence, each of these widgets will have its individual Configuration
. Configurations
expose properties that are available in its individual widgets.
Groups
You can customize the properties of the Groups widget by making use of the GroupsConfiguration. You can accomplish this by employing the following method as demonstrated below:- Dart
GroupsConfiguration
can be found under Groups. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Groups sub widget
You can modify the style using the GroupsStyle
method.
- Dart
- Android
- iOS

Messages
You can customize the properties of the Messages widget by making use of themessagesConfiguration
. You can accomplish this by employing the messagesConfiguration
as demonstrated below:
- Dart
MessagesConfiguration
can be found under Messages. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Messages sub widget and, in addition, you want to hide message composer.
You can modify the style using the messagesStyle
method and hide using hideMessageComposer
method.
- Dart
- Android
- iOS

Join Protected Group
You can customize the properties of the Join Group widget by making use of the JoinGroupConfiguration. You can accomplish this by employing theJoinProtectedGroupConfiguration
class as demonstrated below:
- Dart
JoinProtectedGroupConfiguration
can be found under Join Group. Properties marked with the report symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Join Group sub widget.
You can modify the style using the JoinProtectedGroupStyle
property.
- Dart
- Android
- iOS

Create Group
You can customize the properties of the Create Group widget by making use of the CreateGroupConfiguration. You can accomplish this by employing thecreateGroupConfiguration
props as demonstrated below:
- Dart
CreateGroupConfiguration
can be found under Create Group. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Create Group sub widget.
You can modify the style using the createGroupStyle
property.
- Dart
- Android
- iOS
