getLastMessageWidget method

dynamic getLastMessageWidget(
  1. TencentCloudChatTextStyle textStyle,
  2. TencentCloudChatThemeColors colorTheme
)

Implementation

getLastMessageWidget(TencentCloudChatTextStyle textStyle, TencentCloudChatThemeColors colorTheme) {
  final laseMessage = widget.conversation.lastMessage;
  String originalText = TencentCloudChatUtils.getMessageSummary(
    message: laseMessage,
    messageReceiveOption: widget.conversation.recvOpt,
    unreadCount: widget.conversation.unreadCount,
    draftText: widget.conversation.draftText,
  );

  String replaceText = FaceManager.emojiMap.keys.fold(originalText, (previous, key) {
    return previous.replaceAll(key, FaceManager.emojiMap[key]!);
  });

  return Expanded(
    child: Text(
      replaceText,
      style: TextStyle(
        fontSize: textStyle.fontsize_12,
        fontWeight: FontWeight.w400,
        color: colorTheme.conversationItemLastMessageTextColor,
      ),
      maxLines: 1,
      overflow: TextOverflow.ellipsis,
    ),
  );
}