Skip to main content

Overview

CometChatAddMembers is a Widget that empowers administrators or group owners with the ability to expand group membership by seamlessly adding new participants. This widget facilitates effortless management of group membership and enhances collaboration within the group’s discussions and activities. Administrators can meticulously select desired users to join the group, whether by targeted search or from a list of available users. Selected users receive notifications, streamlining the process of joining the group and ensuring smooth integration into the community.
Image
The CometChatAddMembers widget is composed of the following BaseWidgets:

Usage

Integration

CometChatAddMembers , as a Composite Widget, offers flexible integration options, allowing it to be launched directly via button clicks or any user-triggered action. Additionally, it seamlessly integrates into tab view controllers. With add members, users gain access to a wide range of parameters and methods for effortless customization of its user interface. You can launch CometChatAddMembers 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 CometChatAddMembers
2. Embedding CometChatAddMembers as a Widget in the build Method

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. onBack
Enhance your application’s functionality by leveraging the onBack 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.

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

3. onSelection
When the 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.

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.
1. UsersRequestBuilder
The UsersRequestBuilder enables you to filter and customize the group list based on available parameters in UsersRequestBuilder. This feature allows you to create more specific and targeted queries when fetching users. The following are the parameters available in UsersRequestBuilder Example

2. UsersProtocol
The UsersProtocol uses UsersRequestBuilder enables you to filter and customize the search list based on available parameters in UsersRequestBuilder. This feature allows you to keep uniformity between the displayed User List and searched User List. Example
custom_protocol.dart
main.dart

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. Events emitted by the Join Group widget is as follows. Example
your_screen.dart

Customization

To fit your app’s design requirements, you can customize the appearance of the Groups 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. AddMembers Style
To apply customized styles to the CometChatAddMembers widget in the Group Member Widget, you can use the following code snippet.
Image
List of properties exposed by AddMembersStyle
2. Avatar Style
To apply customized styles to the Avatar widget in the CometChatAddMembers Widget, you can use the following code snippet. For further insights on Avatar Styles refer

3. StatusIndicator Style
To apply customized styles to the Status Indicator widget in the CometChatAddMembers 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 ListItemStyle in the CometChatAddMembers 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
List of functionality exposed by CometChatAddMembers

Advanced

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. The CometChatAddMembers widget does not provide additional functionalities beyond this level of customization.

ListItemView

With this function, you can assign a custom ListItem to the CometChatAddMembers Widget.
widget
Here is the complete example for reference: Example You can indeed create a custom widget named custom_list_item.dart for more complex or unique list items.
custom_list_item.dart
main.dart
Image

SubtitleView

You can customize the subtitle view for each item to meet your specific preferences and needs.
widget
Here is the complete example for reference: Example
main.dart
Image

AppBarOptions

You can set the Custom appBarOptions to the CometChatAddMembers widget.
widget
Here is the complete example for reference: Example
Image

EmptyStateView

You can set a custom EmptyStateView using emptyStateView to match the error widget of your app.
widget
Here is the complete example for reference: Example
main.dart
Image

LoadingStateView

You can set a custom loader widget using loadingStateView to match the loading UI of your app.
widget
Here is the complete example for reference: Example
main.dart
Image

ErrorStateView

You can set a custom ErrorStateView using errorStateView to match the error UI of your app.
widget
Here is the complete example for reference: Example
main.dart
Image