HttpUtilSafeCall extension

HttpUtil 扩展方法 提供安全调用方法,自动处理异常和错误提示

on

Methods

send<T>({required String method, required String path, dynamic data, Map<String, dynamic>? queryParameters, bool isLoading = false, Map<String, String>? headers, int priority = 0, bool skipDeduplication = false, bool skipQueue = false, String? baseUrl, String? service, bool isChainCall = false, void onFailure(int? httpStatusCode, int? errorCode, String message)?}) Future<Response<T>>

Available on HttpUtil, provided by the HttpUtilSafeCall extension

发送请求(自动处理异常,失败时自动提示) method 请求方式:必须使用 hm.get、hm.post 等常量 isLoading 是否显示加载提示(默认 false) 如果为 true 且配置了 contextGetter,将自动显示加载提示 headers 特定请求的请求头(可选),会与全局请求头合并,如果键相同则覆盖全局请求头

Static Methods

clearErrorHandledRecords() → void

Available on HttpUtil, provided by the HttpUtilSafeCall extension

清除错误处理记录(用于测试或特殊场景)
closeChainLoading() → void

Available on HttpUtil, provided by the HttpUtilSafeCall extension

关闭链式调用的加载提示(供 response.dart 使用)
hasChainLoading() bool

Available on HttpUtil, provided by the HttpUtilSafeCall extension

检查是否已有链式调用的加载提示(供 response.dart 使用)