Overview
CometChatBannedMembers is a crucial Widget that showcases users who have been restricted from participating in specific groups or conversations. Once banned, users lose access to content and discussions within the affected group. Administrators or owners wield the authority to ban members from groups they oversee, enabling them to monitor user activity and behavior closely. With CometChatBannedMembers, administrators can take swift and appropriate actions to maintain group integrity and uphold community standards.
- Android
- iOS

BannedMembers Widget is composed of the following BaseWidgets:
Usage
Integration
CometChatBannedMembers , 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 banned members, users gain access to a wide range of parameters and methods for effortless customization of its user interface.
You can launch CometChatBannedMembers 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 CometChatBannedMembers
- Dart
2. Embedding CometChatBannedMembers 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 onItemClick functionality withinCometChatBannedMembers , 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. onItemLongPress
This method becomes invaluable when users seek to override long-click functionality withinCometChatBannedMembers , 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
3. 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
4. onError
You can customize this behavior by using the provided code snippet to override theonError and improve error handling.
- Dart
5. onSelection
When theonSelection event is triggered, it furnishes the list of selected members. 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 members.
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.
- 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.1. BannedGroupMembersRequestBuilder
TheBannedGroupMembersRequestBuilder enables you to filter and customize the Banned Members list based on available parameters in BannedGroupMembersRequestBuilder. This feature allows you to create more specific and targeted queries when fetching banned members. The following are the parameters available in BannedGroupMembersRequestBuilder
Example
In the example below, we are applying a filter to the banned members by setting the limit to 10.
- Dart
2. CustomBannedMembersProtocol
TheCustomBannedMembersProtocol uses BannedGroupMembersRequestBuilder enables you to filter and customize the search list based on available parameters in BannedMembersRequestBuilder.
This feature allows you to keep uniformity between the displayed Banned Members list and searched Banned Members.
Example
- Dart
custom_protocol.dart
- Dart
main.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.
Events emitted by the Join Group Widget is as follows.
- Dart
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. BannedMembers Style 🛑
You can set theBannedMembersStyle to the CometChatBannedMembers Widget to customize the styling.
- Dart
- Android
- iOS

2. Avatar Style
To apply customized styles to theAvatar Widget in the Banned Members Widget, you can use the following code snippet. For further insights on Avatar Styles refer
- Dart
3. StatusIndicator Style
To apply customized styles to the Status Indicator widget in theCometChatBannedMembers Widget, You can use the following code snippet. For further insights on Status Indicator Styles refer
- Dart
4. ListItem Style
To apply customized styles to theListItemStyle in the CometChatBannedMembers Widget, you can use the following code snippet. For further insights on List Item Styles refer
- Dart
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.- Dart
- Android
- iOS

CometChatBannedMembers
Advance
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.ListItemView
With this function, you can assign a custom ListItem to theCometChatBannedMembers Widget.
- Dart
widget
custom_list_item.dart for more complex or unique list items.
- Dart
custom_list_item.dart
- Dart
main.dart
- Android
- iOS

SubtitleView
You can customize the subtitle view for each item to meet your specific preferences and needs.- Dart
widget
- Dart
main.dart
- Android
- iOS

AppBarOptions
You can set the CustomappBarOptions to the CometChatBannedMembers widget.
- Dart
widget
- Dart
- Android
- iOS

EmptyStateView
You can set a customEmptyStateView using emptyStateView to match the error widget of your app.
- Dart
widget
- Dart
main.dart
- Android
- iOS

LoadingStateView
You can set a custom loader widget usingloadingStateView to match the loading UI of your app.
- Dart
widget
- Dart
main.dart
- Android
- iOS

ErrorStateView
You can set a customErrorStateView using errorStateView to match the error UI of your app.
- Dart
widget
- Dart
main.dart
- Android
- iOS









