CometChatUsersWithMessages
is a Composite Widget that seamlessly merges the functionalities of both the Users and Messages modules. It empowers users to effortlessly navigate to any individual’s chat window by simply clicking on their respective list item in the user list.
Additionally, CometChatUsersWithMessages
inherits and encompasses all attributes available within the CometChatUsersWithMessages
module, ensuring a comprehensive user experience.
Widget | Description |
---|---|
Users | Standalone screen displaying a searchable user list. Inherits from CometChatListBase and wraps CometChatUserList . |
Messages | Chat interface for users and groups. Displays message list for logged-in user’s interactions. |
CometChatUsersWithMessages
is a widget, it can be launched either by a button click or through any event’s trigger. It inherits all the customizable properties and methods of CometChatUsers.
You can launch CometChatUsersWithMessages
directly using Navigator.push
, or you can define it as a widget within the build
method of your State
class.
CometChatUsersWithMessages
CometChatUsersWithMessages
as a Widget in the build MethodonItemTap
method is used to override the onClick behavior in CometChatUsersWithMessages
. This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
onItemLongPress
, empowers users to customize long-click actions within CometChatUsersWithMessages
, offering enhanced functionality and interaction possibilities.
CometChatUsersWithMessages
by utilizing the onBack
, providing customization options for handling the back action.
By default, this action has a predefined behavior: it simply dismisses the current widget. However, the flexibility of CometChat UI Kit allows you to override this standard behavior according to your application’s specific requirements. You can define a custom action that will be performed instead when the back button is pressed.
onError
, allows users to override error handling within CometChatUsersWithMessages
, providing greater control over error responses and actions.
onSelection
event is triggered, it furnishes the list of selected users. This event can be invoked by any button or action within the interface. You have the flexibility to implement custom actions or behaviors based on the selected users.
This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.
CometChatUsersWithMessages
widget does not have filters, its widgets do, For more detail on individual filters of its widget refer to Users FiltersMessages Filters
By utilizing the Configurations object of its widgets, you can apply filters.
In the following example, we’re sorting Users
by UID's
and setting the limit
to 10 using the UsersRequestBuilder
.
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 CometChatUsersWithMessages
does not produce any events but its subwidget does.
CometChatUsersWithMessages
widget. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.
UsersWithMessagesStyle
to the CometChatUsersWithMessages
Widget to customize the styling.
Example
CometChatUsersWithMessages
widget does not have any available functionality.
Users
subcomponent to navigate the User to MessagesMessages
subcomponent to navigatefrom Messages to Details.CometChatUsersWithMessages
has Users
and Messages
widget. Hence, each of these widgets will have its individual `Configuration“.
Configurations
expose properties that are available in its individual widgets..set(usersConfiguration: usersConfiguration)
method as demonstrated below:
UsersConfiguration
can be found under Users. Properties marked with the 🛑 symbol are not accessible within the Configuration Object.
Example
Let’s say you want to change the style of the Users child widgets and, in addition, you only want to display users with offline status.
You can modify the style using the UsersStyle
method and filter the list with the UsersRequestBuilder
method.
messagesConfiguration
. You can accomplish this by employing the messagesConfiguration
as demonstrated below: