DirectoryUtil class

DirectoryUtil。

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

createAppDocDir({String? category}) Future<Directory?>
createAppDocDirSync({String? category}) Directory?
createAppSupportDir({String? category}) Future<Directory?>
createAppSupportDirSync({String? category}) Directory?
createDir(String? path) Future<Directory?>
异步创建文件夹
createDirSync(String? path) Directory?
同步创建文件夹
createStorageDir({String? category}) Future<Directory?>
createStorageDirSync({String? category}) Directory?
createTempDir({String? category}) Future<Directory?>
createTempDirSync({String? category}) Directory?
getAppDocPath({String? category, String? fileName, String? format}) String?
get Application Documents Directory file path. fileName 文件名 format 文件格式,如果文件名包含格式,则不需要 category 分类,例如:Download,Pictures, Music等等 String path = DirectoryUtil.getAppDocPath(category: 'Pictures', fileName: 'demo.png'); String path = DirectoryUtil.getAppDocPath(category: 'Pictures', fileName: 'demo', format: 'png'); Android: /data/user/0/com.thl.flustars_example/app_flutter/Pictures/demo.png iOS: xxx;
getAppSupportPath({String? category, String? fileName, String? format}) String?
get Application Support Directory file path. fileName 文件名 format 文件格式,如果文件名包含格式,则不需要 category 分类,例如:video,image等等 String path = DirectoryUtil.getAppSupportPath(category: 'Pictures', fileName: 'demo.png'); String path = DirectoryUtil.getAppSupportPath(category: 'Pictures', fileName: 'demo', format: 'png'); Android: /data/user/0/com.thl.flustars_example/files/Pictures/demo.png iOS: xxx;
getInstance() Future<DirectoryUtil?>
getPath(Directory? dir, {String? category, String? fileName, String? format}) String?
get path. dir category 分类,例如:Download,Pictures, Music等等 fileName 文件名 format 文件格式,如果文件名包含格式,则不需要
getStoragePath({String? category, String? fileName, String? format}) String?
get External Storage Directory file path. category 分类,例如:video,image等等 fileName 文件名 format 文件格式,如果文件名包含格式,则不需要 String path = DirectoryUtil.getStoragePath(category: 'Download', fileName: 'demo.apk'; String path = DirectoryUtil.getStoragePath(category: 'Download', fileName: 'demo', format: 'apk'); Android: /storage/emulated/0/Android/data/com.thl.flustars_example/files/Download/demo.apk iOS: xxx;
getTempPath({String? category, String? fileName, String? format}) String?
get Temporary Directory file path. category 分类,例如:Download,Pictures, Music等等 fileName 文件名 format 文件格式,如果文件名包含格式,则不需要 String path = DirectoryUtil.getTempPath(category: 'Pictures',fileName: 'demo.png'); String path = DirectoryUtil.getTempPath(category: 'Pictures', fileName: 'demo', format: 'png'); Android: /data/user/0/com.thl.flustars_example/cache/Pictures/demo.png iOS: xxx;
initAppDocDir() Future<Directory?>
initAppSupportDir() Future<Directory?>
initStorageDir() Future<Directory?>
initTempDir() Future<Directory?>