SlcFileUtil class

@author: slc 文件操作工具类

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

appendFileAsString(String filePath, String content, {bool catchException = true}) Future<bool>
追加文件内容
copy(String srcPath, String destPath) bool
createOrExistsDir(String dirPath) bool
createOrExistsFile(String filePath) bool
delete(String filePath) bool
deleteDir(String dirPath) bool
getDirName(String filePath) String
getDirNameByFile(File? file) String
getFileByPath(String filePath) File?
getFileExtension(String filePath) String
getFileLastModified(String filePath) DateTime?
getFileLength(String filePath) int
getFileName(String filePath) String
getFileNameByTime({String? prefix, int? ms, String dateFormat = VALUE_FILE_NAME_DATE_FORMAT, String? suffix, bool carryPathSeparator = true}) String
根据时间获取文件名
getFileNameWithoutExtension(String filePath) String
getSize(String filePath) String
isDir(String dirPath) bool
isFile(String filePath) bool
isFileExists(File? file) bool
isFileExistsFromPath(String filePath) bool
listFilesInDir(String dirPath, {bool recursive = false}) List<File>
readAssetFileAsString(String assetPath, {bool catchException = true}) Future<String>
从 assets 读取文件内容
readFileAsString(String filePath, {bool catchException = true}) Future<String>
读取文件内容
rename(File? file, String newName) bool
writeFileAsString(String filePath, String content, {bool catchException = true}) Future<bool>
写入文件内容

Constants

VALUE_FILE_NAME_DATE_FORMAT → const String