NIMMessage.customEmptyMessage constructor Null safety

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

Create a custom message

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);
}