0 purchases
dio repository
封装dio库 #
为了更好的使用对dio网络库进行二次封装
安装使用 #
dependencies:
dio_repository: ^1.1.2
copied to clipboard
主项目中引入 #
DSHttpInject httpInject = DSHttpInject(
onRequest:(options,handler){
//做请求的拦截处理
handler.next(options);
},onResponse:(options,handler){
//做响应的拦截处理
handler.next(options);
},onError:(options,handler){
//异常错误处理
handler.next(options);
},
);
DSDioUtil.getInstance().init(
baseUrl: 'xxx',
connectTimeout: 2000,
inject:httpInject
);
copied to clipboard
网络库模块使用 #
dynamic data = await DSDioUtil.getInstance().get('/xxxx',queryParameters:{'key':'value'});
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.