BaseNetworkClient class
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, 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
-
-
添加/修改/删除 header 中的 key 值
-
updateToken(String? token)
→ void
-
添加/修改/删除token(登录成功/退出成功后调用)