dio_repository

Creator: coderz1093

Last updated:

0 purchases

dio_repository Image
dio_repository Images

Languages

Categories

Add to Cart

Description:

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

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.