Skip to main content

Where It Fits

CometChatGroupMembers displays all members of a group with their roles (owner, admin, moderator, participant). It provides member management actions like kick, ban, and scope change. Wire it to CometChatGroups to show members when a group is selected.
The CometChatGroupMembers widget is composed of the following BaseWidgets:

Minimal Render

You can also launch it using Navigator.push:

Filtering Group Members

Pass a GroupMembersRequestBuilder to groupMembersRequestBuilder. Pass the builder instance — not the result of .build().

Filter Recipes

Default page size is 30. The component uses infinite scroll — the next page loads as the user scrolls to the bottom.

GroupMembersRequestBuilder Properties

Custom Protocol Builder

Use GroupMembersBuilderProtocol to customize both the initial list and search results:

Actions and Events

Callback Props

onItemTap

Fires when a member row is tapped. Use for showing member profile or custom actions.

onItemLongPress

Fires when a member row is long-pressed. Useful for showing context menus.

onSelection

Fires when members are selected in multi-select mode. Requires selectionMode to be set.

onError

Fires on internal errors (network failure, auth issue, SDK exception).

onBack

Fires when the back button is pressed.

onLoad

Fires when the member list is successfully loaded.

onEmpty

Fires when the member list is empty.

Global UI Events

CometChatGroupEvents emits events subscribable from anywhere in the application. Add a listener in initState and remove it in dispose. When to use: sync external UI with member changes. For example, update a member count badge when a member is kicked.

SDK Events (Real-Time, Automatic)

The component listens to these SDK events internally. No manual attachment needed unless additional side effects are required.

Custom View Slots

Each slot replaces a section of the default UI. Slots that accept a member parameter receive the GroupMember object for that row.

listItemView

Replace the entire list item row.

leadingView

Replace the avatar / left section. Online status indicator example.

titleView

Replace the member name. Role badge inline example.

subtitleView

Replace the secondary text. Join date example.

trailingView

Replace the scope badge / right section. Custom scope badge example.

setOptions

Replace the context menu / long-press actions on each member item.

addOptions

Add to the existing context menu actions without removing defaults.

appBarOptions

Add custom widgets to the app bar.

loadingStateView

Custom view displayed while members are being fetched.

emptyStateView

Custom view displayed when no members are found.

errorStateView

Custom view displayed when an error occurs.

Styling

Set CometChatGroupMembersStyle to customize the appearance.

Style Properties


Common Patterns

Hide member management options

Multi-select with selection callback

Hide all chrome — minimal list

Filter admins and moderators only


Props Reference


Groups

Display and manage available groups

Add Members

Add new members to a group

Banned Members

View and manage banned members

Theming

Learn how to customize the look and feel