FileUploadModel class

文件上传模型类

Constructors

FileUploadModel({String? id, FileInfo? fileInfo, required String name, required String path, FileSource source = FileSource.network, int? fileSize, String? fileSizeInfo, UploadStatus? status, double progress = 0, String? url, DateTime? createTime, DateTime? updateTime})
FileUploadModel.fromMap(Map<String, dynamic> map)
从Map创建FileUploadModel实例
factory
FileUploadModel.withAutoId({FileInfo? fileInfo, required String name, required String path, FileSource source = FileSource.network, int? fileSize, String? fileSizeInfo, UploadStatus? status, double progress = 0, String? url, DateTime? createTime, DateTime? updateTime})
创建一个带有自动生成ID的FileUploadModel实例
factory

Properties

createTime DateTime?
文件创建时间
final
fileInfo FileInfo?
文件信息(可为空,因为保存的是最后提交的数据信息,一开始可能没有)
final
fileSize int?
文件大小(字节)
final
fileSizeInfo String?
格式化后的文件大小信息(如:1.2MB、500KB等)
final
hashCode int
The hash code for this object.
no setterinherited
id String
唯一标识ID(随机生成,用于前端操作如删除等,与后端ID不冲突,永远不为空)
final
name String
文件名称
final
path String
文件本地路径
final
progress double
上传进度(0.0 - 1.0)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source FileSource
文件来源(文件选择、图片选择、拍照等)
final
status UploadStatus?
上传状态(等待、上传中、成功、失败)
getter/setter pair
updateTime DateTime?
文件最后更新时间
final
url String?
文件上传后的访问URL地址
final

Methods

copyWith({String? id, FileInfo? fileInfo, String? name, String? path, FileSource? source, UploadStatus? status, double? progress, int? fileSize, String? fileSizeInfo, String? url, DateTime? createTime, DateTime? updateTime}) FileUploadModel
复制并修改模型
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
转换为Map
toString() String
A string representation of this object.
inherited

Operators

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