EMMessage.createImageSendMessage constructor Null safety
Creates an image 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 image path.
Param displayName
The image name.
Param thumbnailLocalPath
The local path of the image thumbnail.
Param sendOriginalImage
Whether to send the original image.
true
: Yes.false
: (default) No. For an image greater than 100 KB, the SDK will compress it and send the thumbnail.
Param fileSize
The image file size in bytes.
Param width
The image width in pixels.
Param height
The image height in pixels.
Return The message instance.
Implementation
EMMessage.createImageSendMessage({
required String username,
required String filePath,
String? displayName,
String? thumbnailLocalPath,
bool sendOriginalImage = false,
int? fileSize,
double? width,
double? height,
}) : this.createSendMessage(
to: username,
body: EMImageMessageBody(
localPath: filePath,
displayName: displayName,
thumbnailLocalPath: thumbnailLocalPath,
sendOriginalImage: sendOriginalImage,
width: width,
height: height,
));