Network class
- Available extensions
Properties
- env ↔ Environment
-
getter/setter pair
- 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
-
request<
T> (Future< ApiResult< apiCall(Api api)) → Future<T> >T?> -
Available on Network, provided by the NetworkExtension extension
泛型 T 为实体类型 apiCall 返回Future<ApiResult<T>>返回必须有值,如果 data 为 null 或请求失败则抛异常 -
switchEnvironment(
Environment env) → void - 切换环境并更新 Dio 配置
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
获取单例
no setter
Static Methods
-
configure(
Environment environment) → void - 必须传入 environment 初始化