getCallIcon static method

Widget getCallIcon(
  1. BuildContext context,
  2. CallLog callLog,
  3. User? loggedInUser,
  4. CometChatColorPalette colorPalette,
  5. CometChatTypography typography,
  6. CometChatSpacing spacing,
  7. CometChatCallLogsStyle style, {
  8. Widget? incomingCallIcon,
  9. Widget? outgoingCallIcon,
  10. Widget? missedCallIcon,
})

getCallIcon Return call status icon: the missed icon for a missed call (isMissedCallLog), otherwise outgoing or incoming by direction, whatever the status.

Implementation

static Widget getCallIcon(
  BuildContext context,
  CallLog callLog,
  User? loggedInUser,
  CometChatColorPalette colorPalette,
  CometChatTypography typography,
  CometChatSpacing spacing,
  CometChatCallLogsStyle style, {
  Widget? incomingCallIcon,
  Widget? outgoingCallIcon,
  Widget? missedCallIcon,
}) {
  if (isMissedCallLog(callLog, loggedInUser)) {
    return missedCallIcon ??
        Icon(
          Icons.call_missed_outgoing_rounded,
          color: style.missedCallIconColor ?? colorPalette.error,
          size: 16,
        );
  }
  if (callLogLoggedInUser(callLog, loggedInUser)) {
    return outgoingCallIcon ??
        Icon(
          Icons.call_made_outlined,
          color: style.outgoingCallIconColor ?? colorPalette.success,
          size: 16,
        );
  }
  return incomingCallIcon ??
      Icon(
        Icons.call_received_outlined,
        color: style.incomingCallIconColor ?? colorPalette.success,
        size: 16,
      );
}