EMMessage.createFileSendMessage constructor Null safety

EMMessage.createFileSendMessage(
  1. {required String username,
  2. required String filePath,
  3. String? displayName,
  4. int? fileSize}
)

Creates a file message for sending.

Param username The ID of the message recipient.

  • For a one-to-one chat, it is the username of the peer user.
  • For a group chat, it is the group ID.
  • For a chat room, it is the chat room ID.

Param filePath The file path.

Param displayName The file name.

Param fileSize The file size in bytes.

Return The message instance.

Implementation

EMMessage.createFileSendMessage({
  required String username,
  required String filePath,
  String? displayName,
  int? fileSize,
}) : this.createSendMessage(
          to: username,
          body: EMFileMessageBody(
            localPath: filePath,
            fileSize: fileSize,
            displayName: displayName,
          ));