Skip to main content
CometChatGroups renders a scrollable list of all available groups with real-time updates for group events, search, avatars, group type indicators (public/private/password), and member counts.

Where It Fits

CometChatGroups is a list component. It renders all available groups and emits the selected Group via onItemTap. Wire it to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer to build a group chat layout.

Quick Start

Using Navigator:
Embedding as a widget:
Prerequisites: CometChat SDK initialized with CometChatUIKit.init(), a user logged in, and the UI Kit dependency added.

Filtering Groups

Pass a GroupsRequestBuilder to control what loads:

Filter Recipes


Actions and Events

Callback Methods

onItemTap

Fires when a group row is tapped. Primary navigation hook.

onItemLongPress

Fires when a group row is long-pressed.

onBack

Fires when the user presses the back button in the app bar.

onSelection

Fires when groups are selected/deselected in multi-select mode.

onError

Fires on internal errors.

onLoad

Fires when the list is successfully fetched and loaded.

onEmpty

Fires when the list is empty after loading.

SDK Events (Real-Time, Automatic)

The component listens to these SDK events internally. No manual setup needed.

Functionality


Custom View Slots

Leading View

Replace the avatar / left section.

Title View

Replace the group name / title text.

Subtitle View

Replace the subtitle text below the group name.

Trailing View

Replace the right section of each group item.

List Item View

Replace the entire list item row.

State Views


Common Patterns

Minimal list — hide all chrome

Joined groups only


Advanced

BLoC Access

Provide a custom GroupsBloc to override behavior:

Extending GroupsBloc

GroupsBloc uses the ListBase<Group> mixin with override hooks:
For ListBase override hooks (onItemAdded, onItemRemoved, onItemUpdated, onListCleared, onListReplaced), see BLoC & Data — ListBase Hooks.

Public BLoC Events


Style

Style Properties

See Component Styling for the full reference.

Next Steps

Group Members

View and manage group members

Conversations

Browse recent conversations

Component Styling

Detailed styling reference

Group Chat Guide

Complete group chat implementation