getDisplayName static method

String getDisplayName(
  1. V2TimMessage message
)

Implementation

static String getDisplayName(V2TimMessage message) {
  final friendRemark = message.friendRemark ?? "";
  final nameCard = message.nameCard ?? "";
  final nickName = message.nickName ?? "";
  final sender = message.sender ?? "";
  final displayName = friendRemark.isNotEmpty
      ? friendRemark
      : nameCard.isNotEmpty
      ? nameCard
      : nickName.isNotEmpty
      ? nickName
      : sender;
  return displayName.toString();
}