パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリSunnatilloShavkatov/dio_retry_plus

dio_retry_plus

SunnatilloShavkatov/dio_retry_plus open-source repository details.

dio_retry_plus のプロジェクト画像
スター
2
フォーク
1
最終プッシュ(UTC)
2025/04/02
プロジェクト状態
公開中

元の 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 ↗