IPFSUtils class

Constructors

IPFSUtils.new(String secretKey, String requestUrl, String downloadUrl, String previewUrl)

Properties

downloadUrl String
下载地址(显示)
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
previewUrl String
文件预览地址
getter/setter pair
requestUrl String
上传的地址
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secretKey String
密钥
getter/setter pair
userId String
用户id
getter/setter pair

Methods

fileUpload(dynamic context, ValueChanged<UploadResultEntity> changed, String parentId, IPFSFileType fileType, {Function? progressCallback, List<String>? allowedExtensions}) Future<void>
文件上传
getCoverPath(String url) String
视频封面的路径
getFilePath(dynamic fileId, dynamic fileName) String
上传之后文件的路径
imageUpload(dynamic context, ValueChanged<UploadResultEntity> changed, String parentId, {IPFSFileType fileType = IPFSFileType.image, CommonSortPathDelegate? sortPathDelegate, Function? progressCallback}) Future<void>
图片或者视频等选择 @param changed 上传之后的内容 @param parentId 文件夹的ID @param fileType 文件类型
initUserId(String userId) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
voneFileUpload(BuildContext context, String filePath, ValueChanged<UploadResultEntity> changed, String parentId, {Function? progressCallback}) Future<void>
文件上传 filePath 文件路径 parentId 文件夹id changed 上传成功之后的结果

Operators

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

Static Properties

instance IPFSUtils?
getter/setter pair

Static Methods

disabledFileType(String fileName) bool
禁止上传文件类型
getFileIconBySuffix(String fileName, {String? fileType}) Icon
根据文件的后缀名获取文件的图标
getIconFont(int iconName, dynamic color, double size) Icon
加载iconfont的图标
getInstance(String secretKey, {String requestUrl = "http://hn.vonechain.com:88", String downloadUrl = "http://hn.vonechain.com:88", String previewUrl = "http://hn.vonechain.com:88/ipfsPreview/onlinePreview"}) IPFSUtils
isAllowFileType(String fileName, IPFSFileType fileType, {List<String>? allowedExtensions = const []}) bool
是否为允许选择的文件类型
isDir(String type) bool