NIMMessage.customEmptyMessage constructor

NIMMessage.customEmptyMessage(
  1. {required String sessionId,
  2. required NIMSessionType sessionType,
  3. String? content,
  4. NIMMessageAttachment? attachment,
  5. NIMCustomMessageConfig? config}
)

创建自定义消息

Implementation

factory NIMMessage.customEmptyMessage(
    {required String sessionId,
    required NIMSessionType sessionType,
    String? content,
    NIMMessageAttachment? attachment,
    NIMCustomMessageConfig? config}) {
  return NIMMessage(
      messageDirection: NIMMessageDirection.outgoing,
      messageType: NIMMessageType.custom,
      timestamp: new DateTime.now().millisecondsSinceEpoch,
      status: NIMMessageStatus.sending,
      sessionId: sessionId,
      sessionType: sessionType,
      content: content,
      messageAttachment: attachment,
      config: config);
}