sendImageMessage method

void sendImageMessage(
  1. String filePath,
  2. String? name,
  3. int width,
  4. int height, {
  5. NIMMessage? replyMsg,
  6. String? imageType,
})

Implementation

void sendImageMessage(String filePath, String? name, int width, int height,
    {NIMMessage? replyMsg, String? imageType}) {
  MessageCreator.createImageMessage(filePath, name, null, width, height)
      .then((value) {
    if (value.isSuccess) {
      if (imageType?.isNotEmpty == true) {
        value.data!.serverExtension =
            jsonEncode({ChatMessage.keyImageType: imageType});
      }
      sendMessage(value.data!, replyMsg: replyMsg);
    }
  });
}