> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-llms-scoped-indexes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Group Management

> Create groups, manage members, assign roles, and transfer ownership in CometChat Flutter UI Kit.

<Accordion title="AI Agent Component Spec">
  | Field | Value |
  | - | - |
  | Package | `cometchat_chat_uikit` |
  | Key components | `CometChatGroups`, `CometChatCreateGroup`, `CometChatGroupInfo`, `CometChatAddMembers`, `CometChatBannedMembers`, `CometChatTransferOwnership` |
  | Init | `CometChatUIKit.init(uiKitSettings)` then `CometChatUIKit.login(uid)` |
  | Entry point | Groups tab → create/join group → `CometChatGroupInfo` for management |
  | Sample app | [GitHub](https://github.com/cometchat/cometchat-uikit-flutter/tree/v5/sample_app) |
  | Related | [All Guides](/ui-kit/flutter/v5/guide-overview) |
</Accordion>

Group Management enables users to create groups, join public/password groups, manage members, ban users, update roles, and transfer ownership.

Before starting, complete the [Getting Started](/ui-kit/flutter/v5/getting-started) guide.

***

## Components

| Component / Class | Role |
| :- | :- |
| `CometChatGroups` | Displays groups and create button |
| `CometChatCreateGroup` | UI to create new groups |
| `CometChatGroupInfo` | Shows group info and member management |
| `CometChatAddMembers` | Add members to a group |
| `CometChatBannedMembers` | View/unban banned users |
| `CometChatTransferOwnership` | Transfer group ownership |
| `CometChatChangeScope` | Change a user's group role |
| `JoinProtectedGroupUtils` | Utility to join password-protected groups |

***

## Integration Steps

### 1. Create a Group

Show the create group dialog from the dashboard.

*File: [dashboard.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/dashboard.dart)*

```dart theme={null}
IconButton(
  onPressed: () {
    showCreateGroup(
      context: context,
      colorPalette: colorPalette,
      typography: typography,
      spacing: spacing,
    );
  },
  icon: Icon(Icons.group_add),
)
```

*File: [cometchat\_create\_group.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/create_group/cometchat_create_group.dart)*

```dart theme={null}
await CometChat.createGroup(
  group: Group(
    guid: groupId,
    name: groupName,
    type: groupType,
    password: groupPassword,
  ),
  onSuccess: (Group group) => Navigator.pop(context),
  onError: (e) {
    // Show error
  },
);
```

***

### 2. Join Public/Password Group

Handle group tap to join or prompt for password.

*File: [join\_protected\_group\_util.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/utils/join_protected_group_util.dart)*

```dart theme={null}
CometChatGroups(
  onItemTap: (context, group) {
    JoinProtectedGroupUtils.onGroupItemTap(context, group);
  },
)
```

***

### 3. View Group Info

Display group details and member management options.

*File: [cometchat\_group\_info.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/group_info/cometchat_group_info.dart)*

```dart theme={null}
CometChatGroupInfo(
  group: group,
)
```

***

### 4. Add Members

Navigate to add members screen.

*File: [cometchat\_add\_members.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/add_memebers/cometchat_add_members.dart)*

```dart theme={null}
CometChatAddMembers(
  group: group,
)
```

***

### 5. Ban/Unban Members

Manage banned members list.

*File: [cometchat\_banned\_members.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/banned_members/cometchat_banned_members.dart)*

```dart theme={null}
CometChatBannedMembers(
  group: group,
)
```

***

### 6. Transfer Ownership

Transfer group ownership to another member.

*File: [cometchat\_transfer\_ownership.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/transfer_ownership/cometchat_transfer_ownership.dart)*

```dart theme={null}
CometChatTransferOwnership(
  group: group,
)
```

***

## Feature Matrix

| Feature | Component / Method | File |
| :- | :- | :- |
| Create group | `CometChatCreateGroup` | [cometchat\_create\_group.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/create_group/cometchat_create_group.dart) |
| Join group | `JoinProtectedGroupUtils` | [join\_protected\_group\_util.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/utils/join_protected_group_util.dart) |
| View members | `CometChatGroupInfo` | [cometchat\_group\_info.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/group_info/cometchat_group_info.dart) |
| Add members | `CometChatAddMembers` | [cometchat\_add\_members.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/add_memebers/cometchat_add_members.dart) |
| Ban/unban | `CometChatBannedMembers` | [cometchat\_banned\_members.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/banned_members/cometchat_banned_members.dart) |
| Transfer ownership | `CometChatTransferOwnership` | [cometchat\_transfer\_ownership.dart](https://github.com/cometchat/cometchat-uikit-flutter/blob/v5/sample_app/lib/transfer_ownership/cometchat_transfer_ownership.dart) |

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Groups" href="/ui-kit/flutter/v5/groups">
    Learn more about the Groups component.
  </Card>

  <Card title="Group Members" href="/ui-kit/flutter/v5/group-members">
    Display and manage group members.
  </Card>

  <Card title="Conversations" href="/ui-kit/flutter/v5/conversations">
    View group conversations.
  </Card>

  <Card title="All Guides" href="/ui-kit/flutter/v5/guide-overview">
    Browse all feature and formatter guides.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.