UtilFile class

UtilFile 文件工具类

Constructors

UtilFile()

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

Operators

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

Static Methods

clearStorage(FileSystemEntity file) Future
清理存储
createDirectory(String path, {bool clear = false}) Future<void>
创建目录
deleteFile(String path) Future
删除文件
downloadStreamFile(String downloadPath, Stream<List<int>> stream) Future<void>
下载流文件
getFileStorageDirectory({FileStorageDirectoryType? type, String? fileName, String? subPath = ''}) Future<String>
获取文件存储路径
getFileType({required String fileName}) FileTypeModel
获取文件类型
getPlatformFileStorageDirectory() Future<Directory?>
获取平台文件存储路径
getStorageSize(FileSystemEntity file) Future<double>
获取存储大小
normalizeFileSize(double value) String
格式化大小
openDocument({required BuildContext context, required String fileType, required String fileName, required String fileUrl}) Future<void>
打开文档
openFile(String path, {String? type, String? uti, String linuxDesktopName = "xdg"}) Future<OpenResult>
打开文件