Skip to main content

Receipt

The CometChatReceipt component renders the receipts such as sending, sent, delivered, read, and error state indicators of a message.

How to integrate CometChatReceipt?

Since CometChatReceipt is a widget, it can be added directly in the build method. CometChatReceipt includes various attributes and methods to customize its UI.

CometChatReceipt(
status: ReceiptStatus.read,
waitIcon: Image.asset(
"<image_url>",
),
sentIcon: Image.asset(
"<image_url>",
),
deliveredIcon: Image.asset(
"<image_url>",
),
readIcon: Image.asset(
"<image_url>",
),
errorIcon: Image.asset(
"<image_url>",
),
);

Properties

To style or customize the CometChatReceipt, you can use the available parameters.

AttributesTypeDescription
statusReceiptStatusReceipt status from which sentAt and readAt will be read to get the receipts
waitIconWidgetIt is used to pass a user-defined image into the MessageReceipt, to change the icon while sending the message.
sentIconWidgetIt is used to pass a user-defined image into the MessageReceipt, to change the icon when the message is sent.
deliveredIconWidgetIt is used to pass a user-defined image into the MessageReceipt, to change the icon when the message is delivered.
readIconWidgetIt is used to pass a user-defined image into the MessageReceipt, to change the icon when the message is read.
errorIconWidgetIt is used to pass a user-defined image into the MessageReceipt, to change the icon when an error occurs.

ReceiptStyle

Custom style for receipts.

AttributesTypeDescription
sentIconTintWidgetIt is used to change the icon color of the receipt when ReceiptStatus is sent.
deliveredIconTintWidgetIt is used to change the icon color of the receipt when ReceiptStatus is delivered.
readIconTintWidgetIt is used to change the icon color of the receipt when ReceiptStatus is read.

Usage

CometChatReceipt(
status: ReceiptStatus.read,
)