Http class

封装网络请求 dio库

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

downloadFile() → dynamic
下载文件
get(String url, {String? baseUrl, Map<String, dynamic>? params, Map<String, dynamic>? header, Success? success, SuccessList? successList, Empty? empty, Error? error, CancelToken? cancelToken, OnValueCallBack<CancelToken>? cancelTokenCallBack, bool isList = false}) Future<void>
get请求 baseUrl 切换baseUrl params 参数 success 请求对象成功回调 successList 请求列表成功回调 error 错误回调 isList 请求的数据是否为List列表 默认对象 isList=true 请求data数据为[]list列表
imageToByte(String imageUrl) Future<Uint8List?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post<T>(String url, {String? baseUrl, Map<String, dynamic>? params, Map<String, dynamic>? header, required dynamic data, Success? success, SuccessList? successList, Empty? empty, Error? error, CancelToken? cancelToken, OnValueCallBack<CancelToken>? cancelTokenCallBack, bool isList = false}) Future<void>
post请求 baseUrl 切换baseUrl params 参数 data 上传表单数据 formData success 请求对象成功回调 successList 请求列表成功回调 error 错误回调 isList 请求的数据是否为List列表 默认对象 isList=true 请求data数据为[]list列表
put<T>(String url, {String? baseUrl, Map<String, dynamic>? params, Map<String, dynamic>? header, required dynamic data, Success? success, SuccessList? successList, Empty? empty, Error? error, CancelToken? cancelToken, OnValueCallBack<CancelToken>? cancelTokenCallBack, bool isList = false}) Future<void>
put请求 baseUrl 切换baseUrl params 参数 data 上传表单数据 formData success 请求对象成功回调 successList 请求列表成功回调 error 错误回调 isList 请求的数据是否为List列表 默认对象 isList=true 请求data数据为[]list列表
toString() String
A string representation of this object.
inherited
uploadFile<T>(String url, {String? baseUrl, required FormData data, Success? success, Empty? empty, Error? error, CancelToken? cancelToken, OnValueCallBack<CancelToken>? cancelTokenCallBack, ProgressCallback? onSendProgress}) Future<void>
上传文件

Operators

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

Static Properties

instance Http
getter/setter pair