BaseNetworkClient class

Constructors

BaseNetworkClient()

Properties

baseUrl String?
no setter
checkResponseModelFunction ResponseModel Function(ResponseModel responseModel, {bool? toastIfMayNeed})
getter/setter pair
dio ↔ Dio?
getter/setter pair
getSuccessResponseModelFunction CJNetworkClientGetSuccessResponseModelBlock
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceValidProxyIp String?
*********************** proxy 设置 ************************
getter/setter pair

Methods

base_postUrl<T>(String url, {Map<String, dynamic>? customParams, CancelToken? cancelToken, Options? options, required void onSuccess(dynamic resultMap), required void onFailure(String? failureMessage)}) → void
base_requestUrl(String url, {RequestMethod requestMethod = RequestMethod.post, Map<String, dynamic>? customParams, Options? options, CancelToken? cancelToken}) Future<ResponseModel>
base_setup({required CJNetworkClientGetSuccessResponseModelBlock getSuccessResponseModelBlock, bool checkIsCommonFailureBlock(ResponseModel responseModel)?, required CJNetworkClientGetFailureResponseModelBlock getFailureResponseModelBlock, required CJNetworkClientGetDioErrorResponseModelBlock getDioErrorResponseModelBlock, required ResponseModel checkResponseModelHandel(ResponseModel responseModel, {bool? toastIfMayNeed})}) → void
base_start({required String baseUrl, int? connectTimeout, int? receiveTimeout, String? contentType, Map<String, dynamic>? headers, Map<String, dynamic> headerCommonChangeParamsGetBlock()?, required Map<String, dynamic> bodyCommonFixParams, Map<String, dynamic> bodyCommonChangeParamsGetBlock()?, List<Interceptor>? interceptors, bool? nouseDefalutInterceptors = false, required void logApiInfoAction(NetOptions apiInfo, ApiProcessType apiProcessType), String localApiDirBlock(String apiPath)?, void dealRequestOptionsAction(RequestOptions options)?, void startCompleteBlock()?}) → void
初始化公共属性
changeOptions({required String baseUrl}) → void
修改 baseUrl
changeProxy(String? proxyIp) bool
getAuthorization() String?
获取当前dio的token值(用于该值为空时候,能否进行请求的token白名单)
getUri(String api) Uri
makeSureCompleteStart() Future<void>
确保网络库start 启动成功过(使用此方法,省得开放_initCompleter)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateDeviceId(String deviceId) → void
updateHeaderKeyWithValue(String key, String? value) → void
添加/修改/删除 header 中的 key 值
updateToken(String? token) → void
添加/修改/删除token(登录成功/退出成功后调用)

Operators

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