MessageBuilder class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
convertJsonToMessage({required String json})
→ Future<NIMResult<NIMMessage>>
-
json转换为NIMMessage
返回结果不支持 yidunAnti相关字段
-
convertMessageToJson({required NIMMessage message})
→ Future<NIMResult<String>>
-
NIMMessage转换为json
-
createAudioMessage({required String sessionId, required NIMSessionType sessionType, required String filePath, required int fileSize, required int duration, String? base64, String? displayName, NIMNosScene nosScene = NIMNosScenes.defaultIm})
→ Future<NIMResult<NIMMessage>>
-
创建音频消息
displayName
字段无效,不建议使用
base64
字段为web端专用,web端filePath
可传空字符串
-
createCustomMessage({required String sessionId, required NIMSessionType sessionType, String? content, NIMMessageAttachment? attachment, NIMCustomMessageConfig? config})
→ Future<NIMResult<NIMMessage>>
-
创建自定义消息
-
createEmptyMessage({required String sessionId, required NIMSessionType sessionType, required int timestamp})
→ Future<NIMResult<NIMMessage>>
-
创建空消息
-
createFileMessage({required String sessionId, required NIMSessionType sessionType, required String filePath, String? base64, int? fileSize, required String displayName, NIMNosScene nosScene = NIMNosScenes.defaultIm})
→ Future<NIMResult<NIMMessage>>
-
创建文件消息
base64
字段为web端专用,web端filePath
可传空字符串
-
createImageMessage({required String sessionId, required NIMSessionType sessionType, required String filePath, required int fileSize, String? displayName, String? base64, NIMNosScene nosScene = NIMNosScenes.defaultIm})
→ Future<NIMResult<NIMMessage>>
-
创建图片消息
base64
字段为web端专用,web端filePath
可传空字符串
-
createLocationMessage({required String sessionId, required NIMSessionType sessionType, required double latitude, required double longitude, required String address})
→ Future<NIMResult<NIMMessage>>
-
创建地理位置消息
-
createTextMessage({required String sessionId, required NIMSessionType sessionType, required String text})
→ Future<NIMResult<NIMMessage>>
-
创建文本消息
-
createTipMessage({required String sessionId, required NIMSessionType sessionType, String? content})
→ Future<NIMResult<NIMMessage>>
-
创建Tip消息
///
content
web端tip内容传这个字段
-
createVideoMessage({required String sessionId, required NIMSessionType sessionType, required String filePath, int? fileSize, String? base64, required int duration, required int width, required int height, required String displayName, NIMNosScene nosScene = NIMNosScenes.defaultIm})
→ Future<NIMResult<NIMMessage>>
-
创建视频消息
base64
字段为web端专用,web端filePath
可传空字符串