createImageMessage static method
- {required String sessionId,
- required NIMSessionType sessionType,
- required String filePath,
- required int fileSize,
- String? displayName,
- String? base64,
- NIMNosScene nosScene = NIMNosScenes.defaultIm}
创建图片消息
base64
字段为web端专用,web端filePath
可传空字符串
Implementation
static Future<NIMResult<NIMMessage>> createImageMessage(
{required String sessionId,
required NIMSessionType sessionType,
required String filePath,
required int fileSize,
String? displayName,
String? base64,
NIMNosScene nosScene = NIMNosScenes.defaultIm}) async {
var message = NIMMessage.imageEmptyMessage(
sessionId: sessionId,
sessionType: sessionType,
filePath: filePath,
fileSize: fileSize,
base64: base64,
displayName: displayName,
nosScene: nosScene);
return NimCore.instance.messageService._createMessage(message: message);
}