NetworkConfig class
Constructors
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 Properties
-
baseUrl
→ Future<
String> -
改成异步 getter,首次调用时自动初始化
no setter
- baseUrlSync → String
-
同步获取baseUrl(使用当前内存中的值)
no setter
- dio → Dio
-
获取 Dio 实例(静态接口)
用于第三方 App 获取已配置好的 Dio 对象
no setter
-
id
→ Future<
String?> -
获取id,首次访问时自动从本地存储加载
no setter
- idSync → String?
-
同步获取id(可能返回null如果还未初始化)
no setter
- localDeviceUrl ↔ String
-
getter/setter pair
Static Methods
-
clearRemoteId(
) → Future< void> - 清除保存的remoteId
-
getClient(
) → HttpClient -
init(
) → Future< void> - 初始化方法(可选调用,用于预加载) 如果不调用,会在首次使用时自动初始化
-
setRemoteId(
String remoteId) → Future< void> - 设置remoteId并持久化 当remoteId为空时,不保存到本地存储,保持原有值不变