
Cometchat Flutter V6 Users Groups
- 5 installs
- 70 repo stars
- Updated June 23, 2026
- cometchat/cometchat-skills
Implement user lists, group lists, and group member management with CometChat Flutter UIKit v6 components and request builders.
About
Covers the CometChatUsers, CometChatGroups, and CometChatGroupMembers widgets for user and group management in Flutter UIKit v6. A developer uses it to build contacts, member lists, and group admin actions.
- CometChatUsers renders a searchable, alphabetical user list
- Covers members, scopes, bans, and request-builder filtering
Cometchat Flutter V6 Users Groups by the numbers
- 5 all-time installs (skills.sh)
- Ranked #828 of 1,039 Mobile Development skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cometchat/cometchat-skills --skill cometchat-flutter-v6-users-groupsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 5 |
|---|---|
| repo stars | ★ 70 |
| Last updated | June 23, 2026 |
| Repository | cometchat/cometchat-skills ↗ |
What it does
Implement user lists, group lists, and group member management with CometChat Flutter UIKit v6 components and request builders.
Files
CometChat Flutter UIKit — Users & Groups
Components for displaying and managing users, groups, and group members.
CometChatUsers
Displays a searchable, alphabetically-sorted list of users.
CometChatUsers(
onItemTap: (context, user) {
Navigator.push(context, MaterialPageRoute(
builder: (_) => MessagesScreen(user: user),
));
},
usersStyle: CometChatUsersStyle(
backgroundColor: colorPalette.background1,
),
usersStatusVisibility: true,
showBackButton: true,
onBack: () => Navigator.pop(context),
)Custom Request Builder
CometChatUsers(
usersRequestBuilder: UsersRequestBuilder()
..limit = 30
..friendsOnly = true
..roles = ['default']
..searchKeyword = 'john',
)View Slots
CometChatUsers(
listItemView: (user) => MyCustomUserItem(user),
subtitleView: (context, user) => Text(user.status ?? 'offline'),
trailingView: (context, user) => Icon(Icons.chat),
)CometChatGroups
Displays a searchable list of groups with type indicators (public/private/password).
CometChatGroups(
onItemTap: (context, group) {
Navigator.push(context, MaterialPageRoute(
builder: (_) => MessagesScreen(group: group),
));
},
groupsStyle: CometChatGroupsStyle(
backgroundColor: colorPalette.background1,
),
groupTypeVisibility: true,
)Custom Request Builder
CometChatGroups(
groupsRequestBuilder: GroupsRequestBuilder()
..limit = 30
..joinedOnly = true
..searchKeyword = 'team'
..withTags = true
..tags = ['project'],
)CometChatGroupMembers
Displays members of a specific group with role indicators and management actions.
CometChatGroupMembers(
group: group,
groupMembersStyle: CometChatGroupMembersStyle(
backgroundColor: colorPalette.background1,
),
)Group Member Actions
The component supports scope changes, kick, and ban based on the logged-in user's role:
| Logged-in Role | Can Change Scope | Can Kick | Can Ban |
|---|---|---|---|
| Owner | ✅ All members | ✅ All | ✅ All |
| Admin | ✅ Participants only | ✅ Participants | ✅ Participants |
| Participant | ❌ | ❌ | ❌ |
Architecture (All Three)
All follow the same Clean Architecture + BLoC pattern:
{component}/
├── bloc/{component}_bloc.dart # State management + SDK listeners
├── domain/usecases/ # Get{Component}sUseCase, etc.
├── data/repositories/ # SDK wrapper
├── di/{component}_service_locator.dart # Singleton DI
└── widgets/ # List item, empty/error/loading viewsBLoC State Pattern
All three use the same state pattern:
// Status-based states
{Component}Initial → {Component}Loading → {Component}Loaded / {Component}Empty / {Component}Error
// Loaded state has:
final List<{Entity}> items;
final bool hasMore;
final Set<String> selectedItems; // For selection mode
final bool isLoadingMore;Selection Mode
All list components support selection:
CometChatUsers(
selectionMode: SelectionMode.multiple,
onSelection: (selectedUsers) {
// Handle selected users
},
activateSelection: ActivateSelection.onLongClick,
)Gotchas
CometChatGroupMembershas been fully migrated to BLoC + Clean Architecture (bloc/, data/, di/, domain/, widgets/). AGroupMembersBlocAdapterwraps the BLoC to implement the legacyCometChatGroupMembersControllerProtocolfor backward compatibility. The oldcometchat_group_members_controller.dartfile still exists but the BLoC is the active implementation.- Group type icons (lock for private, shield for password) are controlled by
groupTypeVisibility. Setting it tofalsehides all type indicators. friendsOnly: trueonUsersRequestBuilderonly works if your CometChat plan supports the friends feature.- When a user is blocked, they still appear in
CometChatUsersunless you setincludeBlockedUsers: falseon the conversations BLoC or filter in the request builder.
Anti-Patterns
// ❌ WRONG — not handling group join for password-protected groups
onItemTap: (context, group) => Navigator.push(context, MaterialPageRoute(
builder: (_) => MessagesScreen(group: group), // Fails if not joined
))
// ✅ CORRECT — check membership, handle password groups
onItemTap: (context, group) {
if (group.hasJoined) {
Navigator.push(context, MaterialPageRoute(
builder: (_) => MessagesScreen(group: group),
));
} else if (group.type == GroupTypeConstants.password) {
Navigator.push(context, MaterialPageRoute(
builder: (_) => JoinProtectedGroupScreen(group: group),
));
} else {
// Join public group first, then navigate
}
}// ❌ WRONG — hardcoded role check strings
if (member.scope == 'admin') { ... }
// ✅ CORRECT — use SDK constants
if (member.scope == GroupMemberScope.admin) { ... }// ❌ WRONG — creating ServiceLocator per widget instance
final locator = GroupsServiceLocator(); // New instance each time
// ✅ CORRECT — use singleton
final locator = GroupsServiceLocator.instance;
locator.setup();Checklist
- [ ]
onItemTaphandles group join state (joined vs password vs public) - [ ] Group member actions respect role hierarchy
- [ ] Selection mode configured if multi-select needed
- [ ] Request builder customized for app's user/group filtering needs
- [ ] ServiceLocator accessed via
.instancesingleton - [ ] Colors from
CometChatThemeHelper, not hardcoded