AxiosFeatures class final

将 Axios 与它所依赖的 Fetch/XHR 宿主能力打包为一个 JsFeatures。

典型用法:在 JsUiView 或 JsEngine.create 的 features 中传入 AxiosFeatures(),即可在 JS 侧使用 axios,无需再单独配置 FetchFeatures 和 JsScript。

默认加载包内 Axios 脚本;传入 path 可替换为应用自带版本。

Inheritance

Constructors

AxiosFeatures({String path = _axiosAsset, AssetBundle? bundle, Set<String>? allowedOrigins, Duration timeout = const Duration(seconds: 30), int maxRequestBytes = 1024 * 1024, int maxResponseBytes = 10 * 1024 * 1024, int maxRedirects = 5, Map<String, String> defaultHeaders = const <String, String>{}, String name = 'axios', String? scriptName})
创建 Axios 组合 features。
factory
AxiosFeatures.session({String path = _axiosAsset, required JsHttpSession session, AssetBundle? bundle, String name = 'axios', String? scriptName})
使用共享网络会话创建 Axios features。
factory

Properties

browserGlobals → JsGlobals
Browser-like global aliases installed before scripts.
finalinherited
bundle → AssetBundle?
读取 path 时使用的 asset bundle;为 null 时使用 rootBundle。
final
fetchFeatures → FetchFeatures
内部用于实现 fetch / XMLHttpRequest 的 FetchFeatures 实例。
final
hashCode → int
The hash code for this object.
no setterinherited
methods → List<JsHostMethod>
注入 JavaScript 的 Dart/Flutter 宿主方法。
finalinherited
modules → List<JsModule>
ES module and CommonJS definitions included in this features.
finalinherited
name → String
Stable name used for conflict detection and debug inspection.
finalinherited
path → String
Axios 脚本所在的 Flutter asset 路径。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scripts → List<JsScript>
Ordered scripts that complete the runtime global environment.
finalinherited

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