搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫SunnatilloShavkatov/dio_retry_plus

dio_retry_plus

SunnatilloShavkatov/dio_retry_plus open-source repository details.

dio_retry_plus 專案封面
星標
2
分支
1
最近推送(UTC)
2025年4月2日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

dio_retry_plus

A plugin for dio that retries failed requests.

Usage

import 'package:dio_retry_plus/dio_retry_plus.dart';
Basic configuration
final dio = Dio()
  ..interceptors.add(RetryInterceptor());
Global retry options
final dio = Dio()
  ..interceptors.add(RetryInterceptor(
    options: const RetryOptions(
      retries: 3, // Number of retries before a failure
      retryInterval: const Duration(seconds: 1), // Interval between each retry
      retryEvaluator: (error) => error.type != DioErrorType.CANCEL && error.type != DioErrorType.RESPONSE, // Evaluating if a retry is necessary regarding the error. It is a good candidate for updating authentication token in case of a unauthorized error (be careful with concurrency though)
    )
  )
);
Sending a request with options
final response = await dio.get("http://www.flutter.dev", options: Options(
    extra: RetryOptions(
      retryInterval: const Duration(seconds: 10),
    ).toExtra(),
  ));
Sending a request without retry
final response = await dio.get("http://www.flutter.dev", options: Options(
    extra: RetryOptions.noRetry().toExtra(),
  ));
Logging retry operations
final dio = Dio()
  ..interceptors.add(RetryInterceptor(logger: Logger("Retry")));

Features and bugs

Please file issues.

Sunnatillo Shavkatov GitHub avatar
GitHub 作者

Sunnatillo Shavkatov ↗

BeelabTashkent City
語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 4 項

  • flutter{"sdk":"flutter"}
  • dio^5.8.0+1
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^5.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗