v3.0.0
http_client_helper
キャンセルおよび再試行機能を備えたHTTPリクエスト用のFlutterプラグイン。
32いいね 24.8万30日間ダウンロード160Pub ポイント
AndroidiOSWebmacOSWindowsLinux
キャンセルおよび再試行機能を備えたHTTPリクエスト用のFlutterプラグイン。
^1.0.0以下は英語原文のスナップショットです。最新版は 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.