CacheManager class
create_user: zhengzaihong email:1096877329@qq.com create_date: 2021/6/14 create_time: 16:10 describe: 缓存工具
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(
{Directory? docDirectory, Directory? tempDirectory}) → void - 删除缓存
-
deleteDirectory(
FileSystemEntity file) → Future< void> -
formatSize(
double? value) → String -
getCache(
{Directory? docDirectory, Directory? tempDirectory}) → Future< String> -
loadApplicationCache(
{Directory? docDirectory, Directory? tempDirectory}) → Future< double> - 外部可借助 path_provider 获取指定的目录读取大小 Directory docDirectory = await getApplicationDocumentsDirectory(); Directory tempDirectory = await getTemporaryDirectory();
-
writeToFile(
Directory documentsDir, String fileName, String notes, {String? direcName, String? userId = "user"}) → Future< File> - 将数据内容写入doc文件夹里,如果不传direcName,默认存doc文件夹 documentsDir 文件夹 ---路径。没有则创建 fileName: 文件名 notes 要存储的内容 direcName 文件夹名字,如分类,首页,购物车,我的等。可不传 userId 可根据不同的用创建不同的文件夹 简单标示