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