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

# Call

> Integrate CometChat Flutter UI Kit calling with one-on-one and group audio/video calls, setup, initialization, and call events.

<Accordion title="AI Integration Quick Reference">
  | Field       | Value                                                                                                                                                                                   |
  | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Package     | `cometchat_chat_uikit`                                                                                                                                                                  |
  | Import      | `import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';`                                                                                                                      |
  | Purpose     | Integrate CometChat Flutter UI Kit calling with one-on-one and group audio/video calls, setup, initialization, and call events.                                                         |
  | Key classes | `CometChatSubscriptionType` · `CometChatUIKit`                                                                                                                                          |
  | Key methods | `addCallListener()` · `init()` · `removeCallListener()`                                                                                                                                 |
  | Related     | [Call Buttons](/ui-kit/flutter/call-buttons) · [Incoming Call](/ui-kit/flutter/incoming-call) · [Outgoing Call](/ui-kit/flutter/outgoing-call) · [Call Logs](/ui-kit/flutter/call-logs) |
</Accordion>

## Overview

CometChat's Calls feature allows you to integrate one-on-one and group audio/video calling capabilities into your application. In V6, calling is built into the `cometchat_chat_uikit` package — no separate calls dependency needed.

## Integration

### Step 1: Add Dependency

Add the dependency to your `pubspec.yaml`:

```yaml pubspec.yaml theme={null}
dependencies:
  cometchat_chat_uikit: ^6.0.5
```

***

### Step 2: Update build.gradle

Set `minSdkVersion` to at least 24 in `android/app/build.gradle`:

<Tabs>
  <Tab title="Groovy">
    ```gradle theme={null}
    defaultConfig {
        minSdkVersion 24
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
    ```
  </Tab>
</Tabs>

***

### Step 3: Update iOS Podfile

In `ios/Podfile`, set the minimum iOS version to 12:

```
platform :ios, '12.0'
```

***

### Step 4: Modify UIKitSettings

Activate calling features by setting `enableCalls` to `true` in UIKitSettings:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
      ..subscriptionType = CometChatSubscriptionType.allUsers
      ..autoEstablishSocketConnection = true
      ..region = "REGION"
      ..appId = "APP_ID"
      ..authKey = "AUTH_KEY"
      ..enableCalls = true
      ..callingConfiguration = CallingConfiguration()
    ).build();

    CometChatUIKit.init(uiKitSettings: uiKitSettings,
      onSuccess: (successMessage) {},
      onError: (e) {},
    );
    ```
  </Tab>
</Tabs>

To allow launching the Incoming Call screen from any widget, provide the navigator key:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    MaterialApp(
      navigatorKey: CallNavigationContext.navigatorKey,
      home: YourHomeScreen(),
    )
    ```
  </Tab>
</Tabs>

### Listeners

Register call listeners for top-level widgets:

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    class _YourClassNameState extends State<YourClassName> with CallListener {
      @override
      void initState() {
        super.initState();
        CometChat.addCallListener(listenerId, this);
      }

      @override
      void dispose() {
        super.dispose();
        CometChat.removeCallListener(listenerId);
      }

      @override
      void onIncomingCallReceived(Call call) {
        debugPrint("onIncomingCallReceived");
      }

      @override
      void onOutgoingCallAccepted(Call call) {
        debugPrint("onOutgoingCallAccepted");
      }

      @override
      void onOutgoingCallRejected(Call call) {
        debugPrint("onOutgoingCallRejected");
      }

      @override
      void onIncomingCallCancelled(Call call) {
        debugPrint("onIncomingCallCancelled");
      }

      @override
      void onCallEndedMessageReceived(Call call) {
        debugPrint("onCallEndedMessageReceived");
      }

      @override
      Widget build(BuildContext context) {
        return const Placeholder();
      }
    }
    ```
  </Tab>
</Tabs>

***

## Features

### Incoming Call

The Incoming Call widget lets users receive real-time audio and video calls. When a call is received, it displays caller information with accept/reject options.

### Outgoing Call

The Outgoing Call widget manages the outgoing call process. It displays recipient information and call status, and automatically transitions to the ongoing call screen when accepted.

### Call Logs

The [Call Logs](/ui-kit/flutter/call-logs) widget displays records of call events including caller, time, and duration.
