MyUserDataDirStore class

将用户选择的数据目录路径保存在系统应用支持目录(bootstrap 指针), 以便下次启动时定位真实数据位置。

Constructors

MyUserDataDirStore({String bootstrapFileName = 'user_data_dir.json', String jsonPathKey = 'userDataDir'})
const

Properties

bootstrapFileName String
Bootstrap 文件名,位于 getApplicationSupportDirectory 下。
final
hashCode int
The hash code for this object.
no setterinherited
jsonPathKey String
JSON 中保存路径的字段名。
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildJsonPayload(String userDataDir) Map<String, dynamic>
构造将要写入 bootstrap 文件的 JSON 对象。
load() Future<String?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(String userDataDir) Future<void>
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

readPathFromJson(Map<String, dynamic> json, String jsonPathKey) String?
从 bootstrap JSON 中解析用户数据目录路径(供 load 与测试使用)。

Constants

defaultInstance → const MyUserDataDirStore
默认实例(user_data_dir.json + userDataDir 字段)。