CacheManagerImpl class

author:郑再红 email:1096877329@qq.com date: 2021/6/14 time: 16:10 describe: 缓存工具 - IO 平台实现

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

clearApplicationCache({dynamic docDirectory, dynamic tempDirectory}) → void
删除缓存
deleteDirectory(FileSystemEntity file) Future<void>
getTotalSizeOfFilesInDir(FileSystemEntity file) Future<double>
获取当前文件大小
loadApplicationCache({dynamic docDirectory, dynamic tempDirectory}) Future<double>
外部可借助 path_provider 获取指定的目录读取大小 Directory docDirectory = await getApplicationDocumentsDirectory(); Directory tempDirectory = await getTemporaryDirectory();
writeToFile(dynamic documentsDir, String fileName, String notes, {String? direcName, String? userId = "user"}) Future<File>
将数据内容写入doc文件夹里,如果不传direcName,默认存doc文件夹 documentsDir 文件夹 ---路径。没有则创建 fileName: 文件名 notes 要存储的内容 direcName 文件夹名字,如分类,首页,购物车,我的等。可不传 userId 可根据不同的用创建不同的文件夹 简单标示