Skip to main content
CometChatCallLogs renders a scrollable list of call history with call type indicators (audio/video), call status (incoming/outgoing/missed), timestamps, and pagination support.
The CometChatCallLogs widget is composed of the following base widgets:
WidgetDescription
CometChatListBaseContainer widget with title, background options, and list integration
CometChatListItemDisplays call log data on a card with title and subtitle

Where It Fits

CometChatCallLogs is a list component. It renders call history and emits the selected CallLog via onItemClick. Wire it to a detail screen or use onCallLogIconClicked to initiate a call directly from the log.
CometChatCallLogs(
  onItemClick: (callLog) {
    // Navigate to call log details or open chat
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => CometChatCallLogDetails(callLog: callLog),
      ),
    );
  },
)

Quick Start

Using Navigator:
Navigator.push(context, MaterialPageRoute(builder: (context) => const CometChatCallLogs()));
Embedding as a widget:
import 'package:cometchat_chat_uikit/cometchat_calls_uikit.dart';
import 'package:flutter/material.dart';

class CallLogsExample extends StatefulWidget {
  const CallLogsExample({super.key});

  @override
  State<CallLogsExample> createState() => _CallLogsExampleState();
}

class _CallLogsExampleState extends State<CallLogsExample> {
  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: SafeArea(child: CometChatCallLogs()),
    );
  }
}
Prerequisites: CometChat SDK initialized with CometChatUIKit.init(), a user logged in, and the Calls UIKit dependency added. See Call Features for setup.

Filtering Call Logs

Pass a CallLogRequestBuilder to control what loads:
CometChatCallLogs(
  callLogsRequestBuilder: CallLogRequestBuilder()
    ..limit = 10
    ..hasRecording = true,
)

Filter Recipes

RecipeBuilder property
Limit per page..limit = 10
Audio calls only..callType = "audio"
Video calls only..callType = "video"
Missed calls only..callStatus = "missed"
Incoming calls only..callDirection = "incoming"
Outgoing calls only..callDirection = "outgoing"
Calls with recording..hasRecording = true
Calls for specific user..uid = "user_uid"
Calls for specific group..guid = "group_guid"
Call category (call/meet)..callCategory = "call"

Filter Properties

PropertyTypeDescription
authTokenString?Authentication token
callCategoryString?Category: "call" or "meet"
callDirectionString?Direction: "incoming" or "outgoing"
callStatusString?Status: "ongoing", "busy", "rejected", "cancelled", "ended", "missed", "initiated", "unanswered"
callTypeString?Type: "audio", "video", or "audio/video"
guidString?Group ID filter
hasRecordingboolFilter calls with recordings
limitintMax results per request
uidString?User ID filter

Actions and Events

Callback Methods

onItemClick

Fires when a call log item is tapped. Primary navigation hook.
CometChatCallLogs(
  onItemClick: (callLog) {
    // Navigate to call details or chat
  },
)

onItemLongPress

Fires when a call log item is long-pressed, allowing additional actions.
CometChatCallLogs(
  onItemLongPress: (CallLog callLog) {
    // Show context menu
  },
)

onBack

Fires when the user presses the back button in the app bar.
CometChatCallLogs(
  onBack: () {
    Navigator.pop(context);
  },
)

onError

Fires on internal errors (network failure, SDK exception).
CometChatCallLogs(
  onError: (e) {
    debugPrint("Error: ${e.message}");
  },
)

onLoad

Fires when the list is successfully fetched and loaded.
CometChatCallLogs(
  onLoad: (list) {
    debugPrint("Loaded ${list.length} call logs");
  },
)

onEmpty

Fires when the list is empty after loading.
CometChatCallLogs(
  onEmpty: () {
    debugPrint("No call logs found");
  },
)

onCallLogIconClicked

Fires when the call icon on a call log item is tapped, typically used to initiate a call back.
CometChatCallLogs(
  onCallLogIconClicked: (CallLog callLog) {
    // Initiate call back to this contact
  },
)

Events

The CometChatCallLogs widget does not emit global events.

Functionality

PropertyTypeDefaultDescription
showBackButtonbool?trueToggle back button visibility
hideAppbarbool?falseToggle app bar visibility
backButtonWidget?nullCustom back button widget
datePatternString?nullFormat pattern for date display
dateSeparatorPatternString?nullFormat pattern for date separator
hideSeparatorboolfalseHide separator between items
emptyStateTextString?nullText for empty state
errorStateTextString?nullText for error state
incomingAudioCallIconIcon?nullCustom icon for incoming audio calls
incomingVideoCallIconIcon?nullCustom icon for incoming video calls
outgoingAudioCallIconIcon?nullCustom icon for outgoing audio calls
outgoingVideoCallIconIcon?nullCustom icon for outgoing video calls
missedAudioCallIconIcon?nullCustom icon for missed audio calls
missedVideoCallIconIcon?nullCustom icon for missed video calls
infoIconUrlString?nullURL for the info icon
loadingIconUrlString?nullURL for the loading icon
Example — custom back button:
CometChatCallLogs(
  backButton: Icon(Icons.arrow_back_ios, color: Color(0xFF6851D6)),
)
Image Image

Custom View Slots

List Item View

Replace the entire list item row with a custom widget.
CometChatCallLogs(
  listItemView: (callLog, context) {
    final status = getCallStatus(context, callLog, CometChatUIKit.loggedInUser);
    IconData icon = Icons.call;
    Color? color;
    Color? textColor;

    if (status == "Incoming Call") {
      icon = Icons.phone_callback_rounded;
      color = Color(0xFF6852D6);
    } else if (status == "Outgoing Call") {
      icon = Icons.phone_forwarded;
      color = Color(0xFF6852D6);
    } else if (status == "Missed Call") {
      icon = Icons.phone_missed;
      color = Colors.red;
      textColor = Colors.red;
    }

    String name = _getCallLogName(callLog);
    String formattedDate = DateFormat('d MMM, hh:mm a').format(
      DateTime.fromMillisecondsSinceEpoch((callLog.initiatedAt ?? 0) * 1000),
    );

    return ListTile(
      leading: CircleAvatar(
        backgroundColor: Color(0xFFEDEAFA),
        child: Icon(icon, color: color, size: 24),
      ),
      title: Text(name, style: TextStyle(
        fontSize: 16, fontWeight: FontWeight.w500,
        color: textColor ?? Color(0xFF141414),
      )),
      subtitle: Text(status, style: TextStyle(
        color: Color(0xFF727272), fontSize: 14,
      )),
      trailing: Text(formattedDate, style: TextStyle(
        color: Color(0xFF727272), fontSize: 14,
      )),
    );
  },
)

Title View

Replace the caller name / title text.
CometChatCallLogs(
  titleView: (callLog, context) {
    return Text(
      _getCallLogName(callLog),
      style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
    );
  },
)

Leading View

Replace the avatar / left section.
CometChatCallLogs(
  leadingView: (callLog, context) {
    return CircleAvatar(
      backgroundColor: Color(0xFFEDEAFA),
      child: Icon(Icons.call, color: Color(0xFF6852D6)),
    );
  },
)

Subtitle View

Replace the call status text below the name.
CometChatCallLogs(
  subTitleView: (callLog, context) {
    return Row(
      children: [
        _getCallIcon(callLog, CometChatUIKit.loggedInUser),
        SizedBox(width: 4),
        Text(
          getCallStatus(context, callLog, CometChatUIKit.loggedInUser),
          style: TextStyle(color: Color(0xFF727272), fontSize: 14),
        ),
      ],
    );
  },
)

Trailing View

Replace the timestamp / right section.
CometChatCallLogs(
  trailingView: (context, callLog) {
    String formattedDate = DateFormat('d MMM, hh:mm a').format(
      DateTime.fromMillisecondsSinceEpoch((callLog.initiatedAt ?? 0) * 1000),
    );
    return Text(
      formattedDate,
      style: TextStyle(color: Color(0xFF727272), fontSize: 14),
    );
  },
)

State Views

CometChatCallLogs(
  emptyStateView: (context) => Center(child: Text("No call logs yet")),
  errorStateView: (context) => Center(child: Text("Something went wrong")),
  loadingStateView: (context) => Center(child: CircularProgressIndicator()),
)

// Replace all options
CometChatCallLogs(
  setOptions: (callLog, controller, context) {
    return [
      CometChatOption(
        id: "callback",
        iconWidget: Icon(Icons.call),
        title: "Call Back",
        onClick: () {
          // Initiate call back
        },
      ),
    ];
  },
)

// Append to defaults
CometChatCallLogs(
  addOptions: (callLog, controller, context) {
    return [
      CometChatOption(
        id: "block",
        iconWidget: Icon(Icons.block),
        title: "Block Number",
        onClick: () {
          // Block this contact
        },
      ),
    ];
  },
)

Style

CometChatCallLogs(
  callLogsStyle: CometChatCallLogsStyle(
    titleTextColor: Color(0xFFF76808),
    separatorColor: Color(0xFFF76808),
    avatarStyle: CometChatAvatarStyle(
      borderRadius: BorderRadius.circular(8),
      backgroundColor: Color(0xFFFBAA75),
    ),
  ),
)

Configurations

Outgoing Call

Customize the outgoing call component that appears when a call is initiated from a call log:
CometChatCallLogs(
  outgoingCallConfiguration: OutgoingCallConfiguration(
    subtitle: "Outgoing Call",
    outgoingCallStyle: OutgoingCallStyle(
      background: Color(0xFFE4EBF5),
    ),
  ),
)
Image Image All exposed properties of OutgoingCallConfiguration can be found under Outgoing Call.

Next Steps

Call Log Details Guide

Build a call log details screen

Call Buttons

Add voice and video call buttons

Component Styling

Detailed styling reference

Conversations

Browse recent conversations