streamHttp static method
void
streamHttp(})
Implementation
static void streamHttp(
String url, {
required Map<String, dynamic> parameters,
Function(Map response)? onSuccess,
Function(String error)? onError,
}) async {
//更新header参数配置
Dio newDio = Dio();
dio!.options.headers = {};
Response request = await newDio.get(url);
if (request.statusCode == 200) {
if (onSuccess != null) onSuccess({"json": request.data});
} else {
if (onError != null) onError("请求错误");
}
}