| name | cometchat-flutter-calls |
| description | Use when implementing voice calls, video calls, or call UI with CometChat Flutter UIKit v6. Covers CometChatCallButtons, CometChatIncomingCall, CometChatOutgoingCall, CometChatOngoingCall, CometChatCallLogs, CometChatUIKitCalls, CallingConfiguration, CallButtonsBloc, IncomingCallBloc, OutgoingCallBloc, OngoingCallBloc, CallLogsBloc, CallEventService, CallOperationsServiceLocator, call_operations, call_settings, SessionSettingsBuilder, CallAppSettings, initiateCall, acceptCall, rejectCall, endSession, startSession, generateToken, CallNavigationContext, CometChatDisplayIncomingCallOverlay, CallScreenOverlay, native_call_kit, call permissions, audio call, video call, group call, call logs, call history, incoming call screen, outgoing call screen, ongoing call screen, call bubble, or "add calling to my app". Also use when seeing errors like "CallManager not found", "startSession null", "call token null", "session already started", or call-related crashes.
|
| license | MIT |
| compatibility | cometchat_chat_uikit ^6.0.0 |
| allowed-tools | executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch |
| metadata | {"author":"CometChat","version":"1.0.0","tags":"cometchat flutter calls voice video calling incoming outgoing ongoing call-logs"} |
CometChat Flutter UIKit — Calls
Voice and video calling for 1:1 and group conversations. Call functionality is built into cometchat_chat_uikit — no separate package needed.
Import
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
import 'package:cometchat_chat_uikit/cometchat_calls_uikit.dart';
The first import gives you chat components. The second gives you call-specific types.
Rule: CALLS_INIT_AFTER_CHAT_INIT
CometChatUIKitCalls.init() MUST be called after CometChatUIKit.init() completes. The calls SDK needs the chat SDK's auth context.
// ✅ CORRECT — calls init after chat init
CometChatUIKit.init(
uiKitSettings: settings,
onSuccess: (_) {
CometChatUIKitCalls.init(appId, region,
onSuccess: (_) => debugPrint('Calls SDK ready'),
onError: (e) => debugPrint('Calls init failed: ${e.message}'),
);
},
);
// ❌ WRONG — parallel init causes auth token null
CometChatUIKit.init(uiKitSettings: settings);
CometChatUIKitCalls.init(appId, region); // Race condition
Rule: SINGLE_CALLS_INIT
CometChatUIKitCalls.init() must be called exactly once per app lifecycle. Calling it again after logout + re-login can cause "session already started" errors.
Rule: CALLS_REINIT_AFTER_LOGOUT
After CometChatUIKit.logout(), the calls SDK session is invalidated. On the next login, CometChatUIKitCalls.init() must be called again.
Architecture
call_ui/src/
├── call_buttons/ # Voice/video call buttons (CallButtonsBloc)
├── incoming_call/ # Incoming call screen (IncomingCallBloc)
├── outgoing_call/ # Outgoing call screen (OutgoingCallBloc)
├── ongoing_call/ # Active call screen — WebRTC (OngoingCallBloc)
├── call_logs/ # Call history list (CallLogsBloc + Clean Arch)
├── call_operations/ # Shared clean architecture (DI, use cases, repos)
├── call_bubble/ # Call message bubble in chat
├── call_settings/ # CometChatUIKitCalls, CallNavigationContext
├── native_call_kit/ # iOS CallKit / Android ConnectionService
├── utils/ # CallUtils, CallStateService, CallPermissions
├── call_event_service.dart # Centralized call event handling
└── calling_configuration.dart # Top-level config object
Components
CometChatCallButtons
Voice and video call buttons. Typically placed in CometChatMessageHeader's trailing view or standalone.
CometChatCallButtons(
user: user, // For 1:1 calls
group: group, // For group calls (meetings)
hideVoiceCallButton: false,
hideVideoCallButton: false,
voiceCallIcon: Icon(Icons.call),
videoCallIcon: Icon(Icons.videocam),
callButtonsStyle: CometChatCallButtonsStyle(
voiceCallIconColor: colorPalette.iconPrimary,
videoCallIconColor: colorPalette.iconPrimary,
),
outgoingCallConfiguration: CometChatOutgoingCallConfiguration(
outgoingCallStyle: CometChatOutgoingCallStyle(...),
),
)