sparrow_dio 0.6.0 copy "sparrow_dio: ^0.6.0" to clipboard
sparrow_dio: ^0.6.0 copied to clipboard

outdated

sparrow团队完成的对dio的封装,实现dio的async await调用以及回调方式的调用.

sparrow_dio #

对 dio 的封装,兼容回调函数方式

使用方法 #

有两种使用方法,用过 async await 使用异步请求或者通过回调的方式使用异步请求

  • async await 方式使用
    • 对外暴露 get, post, put, patch, delete, path, head, download 等别名,方便使用
var res = await Request.get(url: "http://www.baidu.com");
print(res);
  • 回调方式使用
    • 对外暴露 getCallback, postCallback, putCallback, patchCallback, deleteCallback, pathCallback, headCallback, downloadCallback 等别名,方便使用
  Request.getCallback(
    url: "http://www.baidu.com",
    success: (res) {
      _result = res.data;
      setState(() {});
    },
  );

项目信息 #

主页:https://github.com/hanguangbaihuo/sparrow_dio

issue: https://github.com/hanguangbaihuo/sparrow_dio/issues

使用有碰到各种问题,欢迎大家在issue页面留言

2
likes
0
pub points
30%
popularity

Publisher

verified publishersparrow.team

sparrow团队完成的对dio的封装,实现dio的async await调用以及回调方式的调用.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

bot_toast, connectivity, dio, flutter, sparrow_utils

More

Packages that depend on sparrow_dio