RxNetConfig class

Constructors

RxNetConfig({required String baseUrl, NetworkAdapter? adapter, AdapterBaseOptions? adapterBaseOptions, String? cachePath, String cacheName = 'network_cache', String databaseName = 'rxnet_cache.db', CacheMode cacheMode = CacheMode.ONLY_REQUEST, List<AdapterInterceptor>? interceptors, bool systemLog = false, bool isDebug = true, CheckNetWork? baseCheckNet, List<String>? ignoreCacheKeys, Map<String, dynamic>? baseUrlEnv, int cacheInvalidationTime = _defaultCacheInvalidationTime, int cacheMaxSize = 0, CacheEvictionPolicy cacheEvictionPolicy = CacheEvictionPolicy.none, double debugWindowWidth = 800, double debugWindowHeight = 600})
const

Properties

adapter → NetworkAdapter?
网络适配器(DioAdapter、HttpAdapter、MockAdapter 等)
final
adapterBaseOptions → AdapterBaseOptions?
适配器无关的全局请求默认配置(推荐)
final
baseCheckNet → CheckNetWork?
网络检测回调 The network detects a callback-external implementation
final
baseUrl → String
服务端基础地址
final
baseUrlEnv → Map<String, dynamic>?
多环境基础服务地址
final
cacheEvictionPolicy → CacheEvictionPolicy
缓存淘汰策略(默认 CacheEvictionPolicy.none)
final
cacheInvalidationTime → int
缓存时效(毫秒),默认 1 年
final
cacheMaxSize → int
缓存最大条目数(0 表示不限制,默认 0)
final
cacheMode → CacheMode
缓存策略
final
cacheName → String
缓存文件名
final
cachePath → String?
缓存目录路径(可选)
final
databaseName → String
数据库名称
final
debugWindowHeight → double
调试窗口高度
final
debugWindowWidth → double
调试窗口宽度
final
hashCode → int
The hash code for this object.
no setterinherited
ignoreCacheKeys → List<String>?
生成缓存时忽略的参数 key 列表
final
interceptors → List<AdapterInterceptor>?
拦截器列表
final
isDebug → bool
是否为调试模式
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
systemLog → bool
是否开启系统日志
final

Methods

copyWith({String? baseUrl, NetworkAdapter? adapter, AdapterBaseOptions? adapterBaseOptions, String? cachePath, String? cacheName, String? databaseName, CacheMode? cacheMode, List<AdapterInterceptor>? interceptors, bool? systemLog, bool? isDebug, CheckNetWork? baseCheckNet, List<String>? ignoreCacheKeys, Map<String, dynamic>? baseUrlEnv, int? cacheInvalidationTime, int? cacheMaxSize, CacheEvictionPolicy? cacheEvictionPolicy, double? debugWindowWidth, double? debugWindowHeight}) → RxNetConfig
复制并修改配置
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

builder() → RxNetConfigBuilder
创建 Builder 实例