getReceiptIcon method

Widget getReceiptIcon(
  1. CometChatTheme theme, {
  2. required Conversation conversation,
  3. bool? hideReceipt,
})

Implementation

Widget getReceiptIcon(CometChatTheme theme,
    {required Conversation conversation, bool? hideReceipt}) {
  if (hideReceipt ?? false) {
    return const SizedBox();
  } else if (conversation.lastMessage != null &&
      conversation.lastMessage?.sender != null &&
      conversation.lastMessage!.deletedAt == null &&
      conversation.lastMessage!.type != "groupMember") {
    ReceiptStatus status =
        MessageReceiptUtils.getReceiptStatus(conversation.lastMessage!);

    return Padding(
      padding: const EdgeInsets.only(right: 5.0),
      child: CometChatReceipt(
        status: status,
        deliveredIcon: deliveredIcon ??
            Image.asset(
              AssetConstants.messageReceived,
              package: UIConstants.packageName,
              color: receiptStyle?.deliveredIconTint ??
                  theme.palette.getAccent(),
            ),
        readIcon: readIcon ??
            Image.asset(
              AssetConstants.messageReceived,
              package: UIConstants.packageName,
              color: receiptStyle?.readIconTint ?? theme.palette.getPrimary(),
            ),
        sentIcon: sentIcon ??
            Image.asset(
              AssetConstants.messageSent,
              package: UIConstants.packageName,
              color: receiptStyle?.sentIconTint ?? theme.palette.getAccent(),
            ),
      ),
    );
  } else {
    return const SizedBox();
  }
}