StorageService class

存储服务

Annotations

Constructors

StorageService({int? instanceId})

Properties

hashCode int
The hash code for this object.
no setterinherited
instanceId int?
聊天室Id
getter/setter pair
onFileDownloadProgress Stream<NIMDownloadFileProgress>
文件下载进度
no setter
onFileUploadProgress Stream<NIMUploadFileProgress>
文件上传进度
no setter
onMessageAttachmentDownloadProgress Stream<NIMDownloadMessageAttachmentProgress>
消息附件下载进度
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCustomStorageScene(String sceneName, int expireTime) Future<NIMResult<NIMStorageScene>>
添加自定义存储场景
cancelUploadFile(NIMUploadFileTask fileTask) Future<NIMResult<void>>
取消文件上传
createUploadFileTask(NIMUploadFileParams fileParams, {File? fileObj}) Future<NIMResult<NIMUploadFileTask>>
创建文件上传任务
downloadAttachment(NIMDownloadMessageAttachmentParams downloadParam) Future<NIMResult<String>>
下载消息附件
downloadFile(String url, String filePath) Future<NIMResult<String>>
下载文件
getImageThumbUrl(NIMMessageAttachment attachment, NIMSize thumbSize) Future<NIMResult<NIMGetMediaResourceInfoResult>>
获取图片消息中的图片缩略图 传入短链自动获取长链地址并携带缩略图相关 URL 查询参数 旧的下载地址会做新的 CDN 加速域名地址替换 开启自定义鉴权会返回对应的鉴权信息
getStorageSceneList() Future<NIMResult<List<NIMStorageScene>>>
查询存储场景列表
getVideoCoverUrl(NIMMessageAttachment attachment, NIMSize thumbSize) Future<NIMResult<NIMGetMediaResourceInfoResult>>
获取视频消息中的视频封面 传入短链自动获取长链地址并携带视频封面相关 URL 查询参数 旧的下载地址会做新的 CDN 加速域名地址替换 开启自定义鉴权会返回对应的鉴权信息
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shortUrlToLong(String url) Future<NIMResult<String>>
短连接转长连接
toString() String
A string representation of this object.
inherited
uploadFile(NIMUploadFileTask fileTask, {File? fileObj}) Future<NIMResult<String>>
文件上传

Operators

operator ==(Object other) bool
The equality operator.
inherited