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.
- Dart
Quick Start
Using Navigator:- Dart
- Dart
CometChatUIKit.init(), a user logged in, and the UI Kit dependency added.
Filtering Groups
Pass aGroupsRequestBuilder to control what loads:
- Dart
Filter Recipes
| Recipe | Builder property |
|---|---|
| Limit per page | ..limit = 10 |
| Search by keyword | ..searchKeyword = "team" |
| Joined groups only | ..joinedOnly = true |
| Filter by tags | ..tags = ["project"] |
| With tags | ..withTags = true |
Actions and Events
Callback Methods
onItemTap
Fires when a group row is tapped. Primary navigation hook.
- Dart
onItemLongPress
Fires when a group row is long-pressed.
- Dart
onBack
Fires when the user presses the back button in the app bar.
- Dart
onSelection
Fires when groups are selected/deselected in multi-select mode.
- Dart
onError
Fires on internal errors.
- Dart
onLoad
Fires when the list is successfully fetched and loaded.
- Dart
onEmpty
Fires when the list is empty after loading.
- Dart
SDK Events (Real-Time, Automatic)
The component listens to these SDK events internally. No manual setup needed.| SDK Listener | Internal behavior |
|---|---|
onGroupMemberJoined | Updates group member count |
onGroupMemberLeft | Updates group member count |
onGroupMemberKicked | Updates group member count, removes group if logged-in user was kicked |
onGroupMemberBanned | Updates group member count, removes group if logged-in user was banned |
onMemberAddedToGroup | Updates group member count |
ccGroupCreated | Adds new group to list |
ccGroupDeleted | Removes group from list |
| Connection reconnected | Triggers silent refresh |
Functionality
| Property | Type | Default | Description |
|---|---|---|---|
title | String? | null | Custom app bar title |
showBackButton | bool | true | Toggle back button |
hideAppbar | bool? | false | Toggle app bar visibility |
hideSearch | bool | false | Toggle search bar |
selectionMode | SelectionMode? | null | Enable selection mode (single or multiple) |
searchPlaceholder | String? | null | Search placeholder text |
Custom View Slots
Leading View
Replace the avatar / left section.- Dart
Title View
Replace the group name / title text.- Dart
Subtitle View
Replace the subtitle text below the group name.- Dart
Trailing View
Replace the right section of each group item.- Dart
List Item View
Replace the entire list item row.- Dart
State Views
- Dart
Common Patterns
Minimal list — hide all chrome
- Dart
Joined groups only
- Dart
Advanced
BLoC Access
Provide a customGroupsBloc to override behavior:
- Dart
Extending GroupsBloc
GroupsBloc uses the ListBase<Group> mixin with override hooks:
- Dart
ListBase override hooks (onItemAdded, onItemRemoved, onItemUpdated, onListCleared, onListReplaced), see BLoC & Data — ListBase Hooks.
Public BLoC Events
| Event | Description |
|---|---|
LoadGroups({searchKeyword, silent}) | Load initial groups. silent: true keeps existing list visible. |
LoadMoreGroups() | Load next page (pagination) |
RefreshGroups() | Refresh the list |
SearchGroups(keyword) | Search groups with debouncing |
Style
- Dart

Style Properties
| Property | Description |
|---|---|
backgroundColor | List background color |
avatarStyle | Avatar appearance |
statusIndicatorStyle | Group type indicator |
searchBoxStyle | Search box appearance |
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