sendCardMessage method
Implementation
Future<void> sendCardMessage(ChatUIKitProfile cardProfile) async {
if (await createThreadIfNotExits() == false) return;
Map<String, String> param = {cardUserIdKey: cardProfile.id};
if (cardProfile.contactShowName.isNotEmpty) {
param[cardNicknameKey] = cardProfile.contactShowName;
}
if (cardProfile.avatarUrl != null) {
param[cardAvatarKey] = cardProfile.avatarUrl!;
}
final message = Message.createCustomSendMessage(
targetId: thread!.threadId,
event: cardMessageKey,
params: param,
);
sendMessage(message);
}