Skip to main content

Overview

CometChatDetails functions as a standalone widgets designed to establish a screen displaying the details of a specific user or group object. It inherits all properties and methods from the CometChatListBase class, ensuring comprehensive functionality and customization options. CometChatDetails internally implements the following functionalities:
  • User Information: It displays details about the user. This includes his/her profile picture, name, status, and other relevant information.
  • User Actions: The details screen provides actions to block/unblock the user.
Image

Usage

Integration

As CometChatDetails functions as a widget, it can be directly launched through a button click or any user-initiated action. Additionally, it can be seamlessly integrated into a tab view controller. CometChatDetails offers a range of parameters and methods for customizing its user interface. You can launch CometChatUsersWithMessages 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 CometChatUsersWithMessages
2. Embedding CometChatUsersWithMessages as a Widget in the build Method

Actions

Actions dictate how a widgets functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the widgets to fit your specific needs.
1. onBack
The onBack event is typically triggered when the close button is clicked and it carries a default action. However, with the following code snippet, you can effortlessly override this default operation. 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.
2. onError
This method onError, allows users to override error handling within CometChatDetails, providing greater control over error responses and actions.

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. CometChatDetails widgets does not have available filters.

Events

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. To handle events supported by Users you have to add corresponding listeners by using CometChatUserEvents

Customization

To fit your app’s design requirements, you can customize the appearance of the details 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 widgets in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the widget.
1. Details Style
You can set the DetailsStyle to the User Detail Widget to customize the styling.
Image
List of properties exposed by DetailsStyle
2. Avatar Style
To apply customized styles to the Avatar widget in the CometChatDetails widget, you can use the following code snippet. For further insights on Avatar Styles refer

3. StatusIndicator Style
To apply customized styles to the StatusIndicator widget in the CometChatDetails widget, You can use the following code snippet. For further insights on Status Indicator Styles refer

4. ListItem Style
To apply customized styles to the List Item widget in the CometChatDetails widget, You can use the following code snippet. For further insights on List Item Styles refer

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.
Image

Advance

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

SubTitleView

You can customize the subtitle view for each item to meet your specific preferences and needs.
Image

CustomProfileView 🛑

Tailor the custom profile view for each user item to suit your specific preferences and needs.
Image

DetailsOption

The CometChatDetailsOption defines the structure for individual options within the CometChat details widget, facilitating customization and functionality for user interactions.
This defines the structure of each option for a template in the details widget.

DetailsTemplate 🛑

The CometChatDetailsTemplate offers a structure for organizing information in the CometChat details widget. It serves as a blueprint, defining how user-related details are presented. This structure allows for customization and organization within the CometChat interface.
Complete Example of Options and Template
Image