CometChatGroupMembers
is a versatile Widget designed to showcase all users who are either added to or invited to a group, thereby enabling them to participate in group discussions, access shared content, and engage in collaborative activities. CometChatGroupMembers
have the capability to communicate in real-time through messaging, voice and video calls, and various other interactions. Additionally, they can interact with each other, share files, and join calls based on the permissions established by the group administrator or owner.
CometChatGroupMembers
widget is composed of the following BaseWidgets:
Widgets | Description |
---|---|
CometChatListBase | CometChatListBase serves as a container widget equipped with a title (navigationBar), search functionality (search-bar), background settings, and a container for embedding a list widget. |
CometChatListItem | This widget renders information extracted from a User object onto a tile, featuring a title, subtitle, leading widget, and trailing widget. experience, facilitating seamless navigation and interaction within the widget. |
CometChatGroupMembers
, as a Composite Widget, offers flexible integration options, allowing it to be launched directly via button clicks or any user-triggered action.
You can launch CometChatGroupMembers
directly using Navigator.push
, or you can define it as a widget within the build
method of your State
class.
CometChatGroupMembers
CometChatGroupMembers
as a Widget in the build MethodCometChatGroupMembers
, 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.
CometChatGroupMembers
, 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.
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.
onError
and improve error handling.
onSelection
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.
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.
Property | Description | Code |
---|---|---|
GUID | Group ID for the group whose members are to be fetched. | guid: String |
Limit | Number of results to limit the query. | limit: int? |
Search Keyword | Keyword for searching members within the group. | searchKeyword: String? |
Scopes | List of scopes for filtering members (e.g., moderators). | scopes: List<String>? |
GroupMembersProtocol
uses GroupsRequestBuilder enables you to filter and customize the search list based on available parameters in GroupsRequestBuilder.
This feature allows you to keep uniformity between the displayed Group Members List and Searched Group Members List.
Here is the complete example for reference:
Example
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.
Event | Description |
---|---|
ccGroupMemberBanned | Triggers when the group member banned from the group successfully |
ccGroupMemberKicked | Triggers when the group member kicked from the group successfully |
ccGroupMemberScopeChanged | Triggers when the group member scope is changed in the group |
CometChatGroupMembersStyle
to the CometChatGroupMembers
Widget to customize the styling.
CometChatGroupMembers
Property | Data Type | Description |
---|---|---|
groupMembersProtocol | GroupMembersBuilderProtocol? | Custom request builder protocol for fetching group members. |
groupMembersRequestBuilder | GroupMembersRequestBuilder? | Custom request builder for fetching group members. |
subtitleView | Widget? Function(BuildContext, GroupMember)? | Widget to set subtitle for each group member. |
hideSeparator | bool? | Toggle visibility of separator. |
listItemView | Widget Function(GroupMember)? | Custom view for each group member item. |
style | CometChatGroupMembersStyle? | Sets style for [CometChatGroupMembers]. |
controller | ScrollController? | Sets controller for the list. |
options | List<CometChatOption>? Function(Group, GroupMember, CometChatGroupMembersController, BuildContext)? | Options visible at the slide of each group member. |
searchPlaceholder | String? | Placeholder text for the search input. |
backButton | Widget? | Widget for the back button in the app bar. |
showBackButton | bool | Flag to show/hide the back button. |
searchBoxIcon | Widget? | Widget for the search box icon. |
hideSearch | bool | Flag to show/hide the search input box. |
selectionMode | SelectionMode? | Specifies mode group members module is opening in. |
onSelection | Function(List<GroupMember>?)? | Callback for handling group member selection. |
loadingStateView | WidgetBuilder? | View displayed during loading state. |
emptyStateView | WidgetBuilder? | View displayed when the list is empty. |
errorStateView | WidgetBuilder? | View displayed when an error occurs. |
hideError | bool? | Toggle visibility of error dialog. |
stateCallBack | Function(CometChatGroupMembersController)? | Callback to access controller functions from the parent. |
appBarOptions | List<Widget>? | Options available in the app bar. |
group | Group | Group object passed to fetch members. |
trailingView | Function(BuildContext, GroupMember)? | Custom widget for the trailing section of the group member list item. |
submitIcon | Widget? | Widget for the submit icon. |
selectIcon | Widget? | Widget for the selection icon. |
onBack | VoidCallback? | Callback triggered when going back. |
onItemTap | Function(GroupMember)? | Callback triggered when tapping a group member item. |
onItemLongPress | Function(GroupMember)? | Callback triggered on long press of a group member item. |
activateSelection | ActivateSelection? | Lets the widget know if group members can be selected. |
onError | OnError? | Callback for handling errors. |
height | double? | Height of the widget. |
width | double? | Width of the widget. |
controllerTag | String? | Tag for accessing the widget’s GetXController. |
hideAppbar | bool? | Flag to hide the app bar. |
searchKeyword | String? | Keyword to fetch the initial list with. |
onLoad | OnLoad<GroupMember>? | Callback triggered when the list is loaded. |
onEmpty | OnEmpty? | Callback triggered when the list is empty. |
leadingStateView | Widget? Function(BuildContext, GroupMember)? | Widget for the leading section of each group member. |
titleView | Widget? Function(BuildContext, GroupMember)? | Custom title view for each group member. |
hideUserStatus | bool? | Flag to hide the user status indicator on the avatar. |
hideBanMemberOption | bool? | Flag to hide the ban member option. |
hideKickMemberOption | bool? | Flag to hide the kick member option. |
hideScopeChangeOption | bool? | Flag to hide the scope change option. |
setOptions | List<CometChatOption>? Function(Group, GroupMember, CometChatGroupMembersController, BuildContext)? | List of actions available on long press of group member item. |
addOptions | List<CometChatOption>? Function(Group, GroupMember, CometChatGroupMembersController, BuildContext)? | Adds to the current list of actions on long press of a group member item. |
CometChatGroupMembers
widget does not provide additional functionalities beyond this level of customization.
CometChatGroupMembers
Widget.
custom_list_item.dart
for more complex or unique list items.
appBarOptions
to the CometChatGroupMembers
widget.
CometChatGroupMembers
widget. You can add a Tail widget using the following method.