getLastMessageStatus method

Widget getLastMessageStatus(
  1. TencentCloudChatThemeColors colorTheme
)

Implementation

Widget getLastMessageStatus(TencentCloudChatThemeColors colorTheme) {
  Widget? wid;
  if (widget.conversation.lastMessage != null) {
    var message = widget.conversation.lastMessage!;
    if (message.status == 1) {
      // sending
      wid = Padding(
        padding: const EdgeInsets.only(right: 4),
        child: Icon(
          Icons.arrow_circle_left,
          size: getSquareSize(14),
          color: colorTheme.conversationItemSendingIconColor,
        ),
      );
    }
    if (message.status == 3) {
      // failed
      wid = Padding(
        padding: const EdgeInsets.only(right: 4),
        child: Icon(
          Icons.error_rounded,
          size: getSquareSize(14),
          color: colorTheme.conversationItemSendFailedIconColor,
        ),
      );
    }
  }
  wid ??= Container();
  return wid;
}