utils/src/network_util library

Classes

Config
NetworkUtil
Result
A Result.
Session

Enums

BaseURLType
URL环境

Properties

baseURLChangedCallback VoidCallback?
BaseURL变化回调
getter/setter pair
kApiPath String
getter/setter pair
kBaseURLType BaseURLType
上线环境
no setter
kEmptyList String
列表无数据
getter/setter pair
kFirstPage int
分页时第一页的起始页值
getter/setter pair
kLimitPage int
分页时每页数量
getter/setter pair
kPageCountKey String
每页数量
getter/setter pair
kPageKey String
页码数
getter/setter pair
kPageSizeKey String
每页数量
getter/setter pair
kPlaceholderTitleRemote String?
网络错误的提示语
getter/setter pair
kReleaseBaseURL String
生产环境
getter/setter pair
kTestBaseURL String
测试环境
getter/setter pair

Functions

checkVersion(String action, String baseUrl) → dynamic
get({String? baseUrl, String path = '', Map<String, dynamic>? queryParameters, Duration? connectTimeout, BaseCancelToken? cancelToken, bool validResult = true, bool autoLoading = false}) Future<Result>
发送请求并解析远程服务器返回的result对应的实体类型
initSelectedBaseURLType() Future<String?>
post({String? baseUrl, String path = '', dynamic data, Map<String, dynamic>? queryParameters, Duration? connectTimeout, BaseCancelToken? cancelToken, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, bool validResult = true, bool autoLoading = false}) Future<Result>
发送请求并解析远程服务器返回的result对应的实体类型
request({String? baseUrl, String path = '', dynamic data, Map<String, dynamic>? queryParameters, BaseCancelToken? cancelToken, Options? options, Duration? connectTimeout, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, bool validResult = true, bool autoLoading = false}) Future<Result>
发送请求并解析远程服务器返回的result对应的实体类型
showSelectBaseURLTypeAlert({BuildContext? context}) Future<bool?>
弹出切换环境菜单
uploadOSSFile({required String filepath, required String policy, required String accessKeyId, required String signature, required String key, required String host, String successActionStatus = "204", Duration connectTimeout = const Duration(seconds: 60), BaseCancelToken? cancelToken, ProgressCallback? onSendProgress}) Future<Result>
上传文件

Typedefs

BaseCancelToken = CancelToken
SessionExceptionType = DioExceptionType
SessionInterceptorSendHandler = dynamic Function(RequestOptions options)
SessionInterceptorSuccessHandler = dynamic Function(Result result)