v3.0.0
http_client_helper
一个支持取消和重试功能的 Flutter http 请求插件。
32喜欢 41.6万近 30 天下载160Pub 分数
AndroidiOSWebmacOSWindowsLinux
一个支持取消和重试功能的 Flutter http 请求插件。
以下为英文项目原文快照,最新内容请访问 GitHub。
A Flutter plugin for http request with cancel and retry fuctions.
To use this plugin, add http_client_helper as a dependency in your pubspec.yaml file.
cancellationToken = new CancellationToken();
try {
await HttpClientHelper.get(url,
cancelToken: cancellationToken,
timeRetry: Duration(milliseconds: 100),
retries: 3,
timeLimit: Duration(seconds: 5))
.then((response) {
setState(() {
msg = response.body;
});
});
} on TimeoutException catch (_) {
setState(() {
msg = "TimeoutException";
});
} on OperationCanceledError catch (_) {
setState(() {
msg = "cancel";
});
} catch (e) {
setState(() {
msg = "$e";
});
}
Please see the example app of this plugin for a full example.
依赖清单 1 项
^1.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗